You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for the library. It would be great to document what happens in the case of equal keys (by the comparator function).
I want to store (numerical) ranges, and be able to search for all items whose range is overlapping. (In fact, the items indexed have disjoint ranges, but the search range may have start and end overlapping several.) My idea was to have a comparator that took a range as a key, and returned 0 for overlapping ranges, but otherwise ordered by start of range. With a quick test, it seems to work, but the documentation doesn't guarantee that it will work. Also "find" does seem non-deterministic when it comes to retrieving items with equal keys.
UPDATE
In fact, doesn't always seem to return all nodes in range if there are several equal. (Is this a bug?) Switched to querying for range [start,start] -> [end,end] to get elements overlapping range [start, end]. This seems to work (given indexed items are disjoint). In any case, documentation would be welcome.
The text was updated successfully, but these errors were encountered:
shaunc
changed the title
Documentation: equal keys
Documentation: equal keys in "range"
Oct 15, 2018
Thanks for the library. It would be great to document what happens in the case of equal keys (by the comparator function).
I want to store (numerical) ranges, and be able to search for all items whose range is overlapping. (In fact, the items indexed have disjoint ranges, but the search range may have start and end overlapping several.) My idea was to have a comparator that took a range as a key, and returned 0 for overlapping ranges, but otherwise ordered by start of range. With a quick test, it seems to work, but the documentation doesn't guarantee that it will work. Also "find" does seem non-deterministic when it comes to retrieving items with equal keys.
UPDATE
In fact, doesn't always seem to return all nodes in range if there are several equal. (Is this a bug?) Switched to querying for range [start,start] -> [end,end] to get elements overlapping range [start, end]. This seems to work (given indexed items are disjoint). In any case, documentation would be welcome.
The text was updated successfully, but these errors were encountered: