spill_dual_tree_traverser.hpp
Go to the documentation of this file.
1 
18 #ifndef MLPACK_CORE_TREE_SPILL_TREE_SPILL_DUAL_TREE_TRAVERSER_HPP
19 #define MLPACK_CORE_TREE_SPILL_TREE_SPILL_DUAL_TREE_TRAVERSER_HPP
20 
21 #include <mlpack/prereqs.hpp>
22 
23 #include "spill_tree.hpp"
24 
25 namespace mlpack {
26 namespace tree {
27 
28 template<typename MetricType,
29  typename StatisticType,
30  typename MatType,
31  template<typename HyperplaneMetricType> class HyperplaneType,
32  template<typename SplitMetricType, typename SplitMatType>
33  class SplitType>
34 template<typename RuleType, bool Defeatist>
35 class SpillTree<MetricType, StatisticType, MatType, HyperplaneType, SplitType>::
37 {
38  public:
42  SpillDualTreeTraverser(RuleType& rule);
43 
51  void Traverse(SpillTree& queryNode,
52  SpillTree& referenceNode);
53 
55  size_t NumPrunes() const { return numPrunes; }
57  size_t& NumPrunes() { return numPrunes; }
58 
60  size_t NumVisited() const { return numVisited; }
62  size_t& NumVisited() { return numVisited; }
63 
65  size_t NumScores() const { return numScores; }
67  size_t& NumScores() { return numScores; }
68 
70  size_t NumBaseCases() const { return numBaseCases; }
72  size_t& NumBaseCases() { return numBaseCases; }
73 
74  private:
76  RuleType& rule;
77 
79  size_t numPrunes;
80 
82  size_t numVisited;
83 
85  size_t numScores;
86 
88  size_t numBaseCases;
89 
92  typename RuleType::TraversalInfoType traversalInfo;
93 };
94 
95 } // namespace tree
96 } // namespace mlpack
97 
98 // Include implementation.
99 #include "spill_dual_tree_traverser_impl.hpp"
100 
101 #endif // MLPACK_CORE_TREE_SPILL_TREE_SPILL_DUAL_TREE_TRAVERSER_HPP
102 
size_t & NumScores()
Modify the number of times a node combination was scored.
.hpp
Definition: add_to_po.hpp:21
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t NumVisited() const
Get the number of visited combinations.
A hybrid spill tree is a variant of binary space trees in which the children of a node can "spill ove...
Definition: spill_tree.hpp:73
A generic dual-tree traverser for hybrid spill trees; see spill_dual_tree_traverser.hpp for implementation.
size_t & NumVisited()
Modify the number of visited combinations.
size_t NumPrunes() const
Get the number of prunes.
size_t & NumBaseCases()
Modify the number of times a base case was calculated.
size_t & NumPrunes()
Modify the number of prunes.
size_t NumScores() const
Get the number of times a node combination was scored.
size_t NumBaseCases() const
Get the number of times a base case was calculated.