Public Member Functions | |
RangeSearchRules (const arma::mat &referenceSet, const arma::mat &querySet, const math::Range &range, std::vector< std::vector< size_t > > &neighbors, std::vector< std::vector< double > > &distances, MetricType &metric) | |
Construct the RangeSearchRules object. | |
double | BaseCase (const size_t queryIndex, const size_t referenceIndex) |
Compute the base case between the given query point and reference point. | |
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 | |
void | AddResult (const size_t queryIndex, TreeType &referenceNode) |
Add all the points in the given node to the results for the given query point. | |
Private Attributes | |
std::vector< std::vector < double > > & | distances |
The vector the resultant neighbor distances should be stored in. | |
size_t | lastQueryIndex |
The last query index. | |
size_t | lastReferenceIndex |
The last reference index. | |
MetricType & | metric |
The instantiated metric. | |
std::vector< std::vector < size_t > > & | neighbors |
The vector the resultant neighbor indices should be stored in. | |
const arma::mat & | querySet |
The query set. | |
const math::Range & | range |
The range of distances for which we are searching. | |
const arma::mat & | referenceSet |
The reference set. |
Definition at line 30 of file range_search_rules.hpp.
mlpack::range::RangeSearchRules< MetricType, TreeType >::RangeSearchRules | ( | const arma::mat & | referenceSet, | |
const arma::mat & | querySet, | |||
const math::Range & | range, | |||
std::vector< std::vector< size_t > > & | neighbors, | |||
std::vector< std::vector< double > > & | distances, | |||
MetricType & | metric | |||
) |
Construct the RangeSearchRules object.
This is usually done from within the RangeSearch class at search time.
void mlpack::range::RangeSearchRules< MetricType, TreeType >::AddResult | ( | const size_t | queryIndex, | |
TreeType & | referenceNode | |||
) | [private] |
Add all the points in the given node to the results for the given query point.
If the base case has already been calculated, we make sure to not add that to the results twice.
double mlpack::range::RangeSearchRules< MetricType, TreeType >::BaseCase | ( | const size_t | queryIndex, | |
const size_t | referenceIndex | |||
) |
Compute the base case between the given query point and reference point.
queryIndex | Index of query point. | |
referenceIndex | Index of reference point. |
double mlpack::range::RangeSearchRules< 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.
double mlpack::range::RangeSearchRules< 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::range::RangeSearchRules< MetricType, TreeType >::Score | ( | TreeType & | queryNode, | |
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).
queryNode | Candidate query node to recurse into. | |
referenceNode | Candidate reference node to recurse into. |
double mlpack::range::RangeSearchRules< 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. |
std::vector<std::vector<double> >& mlpack::range::RangeSearchRules< MetricType, TreeType >::distances [private] |
The vector the resultant neighbor distances should be stored in.
Definition at line 123 of file range_search_rules.hpp.
size_t mlpack::range::RangeSearchRules< MetricType, TreeType >::lastQueryIndex [private] |
The last query index.
Definition at line 129 of file range_search_rules.hpp.
size_t mlpack::range::RangeSearchRules< MetricType, TreeType >::lastReferenceIndex [private] |
The last reference index.
Definition at line 131 of file range_search_rules.hpp.
MetricType& mlpack::range::RangeSearchRules< MetricType, TreeType >::metric [private] |
The instantiated metric.
Definition at line 126 of file range_search_rules.hpp.
std::vector<std::vector<size_t> >& mlpack::range::RangeSearchRules< MetricType, TreeType >::neighbors [private] |
The vector the resultant neighbor indices should be stored in.
Definition at line 120 of file range_search_rules.hpp.
const arma::mat& mlpack::range::RangeSearchRules< MetricType, TreeType >::querySet [private] |
The query set.
Definition at line 114 of file range_search_rules.hpp.
const math::Range& mlpack::range::RangeSearchRules< MetricType, TreeType >::range [private] |
The range of distances for which we are searching.
Definition at line 117 of file range_search_rules.hpp.
const arma::mat& mlpack::range::RangeSearchRules< MetricType, TreeType >::referenceSet [private] |
The reference set.
Definition at line 111 of file range_search_rules.hpp.