SpiecsEngine
 
Loading...
Searching...
No Matches

◆ range_search()

template<uint32_t K>
auto scl::kd_tree< K >::range_search ( const item & point,
const item & condition ) const -> std::vector<item>
inline

Search for all points within given range. Start at the root. If the current node is within the range, add it to the result. Recursively search the left and/or right subtrees if the range intersects their respective spaces. Prune the search if the current node’s space does not intersect the query range.

Parameters
[in]pointSearched point in k d.
[in]conditionallowed distance for neighbours.
Returns
Returns near points.

Definition at line 660 of file KDTree.h.

665 {
666 std::vector<kd_tree<K>::item> rangePoints;
667 range_search_recursive(m_Root, point, condition, rangePoints, 0);
668 return rangePoints;
669 }
Node * m_Root
Pointer to the root node of the tree.
Definition KDTree.h:76
void range_search_recursive(Node *node, const item &point, const item &condition, std::vector< item > &rangePoints, int depth) const
Recursive function to search for all nearest points in the kd_tree.
Definition KDTree.h:463