Public Member Functions | |
NeighborSearchRules (const arma::mat &referenceSet, const arma::mat &querySet, arma::Mat< size_t > &neighbors, arma::mat &distances, 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) const |
Re-evaluate the score for recursion order. | |
double | Score (TreeType &queryNode, TreeType &referenceNode) |
Get the score for recursion order. | |
double | Score (const size_t queryIndex, TreeType &referenceNode) |
Get the score for recursion order. | |
Private Member Functions | |
double | CalculateBound (TreeType &queryNode) const |
Recalculate the bound for a given query node. | |
void | InsertNeighbor (const size_t queryIndex, const size_t pos, const size_t neighbor, const double distance) |
Insert a point into the neighbors and distances matrices; this is a helper function. | |
Private Attributes | |
arma::mat & | distances |
The matrix the resultant neighbor distances should be stored in. | |
double | lastBaseCase |
The last base case result. | |
size_t | lastQueryIndex |
The last query point BaseCase() was called with. | |
size_t | lastReferenceIndex |
The last reference point BaseCase() was called with. | |
MetricType & | metric |
The instantiated metric. | |
arma::Mat< size_t > & | neighbors |
The matrix the resultant neighbor indices should be stored in. | |
const arma::mat & | querySet |
The query set. | |
const arma::mat & | referenceSet |
The reference set. |
Definition at line 30 of file neighbor_search_rules.hpp.
mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::NeighborSearchRules | ( | const arma::mat & | referenceSet, | |
const arma::mat & | querySet, | |||
arma::Mat< size_t > & | neighbors, | |||
arma::mat & | distances, | |||
MetricType & | metric | |||
) |
double mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::BaseCase | ( | const size_t | queryIndex, | |
const size_t | referenceIndex | |||
) |
double mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::CalculateBound | ( | TreeType & | queryNode | ) | const [private] |
Recalculate the bound for a given query node.
void mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::InsertNeighbor | ( | const size_t | queryIndex, | |
const size_t | pos, | |||
const size_t | neighbor, | |||
const double | distance | |||
) | [private] |
Insert a point into the neighbors and distances matrices; this is a helper function.
queryIndex | Index of point whose neighbors we are inserting into. | |
pos | Position in list to insert into. | |
neighbor | Index of reference point which is being inserted. | |
distance | Distance from query point to reference point. |
double mlpack::neighbor::NeighborSearchRules< SortPolicy, 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::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::Rescore | ( | const size_t | queryIndex, | |
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.
double mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::Score | ( | TreeType & | queryNode, | |
TreeType & | referenceNode | |||
) |
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::neighbor::NeighborSearchRules< SortPolicy, 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. |
arma::mat& mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::distances [private] |
The matrix the resultant neighbor distances should be stored in.
Definition at line 102 of file neighbor_search_rules.hpp.
double mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::lastBaseCase [private] |
The last base case result.
Definition at line 112 of file neighbor_search_rules.hpp.
size_t mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::lastQueryIndex [private] |
The last query point BaseCase() was called with.
Definition at line 108 of file neighbor_search_rules.hpp.
size_t mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::lastReferenceIndex [private] |
The last reference point BaseCase() was called with.
Definition at line 110 of file neighbor_search_rules.hpp.
MetricType& mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::metric [private] |
The instantiated metric.
Definition at line 105 of file neighbor_search_rules.hpp.
arma::Mat<size_t>& mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::neighbors [private] |
The matrix the resultant neighbor indices should be stored in.
Definition at line 99 of file neighbor_search_rules.hpp.
const arma::mat& mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::querySet [private] |
The query set.
Definition at line 96 of file neighbor_search_rules.hpp.
const arma::mat& mlpack::neighbor::NeighborSearchRules< SortPolicy, MetricType, TreeType >::referenceSet [private] |
The reference set.
Definition at line 93 of file neighbor_search_rules.hpp.