|
void | freeIndex (Derived &obj) |
|
Size | size (const Derived &obj) const |
|
Size | veclen (const Derived &obj) |
|
ElementType | dataset_get (const Derived &obj, IndexType 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) |
|
NodePtr | divideTreeConcurrent (Derived &obj, const Offset left, const Offset right, BoundingBox &bbox, std::atomic< unsigned int > &thread_count, std::mutex &mutex) |
|
void | middleSplit_ (const Derived &obj, const Offset ind, const Size count, Offset &index, Dimension &cutfeat, DistanceType &cutval, const BoundingBox &bbox) |
|
void | planeSplit (const Derived &obj, const Offset ind, const Size count, const Dimension cutfeat, const DistanceType &cutval, Offset &lim1, Offset &lim2) |
|
DistanceType | computeInitialDistances (const Derived &obj, const ElementType *vec, distance_vector_t &dists) const |
|
void | saveIndex (const Derived &obj, std::ostream &stream) const |
|
void | loadIndex (Derived &obj, std::istream &stream) |
|
template<class Derived, typename Distance, class DatasetAdaptor, int32_t DIM = -1, typename index_t = uint32_t>
class nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, index_t >
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) |
IndexType | Type of the arguments with which the data can be accessed (e.g. float, double, int64_t, T*) |
template<class Derived , typename Distance , class DatasetAdaptor , int32_t DIM = -1, typename index_t = uint32_t>
void nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, index_t >::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 index_t = uint32_t>
void nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, index_t >::planeSplit |
( |
const Derived & | obj, |
|
|
const Offset | ind, |
|
|
const Size | count, |
|
|
const Dimension | cutfeat, |
|
|
const DistanceType & | cutval, |
|
|
Offset & | lim1, |
|
|
Offset & | lim2 ) |
|
inline |
Subdivide the list of points by a plane perpendicular on the axis 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 index_t = uint32_t>
void nanoflann::KDTreeBaseClass< Derived, Distance, DatasetAdaptor, DIM, index_t >::saveIndex |
( |
const Derived & | obj, |
|
|
std::ostream & | stream ) const |
|
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