Closed lerouxrgd closed 3 years ago
Thank you for your request, but give me some time.
Sure, there is no hurry, thank you very much !
Sorry for the late response. I have pushed the branch ngtqg-capi including the ngtqg C API source codes below. Capi.h Capi.cpp Please refer an example code using the APIs in Capi.h. The ngtqg_quantize and ngtqg_search_index are almost the same as the quantize and search of the ngtqg command, respectively. If there are no problems with the C APIs, I will merge them into the master branch.
Thank you for the C API and the example, it is very useful. I managed to use the C API correctly and here are my findings:
ngt_get_object_as_integer
and ngt_get_object_as_float
in the regular index case.ngtqg_quantize
? Would it be possible to return true/false so that we know whether we have to check the NGTError
?NGTQGQuantizationPrameters
-> NGTQGQuantizationParametersAlso on a similar topic, I noticed that ngt_set_property_distance_type_sparse_jaccard
is missing in the regular C API.
Thank you for your comments. I have released NGT v1.13.7 with NGTQG C APIs.
- Would it be possible to have a function to retrieve an object from a quantized index ? Something like
ngt_get_object_as_integer
andngt_get_object_as_float
in the regular index case.
You can also use ngt_get_object_as_float
for the quantized indexes like this.
- How to check the result of
ngtqg_quantize
? Would it be possible to return true/false so that we know whether we have to check theNGTError
?
I modified ngtqg_quantize()
to return its status.
- There is a typo in NGTQGQuantizationPrameters -> NGTQGQuantizationParameters
Thanks.
Also on a similar topic, I noticed that ngt_set_property_distance_type_sparse_jaccard is missing in the regular C API.
At this moment I cannot afford to deal with the sparse jaccard which is significantly different from other distances in terms of implementation.
Thank you for the fixes, everything looks good !
Just one last question, NGTQGIndex is not compatible with feature NGT_SHARED_MEMORY_ALLOCATOR ? I tried to test it and got SIGABRT.
Thank you for reviewing. I am wondering whether I should support NGT_SHARED_MEMORY_ALLOCATOR for NGTQG, because this spoils the fastest NGTQG index of the NGT indexes.
I see, indeed it is better not to spoil performances. I found the NGT_SHARED_MEMORY_ALLOCATOR very convenient so I just wanted to check it with NGTQG Index.
Anyway as long as C API is concerned everything is fine, thank you again for adding this !
Would it be possible to add latest NGTQG to the C API ? It would be then possible for wrappers to stay up to date.