ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
flann::AutotunedIndex< Distance > Class Template Reference

#include <autotuned_index.h>

Inheritance diagram for flann::AutotunedIndex< Distance >:
Collaboration diagram for flann::AutotunedIndex< Distance >:

Public Types

typedef Distance::ElementType ElementType
 
typedef Distance::ResultType DistanceType
 
typedef NNIndex< DistanceBaseClass
 
typedef AutotunedIndex< DistanceIndexType
 
typedef bool needs_kdtree_distance
 
- Public Types inherited from flann::NNIndex< Distance >
typedef Distance::ElementType ElementType
 
typedef Distance::ResultType DistanceType
 

Public Member Functions

 AutotunedIndex (const Matrix< ElementType > &inputData, const IndexParams &params=AutotunedIndexParams(), Distance d=Distance())
 
 AutotunedIndex (const IndexParams &params=AutotunedIndexParams(), Distance d=Distance())
 
 AutotunedIndex (const AutotunedIndex &other)
 
AutotunedIndexoperator= (AutotunedIndex other)
 
virtual ~AutotunedIndex ()
 
BaseClassclone () const
 
void buildIndex ()
 
void buildIndex (const Matrix< ElementType > &dataset)
 
void addPoints (const Matrix< ElementType > &points, float rebuild_threshold=2)
 Incrementally add points to the index. More...
 
void removePoint (size_t id)
 
template<typename Archive >
void serialize (Archive &ar)
 
void saveIndex (FILE *stream)
 
void loadIndex (FILE *stream)
 
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, std::vector< std::vector< size_t > > &indices, std::vector< std::vector< DistanceType > > &dists, size_t knn, const SearchParams &params) const
 
int radiusSearch (const Matrix< ElementType > &queries, Matrix< size_t > &indices, Matrix< DistanceType > &dists, DistanceType radius, const SearchParams &params) const
 
int radiusSearch (const Matrix< ElementType > &queries, std::vector< std::vector< size_t > > &indices, std::vector< std::vector< DistanceType > > &dists, DistanceType radius, const SearchParams &params) const
 
void findNeighbors (ResultSet< DistanceType > &result, const ElementType *vec, const SearchParams &searchParams) const
 
IndexParams getParameters () const
 
FLANN_DEPRECATED SearchParams getSearchParameters () const
 
FLANN_DEPRECATED float getSpeedup () const
 
size_t size () const
 
size_t veclen () const
 
int usedMemory () const
 
flann_algorithm_t getType () const
 
- Public Member Functions inherited from flann::NNIndex< Distance >
 NNIndex (Distance d)
 
 NNIndex (const IndexParams &params, Distance d)
 
 NNIndex (const NNIndex &other)
 
virtual ~NNIndex ()
 
virtual ElementTypegetPoint (size_t id)
 
size_t size () const
 
size_t veclen () const
 
IndexParams getParameters () const
 
template<typename Archive >
void serialize (Archive &ar)
 
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
 
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
 
- Public Member Functions inherited from flann::IndexBase
virtual ~IndexBase ()
 

Protected Member Functions

void buildIndexImpl ()
 
void freeIndex ()
 
- Protected Member Functions inherited from flann::NNIndex< Distance >
size_t id_to_index (size_t id)
 
void indices_to_ids (const size_t *in, size_t *out, size_t size) const
 
void setDataset (const Matrix< ElementType > &dataset)
 
void extendDataset (const Matrix< ElementType > &new_points)
 
void cleanRemovedPoints ()
 
void swap (NNIndex &other)
 

Additional Inherited Members

- Protected Attributes inherited from flann::NNIndex< Distance >
Distance distance_
 
size_t last_id_
 
size_t size_
 
size_t size_at_build_
 
size_t veclen_
 
IndexParams index_params_
 
bool removed_
 
DynamicBitset removed_points_
 
size_t removed_count_
 
std::vector< size_t > ids_
 
std::vector< ElementType * > points_
 
ElementTypedata_ptr_
 

Detailed Description

template<typename Distance>
class flann::AutotunedIndex< Distance >

Definition at line 73 of file autotuned_index.h.

Member Typedef Documentation

◆ BaseClass

template<typename Distance >
typedef NNIndex<Distance> flann::AutotunedIndex< Distance >::BaseClass

Definition at line 79 of file autotuned_index.h.

◆ DistanceType

template<typename Distance >
typedef Distance::ResultType flann::AutotunedIndex< Distance >::DistanceType

Definition at line 77 of file autotuned_index.h.

◆ ElementType

template<typename Distance >
typedef Distance::ElementType flann::AutotunedIndex< Distance >::ElementType

Definition at line 76 of file autotuned_index.h.

◆ IndexType

template<typename Distance >
typedef AutotunedIndex<Distance> flann::AutotunedIndex< Distance >::IndexType

Definition at line 81 of file autotuned_index.h.

◆ needs_kdtree_distance

template<typename Distance >
typedef bool flann::AutotunedIndex< Distance >::needs_kdtree_distance

Definition at line 83 of file autotuned_index.h.

Constructor & Destructor Documentation

◆ AutotunedIndex() [1/3]

template<typename Distance >
flann::AutotunedIndex< Distance >::AutotunedIndex ( const Matrix< ElementType > &  inputData,
const IndexParams params = AutotunedIndexParams(),
Distance  d = Distance() 
)
inline

Definition at line 85 of file autotuned_index.h.

References flann::get_param(), and params.

Referenced by flann::AutotunedIndex< Distance >::clone().

◆ AutotunedIndex() [2/3]

template<typename Distance >
flann::AutotunedIndex< Distance >::AutotunedIndex ( const IndexParams params = AutotunedIndexParams(),
Distance  d = Distance() 
)
inline

Definition at line 94 of file autotuned_index.h.

References flann::get_param(), and params.

◆ AutotunedIndex() [3/3]

template<typename Distance >
flann::AutotunedIndex< Distance >::AutotunedIndex ( const AutotunedIndex< Distance > &  other)
inline

Definition at line 103 of file autotuned_index.h.

◆ ~AutotunedIndex()

template<typename Distance >
virtual flann::AutotunedIndex< Distance >::~AutotunedIndex ( )
inlinevirtual

Definition at line 122 of file autotuned_index.h.

Member Function Documentation

◆ addPoints()

template<typename Distance >
void flann::AutotunedIndex< Distance >::addPoints ( const Matrix< ElementType > &  points,
float  rebuild_threshold = 2 
)
inlinevirtual

Incrementally add points to the index.

Parameters
pointsMatrix with points to be added
rebuild_threshold

Reimplemented from flann::NNIndex< Distance >.

Definition at line 164 of file autotuned_index.h.

References points.

◆ buildIndex() [1/2]

template<typename Distance >
void flann::AutotunedIndex< Distance >::buildIndex ( )
inlinevirtual

◆ buildIndex() [2/2]

template<typename Distance >
void flann::AutotunedIndex< Distance >::buildIndex ( const Matrix< ElementType > &  dataset)
inlinevirtual

Builds the index using the specified dataset

Parameters
datasetthe dataset to use

Reimplemented from flann::NNIndex< Distance >.

Definition at line 157 of file autotuned_index.h.

References flann::AutotunedIndex< Distance >::buildIndex().

◆ buildIndexImpl()

template<typename Distance >
void flann::AutotunedIndex< Distance >::buildIndexImpl ( )
inlineprotectedvirtual

Implements flann::NNIndex< Distance >.

Definition at line 357 of file autotuned_index.h.

◆ clone()

template<typename Distance >
BaseClass* flann::AutotunedIndex< Distance >::clone ( ) const
inlinevirtual

◆ findNeighbors()

template<typename Distance >
void flann::AutotunedIndex< Distance >::findNeighbors ( ResultSet< DistanceType > &  result,
const ElementType vec,
const SearchParams searchParams 
) const
inlinevirtual

Method that searches for nearest-neighbors

Implements flann::NNIndex< Distance >.

Definition at line 302 of file autotuned_index.h.

◆ freeIndex()

template<typename Distance >
void flann::AutotunedIndex< Distance >::freeIndex ( )
inlineprotectedvirtual

Implements flann::NNIndex< Distance >.

Definition at line 362 of file autotuned_index.h.

◆ getParameters()

template<typename Distance >
IndexParams flann::AutotunedIndex< Distance >::getParameters ( ) const
inlinevirtual

Implements flann::IndexBase.

Definition at line 308 of file autotuned_index.h.

◆ getSearchParameters()

template<typename Distance >
FLANN_DEPRECATED SearchParams flann::AutotunedIndex< Distance >::getSearchParameters ( ) const
inline

Definition at line 313 of file autotuned_index.h.

◆ getSpeedup()

template<typename Distance >
FLANN_DEPRECATED float flann::AutotunedIndex< Distance >::getSpeedup ( ) const
inline

Definition at line 318 of file autotuned_index.h.

◆ getType()

template<typename Distance >
flann_algorithm_t flann::AutotunedIndex< Distance >::getType ( ) const
inlinevirtual

Algorithm name

Implements flann::IndexBase.

Definition at line 351 of file autotuned_index.h.

References FLANN_INDEX_AUTOTUNED.

Referenced by flann::AutotunedIndex< Distance >::serialize().

◆ knnSearch() [1/2]

template<typename Distance >
int flann::AutotunedIndex< Distance >::knnSearch ( const Matrix< ElementType > &  queries,
Matrix< size_t > &  indices,
Matrix< DistanceType > &  dists,
size_t  knn,
const SearchParams params 
) const
inlinevirtual

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

Reimplemented from flann::NNIndex< Distance >.

Definition at line 232 of file autotuned_index.h.

References flann::SearchParams::checks, FLANN_CHECKS_AUTOTUNED, and params.

◆ knnSearch() [2/2]

template<typename Distance >
int flann::AutotunedIndex< 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

Definition at line 248 of file autotuned_index.h.

References flann::SearchParams::checks, FLANN_CHECKS_AUTOTUNED, and params.

◆ loadIndex()

template<typename Distance >
void flann::AutotunedIndex< Distance >::loadIndex ( FILE *  stream)
inlinevirtual

Implements flann::IndexBase.

Definition at line 219 of file autotuned_index.h.

References flann::NNIndex< Distance >::distance_, and params.

◆ operator=()

template<typename Distance >
AutotunedIndex& flann::AutotunedIndex< Distance >::operator= ( AutotunedIndex< Distance other)
inline

Definition at line 116 of file autotuned_index.h.

◆ radiusSearch() [1/2]

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

Definition at line 265 of file autotuned_index.h.

References flann::SearchParams::checks, FLANN_CHECKS_AUTOTUNED, and params.

◆ radiusSearch() [2/2]

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

Definition at line 281 of file autotuned_index.h.

References flann::SearchParams::checks, FLANN_CHECKS_AUTOTUNED, and params.

◆ removePoint()

template<typename Distance >
void flann::AutotunedIndex< Distance >::removePoint ( size_t  id)
inlinevirtual

Remove point from the index

Parameters
indexIndex of point to be removed

Reimplemented from flann::NNIndex< Distance >.

Definition at line 171 of file autotuned_index.h.

◆ saveIndex()

template<typename Distance >
void flann::AutotunedIndex< Distance >::saveIndex ( FILE *  stream)
inlinevirtual

Implements flann::IndexBase.

Definition at line 209 of file autotuned_index.h.

◆ serialize()

template<typename Distance >
template<typename Archive >
void flann::AutotunedIndex< Distance >::serialize ( Archive &  ar)
inline

◆ size()

template<typename Distance >
size_t flann::AutotunedIndex< Distance >::size ( ) const
inlinevirtual

Number of features in this index.

Implements flann::IndexBase.

Definition at line 327 of file autotuned_index.h.

◆ usedMemory()

template<typename Distance >
int flann::AutotunedIndex< Distance >::usedMemory ( ) const
inlinevirtual

The amount of memory (in bytes) this index uses.

Implements flann::IndexBase.

Definition at line 343 of file autotuned_index.h.

◆ veclen()

template<typename Distance >
size_t flann::AutotunedIndex< Distance >::veclen ( ) const
inlinevirtual

The length of each vector in this index.

Implements flann::IndexBase.

Definition at line 335 of file autotuned_index.h.


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