Brute-force nearest neighbour. More...
#include <nabo_private.h>
Public Types | |
typedef NearestNeighbourSearch < T >::Vector | Vector |
an Eigen vector of type T, to hold the coordinates of a point | |
typedef NearestNeighbourSearch < T >::Matrix | Matrix |
a column-major Eigen matrix in which each column is a point; this matrix has dim rows | |
typedef NearestNeighbourSearch < T >::Index | Index |
an index to a Vector or a Matrix, for refering to data points | |
typedef NearestNeighbourSearch < T >::IndexVector | IndexVector |
a vector of indices to data points | |
typedef NearestNeighbourSearch < T >::IndexMatrix | IndexMatrix |
a matrix of indices to data points | |
Public Member Functions | |
BruteForceSearch (const Matrix &cloud, const Index dim, const unsigned creationOptionFlags) | |
constructor, calls NearestNeighbourSearch<T>(cloud) | |
virtual unsigned long | knn (const Matrix &query, IndexMatrix &indices, Matrix &dists2, const Index k, const T epsilon, const unsigned optionFlags, const T maxRadius) const |
Find the k nearest neighbours for each point of query. | |
virtual unsigned long | knn (const Matrix &query, IndexMatrix &indices, Matrix &dists2, const Vector &maxRadii, const Index k=1, const T epsilon=0, const unsigned optionFlags=0) const |
Find the k nearest neighbours for each point of query. |
Brute-force nearest neighbour.
unsigned long Nabo::BruteForceSearch< T >::knn | ( | const Matrix & | query, | |
IndexMatrix & | indices, | |||
Matrix & | dists2, | |||
const Vector & | maxRadii, | |||
const Index | k = 1 , |
|||
const T | epsilon = 0 , |
|||
const unsigned | optionFlags = 0 | |||
) | const [inline, virtual] |
Find the k nearest neighbours for each point of query.
If the search finds less than k points, the empty entries in dists2 will be filled with infinity and the indices with 0.
query | query points | |
indices | indices of nearest neighbours, must be of size k x query.cols() | |
dists2 | squared distances to nearest neighbours, must be of size k x query.cols() | |
maxRadii | vector of maximum radii in which to search, used to prune search, is not affected by epsilon | |
k | number of nearest neighbour requested | |
epsilon | maximal percentage of error for approximate search, 0 for exact search | |
optionFlags | search options, a bitwise OR of elements of SearchOptionFlags |
Implements Nabo::NearestNeighbourSearch< T >.
unsigned long Nabo::BruteForceSearch< T >::knn | ( | const Matrix & | query, | |
IndexMatrix & | indices, | |||
Matrix & | dists2, | |||
const Index | k, | |||
const T | epsilon, | |||
const unsigned | optionFlags, | |||
const T | maxRadius | |||
) | const [inline, virtual] |
Find the k nearest neighbours for each point of query.
If the search finds less than k points, the empty entries in dists2 will be filled with infinity and the indices with 0.
query | query points | |
indices | indices of nearest neighbours, must be of size k x query.cols() | |
dists2 | squared distances to nearest neighbours, must be of size k x query.cols() | |
k | number of nearest neighbour requested | |
epsilon | maximal percentage of error for approximate search, 0 for exact search | |
optionFlags | search options, a bitwise OR of elements of SearchOptionFlags | |
maxRadius | maximum radius in which to search, can be used to prune search, is not affected by epsilon |
Implements Nabo::NearestNeighbourSearch< T >.