dual_tree_traverser.hpp
Go to the documentation of this file.
1 
12 #ifndef MLPACK_CORE_TREE_OCTREE_DUAL_TREE_TRAVERSER_HPP
13 #define MLPACK_CORE_TREE_OCTREE_DUAL_TREE_TRAVERSER_HPP
14 
15 #include <mlpack/prereqs.hpp>
16 #include "octree.hpp"
17 
18 namespace mlpack {
19 namespace tree {
20 
21 template<typename MetricType,
22  typename StatisticType,
23  typename MatType>
24 template<typename RuleType>
25 class Octree<MetricType, StatisticType, MatType>::DualTreeTraverser
26 {
27  public:
31  DualTreeTraverser(RuleType& rule);
32 
37  void Traverse(Octree& queryNode, Octree& referenceNode);
38 
40  size_t NumPrunes() const { return numPrunes; }
42  size_t& NumPrunes() { return numPrunes; }
43 
45  size_t NumVisited() const { return numVisited; }
47  size_t& NumVistied() { return numVisited; }
48 
50  size_t NumScores() const { return numScores; }
52  size_t& NumScores() { return numScores; }
53 
55  size_t NumBaseCases() const { return numBaseCases; }
57  size_t& NumBaseCases() { return numBaseCases; }
58 
59  private:
61  RuleType& rule;
62 
64  size_t numPrunes;
66  size_t numVisited;
68  size_t numScores;
70  size_t numBaseCases;
71 
74  typename RuleType::TraversalInfoType traversalInfo;
75 };
76 
77 } // namespace tree
78 } // namespace mlpack
79 
80 // Include implementation.
81 #include "dual_tree_traverser_impl.hpp"
82 
83 #endif
size_t & NumBaseCases()
Modify the number of times a base case was computed.
A dual-tree traverser; see dual_tree_traverser.hpp.
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t NumScores() const
Get the number of times a node was scored.
size_t NumPrunes() const
Get the number of pruned nodes.
size_t & NumVistied()
Modify the number of visited node combinations.
size_t NumVisited() const
Get the number of visited node combinations.
size_t NumBaseCases() const
Get the number of times a base case was computed.
size_t & NumPrunes()
Modify the number of pruned nodes (i.e. to reset it).
size_t & NumScores()
Modify the number of times a node was scored.