KdTree with arbitrary dimension.
More...
#include <kdtreex.hpp>
|
|
| KdTreeX (const Eigen::Matrix< double, D, 1 > *points, int num_points) |
| | Constructor.
|
| |
|
int | dim () const |
| |
|
size_t | kdtree_get_point_count () const |
| |
|
double | kdtree_get_pt (const size_t idx, const size_t dim) const |
| |
|
template<class BBox > |
| bool | kdtree_get_bbox (BBox &) const |
| |
| virtual size_t | knn_search (const double *pt, size_t k, size_t *k_indices, double *k_sq_dists, double max_sq_dist=std::numeric_limits< double >::max()) const override |
| | k-nearest neighbor search
|
| |
| virtual size_t | radius_search (const double *pt, double radius, std::vector< size_t > &indices, std::vector< double > &sq_dists, int max_num_neighbors=std::numeric_limits< int >::max()) const override |
| | Radius search.
|
| |
|
|
const int | num_points |
| |
|
const Eigen::Matrix< double, D, 1 > * | points |
| |
|
double | search_eps |
| |
|
std::unique_ptr< Index > | index |
| |
template<int D = -1>
struct gtsam_points::KdTreeX< D >
KdTree with arbitrary dimension.
◆ knn_search()
template<int D>
| size_t gtsam_points::KdTreeX< D >::knn_search |
( |
const double * |
pt, |
|
|
size_t |
k, |
|
|
size_t * |
k_indices, |
|
|
double * |
k_sq_dists, |
|
|
double |
max_sq_dist = std::numeric_limits<double>::max() |
|
) |
| const |
|
overridevirtual |
k-nearest neighbor search
- Parameters
-
| pt | Point |
| k | Number of neighbors |
| k_indices | Indices of k-nearest neighbors |
| k_sq_dists | Squared distances to the neighbors (sorted in ascending order) |
Reimplemented from gtsam_points::NearestNeighborSearch.
◆ radius_search()
template<int D>
| size_t gtsam_points::KdTreeX< D >::radius_search |
( |
const double * |
pt, |
|
|
double |
radius, |
|
|
std::vector< size_t > & |
indices, |
|
|
std::vector< double > & |
sq_dists, |
|
|
int |
max_num_neighbors = std::numeric_limits<int>::max() |
|
) |
| const |
|
overridevirtual |
Radius search.
- Note
- There is no assumption and guarantee on the order of points to be selected when
max_num_neighbors is specified. (Some algorithms like KdTree tend to first pick closer points though).
- Parameters
-
| pt | Point |
| radius | Search radius |
| indices | Indices of neighbors within the radius |
| sq_dists | Squared distances to the neighbors (sorted in ascending order) |
| max_num_neighbors | Maximum number of neighbors |
- Returns
- Number of neighbors
Reimplemented from gtsam_points::NearestNeighborSearch.
The documentation for this struct was generated from the following files:
- /home/runner/work/gtsam_points/gtsam_points/include/gtsam_points/ann/kdtreex.hpp
- /home/runner/work/gtsam_points/gtsam_points/include/gtsam_points/ann/impl/kdtreex_impl.hpp