#include <nanoflann.hpp>
|
void | freeIndex (Derived &obj) |
|
size_t | size (const Derived &obj) const |
|
size_t | veclen (const Derived &obj) |
|
ElementType | dataset_get (const Derived &obj, size_t idx, int component) const |
| Helper accessor to the dataset points:
|
|
size_t | usedMemory (Derived &obj) |
|
void | computeMinMax (const Derived &obj, IndexType *ind, IndexType count, int element, ElementType &min_elem, ElementType &max_elem) |
|
NodePtr | divideTree (Derived &obj, const IndexType left, const IndexType right, BoundingBox &bbox) |
|
void | middleSplit_ (Derived &obj, IndexType *ind, IndexType count, IndexType &index, int &cutfeat, DistanceType &cutval, const BoundingBox &bbox) |
|
void | planeSplit (Derived &obj, IndexType *ind, const IndexType count, int cutfeat, DistanceType &cutval, IndexType &lim1, IndexType &lim2) |
|
DistanceType | computeInitialDistances (const Derived &obj, const ElementType *vec, distance_vector_t &dists) const |
|
void | save_tree (Derived &obj, FILE *stream, NodePtr tree) |
|
void | load_tree (Derived &obj, FILE *stream, NodePtr &tree) |
|
void | saveIndex_ (Derived &obj, FILE *stream) |
|
void | loadIndex_ (Derived &obj, FILE *stream) |
|
template<class Derived, typename Distance, class DatasetAdaptor, int DIM = -1, typename IndexType = size_t>
class nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >
kd-tree base-class
Contains the member functions common to the classes KDTreeSingleIndexAdaptor and KDTreeSingleIndexDynamicAdaptor_.
- Template Parameters
-
Derived | The name of the class which inherits this class. |
DatasetAdaptor | The user-provided adaptor (see comments above). |
Distance | The distance metric to use, these are all classes derived from nanoflann::Metric |
DIM | Dimensionality of data points (e.g. 3 for 3D points) |
IndexType | Will be typically size_t or int |
◆ BoundingBox
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Define "BoundingBox" as a fixed-size or variable-size container depending on "DIM"
◆ distance_vector_t
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Define "distance_vector_t" as a fixed-size or variable-size container depending on "DIM"
◆ divideTree()
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Create a tree node that subdivides the list of vecs from vind[first] to vind[last]. The routine is called recursively on each sublist.
- Parameters
-
left | index of the first vector |
right | index of the last vector |
◆ freeIndex()
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Frees the previously-built index. Automatically called within buildIndex().
◆ loadIndex_()
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Loads a previous index from a binary file. IMPORTANT NOTE: The set of data points is NOT stored in the file, so the index object must be constructed associated to the same source of data points used while building the index. See the example: examples/saveload_example.cpp
- See also
- loadIndex
◆ planeSplit()
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
void nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, IndexType >::planeSplit |
( |
Derived & |
obj, |
|
|
IndexType * |
ind, |
|
|
const IndexType |
count, |
|
|
int |
cutfeat, |
|
|
DistanceType & |
cutval, |
|
|
IndexType & |
lim1, |
|
|
IndexType & |
lim2 |
|
) |
| |
|
inline |
Subdivide the list of points by a plane perpendicular on axe corresponding to the 'cutfeat' dimension at 'cutval' position.
On return: dataset[ind[0..lim1-1]][cutfeat]<cutval dataset[ind[lim1..lim2-1]][cutfeat]==cutval dataset[ind[lim2..count]][cutfeat]>cutval
◆ saveIndex_()
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Stores the index in a binary file. IMPORTANT NOTE: The set of data points is NOT stored in the file, so when loading the index object it must be constructed associated to the same source of data points used while building it. See the example: examples/saveload_example.cpp
- See also
- loadIndex
◆ size()
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Returns number of points in dataset
◆ usedMemory()
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Computes the inde memory usage Returns: memory used by the index
◆ veclen()
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Returns the length of each point in the dataset
◆ m_size_at_index_build
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Number of points in the dataset when the index was built
◆ pool
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Pooled memory allocator.
Using a pooled memory allocator is more efficient than allocating memory directly when there is a large number small of memory allocations.
◆ root_bbox
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
The KD-tree used to find neighbours
◆ vind
template<class Derived , typename Distance , class DatasetAdaptor , int DIM = -1, typename IndexType = size_t>
Array of indices to vectors in the dataset.
The documentation for this class was generated from the following file: