nmslib / hnswlib

Header-only C++/python library for fast approximate nearest neighbors
https://github.com/nmslib/hnswlib
Apache License 2.0
4.27k stars 630 forks source link

enterpoint_node_ is unsigned int, but initialized to -1. It makes me feel bad. #257

Open Jowekk opened 3 years ago

Jowekk commented 3 years ago

https://github.com/nmslib/hnswlib/blob/2571bdb6ef3f91d6f4c2e59178fde49055d2f980/hnswlib/hnswalg.h#L62

yurymalkov commented 3 years ago

Hi @Jowekk, This essentially the max value of the integer (0xFFFFFFFF). AFAIK such behavior is a part of the standard, but I agree it is confusing and probably needs to changed.