Closed lerouxrgd closed 1 year ago
Hello @lerouxrgd , The TYPE of ngt_XXX_indexasTYPE doesn't need to coincide with the object type for the indexed object. TYPE is just for the specified vector of ngt_XXX_indexasTYPE. On the other hand, TYPE of ngt_get_objectasTYPE should coincide with the object type for the indexed object.
ngt_append_index
always appends the object to the end of the object list in the NGT index. However, if there is a removed object entry in the object list, ngt_append_index
inserts the object into the entry and returns the ID of the entry. Otherwise, it appends the object to the end of the list.
Thank you for the explanation, I got it !
So I guess we still need ngt_get_object_as_float16
to be able to use float16 from C API.
ngt_get_object_as_float
and ngt_get_object_as_integer
return just the same address of the specified object inside the NGT index. Therefore, you can get float 16 objects as follows.
NGT::float16 *objectVector = reinterpret_cast<NGT::float16*>(ngt_get_object_as_float(objectSpace, object.id, err));
for (size_t i = 0; i < dimension; i++) {
std::cout << objectVector[i] << " ";
}
std::cout << std::endl;
Ok I see. Thank you again for the explanation.
Hello @masajiro ,
I see that the C API has
ngt_set_property_object_type_float16
but not:Are some of these functions needed to use float16 ? Or just using
ngt_set_property_object_type_float16
and thenngt_get_object_as_float
is enough ?By the way, what is the difference between
ngt_insert_index
andngt_append_index
?