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

#include <linear_index.h>

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

Public Types

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

Public Member Functions

 LinearIndex (const IndexParams &params=LinearIndexParams(), Distance d=Distance())
 
 LinearIndex (const Matrix< ElementType > &input_data, const IndexParams &params=LinearIndexParams(), Distance d=Distance())
 
 LinearIndex (const LinearIndex &other)
 
LinearIndexoperator= (LinearIndex other)
 
virtual ~LinearIndex ()
 
BaseClassclone () const
 
void addPoints (const Matrix< ElementType > &points, float rebuild_threshold=2)
 Incrementally add points to the index. More...
 
flann_algorithm_t getType () const
 
int usedMemory () const
 
template<typename Archive >
void serialize (Archive &ar)
 
void saveIndex (FILE *stream)
 
void loadIndex (FILE *stream)
 
void findNeighbors (ResultSet< DistanceType > &resultSet, const ElementType *vec, const SearchParams &) 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 void buildIndex ()
 
virtual void buildIndex (const Matrix< ElementType > &dataset)
 
virtual void removePoint (size_t id)
 
virtual ElementTypegetPoint (size_t id)
 
size_t size () const
 
size_t veclen () const
 
IndexParams getParameters () const
 
template<typename Archive >
void serialize (Archive &ar)
 
virtual 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
 
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::LinearIndex< Distance >

Definition at line 49 of file linear_index.h.

Member Typedef Documentation

◆ BaseClass

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

Definition at line 56 of file linear_index.h.

◆ DistanceType

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

Definition at line 54 of file linear_index.h.

◆ ElementType

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

Definition at line 53 of file linear_index.h.

Constructor & Destructor Documentation

◆ LinearIndex() [1/3]

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

Definition at line 58 of file linear_index.h.

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

◆ LinearIndex() [2/3]

template<typename Distance >
flann::LinearIndex< Distance >::LinearIndex ( const Matrix< ElementType > &  input_data,
const IndexParams params = LinearIndexParams(),
Distance  d = Distance() 
)
inline

Definition at line 63 of file linear_index.h.

References flann::NNIndex< Distance >::setDataset().

◆ LinearIndex() [3/3]

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

Definition at line 69 of file linear_index.h.

◆ ~LinearIndex()

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

Definition at line 79 of file linear_index.h.

Member Function Documentation

◆ addPoints()

template<typename Distance >
void flann::LinearIndex< 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 88 of file linear_index.h.

References flann::NNIndex< Distance >::extendDataset(), points, and flann::NNIndex< Distance >::veclen_.

◆ buildIndexImpl()

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

Implements flann::NNIndex< Distance >.

Definition at line 146 of file linear_index.h.

◆ clone()

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

◆ findNeighbors()

◆ freeIndex()

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

Implements flann::NNIndex< Distance >.

Definition at line 151 of file linear_index.h.

◆ getType()

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

Implements flann::IndexBase.

Definition at line 94 of file linear_index.h.

References FLANN_INDEX_LINEAR.

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

◆ loadIndex()

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

Implements flann::IndexBase.

Definition at line 123 of file linear_index.h.

◆ operator=()

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

Definition at line 73 of file linear_index.h.

References flann::NNIndex< Distance >::swap().

◆ saveIndex()

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

Implements flann::IndexBase.

Definition at line 117 of file linear_index.h.

◆ serialize()

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

◆ usedMemory()

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

Implements flann::IndexBase.

Definition at line 100 of file linear_index.h.


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