Page
Library
Module
Module type
Parameter
Class
Class type
Source
Vp_tree.MakeSourceA vantage point tree.
Quality of the constructed tree. Tree construction takes more time with higher quality. Tree query time takes less time with higher tree quality. If you have 100k or more points, use a Good or Random tree.
create quality points create a vantage point tree of given quality containing all points.
nearest_neighbor p vpt return the distance along with the nearest neighbor to query point p in vpt. Warning: there may be several points at this distance from p in vpt, but a single (arbitrary) one is returned. If you are not happy with that, use a point type that is deduplicated (i.e. a point that holds the info for all points with the same coordinates).
neighbors p tol vpt return all points in vpt within tol distance from query point p. I.e. all points returned are within (d <= tol) distance from p.
find query tree return the first point with distance to query = 0.0.
mem query tree return true if query can be found in tree; false otherwise.
check tree test the tree invariant. Should always be true. If invariant doesn't hold, then this library has a bug (or your distance function is not a proper metric).