#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 ¶ms=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_t > | index |
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 () |
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
DatasetAdaptor | The user-provided adaptor (see comments above). |
Distance | The distance metric to use: nanoflann::metric_L1, nanoflann::metric_L2, nanoflann::metric_L2_Simple, etc. |
DIM | Dimensionality of data points (e.g. 3 for 3D points) |
IndexType | Will be typically size_t or int |
Definition at line 1788 of file nanoflann.hpp.
typedef Distance::DistanceType nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::DistanceType |
Definition at line 1791 of file nanoflann.hpp.
typedef Distance::ElementType nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::ElementType |
Definition at line 1790 of file nanoflann.hpp.
|
protected |
Definition at line 1812 of file nanoflann.hpp.
|
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:
inputData | Dataset with the input features |
params | Basically, the maximum leaf node size |
Definition at line 1857 of file nanoflann.hpp.
|
delete |
Deleted copy constructor
|
inline |
Add points to the set, Inserts all points from [start, end]
Definition at line 1883 of file nanoflann.hpp.
|
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
RESULTSET | Should be any ResultSet<DistanceType> |
Definition at line 1926 of file nanoflann.hpp.
|
inlineprivate |
finds position of least significant unset bit
Definition at line 1822 of file nanoflann.hpp.
|
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.
|
inlineprivate |
Creates multiple empty trees to handle dynamic support
Definition at line 1832 of file nanoflann.hpp.
|
inline |
Remove a point from the set (Lazy Deletion)
Definition at line 1906 of file nanoflann.hpp.
|
protected |
The source of our data.
The dataset used by this index
Definition at line 1801 of file nanoflann.hpp.
|
protected |
Dimensionality of each data point.
Definition at line 1809 of file nanoflann.hpp.
Distance nanoflann::KDTreeSingleIndexDynamicAdaptor< Distance, DatasetAdaptor, DIM, IndexType >::distance |
Definition at line 1841 of file nanoflann.hpp.
|
protected |
Definition at line 1813 of file nanoflann.hpp.
|
protected |
Definition at line 1807 of file nanoflann.hpp.
|
protected |
Definition at line 1794 of file nanoflann.hpp.
|
protected |
Definition at line 1796 of file nanoflann.hpp.
|
protected |
Definition at line 1795 of file nanoflann.hpp.
|
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.