mlpack  2.0.1
Classes | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType > Class Template Reference

A dual tree traverser for rectangle type trees. More...

Classes

struct  NodeAndScore
 

Public Member Functions

 DualTreeTraverser (RuleType &rule)
 Instantiate the dual-tree traverser with the given rule set. More...
 
size_t NumBaseCases () const
 Get the number of times a base case was calculated. More...
 
size_t & NumBaseCases ()
 Modify the number of times a base case was calculated. More...
 
size_t NumPrunes () const
 Get the number of prunes. More...
 
size_t & NumPrunes ()
 Modify the number of prunes. More...
 
size_t NumScores () const
 Get the number of times a node combination was scored. More...
 
size_t & NumScores ()
 Modify the number of times a node combination was scored. More...
 
size_t NumVisited () const
 Get the number of visited combinations. More...
 
size_t & NumVisited ()
 Modify the number of visited combinations. More...
 
void Traverse (RectangleTree &queryNode, RectangleTree &referenceNode)
 Traverse the two trees. More...
 

Static Private Member Functions

static bool nodeComparator (const NodeAndScore &obj1, const NodeAndScore &obj2)
 

Private Attributes

size_t numBaseCases
 The number of times a base case was calculated. More...
 
size_t numPrunes
 The number of prunes. More...
 
size_t numScores
 The number of times a node combination was scored. More...
 
size_t numVisited
 The number of node combinations that have been visited during traversal. More...
 
RuleType & rule
 Reference to the rules with which the trees will be traversed. More...
 
RuleType::TraversalInfoType traversalInfo
 Traversal information, held in the class so that it isn't continually being reallocated. More...
 

Detailed Description

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType, typename StatisticType, typename MatType, typename SplitType, typename DescentType>
class mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >

A dual tree traverser for rectangle type trees.

Definition at line 32 of file dual_tree_traverser.hpp.

Constructor & Destructor Documentation

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser ( RuleType &  rule)

Instantiate the dual-tree traverser with the given rule set.

Member Function Documentation

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
static bool mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::nodeComparator ( const NodeAndScore obj1,
const NodeAndScore obj2 
)
inlinestaticprivate
template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
size_t mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::NumBaseCases ( ) const
inline

Get the number of times a base case was calculated.

Definition at line 66 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
size_t& mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::NumBaseCases ( )
inline

Modify the number of times a base case was calculated.

Definition at line 68 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
size_t mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::NumPrunes ( ) const
inline

Get the number of prunes.

Definition at line 51 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
size_t& mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::NumPrunes ( )
inline

Modify the number of prunes.

Definition at line 53 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
size_t mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::NumScores ( ) const
inline

Get the number of times a node combination was scored.

Definition at line 61 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
size_t& mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::NumScores ( )
inline

Modify the number of times a node combination was scored.

Definition at line 63 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
size_t mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::NumVisited ( ) const
inline

Get the number of visited combinations.

Definition at line 56 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
size_t& mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::NumVisited ( )
inline

Modify the number of visited combinations.

Definition at line 58 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
void mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::Traverse ( RectangleTree queryNode,
RectangleTree referenceNode 
)

Traverse the two trees.

This does not reset the number of prunes.

Parameters
queryNodeThe query node to be traversed.
referenceNodeThe reference node to be traversed.
scoreThe score of the current node combination.

Member Data Documentation

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
size_t mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::numBaseCases
private

The number of times a base case was calculated.

Definition at line 100 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
size_t mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::numPrunes
private

The number of prunes.

Definition at line 91 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
size_t mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::numScores
private

The number of times a node combination was scored.

Definition at line 97 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
size_t mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::numVisited
private

The number of node combinations that have been visited during traversal.

Definition at line 94 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
RuleType& mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::rule
private

Reference to the rules with which the trees will be traversed.

Definition at line 88 of file dual_tree_traverser.hpp.

template<typename MetricType = metric::EuclideanDistance, typename StatisticType = EmptyStatistic, typename MatType = arma::mat, typename SplitType = RTreeSplit, typename DescentType = RTreeDescentHeuristic>
template<typename MetricType , typename StatisticType , typename MatType , typename SplitType , typename DescentType >
RuleType::TraversalInfoType mlpack::tree::RectangleTree< MetricType, StatisticType, MatType, SplitType, DescentType >::DualTreeTraverser< MetricType, StatisticType, MatType, SplitType, DescentType >::traversalInfo
private

Traversal information, held in the class so that it isn't continually being reallocated.

Definition at line 104 of file dual_tree_traverser.hpp.


The documentation for this class was generated from the following file: