Public Types | Public Member Functions | Public Attributes | Protected Types | Protected Attributes | Private Member Functions | List of all members
nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType > Class Template Reference

#include <nanoflann.hpp>

Public Types

typedef Distance::DistanceType DistanceType
 
typedef Distance::ElementType ElementType
 

Public Member Functions

void addPoints (IndexType start, IndexType end)
 
template<typename RESULTSET >
bool findNeighbors (RESULTSET &result, const ElementType *vec, const SearchParams &searchParams) const
 
const std::vector< index_container_t > & getAllIndices () const
 
 KDTreeSingleIndexDynamicAdaptor (const int dimensionality, const DatasetAdaptor &inputData, const KDTreeSingleIndexAdaptorParams &params=KDTreeSingleIndexAdaptorParams(), const size_t maximumPointCount=1000000000U)
 
 KDTreeSingleIndexDynamicAdaptor (const KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType > &)=delete
 
void removePoint (size_t idx)
 

Public Attributes

Distance distance
 

Protected Types

typedef KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, DIM > index_container_t
 

Protected Attributes

const DatasetAdaptor & dataset
 The source of our data. More...
 
int dim
 Dimensionality of each data point. More...
 
std::vector< index_container_tindex
 
KDTreeSingleIndexAdaptorParams index_params
 
size_t m_leaf_max_size
 
size_t pointCount
 
size_t treeCount
 
std::vector< int > treeIndex
 

Private Member Functions

int First0Bit (IndexType num)
 
void init ()
 

Detailed Description

template<typename Distance, class DatasetAdaptor, int DIM = -1, typename IndexType = size_t>
class nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >

kd-tree dynaimic index

class to create multiple static index and merge their results to behave as single dynamic index as proposed in Logarithmic Approach.

Example of usage: examples/dynamic_pointcloud_example.cpp

Template Parameters
DatasetAdaptorThe user-provided adaptor (see comments above).
DistanceThe distance metric to use: nanoflann::metric_L1, nanoflann::metric_L2, nanoflann::metric_L2_Simple, etc.
DIMDimensionality of data points (e.g. 3 for 3D points)
IndexTypeWill be typically size_t or int

Definition at line 1788 of file nanoflann.hpp.

Member Typedef Documentation

◆ DistanceType

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
typedef Distance::DistanceType nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::DistanceType

Definition at line 1791 of file nanoflann.hpp.

◆ ElementType

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
typedef Distance::ElementType nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::ElementType

Definition at line 1790 of file nanoflann.hpp.

◆ index_container_t

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
typedef KDTreeSingleIndexDynamicAdaptor_<Distance, DatasetAdaptor, DIM> nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::index_container_t
protected

Definition at line 1812 of file nanoflann.hpp.

Constructor & Destructor Documentation

◆ KDTreeSingleIndexDynamicAdaptor() [1/2]

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::KDTreeSingleIndexDynamicAdaptor ( const int  dimensionality,
const DatasetAdaptor &  inputData,
const KDTreeSingleIndexAdaptorParams params = KDTreeSingleIndexAdaptorParams(),
const size_t  maximumPointCount = 1000000000U 
)
inline

KDTree constructor

Refer to docs in README.md or online in https://github.com/jlblancoc/nanoflann

The KD-Tree point dimension (the length of each point in the datase, e.g. 3 for 3D points) is determined by means of:

  • The DIM template parameter if >0 (highest priority)
  • Otherwise, the dimensionality parameter of this constructor.
Parameters
inputDataDataset with the input features
paramsBasically, the maximum leaf node size

Definition at line 1857 of file nanoflann.hpp.

◆ KDTreeSingleIndexDynamicAdaptor() [2/2]

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::KDTreeSingleIndexDynamicAdaptor ( const KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType > &  )
delete

Deleted copy constructor

Member Function Documentation

◆ addPoints()

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
void nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::addPoints ( IndexType  start,
IndexType  end 
)
inline

Add points to the set, Inserts all points from [start, end]

Definition at line 1883 of file nanoflann.hpp.

◆ findNeighbors()

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
template<typename RESULTSET >
bool nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::findNeighbors ( RESULTSET &  result,
const ElementType vec,
const SearchParams searchParams 
) const
inline

Find set of nearest neighbors to vec[0:dim-1]. Their indices are stored inside the result object.

Params: result = the result object in which the indices of the nearest-neighbors are stored vec = the vector for which to search the nearest neighbors

Template Parameters
RESULTSETShould be any ResultSet<DistanceType>
Returns
True if the requested neighbors could be found.
See also
knnSearch, radiusSearch

Definition at line 1926 of file nanoflann.hpp.

◆ First0Bit()

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
int nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::First0Bit ( IndexType  num)
inlineprivate

finds position of least significant unset bit

Definition at line 1822 of file nanoflann.hpp.

◆ getAllIndices()

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
const std::vector<index_container_t>& nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::getAllIndices ( ) const
inline

Get a const ref to the internal list of indices; the number of indices is adapted dynamically as the dataset grows in size.

Definition at line 1818 of file nanoflann.hpp.

◆ init()

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
void nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::init ( )
inlineprivate

Creates multiple empty trees to handle dynamic support

Definition at line 1832 of file nanoflann.hpp.

◆ removePoint()

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
void nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::removePoint ( size_t  idx)
inline

Remove a point from the set (Lazy Deletion)

Definition at line 1906 of file nanoflann.hpp.

Member Data Documentation

◆ dataset

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
const DatasetAdaptor& nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::dataset
protected

The source of our data.

The dataset used by this index

Definition at line 1801 of file nanoflann.hpp.

◆ dim

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
int nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::dim
protected

Dimensionality of each data point.

Definition at line 1809 of file nanoflann.hpp.

◆ distance

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Distance nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::distance

Definition at line 1841 of file nanoflann.hpp.

◆ index

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
std::vector<index_container_t> nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::index
protected

Definition at line 1813 of file nanoflann.hpp.

◆ index_params

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
KDTreeSingleIndexAdaptorParams nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::index_params
protected

Definition at line 1807 of file nanoflann.hpp.

◆ m_leaf_max_size

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
size_t nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::m_leaf_max_size
protected

Definition at line 1794 of file nanoflann.hpp.

◆ pointCount

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
size_t nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::pointCount
protected

Definition at line 1796 of file nanoflann.hpp.

◆ treeCount

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
size_t nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::treeCount
protected

Definition at line 1795 of file nanoflann.hpp.

◆ treeIndex

template<typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
std::vector<int> nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::treeIndex
protected

treeIndex[idx] is the index of tree in which point at idx is stored. treeIndex[idx]=-1 means that point has been removed.

Definition at line 1803 of file nanoflann.hpp.


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


mesh_map
Author(s): Sebastian Pütz
autogenerated on Thu Jan 25 2024 03:42:46