22 #ifndef __MLPACK_METHODS_EMST_DTB_RULES_HPP 23 #define __MLPACK_METHODS_EMST_DTB_RULES_HPP 27 #include "../neighbor_search/ns_traversal_info.hpp" 32 template<
typename MetricType,
typename TreeType>
43 double BaseCase(
const size_t queryIndex,
const size_t referenceIndex);
53 double Score(
const size_t queryIndex, TreeType& referenceNode);
65 double Score(
const size_t queryIndex,
66 TreeType& referenceNode,
67 const double baseCaseResult);
80 double Rescore(
const size_t queryIndex,
81 TreeType& referenceNode,
82 const double oldScore);
92 double Score(TreeType& queryNode, TreeType& referenceNode);
104 double Score(TreeType& queryNode,
105 TreeType& referenceNode,
106 const double baseCaseResult);
119 double Rescore(TreeType& queryNode,
120 TreeType& referenceNode,
121 const double oldScore)
const;
176 #include "dtb_rules_impl.hpp" A Union-Find data structure.
double CalculateBound(TreeType &queryNode) const
Update the bound for the given query node.
size_t scores
The number of node combinations that have been scored.
double BaseCase(const size_t queryIndex, const size_t referenceIndex)
Linear algebra utility functions, generally performed on matrices or vectors.
arma::vec & neighborsDistances
The distance to the candidate nearest neighbor for each component.
size_t & BaseCases()
Modify the number of base cases performed.
TraversalInfoType traversalInfo
size_t Scores() const
Get the number of node combinations that have been scored.
UnionFind & connections
Stores the tree structure so far.
arma::Col< size_t > & neighborsInComponent
The index of the point in the component that is an endpoint of the candidate edge.
Traversal information for NeighborSearch.
TraversalInfoType & TraversalInfo()
DTBRules(const arma::mat &dataSet, UnionFind &connections, arma::vec &neighborsDistances, arma::Col< size_t > &neighborsInComponent, arma::Col< size_t > &neighborsOutComponent, MetricType &metric)
neighbor::NeighborSearchTraversalInfo< TreeType > TraversalInfoType
double Score(const size_t queryIndex, TreeType &referenceNode)
Get the score for recursion order.
MetricType & metric
The instantiated metric.
size_t baseCases
The number of base cases calculated.
size_t BaseCases() const
Get the number of base cases performed.
const arma::mat & dataSet
The data points.
arma::Col< size_t > & neighborsOutComponent
The index of the point outside of the component that is an endpoint of the candidate edge...
size_t & Scores()
Modify 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.
const TraversalInfoType & TraversalInfo() const