Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Is incremental addition and deletion supported? #38

Closed
allComputableThings opened this issue Sep 27, 2019 · 4 comments
Closed

Comments

@allComputableThings
Copy link

Sometimes, its helpful to be able to incrementally add (and sometime delete) to a NN map. Is this supported?

@masajiro
Copy link
Member

@saicomagic
Copy link

What's the difference between append and insert?
https://github.com/yahoojapan/NGT/wiki/Cpp-Quick-Reference#size_t-appendstdvectortype-object
https://github.com/yahoojapan/NGT/wiki/Cpp-Quick-Reference#size_t-insertstdvectortype-object

If the index is constructed with read only mode, is it able to incrementally add or remove?

Many thanks

@masajiro
Copy link
Member

NGT has an object list to manage objects. append() always adds the given object at the end of the list. The retuned object ID always increases by one for each appending. If the list has no empty entries for removed objects, insert() is the same as append(). However, if the list has empty entries for removed objects, insert() inserts the given object into the empty entry to save the memory space. Note that the ID of the given object must be discontinuous, because the empty entry ID is assigned to the given object.

You cannot construct the index with read only mode.

@saicomagic
Copy link

NGT has an object list to manage objects. append() always adds the given object at the end of the list. The retuned object ID always increases by one for each appending. If the list has no empty entries for removed objects, insert() is the same as append(). However, if the list has empty entries for removed objects, insert() inserts the given object into the empty entry to save the memory space. Note that the ID of the given object must be discontinuous, because the empty entry ID is assigned to the given object.

You cannot construct the index with read only mode.

Get it! Thanks for your prompt reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants