Public Member Functions | |
DTBRules (const arma::mat &dataSet, UnionFind &connections, arma::vec &neighborsDistances, arma::Col< size_t > &neighborsInComponent, arma::Col< size_t > &neighborsOutComponent, MetricType &metric) | |
double | BaseCase (const size_t queryIndex, const size_t referenceIndex) |
double | Rescore (TreeType &queryNode, TreeType &referenceNode, const double oldScore) const |
Re-evaluate the score for recursion order. | |
double | Rescore (const size_t queryIndex, TreeType &referenceNode, const double oldScore) |
Re-evaluate the score for recursion order. | |
double | Score (TreeType &queryNode, TreeType &referenceNode, const double baseCaseResult) const |
Get the score for recursion order, passing the base case result (in the situation where it may be needed to calculate the recursion order). | |
double | Score (TreeType &queryNode, TreeType &referenceNode) const |
Get the score for recursion order. | |
double | Score (const size_t queryIndex, TreeType &referenceNode, const double baseCaseResult) |
Get the score for recursion order, passing the base case result (in the situation where it may be needed to calculate the recursion order). | |
double | Score (const size_t queryIndex, TreeType &referenceNode) |
Get the score for recursion order. | |
Private Member Functions | |
double | CalculateBound (TreeType &queryNode) const |
Update the bound for the given query node. | |
Private Attributes | |
UnionFind & | connections |
Stores the tree structure so far. | |
const arma::mat & | dataSet |
The data points. | |
MetricType & | metric |
The instantiated metric. | |
arma::vec & | neighborsDistances |
The distance to the candidate nearest neighbor for each component. | |
arma::Col< size_t > & | neighborsInComponent |
The index of the point in the component that is an endpoint of the candidate edge. | |
arma::Col< size_t > & | neighborsOutComponent |
The index of the point outside of the component that is an endpoint of the candidate edge. |
Definition at line 31 of file dtb_rules.hpp.
mlpack::emst::DTBRules< MetricType, TreeType >::DTBRules | ( | const arma::mat & | dataSet, | |
UnionFind & | connections, | |||
arma::vec & | neighborsDistances, | |||
arma::Col< size_t > & | neighborsInComponent, | |||
arma::Col< size_t > & | neighborsOutComponent, | |||
MetricType & | metric | |||
) |
double mlpack::emst::DTBRules< MetricType, TreeType >::BaseCase | ( | const size_t | queryIndex, | |
const size_t | referenceIndex | |||
) |
double mlpack::emst::DTBRules< MetricType, TreeType >::CalculateBound | ( | TreeType & | queryNode | ) | const [inline, private] |
Update the bound for the given query node.
double mlpack::emst::DTBRules< MetricType, TreeType >::Rescore | ( | TreeType & | queryNode, | |
TreeType & | referenceNode, | |||
const double | oldScore | |||
) | const |
Re-evaluate the score for recursion order.
A low score indicates priority for recursion, while DBL_MAX indicates that the node should not be recursed into at all (it should be pruned). This is used when the score has already been calculated, but another recursion may have modified the bounds for pruning. So the old score is checked against the new pruning bound.
queryNode | Candidate query node to recurse into. | |
referenceNode | Candidate reference node to recurse into. | |
oldScore | Old score produced by Socre() (or Rescore()). |
double mlpack::emst::DTBRules< MetricType, TreeType >::Rescore | ( | const size_t | queryIndex, | |
TreeType & | referenceNode, | |||
const double | oldScore | |||
) |
Re-evaluate the score for recursion order.
A low score indicates priority for recursion, while DBL_MAX indicates that the node should not be recursed into at all (it should be pruned). This is used when the score has already been calculated, but another recursion may have modified the bounds for pruning. So the old score is checked against the new pruning bound.
double mlpack::emst::DTBRules< MetricType, TreeType >::Score | ( | TreeType & | queryNode, | |
TreeType & | referenceNode, | |||
const double | baseCaseResult | |||
) | const |
Get the score for recursion order, passing the base case result (in the situation where it may be needed to calculate the recursion order).
A low score indicates priority for recursion, while DBL_MAX indicates that the node should not be recursed into at all (it should be pruned).
queryNode | Candidate query node to recurse into. | |
referenceNode | Candidate reference node to recurse into. | |
baseCaseResult | Result of BaseCase(queryIndex, referenceNode). |
double mlpack::emst::DTBRules< MetricType, TreeType >::Score | ( | TreeType & | queryNode, | |
TreeType & | referenceNode | |||
) | const |
Get the score for recursion order.
A low score indicates priority for recursionm while DBL_MAX indicates that the node should not be recursed into at all (it should be pruned).
queryNode | Candidate query node to recurse into. | |
referenceNode | Candidate reference node to recurse into. |
double mlpack::emst::DTBRules< MetricType, TreeType >::Score | ( | const size_t | queryIndex, | |
TreeType & | referenceNode, | |||
const double | baseCaseResult | |||
) |
Get the score for recursion order, passing the base case result (in the situation where it may be needed to calculate the recursion order).
A low score indicates priority for recursion, while DBL_MAX indicates that the node should not be recursed into at all (it should be pruned).
queryIndex | Index of query point. | |
referenceNode | Candidate node to be recursed into. | |
baseCaseResult | Result of BaseCase(queryIndex, referenceNode). |
double mlpack::emst::DTBRules< MetricType, TreeType >::Score | ( | const size_t | queryIndex, | |
TreeType & | referenceNode | |||
) |
Get the score for recursion order.
A low score indicates priority for recursion, while DBL_MAX indicates that the node should not be recursed into at all (it should be pruned).
queryIndex | Index of query point. | |
referenceNode | Candidate node to be recursed into. |
UnionFind& mlpack::emst::DTBRules< MetricType, TreeType >::connections [private] |
Stores the tree structure so far.
Definition at line 126 of file dtb_rules.hpp.
const arma::mat& mlpack::emst::DTBRules< MetricType, TreeType >::dataSet [private] |
The data points.
Definition at line 123 of file dtb_rules.hpp.
MetricType& mlpack::emst::DTBRules< MetricType, TreeType >::metric [private] |
The instantiated metric.
Definition at line 140 of file dtb_rules.hpp.
arma::vec& mlpack::emst::DTBRules< MetricType, TreeType >::neighborsDistances [private] |
The distance to the candidate nearest neighbor for each component.
Definition at line 129 of file dtb_rules.hpp.
arma::Col<size_t>& mlpack::emst::DTBRules< MetricType, TreeType >::neighborsInComponent [private] |
The index of the point in the component that is an endpoint of the candidate edge.
Definition at line 133 of file dtb_rules.hpp.
arma::Col<size_t>& mlpack::emst::DTBRules< MetricType, TreeType >::neighborsOutComponent [private] |
The index of the point outside of the component that is an endpoint of the candidate edge.
Definition at line 137 of file dtb_rules.hpp.