ompl::NearestNeighborsFLANN< _T, _Dist > Class Template Reference

Wrapper class for nearest neighbor data structures in the FLANN library. More...

#include <ompl/datastructures/NearestNeighborsFLANN.h>

Inheritance diagram for ompl::NearestNeighborsFLANN< _T, _Dist >:

List of all members.

Public Member Functions

 NearestNeighborsFLANN (const boost::shared_ptr< flann::IndexParams > &params)
virtual void clear ()
 Clear the datastructure.
virtual bool reportsSortedResults () const
 Return true if the solutions reported by this data structure are sorted, when calling nearestK / nearestR.
virtual void setDistanceFunction (const typename NearestNeighbors< _T >::DistanceFunction &distFun)
virtual void add (const _T &data)
 Add an element to the datastructure.
virtual void add (const std::vector< _T > &data)
 Add a vector of points.
virtual bool remove (const _T &data)
 Remove an element from the datastructure.
virtual _T nearest (const _T &data) const
 Get the nearest neighbor of a point.
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)
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)
virtual std::size_t size () const
 Get the number of elements in the datastructure.
virtual void list (std::vector< _T > &data) const
 Get all the elements in the datastructure.
virtual void setIndexParams (const boost::shared_ptr< flann::IndexParams > &params)
 Set the FLANN index parameters.
virtual const
boost::shared_ptr
< flann::IndexParams > & 
getIndexParams () const
 Get the FLANN parameters used to build the current index.
virtual void setSearchParams (const flann::SearchParams &searchParams)
 Set the FLANN parameters to be used during nearest neighbor searches.
flann::SearchParams & getSearchParams ()
 Get the FLANN parameters used during nearest neighbor searches.
const flann::SearchParams & getSearchParams () const
 Get the FLANN parameters used during nearest neighbor searches.
unsigned int getContainerSize () const

Protected Member Functions

void createIndex (const flann::Matrix< _T > &mat)
 Internal function to construct nearest neighbor data structure with initial elements stored in mat.
void rebuildIndex (unsigned int capacity=0)
 Rebuild the nearest neighbor data structure (necessary when changing the distance function or index parameters).
template<>
void createIndex (const flann::Matrix< double > &mat)

Protected Attributes

std::vector< _T > data_
 vector of data stored in FLANN's index. FLANN only indexes references, so we need store the original data.
flann::Index< _Dist > * index_
 The FLANN index (the actual index type depends on params_).
boost::shared_ptr
< flann::IndexParams > 
params_
 The FLANN index parameters. This contains both the type of index and the parameters for that type.
flann::SearchParams searchParams_
 The parameters used to seach for nearest neighbors.
unsigned int dimension_
 If each element has an array-like structure that is exposed to FLANN, then the dimension_ needs to be set to the length of this array.

Detailed Description

template<typename _T, typename _Dist = FLANNDistance<_T>>
class ompl::NearestNeighborsFLANN< _T, _Dist >

Wrapper class for nearest neighbor data structures in the FLANN library.

See: M. Muja and D.G. Lowe, "Fast Approximate Nearest Neighbors with Automatic Algorithm Configuration", in International Conference on Computer Vision Theory and Applications (VISAPP'09), 2009. http://people.cs.ubc.ca/~mariusm/index.php/FLANN/FLANN

Definition at line 87 of file NearestNeighborsFLANN.h.


Member Function Documentation

template<typename _T , typename _Dist = FLANNDistance<_T>>
virtual void ompl::NearestNeighborsFLANN< _T, _Dist >::setIndexParams ( const boost::shared_ptr< flann::IndexParams > &  params) [inline, virtual]

Set the FLANN index parameters.

The parameters determine the type of nearest neighbor data structure to be constructed.

Definition at line 240 of file NearestNeighborsFLANN.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines