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 
52  void Traverse(SpillTree& queryNode,
53  SpillTree& referenceNode,
54  const bool bruteForce = false);
55 
57  size_t NumPrunes() const { return numPrunes; }
59  size_t& NumPrunes() { return numPrunes; }
60 
62  size_t NumVisited() const { return numVisited; }
64  size_t& NumVisited() { return numVisited; }
65 
67  size_t NumScores() const { return numScores; }
69  size_t& NumScores() { return numScores; }
70 
72  size_t NumBaseCases() const { return numBaseCases; }
74  size_t& NumBaseCases() { return numBaseCases; }
75 
76  private:
78  RuleType& rule;
79 
81  size_t numPrunes;
82 
84  size_t numVisited;
85 
87  size_t numScores;
88 
90  size_t numBaseCases;
91 
94  typename RuleType::TraversalInfoType traversalInfo;
95 };
96 
97 } // namespace tree
98 } // namespace mlpack
99 
100 // Include implementation.
101 #include "spill_dual_tree_traverser_impl.hpp"
102 
103 #endif // MLPACK_CORE_TREE_SPILL_TREE_SPILL_DUAL_TREE_TRAVERSER_HPP
size_t & NumScores()
Modify the number of times a node combination was scored.
Linear algebra utility functions, generally performed on matrices or vectors.
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.
Definition of generalized hybrid spill tree (SpillTree).
size_t NumBaseCases() const
Get the number of times a base case was calculated.