template<class VectorOfVectorsType, typename num_t = double, int DIM = -1, class Distance = nanoflann::metric_L2, typename IndexType = size_t>
struct KDTreeVectorOfVectorsAdaptor< VectorOfVectorsType, num_t, DIM, Distance, IndexType >
A simple vector-of-vectors adaptor for nanoflann, without duplicating the storage. The i'th vector represents a point in the state space.
- Template Parameters
-
| DIM | If set to >0, it specifies a compile-time fixed dimensionality for the points in the data set, allowing more compiler optimizations. |
| num_t | The type of the point coordinates (typ. double or float). |
| Distance | The distance metric to use: nanoflann::metric_L1, nanoflann::metric_L2, nanoflann::metric_L2_Simple, etc. |
| IndexType | The type for indices in the KD-tree index (typically, size_t of int) |
template<class VectorOfVectorsType , typename num_t = double, int DIM = -1, class Distance = nanoflann::metric_L2, typename IndexType = size_t>
| void KDTreeVectorOfVectorsAdaptor< VectorOfVectorsType, num_t, DIM, Distance, IndexType >::query |
( |
const num_t * | query_point, |
|
|
const size_t | num_closest, |
|
|
IndexType * | out_indices, |
|
|
num_t * | out_distances_sq ) const |
|
inline |
Query for the num_closest closest points to a given point (entered as query_point[0:dim-1]). Note that this is a short-cut method for index->findNeighbors(). The user can also call index->... methods as desired.