mlpack
2.2.5
|
The RangeSearchRules class is a template helper class used by RangeSearch class when performing range searches. More...
Public Types | |
typedef tree::TraversalInfo < TreeType > | TraversalInfoType |
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, const bool sameSet=false) | |
Construct the RangeSearchRules object. More... | |
double | BaseCase (const size_t queryIndex, const size_t referenceIndex) |
Compute the base case between the given query point and reference point. More... | |
size_t | BaseCases () const |
Get the number of base cases. More... | |
double | Rescore (const size_t queryIndex, TreeType &referenceNode, const double oldScore) const |
Re-evaluate the score for recursion order. More... | |
double | Rescore (TreeType &queryNode, TreeType &referenceNode, const double oldScore) const |
Re-evaluate the score for recursion order. More... | |
double | Score (const size_t queryIndex, TreeType &referenceNode) |
Get the score for recursion order. More... | |
double | Score (TreeType &queryNode, TreeType &referenceNode) |
Get the score for recursion order. More... | |
size_t | Scores () const |
Get the number of scores (that is, calls to RangeDistance()). More... | |
const TraversalInfoType & | TraversalInfo () const |
TraversalInfoType & | TraversalInfo () |
The RangeSearchRules class is a template helper class used by RangeSearch class when performing range searches.
MetricType | The metric to use for computation. |
TreeType | The tree type to use; must adhere to the TreeType API. |
Definition at line 28 of file range_search_rules.hpp.
typedef tree::TraversalInfo<TreeType> TraversalInfoType |
Definition at line 110 of file range_search_rules.hpp.
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, | ||
const bool | sameSet = false |
||
) |
Construct the RangeSearchRules object.
This is usually done from within the RangeSearch class at search time.
referenceSet | Set of reference data. |
querySet | Set of query data. |
range | Range to search for. |
neighbors | Vector to store resulting neighbors in. |
distances | Vector to store resulting distances in. |
metric | Instantiated metric. |
sameSet | If true, the query and reference set are taken to be the same, and a query point will not return itself in the results. |
double 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. |
|
inline |
Get the number of base cases.
Definition at line 116 of file range_search_rules.hpp.
double 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 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 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. |
double 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. |
|
inline |
Get the number of scores (that is, calls to RangeDistance()).
Definition at line 118 of file range_search_rules.hpp.
|
inline |
Definition at line 112 of file range_search_rules.hpp.
|
inline |
Definition at line 113 of file range_search_rules.hpp.