#include <nanoflann.hpp>
Public Types | |
typedef Distance::ElementType | ElementType |
typedef Distance::DistanceType | DistanceType |
Public Member Functions | |
KDTreeSingleIndexDynamicAdaptor (const int dimensionality, DatasetAdaptor &inputData, const KDTreeSingleIndexAdaptorParams ¶ms=KDTreeSingleIndexAdaptorParams(), const int maximumPointCount=1e9) | |
~KDTreeSingleIndexDynamicAdaptor () | |
void | addPoints (IndexType start, IndexType end) |
void | removePoint (int idx) |
template<typename RESULTSET > | |
bool | findNeighbors (RESULTSET &result, const ElementType *vec, const SearchParams &searchParams) const |
Public Attributes | |
Distance | distance |
Protected Attributes | |
size_t | m_leaf_max_size |
int | treeCount |
int | pointCount |
DatasetAdaptor & | dataset |
The source of our data. More... | |
std::vector< int > | treeIndex |
treeIndex[idx] is the index of tree in which point at idx is stored. treeIndex[idx]=-1 means that point has been removed. | |
KDTreeSingleIndexAdaptorParams | index_params |
int | dim |
Dimensionality of each data point. | |
std::vector < KDTreeSingleIndexDynamicAdaptor_ < Distance, DatasetAdaptor, DIM > > | index |
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 |
|
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 |
|
inline |
Standard destructor
|
inline |
Add points to the set
|
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> |
|
inline |
Remove a point from the set (Lazy Deletion)
|
protected |
The source of our data.
The dataset used by this index