Spatial tree data structure to perform (approximate) nearest and furthest neighbor search.
More...
|
| Kd_tree_search (Point_range const &points) |
| Constructor. More...
|
|
template<typename Point_indices_range > |
| Kd_tree_search (Point_range const &points, Point_indices_range const &only_these_points) |
| Constructor. More...
|
|
| Kd_tree_search (Point_range const &points, std::size_t begin_idx, std::size_t past_the_end_idx) |
| Constructor. More...
|
|
KNS_range | k_nearest_neighbors (Point const &p, unsigned int k, bool sorted=true, FT eps=FT(0)) const |
| Search for the k-nearest neighbors from a query point. More...
|
|
INS_range | incremental_nearest_neighbors (Point const &p, FT eps=FT(0)) const |
| Search incrementally for the nearest neighbors from a query point. More...
|
|
KNS_range | k_furthest_neighbors (Point const &p, unsigned int k, bool sorted=true, FT eps=FT(0)) const |
| Search for the k-furthest points from a query point. More...
|
|
INS_range | incremental_furthest_neighbors (Point const &p, FT eps=FT(0)) const |
| Search incrementally for the furthest neighbors from a query point. More...
|
|
template<typename OutputIterator > |
void | all_near_neighbors (Point const &p, FT const &radius, OutputIterator it, FT eps=FT(0)) const |
| Search for all the neighbors in a ball. More...
|
|
template<typename OutputIterator > |
void | all_near_neighbors2 (Point const &p, FT const &sq_radius_min, FT const &sq_radius_max, OutputIterator it) const |
| Search for all the neighbors in a ball. This is similar to all_near_neighbors but takes directly the square of the minimum distance below which points must be considered neighbors and square of the maximum distance above which they cannot be. More...
|
|
template<typename Search_traits, typename Point_range>
class Gudhi::spatial_searching::Kd_tree_search< Search_traits, Point_range >
Spatial tree data structure to perform (approximate) nearest and furthest neighbor search.
The class Kd_tree_search is a tree-based data structure, based on CGAL dD spatial searching data structures. It provides a simplified API to perform (approximate) nearest and furthest neighbor searches. Contrary to CGAL default behavior, the tree does not store the points themselves, but stores indices.
There are two types of queries: the k-nearest or k-furthest neighbor query, where k is fixed and the k nearest or furthest points are computed right away, and the incremental nearest or furthest neighbor query, where no number of neighbors is provided during the call, as the neighbors will be computed incrementally when the iterator on the range is incremented.
- Template Parameters
-
Search_traits | must be a model of the SearchTraits concept, such as the CGAL::Epick_d class, which can be static if you know the ambiant dimension at compile-time, or dynamic if you don't. |
Point_range | is the type of the range that provides the points. It must be a range whose iterator type is a RandomAccessIterator . |
- Examples
- example_spatial_searching.cpp.