Iterative nearest neighbors query. More...
#include <shark/Algorithms/NearestNeighbors/TreeNearestNeighbors.h>
Public Member Functions | |
IterativeNNQuery (tree_type const *tree, DataContainer const &data, value_type const &point) | |
~IterativeNNQuery () | |
destroy the query object and its internal data structures More... | |
std::size_t | neighbors () const |
return the number of neighbors already found More... | |
result_type | next () |
find and return the next nearest neighbor More... | |
std::size_t | queuesize () const |
Iterative nearest neighbors query.
The Data must be sotred in a random access container. This means that elements have O(1) access time. This is crucial for the performance of the tree lookup. When data is stored in a Data<T>, a View should be chosen as template parameter.
Definition at line 82 of file TreeNearestNeighbors.h.
|
inline |
create a new query
tree | Underlying space-partitioning tree (this is assumed to persist for the lifetime of the query object). |
data | Container holding the stored data which is referenced by the tree |
point | Point whose nearest neighbors are to be found. |
Definition at line 94 of file TreeNearestNeighbors.h.
References shark::BinaryTree< InputT >::hasChildren(), shark::BinaryTree< InputT >::isLeft(), shark::BinaryTree< InputT >::left(), and shark::BinaryTree< InputT >::right().
|
inline |
destroy the query object and its internal data structures
Definition at line 122 of file TreeNearestNeighbors.h.
|
inline |
return the number of neighbors already found
Definition at line 129 of file TreeNearestNeighbors.h.
|
inline |
find and return the next nearest neighbor
Definition at line 134 of file TreeNearestNeighbors.h.
References SHARK_RUNTIME_CHECK.
|
inline |
return the size of the queue, which is a measure of the overhead of the search
Definition at line 169 of file TreeNearestNeighbors.h.
References shark::BinaryTree< InputT >::hasChildren(), shark::BinaryTree< InputT >::left(), shark::NONE, shark::BinaryTree< InputT >::right(), and shark::BinaryTree< InputT >::squaredDistanceLowerBound().