|
| KDTreeSingleIndexDynamicAdaptor_ (const Dimension dimensionality, const DatasetAdaptor &inputData, std::vector< int > &treeIndex, const KDTreeSingleIndexAdaptorParams ¶ms=KDTreeSingleIndexAdaptorParams()) |
|
| KDTreeSingleIndexDynamicAdaptor_ (const KDTreeSingleIndexDynamicAdaptor_ &rhs)=default |
|
KDTreeSingleIndexDynamicAdaptor_ | operator= (const KDTreeSingleIndexDynamicAdaptor_ &rhs) |
|
void | buildIndex () |
|
void | computeBoundingBox (BoundingBox &bbox) |
|
template<class RESULTSET > |
void | searchLevel (RESULTSET &result_set, const ElementType *vec, const NodePtr node, DistanceType mindist, distance_vector_t &dists, const float epsError) const |
|
void | saveIndex (std::ostream &stream) |
|
void | loadIndex (std::istream &stream) |
|
|
template<typename RESULTSET > |
bool | findNeighbors (RESULTSET &result, const ElementType *vec, const SearchParameters &searchParams={}) const |
|
Size | knnSearch (const ElementType *query_point, const Size num_closest, IndexType *out_indices, DistanceType *out_distances, const SearchParameters &searchParams={}) const |
|
Size | radiusSearch (const ElementType *query_point, const DistanceType &radius, std::vector< ResultItem< IndexType, DistanceType > > &IndicesDists, const SearchParameters &searchParams={}) const |
|
template<class SEARCH_CALLBACK > |
Size | radiusSearchCustomCallback (const ElementType *query_point, SEARCH_CALLBACK &resultSet, const SearchParameters &searchParams={}) const |
|
void | freeIndex (KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj) |
|
Size | size (const KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj) const |
|
Size | veclen (const KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj) |
|
ElementType | dataset_get (const KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj, IndexType element, Dimension component) const |
| Helper accessor to the dataset points:
|
|
Size | usedMemory (KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj) |
|
void | computeMinMax (const KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj, Offset ind, Size count, Dimension element, ElementType &min_elem, ElementType &max_elem) |
|
NodePtr | divideTree (KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj, const Offset left, const Offset right, BoundingBox &bbox) |
|
NodePtr | divideTreeConcurrent (KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj, const Offset left, const Offset right, BoundingBox &bbox, std::atomic< unsigned int > &thread_count, std::mutex &mutex) |
|
void | middleSplit_ (const KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj, const Offset ind, const Size count, Offset &index, Dimension &cutfeat, DistanceType &cutval, const BoundingBox &bbox) |
|
void | planeSplit (const KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj, const Offset ind, const Size count, const Dimension cutfeat, const DistanceType &cutval, Offset &lim1, Offset &lim2) |
|
DistanceType | computeInitialDistances (const KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj, const ElementType *vec, distance_vector_t &dists) const |
|
void | saveIndex (const KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj, std::ostream &stream) const |
|
void | loadIndex (KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, -1, uint32_t > &obj, std::istream &stream) |
|
template<typename Distance, class DatasetAdaptor, int32_t DIM = -1, typename IndexType = uint32_t>
class nanoflann::KDTreeSingleIndexDynamicAdaptor_< Distance, DatasetAdaptor, DIM, IndexType >
kd-tree dynamic index
Contains the k-d trees and other information for indexing a set of points for nearest-neighbor matching.
The class "DatasetAdaptor" must provide the following interface (can be non-virtual, inlined methods):
size_t kdtree_get_point_count() const { ... }
T kdtree_get_pt(const size_t idx, const size_t dim) const { ... }
bbox computation loop.
in "bb" so it can be avoided to redo it again.
for point clouds) template <class BBOX> bool kdtree_get_bbox(BBOX &bb) const
{
bb[0].low = ...; bb[0].high = ...;
bb[1].low = ...; bb[1].high = ...;
...
return true;
}
- Template Parameters
-
template<typename Distance , class DatasetAdaptor , int32_t DIM = -1, typename IndexType = uint32_t>
Find all the neighbors to query_point[0:dim-1] within a maximum radius. The output is given as a vector of pairs, of which the first element is a point index and the second the corresponding distance. Previous contents of IndicesDists are cleared.
If searchParams.sorted==true, the output list is sorted by ascending distances.
For a better performance, it is advisable to do a .reserve() on the vector if you have any wild guess about the number of expected matches.
- See also
- knnSearch, findNeighbors, radiusSearchCustomCallback
- Returns
- The number of points within the given radius (i.e. indices.size() or dists.size() )
- Note
- If L2 norms are used, search radius and all returned distances are actually squared distances.