MLPACK  1.0.11
single_tree_traverser.hpp
Go to the documentation of this file.
1 
24 #ifndef __MLPACK_CORE_TREE_BINARY_SPACE_TREE_SINGLE_TREE_TRAVERSER_HPP
25 #define __MLPACK_CORE_TREE_BINARY_SPACE_TREE_SINGLE_TREE_TRAVERSER_HPP
26 
27 #include <mlpack/core.hpp>
28 
29 #include "binary_space_tree.hpp"
30 
31 namespace mlpack {
32 namespace tree {
33 
34 template<typename BoundType,
35  typename StatisticType,
36  typename MatType,
37  typename SplitType>
38 template<typename RuleType>
39 class BinarySpaceTree<BoundType, StatisticType, MatType, SplitType>::
40  SingleTreeTraverser
41 {
42  public:
46  SingleTreeTraverser(RuleType& rule);
47 
55  void Traverse(const size_t queryIndex, BinarySpaceTree& referenceNode);
56 
58  size_t NumPrunes() const { return numPrunes; }
60  size_t& NumPrunes() { return numPrunes; }
61 
62  private:
64  RuleType& rule;
65 
67  size_t numPrunes;
68 };
69 
70 }; // namespace tree
71 }; // namespace mlpack
72 
73 // Include implementation.
74 #include "single_tree_traverser_impl.hpp"
75 
76 #endif
size_t numPrunes
The number of nodes which have been pruned during traversal.
size_t NumPrunes() const
Get the number of prunes.
RuleType & rule
Reference to the rules with which the tree will be traversed.
size_t & NumPrunes()
Modify the number of prunes.
BinarySpaceTree(MatType &data, const size_t maxLeafSize=20)
Construct this as the root node of a binary space tree using the given dataset.