Loading...
Searching...
No Matches
NearestNeighborsFLANN.h
63 FLANNDistance(const typename NearestNeighbors<_T>::DistanceFunction &distFun) : distFun_(distFun)
116 void setDistanceFunction(const typename NearestNeighbors<_T>::DistanceFunction &distFun) override
325 inline void NearestNeighborsFLANN<double, flann::L2<double>>::createIndex(const flann::Matrix<double> &mat)
Wrapper class for nearest neighbor data structures in the FLANN library.
Definition NearestNeighborsFLANN.h:88
void nearestR(const _T &data, double radius, std::vector< _T > &nbh) const override
Return the nearest neighbors within distance radius in sorted order if searchParams_....
Definition NearestNeighborsFLANN.h:206
std::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:313
const flann::SearchParams & getSearchParams() const
Get the FLANN parameters used during nearest neighbor searches.
Definition NearestNeighborsFLANN.h:270
bool reportsSortedResults() const override
Return true if the solutions reported by this data structure are sorted, when calling nearestK / near...
Definition NearestNeighborsFLANN.h:111
virtual const std::shared_ptr< flann::IndexParams > & getIndexParams() const
Get the FLANN parameters used to build the current index.
Definition NearestNeighborsFLANN.h:249
void add(const _T &data) override
Add an element to the datastructure.
Definition NearestNeighborsFLANN.h:122
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:306
virtual void setSearchParams(const flann::SearchParams &searchParams)
Set the FLANN parameters to be used during nearest neighbor searches.
Definition NearestNeighborsFLANN.h:256
flann::SearchParams & getSearchParams()
Get the FLANN parameters used during nearest neighbor searches.
Definition NearestNeighborsFLANN.h:263
void list(std::vector< _T > &data) const override
Get all the elements in the datastructure.
Definition NearestNeighborsFLANN.h:223
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:321
void rebuildIndex(unsigned int capacity=0)
Rebuild the nearest neighbor data structure (necessary when changing the distance function or index p...
Definition NearestNeighborsFLANN.h:291
virtual void setIndexParams(const std::shared_ptr< flann::IndexParams > ¶ms)
Set the FLANN index parameters.
Definition NearestNeighborsFLANN.h:242
_T nearest(const _T &data) const override
Get the nearest neighbor of a point.
Definition NearestNeighborsFLANN.h:178
bool remove(const _T &data) override
Remove an element from the datastructure.
Definition NearestNeighborsFLANN.h:161
void createIndex(const flann::Matrix< _T > &mat)
Internal function to construct nearest neighbor data structure with initial elements stored in mat.
Definition NearestNeighborsFLANN.h:283
flann::SearchParams searchParams_
The parameters used to seach for nearest neighbors.
Definition NearestNeighborsFLANN.h:316
flann::Index< _Dist > * index_
The FLANN index (the actual index type depends on params_).
Definition NearestNeighborsFLANN.h:309
std::size_t size() const override
Get the number of elements in the datastructure.
Definition NearestNeighborsFLANN.h:218
void add(const std::vector< _T > &data) override
Add a vector of points.
Definition NearestNeighborsFLANN.h:137
void nearestK(const _T &data, std::size_t k, std::vector< _T > &nbh) const override
Return the k nearest neighbors in sorted order if searchParams_.sorted==true (the default).
Definition NearestNeighborsFLANN.h:193
std::function< double(const _T &, const _T &)> DistanceFunction
The definition of a distance function.
Definition NearestNeighbors.h:51
virtual void setDistanceFunction(const DistanceFunction &distFun)
Set the distance function to use.
Definition NearestNeighbors.h:58
Main namespace. Contains everything in this library.
Definition MultiLevelPlanarManipulatorDemo.cpp:66