11 MatrixXf M = MatrixXf::Random(3, 100);
13 VectorXf
q = VectorXf::Random(3);
22 nns->
knn(q, indices, dists2, K);
Nearest neighbour search interface, templatized on scalar type.
static NearestNeighbourSearch * createKDTreeLinearHeap(const CloudType &cloud, const Index dim=std::numeric_limits< Index >::max(), const unsigned creationOptionFlags=0, const Parameters &additionalParameters=Parameters())
Create a nearest-neighbour search, using a kd-tree with linear heap, good for small k (~up to 30) ...
unsigned long knn(const Vector &query, IndexVector &indices, Vector &dists2, const Index k=1, const T epsilon=0, const unsigned optionFlags=0, const T maxRadius=std::numeric_limits< T >::infinity()) const
Find the k nearest neighbours of query.