#include <composite_index.h>
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. | |
BaseClass * | clone () const |
CompositeIndex (const IndexParams ¶ms=CompositeIndexParams(), Distance d=Distance()) | |
CompositeIndex (const Matrix< ElementType > &inputData, const IndexParams ¶ms=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. | |
CompositeIndex & | operator= (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_ |
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.
typedef NNIndex<Distance> rtflann::CompositeIndex< Distance >::BaseClass |
Definition at line 77 of file composite_index.h.
typedef Distance::ResultType rtflann::CompositeIndex< Distance >::DistanceType |
Reimplemented from rtflann::NNIndex< Distance >.
Definition at line 75 of file composite_index.h.
typedef Distance::ElementType rtflann::CompositeIndex< Distance >::ElementType |
Reimplemented from rtflann::NNIndex< Distance >.
Definition at line 74 of file composite_index.h.
typedef bool rtflann::CompositeIndex< Distance >::needs_kdtree_distance |
Definition at line 79 of file composite_index.h.
rtflann::CompositeIndex< Distance >::CompositeIndex | ( | const IndexParams & | params = CompositeIndexParams() , |
Distance | d = Distance() |
||
) | [inline] |
Index constructor
inputData | dataset containing the points to index |
params | Index parameters |
d | Distance functor |
Definition at line 88 of file composite_index.h.
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.
rtflann::CompositeIndex< Distance >::CompositeIndex | ( | const CompositeIndex< Distance > & | other | ) | [inline] |
Definition at line 103 of file composite_index.h.
virtual rtflann::CompositeIndex< Distance >::~CompositeIndex | ( | ) | [inline, virtual] |
Definition at line 114 of file composite_index.h.
void rtflann::CompositeIndex< Distance >::addPoints | ( | const Matrix< ElementType > & | points, |
float | rebuild_threshold = 2 |
||
) | [inline, virtual] |
Incrementally add points to the index.
points | Matrix with points to be added |
rebuild_threshold |
Reimplemented from rtflann::NNIndex< Distance >.
Definition at line 169 of file composite_index.h.
void rtflann::CompositeIndex< Distance >::buildIndex | ( | ) | [inline, virtual] |
Builds the index.
Reimplemented from rtflann::NNIndex< Distance >.
Definition at line 161 of file composite_index.h.
void rtflann::CompositeIndex< Distance >::buildIndexImpl | ( | ) | [inline, protected, virtual] |
Implements rtflann::NNIndex< Distance >.
Definition at line 218 of file composite_index.h.
BaseClass* rtflann::CompositeIndex< Distance >::clone | ( | ) | const [inline, virtual] |
Implements rtflann::NNIndex< Distance >.
Definition at line 120 of file composite_index.h.
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.
void rtflann::CompositeIndex< Distance >::freeIndex | ( | ) | [inline, protected, virtual] |
Implements rtflann::NNIndex< Distance >.
Definition at line 223 of file composite_index.h.
flann_algorithm_t rtflann::CompositeIndex< Distance >::getType | ( | ) | const [inline, virtual] |
Implements rtflann::IndexBase.
Definition at line 128 of file composite_index.h.
void rtflann::CompositeIndex< Distance >::loadIndex | ( | FILE * | stream | ) | [inline, virtual] |
Loads the index from a stream.
stream | The stream from which the index is loaded |
Implements rtflann::IndexBase.
Definition at line 196 of file composite_index.h.
CompositeIndex& rtflann::CompositeIndex< Distance >::operator= | ( | CompositeIndex< Distance > | other | ) | [inline] |
Definition at line 108 of file composite_index.h.
void rtflann::CompositeIndex< Distance >::removePoint | ( | size_t | id | ) | [inline, virtual] |
Remove point from the index
index | Index of point to be removed |
Reimplemented from rtflann::NNIndex< Distance >.
Definition at line 175 of file composite_index.h.
void rtflann::CompositeIndex< Distance >::saveIndex | ( | FILE * | stream | ) | [inline, virtual] |
Saves the index to a stream.
stream | The stream to save the index to |
Implements rtflann::IndexBase.
Definition at line 186 of file composite_index.h.
size_t rtflann::CompositeIndex< Distance >::size | ( | ) | const [inline, virtual] |
Reimplemented from rtflann::NNIndex< Distance >.
Definition at line 136 of file composite_index.h.
void rtflann::CompositeIndex< Distance >::swap | ( | CompositeIndex< Distance > & | other | ) | [inline, protected] |
Definition at line 212 of file composite_index.h.
int rtflann::CompositeIndex< Distance >::usedMemory | ( | ) | const [inline, virtual] |
Implements rtflann::IndexBase.
Definition at line 152 of file composite_index.h.
size_t rtflann::CompositeIndex< Distance >::veclen | ( | ) | const [inline, virtual] |
Reimplemented from rtflann::NNIndex< Distance >.
Definition at line 144 of file composite_index.h.
KDTreeIndex<Distance>* rtflann::CompositeIndex< Distance >::kdtree_index_ [private] |
The kd-tree index
Definition at line 234 of file composite_index.h.
KMeansIndex<Distance>* rtflann::CompositeIndex< Distance >::kmeans_index_ [private] |
The k-means index
Definition at line 231 of file composite_index.h.