Construction of these trees should be O(n log n) and searches should be O(log n), though real life performance depends on how the data is distributed. Thus, this structure is primarily useful when performing many searches of the same data. Below a certain number of points, it may be better to perform a direct search.
Build a ball tree from the list of vectors pts. Recursive construction of the tree will cease branching when a node holds a number of points less than or equal to leaf_size.
Build a ball tree from the array of vectors pts. Recursive construction of the tree will cease branching when a node holds a number of points less than or equal to leaf_size.
Sourceval search_idxs : ?radius:float ->t->V3.t->int list
search_idxs ?radius t p
Search through the ball tree t for points that are within a distance radius of the target point p. Matches are returned as an arbitrarily ordered list of indices (into the point array used to construct t).
Sourceval search_points : ?radius:float ->t->V3.t->V3.t list
search_points ?radius t p
Search through the ball tree t for points that are within a distance radius of the target point p. Matches are returned as an arbitrarily ordered (not sorted from nearest to furthest) list of points.