Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
rtflann::Index< Distance > Class Template Reference

#include <flann.hpp>

Public Types

typedef Distance::ResultType DistanceType
 
typedef Distance::ElementType ElementType
 
typedef NNIndex< Distance > IndexType
 

Public Member Functions

void addPoints (const Matrix< ElementType > &points, float rebuild_threshold=2)
 
void buildIndex ()
 
void buildIndex (const Matrix< ElementType > &points)
 
IndexParams getParameters () const
 
ElementTypegetPoint (size_t point_id)
 
flann_algorithm_t getType () const
 
 Index (const IndexParams &params, Distance distance=Distance())
 
 Index (const Matrix< ElementType > &features, const IndexParams &params, Distance distance=Distance())
 
 Index (const Index &other)
 
int knnSearch (const Matrix< ElementType > &queries, Matrix< size_t > &indices, Matrix< DistanceType > &dists, size_t knn, const SearchParams &params) const
 Perform k-nearest neighbor search. More...
 
int knnSearch (const Matrix< ElementType > &queries, Matrix< int > &indices, Matrix< DistanceType > &dists, size_t knn, const SearchParams &params) const
 
int knnSearch (const Matrix< ElementType > &queries, std::vector< std::vector< size_t > > &indices, std::vector< std::vector< DistanceType > > &dists, size_t knn, const SearchParams &params) const
 Perform k-nearest neighbor search. More...
 
int knnSearch (const Matrix< ElementType > &queries, std::vector< std::vector< int > > &indices, std::vector< std::vector< DistanceType > > &dists, size_t knn, const SearchParams &params) const
 
Indexoperator= (Index other)
 
int radiusSearch (const Matrix< ElementType > &queries, Matrix< size_t > &indices, Matrix< DistanceType > &dists, float radius, const SearchParams &params) const
 Perform radius search. More...
 
int radiusSearch (const Matrix< ElementType > &queries, Matrix< int > &indices, Matrix< DistanceType > &dists, float radius, const SearchParams &params) const
 
int radiusSearch (const Matrix< ElementType > &queries, std::vector< std::vector< size_t > > &indices, std::vector< std::vector< DistanceType > > &dists, float radius, const SearchParams &params) const
 Perform radius search. More...
 
int radiusSearch (const Matrix< ElementType > &queries, std::vector< std::vector< int > > &indices, std::vector< std::vector< DistanceType > > &dists, float radius, const SearchParams &params) const
 
size_t removedCount () const
 
void removePoint (size_t point_id)
 
void save (std::string filename)
 
size_t size () const
 
size_t sizeAtBuild () const
 
int usedMemory () const
 
size_t veclen () const
 
virtual ~Index ()
 

Private Member Functions

IndexTypeload_saved_index (const Matrix< ElementType > &dataset, const std::string &filename, Distance distance)
 
void swap (Index &other)
 

Private Attributes

IndexParams index_params_
 
bool loaded_
 
IndexTypennIndex_
 

Detailed Description

template<typename Distance>
class rtflann::Index< Distance >

Definition at line 76 of file flann.hpp.

Member Typedef Documentation

◆ DistanceType

template<typename Distance>
typedef Distance::ResultType rtflann::Index< Distance >::DistanceType

Definition at line 80 of file flann.hpp.

◆ ElementType

template<typename Distance>
typedef Distance::ElementType rtflann::Index< Distance >::ElementType

Definition at line 79 of file flann.hpp.

◆ IndexType

template<typename Distance>
typedef NNIndex<Distance> rtflann::Index< Distance >::IndexType

Definition at line 81 of file flann.hpp.

Constructor & Destructor Documentation

◆ Index() [1/3]

template<typename Distance>
rtflann::Index< Distance >::Index ( const IndexParams params,
Distance  distance = Distance() 
)
inline

Definition at line 83 of file flann.hpp.

◆ Index() [2/3]

template<typename Distance>
rtflann::Index< Distance >::Index ( const Matrix< ElementType > &  features,
const IndexParams params,
Distance  distance = Distance() 
)
inline

Definition at line 101 of file flann.hpp.

◆ Index() [3/3]

template<typename Distance>
rtflann::Index< Distance >::Index ( const Index< Distance > &  other)
inline

Definition at line 118 of file flann.hpp.

◆ ~Index()

template<typename Distance>
virtual rtflann::Index< Distance >::~Index ( )
inlinevirtual

Definition at line 129 of file flann.hpp.

Member Function Documentation

◆ addPoints()

template<typename Distance>
void rtflann::Index< Distance >::addPoints ( const Matrix< ElementType > &  points,
float  rebuild_threshold = 2 
)
inline

Definition at line 149 of file flann.hpp.

◆ buildIndex() [1/2]

template<typename Distance>
void rtflann::Index< Distance >::buildIndex ( )
inline

Builds the index.

Definition at line 137 of file flann.hpp.

◆ buildIndex() [2/2]

template<typename Distance>
void rtflann::Index< Distance >::buildIndex ( const Matrix< ElementType > &  points)
inline

Definition at line 144 of file flann.hpp.

◆ getParameters()

template<typename Distance>
IndexParams rtflann::Index< Distance >::getParameters ( ) const
inline
Returns
The index parameters

Definition at line 233 of file flann.hpp.

◆ getPoint()

template<typename Distance>
ElementType* rtflann::Index< Distance >::getPoint ( size_t  point_id)
inline

Returns pointer to a data point with the specified id.

Parameters
point_idthe id of point to retrieve
Returns

Definition at line 168 of file flann.hpp.

◆ getType()

template<typename Distance>
flann_algorithm_t rtflann::Index< Distance >::getType ( ) const
inline
Returns
The index type (kdtree, kmeans,...)

Definition at line 216 of file flann.hpp.

◆ knnSearch() [1/4]

template<typename Distance>
int rtflann::Index< Distance >::knnSearch ( const Matrix< ElementType > &  queries,
Matrix< size_t > &  indices,
Matrix< DistanceType > &  dists,
size_t  knn,
const SearchParams params 
) const
inline

Perform k-nearest neighbor search.

Parameters
[in]queriesThe query points for which to find the nearest neighbors
[out]indicesThe indices of the nearest neighbors found
[out]distsDistances to the nearest neighbors found
[in]knnNumber of nearest neighbors to return
[in]paramsSearch parameters

Definition at line 246 of file flann.hpp.

◆ knnSearch() [2/4]

template<typename Distance>
int rtflann::Index< Distance >::knnSearch ( const Matrix< ElementType > &  queries,
Matrix< int > &  indices,
Matrix< DistanceType > &  dists,
size_t  knn,
const SearchParams params 
) const
inline
Parameters
queries
indices
dists
knn
params
Returns

Definition at line 264 of file flann.hpp.

◆ knnSearch() [3/4]

template<typename Distance>
int rtflann::Index< Distance >::knnSearch ( const Matrix< ElementType > &  queries,
std::vector< std::vector< size_t > > &  indices,
std::vector< std::vector< DistanceType > > &  dists,
size_t  knn,
const SearchParams params 
) const
inline

Perform k-nearest neighbor search.

Parameters
[in]queriesThe query points for which to find the nearest neighbors
[out]indicesThe indices of the nearest neighbors found
[out]distsDistances to the nearest neighbors found
[in]knnNumber of nearest neighbors to return
[in]paramsSearch parameters

Definition at line 281 of file flann.hpp.

◆ knnSearch() [4/4]

template<typename Distance>
int rtflann::Index< Distance >::knnSearch ( const Matrix< ElementType > &  queries,
std::vector< std::vector< int > > &  indices,
std::vector< std::vector< DistanceType > > &  dists,
size_t  knn,
const SearchParams params 
) const
inline
Parameters
queries
indices
dists
knn
params
Returns

Definition at line 299 of file flann.hpp.

◆ load_saved_index()

template<typename Distance>
IndexType* rtflann::Index< Distance >::load_saved_index ( const Matrix< ElementType > &  dataset,
const std::string filename,
Distance  distance 
)
inlineprivate

Definition at line 381 of file flann.hpp.

◆ operator=()

template<typename Distance>
Index& rtflann::Index< Distance >::operator= ( Index< Distance >  other)
inline

Definition at line 123 of file flann.hpp.

◆ radiusSearch() [1/4]

template<typename Distance>
int rtflann::Index< Distance >::radiusSearch ( const Matrix< ElementType > &  queries,
Matrix< size_t > &  indices,
Matrix< DistanceType > &  dists,
float  radius,
const SearchParams params 
) const
inline

Perform radius search.

Parameters
[in]queriesThe query points
[out]indicesThe indices of the neighbors found within the given radius
[out]distsThe distances to the nearest neighbors found
[in]radiusThe radius used for search
[in]paramsSearch parameters
Returns
Number of neighbors found

Definition at line 317 of file flann.hpp.

◆ radiusSearch() [2/4]

template<typename Distance>
int rtflann::Index< Distance >::radiusSearch ( const Matrix< ElementType > &  queries,
Matrix< int > &  indices,
Matrix< DistanceType > &  dists,
float  radius,
const SearchParams params 
) const
inline
Parameters
queries
indices
dists
radius
params
Returns

Definition at line 335 of file flann.hpp.

◆ radiusSearch() [3/4]

template<typename Distance>
int rtflann::Index< Distance >::radiusSearch ( const Matrix< ElementType > &  queries,
std::vector< std::vector< size_t > > &  indices,
std::vector< std::vector< DistanceType > > &  dists,
float  radius,
const SearchParams params 
) const
inline

Perform radius search.

Parameters
[in]queriesThe query points
[out]indicesThe indices of the neighbors found within the given radius
[out]distsThe distances to the nearest neighbors found
[in]radiusThe radius used for search
[in]paramsSearch parameters
Returns
Number of neighbors found

Definition at line 353 of file flann.hpp.

◆ radiusSearch() [4/4]

template<typename Distance>
int rtflann::Index< Distance >::radiusSearch ( const Matrix< ElementType > &  queries,
std::vector< std::vector< int > > &  indices,
std::vector< std::vector< DistanceType > > &  dists,
float  radius,
const SearchParams params 
) const
inline
Parameters
queries
indices
dists
radius
params
Returns

Definition at line 371 of file flann.hpp.

◆ removedCount()

template<typename Distance>
size_t rtflann::Index< Distance >::removedCount ( ) const
inline

Definition at line 203 of file flann.hpp.

◆ removePoint()

template<typename Distance>
void rtflann::Index< Distance >::removePoint ( size_t  point_id)
inline

Remove point from the index

Parameters
indexIndex of point to be removed

Definition at line 158 of file flann.hpp.

◆ save()

template<typename Distance>
void rtflann::Index< Distance >::save ( std::string  filename)
inline

Save index to file

Parameters
filename

Definition at line 177 of file flann.hpp.

◆ size()

template<typename Distance>
size_t rtflann::Index< Distance >::size ( ) const
inline
Returns
The dimensionality of the features in this index.

Definition at line 198 of file flann.hpp.

◆ sizeAtBuild()

template<typename Distance>
size_t rtflann::Index< Distance >::sizeAtBuild ( ) const
inline

Definition at line 208 of file flann.hpp.

◆ swap()

template<typename Distance>
void rtflann::Index< Distance >::swap ( Index< Distance > &  other)
inlineprivate

Definition at line 402 of file flann.hpp.

◆ usedMemory()

template<typename Distance>
int rtflann::Index< Distance >::usedMemory ( ) const
inline
Returns
The amount of memory (in bytes) used by the index.

Definition at line 224 of file flann.hpp.

◆ veclen()

template<typename Distance>
size_t rtflann::Index< Distance >::veclen ( ) const
inline
Returns
number of features in this index.

Definition at line 190 of file flann.hpp.

Member Data Documentation

◆ index_params_

template<typename Distance>
IndexParams rtflann::Index< Distance >::index_params_
private

Parameters passed to the index

Definition at line 415 of file flann.hpp.

◆ loaded_

template<typename Distance>
bool rtflann::Index< Distance >::loaded_
private

Indices if the index was loaded from a file

Definition at line 413 of file flann.hpp.

◆ nnIndex_

template<typename Distance>
IndexType* rtflann::Index< Distance >::nnIndex_
private

Pointer to actual index class

Definition at line 411 of file flann.hpp.


The documentation for this class was generated from the following file:


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Jan 23 2023 03:39:00