NearestNeighborsFLANN.h
117 virtual void setDistanceFunction(const typename NearestNeighbors<_T>::DistanceFunction &distFun)
virtual const boost::shared_ptr< flann::IndexParams > & getIndexParams() const
Get the FLANN parameters used to build the current index.
Definition: NearestNeighborsFLANN.h:247
virtual std::size_t size() const
Get the number of elements in the datastructure.
Definition: NearestNeighborsFLANN.h:216
unsigned int dimension_
If each element has an array-like structure that is exposed to FLANN, then the dimension_ needs to be...
Definition: NearestNeighborsFLANN.h:320
boost::function< double(const _T &, const _T &)> DistanceFunction
The definition of a distance function.
Definition: NearestNeighbors.h:55
Wrapper class to allow FLANN access to the NearestNeighbors::distFun_ callback function.
Definition: NearestNeighborsFLANN.h:56
virtual void nearestK(const _T &data, std::size_t k, std::vector< _T > &nbh) const
Return the k nearest neighbors in sorted order if searchParams_.sorted==true (the default) ...
Definition: NearestNeighborsFLANN.h:191
boost::shared_ptr< flann::IndexParams > params_
The FLANN index parameters. This contains both the type of index and the parameters for that type...
Definition: NearestNeighborsFLANN.h:312
flann::SearchParams & getSearchParams()
Get the FLANN parameters used during nearest neighbor searches.
Definition: NearestNeighborsFLANN.h:261
virtual void add(const std::vector< _T > &data)
Add a vector of points.
Definition: NearestNeighborsFLANN.h:138
std::vector< _T > data_
vector of data stored in FLANN's index. FLANN only indexes references, so we need store the original ...
Definition: NearestNeighborsFLANN.h:305
Wrapper class for nearest neighbor data structures in the FLANN library.
Definition: NearestNeighborsFLANN.h:87
virtual void setDistanceFunction(const DistanceFunction &distFun)
Set the distance function to use.
Definition: NearestNeighbors.h:66
flann::Index< _Dist > * index_
The FLANN index (the actual index type depends on params_).
Definition: NearestNeighborsFLANN.h:308
flann::SearchParams searchParams_
The parameters used to seach for nearest neighbors.
Definition: NearestNeighborsFLANN.h:315
virtual _T nearest(const _T &data) const
Get the nearest neighbor of a point.
Definition: NearestNeighborsFLANN.h:176
Abstract representation of a container that can perform nearest neighbors queries.
Definition: NearestNeighbors.h:50
void rebuildIndex(unsigned int capacity=0)
Rebuild the nearest neighbor data structure (necessary when changing the distance function or index p...
Definition: NearestNeighborsFLANN.h:290
void createIndex(const flann::Matrix< _T > &mat)
Internal function to construct nearest neighbor data structure with initial elements stored in mat...
Definition: NearestNeighborsFLANN.h:282
virtual void setIndexParams(const boost::shared_ptr< flann::IndexParams > ¶ms)
Set the FLANN index parameters.
Definition: NearestNeighborsFLANN.h:240
virtual void add(const _T &data)
Add an element to the datastructure.
Definition: NearestNeighborsFLANN.h:123
const flann::SearchParams & getSearchParams() const
Get the FLANN parameters used during nearest neighbor searches.
Definition: NearestNeighborsFLANN.h:268
virtual void list(std::vector< _T > &data) const
Get all the elements in the datastructure.
Definition: NearestNeighborsFLANN.h:221
virtual bool reportsSortedResults() const
Return true if the solutions reported by this data structure are sorted, when calling nearestK / near...
Definition: NearestNeighborsFLANN.h:112
virtual void nearestR(const _T &data, double radius, std::vector< _T > &nbh) const
Return the nearest neighbors within distance radius in sorted order if searchParams_.sorted==true (the default)
Definition: NearestNeighborsFLANN.h:204
virtual void setSearchParams(const flann::SearchParams &searchParams)
Set the FLANN parameters to be used during nearest neighbor searches.
Definition: NearestNeighborsFLANN.h:254