hnswlib icon indicating copy to clipboard operation
hnswlib copied to clipboard

Number of bits for storing the delete mark of each element

Open lxfhfut opened this issue 4 years ago • 2 comments

Hi @Yury Malkov,

In the comment for function 'markDeletedInternal', it states that "Uses the first 8 bits of the memory for the linked list to store the mark...". However, from the implementations of function "getListCount" and "markDeletedInternal", we can see that the first 16 bits are used to store the delete mark and the lower 16 bits are used to store the number of neighbors. It is a bit confusing here.

https://github.com/nmslib/hnswlib/blob/2571bdb6ef3f91d6f4c2e59178fde49055d2f980/hnswlib/hnswalg.h#L795-L798 https://github.com/nmslib/hnswlib/blob/2571bdb6ef3f91d6f4c2e59178fde49055d2f980/hnswlib/hnswalg.h#L819-L821

lxfhfut avatar Dec 07 '20 00:12 lxfhfut

Yes. It is strange. I do not remember the exact reason why it has been changed, but it seems we forgot to update the comments.

yurymalkov avatar Dec 07 '20 18:12 yurymalkov

Yep. It seems I've changed it and forgot to update the comments. Thanks for reporting!

yurymalkov avatar Dec 07 '20 18:12 yurymalkov