ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
flann::lsh::LshTable< ElementType > Class Template Reference

#include <lsh_table.h>

Public Types

typedef std::map< BucketKey, BucketBucketsSpace
 
typedef std::vector< BucketBucketsSpeed
 

Public Member Functions

 LshTable ()
 
 LshTable (unsigned int, unsigned int)
 
void add (unsigned int value, const ElementType *feature)
 
void add (const std::vector< std::pair< size_t, ElementType * > > &features)
 
const BucketgetBucketFromKey (BucketKey key) const
 
size_t getKey (const ElementType *) const
 
LshStats getStats () const
 
 LshTable (unsigned int feature_size, unsigned int subsignature_size)
 
size_t getKey (const unsigned char *feature) const
 
LshStats getStats () const
 

Detailed Description

template<typename ElementType>
class flann::lsh::LshTable< ElementType >

Lsh hash table. As its key is a sub-feature, and as usually the size of it is pretty small, we keep it as a continuous memory array. The value is an index in the corpus of features (we keep it as an unsigned int for pure memory reasons, it could be a size_t)

Definition at line 125 of file lsh_table.h.

Member Typedef Documentation

◆ BucketsSpace

template<typename ElementType >
typedef std::map<BucketKey, Bucket> flann::lsh::LshTable< ElementType >::BucketsSpace

A container of all the feature indices. Optimized for space

Definition at line 133 of file lsh_table.h.

◆ BucketsSpeed

template<typename ElementType >
typedef std::vector<Bucket> flann::lsh::LshTable< ElementType >::BucketsSpeed

A container of all the feature indices. Optimized for speed

Definition at line 138 of file lsh_table.h.

Constructor & Destructor Documentation

◆ LshTable() [1/3]

template<typename ElementType >
flann::lsh::LshTable< ElementType >::LshTable ( )
inline

Default constructor

Definition at line 142 of file lsh_table.h.

◆ LshTable() [2/3]

template<typename ElementType >
flann::lsh::LshTable< ElementType >::LshTable ( unsigned int  ,
unsigned int   
)
inline

Default constructor Create the mask and allocate the memory

Parameters
feature_sizeis the size of the feature (considered as a ElementType[])
key_sizeis the number of bits that are turned on in the feature

Definition at line 151 of file lsh_table.h.

References QtCompat::endl().

◆ LshTable() [3/3]

flann::lsh::LshTable< unsigned char >::LshTable ( unsigned int  feature_size,
unsigned int  subsignature_size 
)
inline

Definition at line 358 of file lsh_table.h.

References cloudViewer::utility::ceil().

Member Function Documentation

◆ add() [1/2]

template<typename ElementType >
void flann::lsh::LshTable< ElementType >::add ( const std::vector< std::pair< size_t, ElementType * > > &  features)
inline

Add a set of features to the table

Parameters
datasetthe values to store

Definition at line 188 of file lsh_table.h.

References flann::lsh::LshTable< ElementType >::add().

◆ add() [2/2]

template<typename ElementType >
void flann::lsh::LshTable< ElementType >::add ( unsigned int  value,
const ElementType *  feature 
)
inline

Add a feature to the table

Parameters
valuethe value to store for that feature
featurethe feature itself

Definition at line 161 of file lsh_table.h.

References flann::lsh::LshTable< ElementType >::getKey(), and flann::DynamicBitset::set().

Referenced by flann::lsh::LshTable< ElementType >::add(), flann::LshIndex< Distance >::addPoints(), and flann::LshIndex< Distance >::buildIndexImpl().

◆ getBucketFromKey()

template<typename ElementType >
const Bucket* flann::lsh::LshTable< ElementType >::getBucketFromKey ( BucketKey  key) const
inline

Get a bucket given the key

Parameters
key
Returns

Definition at line 205 of file lsh_table.h.

References flann::DynamicBitset::test().

◆ getKey() [1/2]

template<typename ElementType >
size_t flann::lsh::LshTable< ElementType >::getKey ( const ElementType *  ) const
inline

Compute the sub-signature of a feature

Definition at line 234 of file lsh_table.h.

References QtCompat::endl().

Referenced by flann::lsh::LshTable< ElementType >::add().

◆ getKey() [2/2]

size_t flann::lsh::LshTable< unsigned char >::getKey ( const unsigned char *  feature) const
inline

Return the Subsignature of a feature

Parameters
featurethe feature to analyze

Definition at line 400 of file lsh_table.h.

◆ getStats() [1/2]

template<typename ElementType >
LshStats flann::lsh::LshTable< ElementType >::getStats ( ) const

Get statistics about the table

Returns

◆ getStats() [2/2]


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