|
Medusa
1.1
Coordinate Free Mehless Method implementation
|
|
Go to the documentation of this file. 1 #ifndef MEDUSA_BITS_SPATIAL_SEARCH_KDTREE_FWD_HPP_
2 #define MEDUSA_BITS_SPATIAL_SEARCH_KDTREE_FWD_HPP_
12 #include <nanoflann/nanoflann.hpp>
35 template <
class vec_t>
44 typedef nanoflann::KDTreeSingleIndexAdaptor<
45 nanoflann::L2_Simple_Adaptor<scalar_t, kdtree_internal::PointCloud<vec_t>>,
97 const vec_t& point,
const scalar_t& radius_squared)
const;
117 const int n = indexes.
size();
119 for (
int i = 0; i < n; ++i) {
120 result[i] =
points_.get(indexes[i]);
135 #endif // MEDUSA_BITS_SPATIAL_SEARCH_KDTREE_FWD_HPP_
Root namespace for the whole library.
Scalar scalar_t
Type of the elements, alias of Scalar.
Class representing a static k-d tree data structure.
Helper class for KDTree with appropriate accessors containing a set of points.
kdtree_internal::PointCloud< vec_t > points_
Points, contained in the tree.
@ dim
Number of elements of this matrix.
@ dim
Dimensionality of the space.
nanoflann::KDTreeSingleIndexAdaptor< nanoflann::L2_Simple_Adaptor< scalar_t, kdtree_internal::PointCloud< vec_t > >, kdtree_internal::PointCloud< vec_t >, dim, int > kd_tree_t
k-d tree type.
KDTree()
Creates an empty KDTree. The tree may later be filled using KDTree::resetTree.
vec_t vector_t
Vector type used.
std::pair< Range< int >, Range< scalar_t > > query(const vec_t &point, int k=1) const
Find k nearest neighbors to given point.
KDTree(const Range< vec_t > &points)
Constructor that builds the search tree for the given points.
kd_tree_t tree
Actual tree build over points.
friend std::ostream & operator<<(std::ostream &os, const KDTree< V > &tree)
Output basic info about given tree.
int size() const
Returns number of points in this tree.
int size() const
Returns number of elements.
Range< vec_t > get(const Range< int > &indexes) const
Vectorized version of KDTree::get.
void reset(const Range< vec_t > &points)
Grows a new tree with new points.
vector_t::scalar_t scalar_t
Scalar type used.
vec_t get(int index) const
Get the coordinates of a point in the tree.