12 #ifndef MLPACK_METHODS_EMST_DTB_RULES_HPP 13 #define MLPACK_METHODS_EMST_DTB_RULES_HPP 22 template<
typename MetricType,
typename TreeType>
28 arma::vec& neighborsDistances,
29 arma::Col<size_t>& neighborsInComponent,
30 arma::Col<size_t>& neighborsOutComponent,
33 double BaseCase(
const size_t queryIndex,
const size_t referenceIndex);
43 double Score(
const size_t queryIndex, TreeType& referenceNode);
56 double Rescore(
const size_t queryIndex,
57 TreeType& referenceNode,
58 const double oldScore);
68 double Score(TreeType& queryNode, TreeType& referenceNode);
81 double Rescore(TreeType& queryNode,
82 TreeType& referenceNode,
83 const double oldScore)
const;
87 const TraversalInfoType&
TraversalInfo()
const {
return traversalInfo; }
96 size_t Scores()
const {
return scores; }
102 const arma::mat& dataSet;
108 arma::vec& neighborsDistances;
112 arma::Col<size_t>& neighborsInComponent;
116 arma::Col<size_t>& neighborsOutComponent;
124 inline double CalculateBound(TreeType& queryNode)
const;
126 TraversalInfoType traversalInfo;
137 #include "dtb_rules_impl.hpp" A Union-Find data structure.
size_t BaseCases() const
Get the number of base cases performed.
DTBRules(const arma::mat &dataSet, UnionFind &connections, arma::vec &neighborsDistances, arma::Col< size_t > &neighborsInComponent, arma::Col< size_t > &neighborsOutComponent, MetricType &metric)
The TraversalInfo class holds traversal information which is used in dual-tree (and single-tree) trav...
Linear algebra utility functions, generally performed on matrices or vectors.
The core includes that mlpack expects; standard C++ includes and Armadillo.
size_t & Scores()
Modify the number of node combinations that have been scored.
const TraversalInfoType & TraversalInfo() const
tree::TraversalInfo< TreeType > TraversalInfoType
size_t Scores() const
Get the number of node combinations that have been scored.
double Rescore(const size_t queryIndex, TreeType &referenceNode, const double oldScore)
Re-evaluate the score for recursion order.
TraversalInfoType & TraversalInfo()
double Score(const size_t queryIndex, TreeType &referenceNode)
Get the score for recursion order.
size_t & BaseCases()
Modify the number of base cases performed.
double BaseCase(const size_t queryIndex, const size_t referenceIndex)