mlpack  1.0.12
single_tree_traverser.hpp
Go to the documentation of this file.
1 
16 #ifndef __MLPACK_CORE_TREE_COVER_TREE_SINGLE_TREE_TRAVERSER_HPP
17 #define __MLPACK_CORE_TREE_COVER_TREE_SINGLE_TREE_TRAVERSER_HPP
18 
19 #include <mlpack/core.hpp>
20 
21 #include "cover_tree.hpp"
22 
23 namespace mlpack {
24 namespace tree {
25 
26 template<typename MetricType, typename RootPointPolicy, typename StatisticType>
27 template<typename RuleType>
28 class CoverTree<MetricType, RootPointPolicy, StatisticType>::SingleTreeTraverser
29 {
30  public:
34  SingleTreeTraverser(RuleType& rule);
35 
43  void Traverse(const size_t queryIndex, CoverTree& referenceNode);
44 
46  size_t NumPrunes() const { return numPrunes; }
48  size_t& NumPrunes() { return numPrunes; }
49 
50  private:
52  RuleType& rule;
53 
55  size_t numPrunes;
56 };
57 
58 }; // namespace tree
59 }; // namespace mlpack
60 
61 // Include implementation.
62 #include "single_tree_traverser_impl.hpp"
63 
64 #endif
RuleType & rule
Reference to the rules with which the tree will be traversed.
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).
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:23
CoverTree(const arma::mat &dataset, const double base=2.0, MetricType *metric=NULL)
Create the cover tree with the given dataset and given base.
size_t numPrunes
The number of nodes which have been pruned during traversal.