|
void | freeIndex (Derived &obj) |
|
Size | size (const Derived &obj) const |
|
Size | veclen (const Derived &obj) |
|
ElementType | dataset_get (const Derived &obj, AccessorType element, Dimension component) const |
| Helper accessor to the dataset points:
|
|
Size | usedMemory (Derived &obj) |
|
void | computeMinMax (const Derived &obj, Offset ind, Size count, Dimension element, ElementType &min_elem, ElementType &max_elem) |
|
NodePtr | divideTree (Derived &obj, const Offset left, const Offset right, BoundingBox &bbox) |
|
void | middleSplit_ (Derived &obj, Offset ind, Size count, Offset &index, Dimension &cutfeat, DistanceType &cutval, const BoundingBox &bbox) |
|
void | planeSplit (Derived &obj, Offset ind, const Size count, Dimension cutfeat, DistanceType &cutval, Offset &lim1, Offset &lim2) |
|
DistanceType | computeInitialDistances (const Derived &obj, const ElementType *vec, distance_vector_t &dists) const |
|
void | save_tree (Derived &obj, std::ostream &stream, NodePtr tree) |
|
void | load_tree (Derived &obj, std::istream &stream, NodePtr &tree) |
|
void | saveIndex_ (Derived &obj, std::ostream &stream) |
|
void | loadIndex_ (Derived &obj, std::istream &stream) |
|
template<class Derived, typename Distance, class DatasetAdaptor, int32_t DIM = -1, typename AccessorType = uint32_t>
class nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, AccessorType >
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, which must be ensured to have a lifetime equal or longer than the instance of this class. |
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) |
AccessorType | Will be typically size_t or int |
template<class Derived , typename Distance , class DatasetAdaptor , int32_t DIM = -1, typename AccessorType = uint32_t>
void nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, AccessorType >::loadIndex_ |
( |
Derived & |
obj, |
|
|
std::istream & |
stream |
|
) |
| |
|
inline |
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
template<class Derived , typename Distance , class DatasetAdaptor , int32_t DIM = -1, typename AccessorType = uint32_t>
void nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, AccessorType >::planeSplit |
( |
Derived & |
obj, |
|
|
Offset |
ind, |
|
|
const Size |
count, |
|
|
Dimension |
cutfeat, |
|
|
DistanceType & |
cutval, |
|
|
Offset & |
lim1, |
|
|
Offset & |
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
template<class Derived , typename Distance , class DatasetAdaptor , int32_t DIM = -1, typename AccessorType = uint32_t>
void nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, AccessorType >::saveIndex_ |
( |
Derived & |
obj, |
|
|
std::ostream & |
stream |
|
) |
| |
|
inline |
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