MLPACK  1.0.11
single_tree_traverser.hpp
Go to the documentation of this file.
1 
24 #ifndef __MLPACK_CORE_TREE_COVER_TREE_SINGLE_TREE_TRAVERSER_HPP
25 #define __MLPACK_CORE_TREE_COVER_TREE_SINGLE_TREE_TRAVERSER_HPP
26 
27 #include <mlpack/core.hpp>
28 
29 #include "cover_tree.hpp"
30 
31 namespace mlpack {
32 namespace tree {
33 
34 template<typename MetricType, typename RootPointPolicy, typename StatisticType>
35 template<typename RuleType>
36 class CoverTree<MetricType, RootPointPolicy, StatisticType>::SingleTreeTraverser
37 {
38  public:
42  SingleTreeTraverser(RuleType& rule);
43 
51  void Traverse(const size_t queryIndex, CoverTree& referenceNode);
52 
54  size_t NumPrunes() const { return numPrunes; }
56  size_t& NumPrunes() { return numPrunes; }
57 
58  private:
60  RuleType& rule;
61 
63  size_t numPrunes;
64 };
65 
66 }; // namespace tree
67 }; // namespace mlpack
68 
69 // Include implementation.
70 #include "single_tree_traverser_impl.hpp"
71 
72 #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).
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.