dual_tree_traverser.hpp
Go to the documentation of this file.
1 
15 #ifndef MLPACK_CORE_TREE_BINARY_SPACE_TREE_DUAL_TREE_TRAVERSER_HPP
16 #define MLPACK_CORE_TREE_BINARY_SPACE_TREE_DUAL_TREE_TRAVERSER_HPP
17 
18 #include <mlpack/prereqs.hpp>
19 
20 #include "binary_space_tree.hpp"
21 
22 namespace mlpack {
23 namespace tree {
24 
25 template<typename MetricType,
26  typename StatisticType,
27  typename MatType,
28  template<typename BoundMetricType, typename...> class BoundType,
29  template<typename SplitBoundType, typename SplitMatType>
30  class SplitType>
31 template<typename RuleType>
32 class BinarySpaceTree<MetricType, StatisticType, MatType, BoundType,
33  SplitType>::DualTreeTraverser
34 {
35  public:
39  DualTreeTraverser(RuleType& rule);
40 
47  void Traverse(BinarySpaceTree& queryNode,
48  BinarySpaceTree& referenceNode);
49 
51  size_t NumPrunes() const { return numPrunes; }
53  size_t& NumPrunes() { return numPrunes; }
54 
56  size_t NumVisited() const { return numVisited; }
58  size_t& NumVisited() { return numVisited; }
59 
61  size_t NumScores() const { return numScores; }
63  size_t& NumScores() { return numScores; }
64 
66  size_t NumBaseCases() const { return numBaseCases; }
68  size_t& NumBaseCases() { return numBaseCases; }
69 
70  private:
72  RuleType& rule;
73 
75  size_t numPrunes;
76 
78  size_t numVisited;
79 
81  size_t numScores;
82 
84  size_t numBaseCases;
85 
88  typename RuleType::TraversalInfoType traversalInfo;
89 };
90 
91 } // namespace tree
92 } // namespace mlpack
93 
94 // Include implementation.
95 #include "dual_tree_traverser_impl.hpp"
96 
97 #endif // MLPACK_CORE_TREE_BINARY_SPACE_TREE_DUAL_TREE_TRAVERSER_HPP
size_t NumPrunes() const
Get the number of prunes.
size_t NumVisited() const
Get the number of visited combinations.
size_t & NumBaseCases()
Modify the number of times a base case was calculated.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
BinarySpaceTree()
A default constructor.
size_t & NumScores()
Modify the number of times a node combination was scored.
size_t NumScores() const
Get the number of times a node combination was scored.
Definition of generalized binary space partitioning tree (BinarySpaceTree).
size_t & NumPrunes()
Modify the number of prunes.
size_t NumBaseCases() const
Get the number of times a base case was calculated.
size_t & NumVisited()
Modify the number of visited combinations.