mlpack  1.0.12
single_tree_traverser.hpp
Go to the documentation of this file.
1 
16 #ifndef __MLPACK_CORE_TREE_BINARY_SPACE_TREE_SINGLE_TREE_TRAVERSER_HPP
17 #define __MLPACK_CORE_TREE_BINARY_SPACE_TREE_SINGLE_TREE_TRAVERSER_HPP
18 
19 #include <mlpack/core.hpp>
20 
21 #include "binary_space_tree.hpp"
22 
23 namespace mlpack {
24 namespace tree {
25 
26 template<typename BoundType,
27  typename StatisticType,
28  typename MatType,
29  typename SplitType>
30 template<typename RuleType>
31 class BinarySpaceTree<BoundType, StatisticType, MatType, SplitType>::
32  SingleTreeTraverser
33 {
34  public:
38  SingleTreeTraverser(RuleType& rule);
39 
47  void Traverse(const size_t queryIndex, BinarySpaceTree& 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
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:23
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.