mlpack 3.4.2
single_tree_traverser.hpp
Go to the documentation of this file.
1
14#ifndef MLPACK_CORE_TREE_COVER_TREE_SINGLE_TREE_TRAVERSER_HPP
15#define MLPACK_CORE_TREE_COVER_TREE_SINGLE_TREE_TRAVERSER_HPP
16
17#include <mlpack/prereqs.hpp>
18
19#include "cover_tree.hpp"
20
21namespace mlpack {
22namespace tree {
23
24template<
25 typename MetricType,
26 typename StatisticType,
27 typename MatType,
28 typename RootPointPolicy
29>
30template<typename RuleType>
31class CoverTree<MetricType, StatisticType, MatType, RootPointPolicy>::
33{
34 public:
38 SingleTreeTraverser(RuleType& rule);
39
47 void Traverse(const size_t queryIndex, CoverTree& referenceNode);
48
50 size_t NumPrunes() const { return numPrunes; }
52 size_t& NumPrunes() { return numPrunes; }
53
54 private:
56 RuleType& rule;
57
59 size_t numPrunes;
60};
61
62} // namespace tree
63} // namespace mlpack
64
65// Include implementation.
66#include "single_tree_traverser_impl.hpp"
67
68#endif
A single-tree cover tree traverser; see single_tree_traverser.hpp for implementation.
void Traverse(const size_t queryIndex, CoverTree &referenceNode)
Traverse the tree with the given point.
size_t NumPrunes() const
Get the number of prunes so far.
size_t & NumPrunes()
Set the number of prunes (good for a reset to 0).
SingleTreeTraverser(RuleType &rule)
Initialize the single tree traverser with the given rule.
A cover tree is a tree specifically designed to speed up nearest-neighbor computation in high-dimensi...
Definition: cover_tree.hpp:100
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: cv.hpp:1
The core includes that mlpack expects; standard C++ includes and Armadillo.