hnswlib
hnswlib copied to clipboard
About interface
I'm integrating hnswlib into my own code, I have the following suggestions:
- I think that the data passed to
addPoint
should beconst void *
.
https://github.com/nmslib/hnswlib/blob/44f20f0b2257af1b3251ac9ed976a6d6583967c0/hnswlib/hnswalg.h#L773
- I think that
searchKnn
shuld first check if the "container" is empty, in wich case a search may result in a core dump. https://github.com/nmslib/hnswlib/blob/44f20f0b2257af1b3251ac9ed976a6d6583967c0/hnswlib/hnswalg.h#L486
Another suggestion: the result points are aranged in a max heap, while what people interested in is the nearest points. I would suggest using another comparator that would return a min heap. https://github.com/nmslib/hnswlib/blob/44f20f0b2257af1b3251ac9ed976a6d6583967c0/hnswlib/hnswalg.h#L928-L937
@uestc-lfs Thanks for the suggestions! Seems reasonable.
Would you like some pull requests for these suggestions?
@uestc-lfs Yeah, sure. That would be great! I've already started to implement them, but was distracted by other things...