Public Types | Public Member Functions | Protected Member Functions | Private Attributes
rtflann::CompositeIndex< Distance > Class Template Reference

#include <composite_index.h>

Inheritance diagram for rtflann::CompositeIndex< Distance >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef NNIndex< Distance > BaseClass
typedef Distance::ResultType DistanceType
typedef Distance::ElementType ElementType
typedef bool needs_kdtree_distance

Public Member Functions

void addPoints (const Matrix< ElementType > &points, float rebuild_threshold=2)
 Incrementally add points to the index.
void buildIndex ()
 Builds the index.
BaseClassclone () const
 CompositeIndex (const IndexParams &params=CompositeIndexParams(), Distance d=Distance())
 CompositeIndex (const Matrix< ElementType > &inputData, const IndexParams &params=CompositeIndexParams(), Distance d=Distance())
 CompositeIndex (const CompositeIndex &other)
void findNeighbors (ResultSet< DistanceType > &result, const ElementType *vec, const SearchParams &searchParams) const
 Method that searches for nearest-neighbours.
flann_algorithm_t getType () const
void loadIndex (FILE *stream)
 Loads the index from a stream.
CompositeIndexoperator= (CompositeIndex other)
void removePoint (size_t index)
void saveIndex (FILE *stream)
 Saves the index to a stream.
size_t size () const
int usedMemory () const
size_t veclen () const
virtual ~CompositeIndex ()

Protected Member Functions

void buildIndexImpl ()
void freeIndex ()
void swap (CompositeIndex &other)

Private Attributes

KDTreeIndex< Distance > * kdtree_index_
KMeansIndex< Distance > * kmeans_index_

Detailed Description

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

This index builds a kd-tree index and a k-means index and performs nearest neighbour search both indexes. This gives a slight boost in search performance as some of the neighbours that are missed by one index are found by the other.

Definition at line 71 of file composite_index.h.


Member Typedef Documentation

template<typename Distance >
typedef NNIndex<Distance> rtflann::CompositeIndex< Distance >::BaseClass

Definition at line 77 of file composite_index.h.

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

Reimplemented from rtflann::NNIndex< Distance >.

Definition at line 75 of file composite_index.h.

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

Reimplemented from rtflann::NNIndex< Distance >.

Definition at line 74 of file composite_index.h.

template<typename Distance >
typedef bool rtflann::CompositeIndex< Distance >::needs_kdtree_distance

Definition at line 79 of file composite_index.h.


Constructor & Destructor Documentation

template<typename Distance >
rtflann::CompositeIndex< Distance >::CompositeIndex ( const IndexParams params = CompositeIndexParams(),
Distance  d = Distance() 
) [inline]

Index constructor

Parameters:
inputDatadataset containing the points to index
paramsIndex parameters
dDistance functor
Returns:

Definition at line 88 of file composite_index.h.

template<typename Distance >
rtflann::CompositeIndex< Distance >::CompositeIndex ( const Matrix< ElementType > &  inputData,
const IndexParams params = CompositeIndexParams(),
Distance  d = Distance() 
) [inline]

Definition at line 96 of file composite_index.h.

template<typename Distance >
rtflann::CompositeIndex< Distance >::CompositeIndex ( const CompositeIndex< Distance > &  other) [inline]

Definition at line 103 of file composite_index.h.

template<typename Distance >
virtual rtflann::CompositeIndex< Distance >::~CompositeIndex ( ) [inline, virtual]

Definition at line 114 of file composite_index.h.


Member Function Documentation

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

Incrementally add points to the index.

Parameters:
pointsMatrix with points to be added
rebuild_threshold

Reimplemented from rtflann::NNIndex< Distance >.

Definition at line 169 of file composite_index.h.

template<typename Distance >
void rtflann::CompositeIndex< Distance >::buildIndex ( ) [inline, virtual]

Builds the index.

Reimplemented from rtflann::NNIndex< Distance >.

Definition at line 161 of file composite_index.h.

template<typename Distance >
void rtflann::CompositeIndex< Distance >::buildIndexImpl ( ) [inline, protected, virtual]

Implements rtflann::NNIndex< Distance >.

Definition at line 218 of file composite_index.h.

template<typename Distance >
BaseClass* rtflann::CompositeIndex< Distance >::clone ( ) const [inline, virtual]

Implements rtflann::NNIndex< Distance >.

Definition at line 120 of file composite_index.h.

template<typename Distance >
void rtflann::CompositeIndex< Distance >::findNeighbors ( ResultSet< DistanceType > &  result,
const ElementType vec,
const SearchParams searchParams 
) const [inline, virtual]

Method that searches for nearest-neighbours.

Implements rtflann::NNIndex< Distance >.

Definition at line 205 of file composite_index.h.

template<typename Distance >
void rtflann::CompositeIndex< Distance >::freeIndex ( ) [inline, protected, virtual]

Implements rtflann::NNIndex< Distance >.

Definition at line 223 of file composite_index.h.

template<typename Distance >
flann_algorithm_t rtflann::CompositeIndex< Distance >::getType ( ) const [inline, virtual]
Returns:
The index type

Implements rtflann::IndexBase.

Definition at line 128 of file composite_index.h.

template<typename Distance >
void rtflann::CompositeIndex< Distance >::loadIndex ( FILE *  stream) [inline, virtual]

Loads the index from a stream.

Parameters:
streamThe stream from which the index is loaded

Implements rtflann::IndexBase.

Definition at line 196 of file composite_index.h.

template<typename Distance >
CompositeIndex& rtflann::CompositeIndex< Distance >::operator= ( CompositeIndex< Distance >  other) [inline]

Definition at line 108 of file composite_index.h.

template<typename Distance >
void rtflann::CompositeIndex< Distance >::removePoint ( size_t  id) [inline, virtual]

Remove point from the index

Parameters:
indexIndex of point to be removed

Reimplemented from rtflann::NNIndex< Distance >.

Definition at line 175 of file composite_index.h.

template<typename Distance >
void rtflann::CompositeIndex< Distance >::saveIndex ( FILE *  stream) [inline, virtual]

Saves the index to a stream.

Parameters:
streamThe stream to save the index to

Implements rtflann::IndexBase.

Definition at line 186 of file composite_index.h.

template<typename Distance >
size_t rtflann::CompositeIndex< Distance >::size ( ) const [inline, virtual]
Returns:
Size of the index

Reimplemented from rtflann::NNIndex< Distance >.

Definition at line 136 of file composite_index.h.

template<typename Distance >
void rtflann::CompositeIndex< Distance >::swap ( CompositeIndex< Distance > &  other) [inline, protected]

Definition at line 212 of file composite_index.h.

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

Implements rtflann::IndexBase.

Definition at line 152 of file composite_index.h.

template<typename Distance >
size_t rtflann::CompositeIndex< Distance >::veclen ( ) const [inline, virtual]
Returns:
The dimensionality of the features in this index.

Reimplemented from rtflann::NNIndex< Distance >.

Definition at line 144 of file composite_index.h.


Member Data Documentation

template<typename Distance >
KDTreeIndex<Distance>* rtflann::CompositeIndex< Distance >::kdtree_index_ [private]

The kd-tree index

Definition at line 234 of file composite_index.h.

template<typename Distance >
KMeansIndex<Distance>* rtflann::CompositeIndex< Distance >::kmeans_index_ [private]

The k-means index

Definition at line 231 of file composite_index.h.


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


rtabmap
Author(s): Mathieu Labbe
autogenerated on Sat Jul 23 2016 11:44:32