Give the nearest-neighbour cursors classes of their own - #132
Merged
estebanzimanyi merged 1 commit intoSep 3, 2026
Merged
Conversation
`rtree_nn_cursor_open` answers an `RTreeNNCursor *` that `_next` walks and `_close` frees, and `sptree_nn_cursor_*` do the same for an `SPNNCursor *`. Both types are `typedef struct X X;` in `meos.h` — published without their layout, registered in no enum — so they are `Value` leaves stating a null temptype, as `RTree` and `SPTree` themselves are. The three cursor entries move off the tree's class onto the cursor's, longest prefix winning: a cursor is opened FROM a tree and then walked on its own, so `open` belongs to the cursor it answers rather than among the tree's twenty methods. RTree and SPTree read 20 methods each against 23, and the cursors 3. Without a class for the cursor a binding reaches none of the three, which is the whole kNN surface: the tree can be built and searched by containment while the question "which entries are nearest" has no answer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
rtree_nn_cursor_openanswers anRTreeNNCursor *that_nextwalks and_closefrees, andsptree_nn_cursor_*do the same for anSPNNCursor *.Both types are
typedef struct X X;inmeos.h— published without theirlayout, registered in no enum — so they are
Valueleaves stating a nulltemptype, as
RTreeandSPTreethemselves are.The three cursor entries move off the tree's class onto the cursor's, longest
prefix winning: a cursor is opened FROM a tree and then walked on its own, so
openbelongs to the cursor it answers rather than among the tree's twentymethods. RTree and SPTree read 20 methods each against 23, and the cursors 3.
Without a class for the cursor a binding reaches none of the three, which is
the whole kNN surface: the tree can be built and searched by containment while
the question "which entries are nearest" has no answer.