SYNOPSIS

Public Types

typedef

neighbor::NeighborSearchTraversalInfo

< 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)

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 (const size_t queryIndex, TreeType &referenceNode, const double oldScore) const

Re-evaluate the score for recursion order. double Rescore (TreeType &queryNode, TreeType &referenceNode, const double oldScore) const

Re-evaluate the score for recursion order. double Score (const size_t queryIndex, TreeType &referenceNode)

Get the score for recursion order. double Score (TreeType &queryNode, TreeType &referenceNode)

Get the score for recursion order. const TraversalInfoType & TraversalInfo () const

TraversalInfoType & TraversalInfo ()

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. TraversalInfoType traversalInfo

Detailed Description

template<typename MetricType, typename TreeType>class mlpack::range::RangeSearchRules< MetricType, TreeType >

Definition at line 32 of file range_search_rules.hpp.

Member Typedef Documentation

template<typename MetricType , typename TreeType > typedef \fBneighbor::NeighborSearchTraversalInfo\fP<TreeType> \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::\fBTraversalInfoType\fP

Definition at line 111 of file range_search_rules.hpp.

Constructor & Destructor Documentation

template<typename MetricType , typename TreeType > \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::\fBRangeSearchRules\fP (const arma::mat &referenceSet, const arma::mat &querySet, const \fBmath::Range\fP &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.

Parameters:

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.

Member Function Documentation

template<typename MetricType , typename TreeType > void \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::AddResult (const size_tqueryIndex, TreeType &referenceNode)\fC [private]\fP

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.

template<typename MetricType , typename TreeType > double \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::BaseCase (const size_tqueryIndex, const size_treferenceIndex)

Compute the base case between the given query point and reference point.

Parameters:

queryIndex Index of query point.

referenceIndex Index of reference point.

template<typename MetricType , typename TreeType > double \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::Rescore (const size_tqueryIndex, TreeType &referenceNode, const doubleoldScore) 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.

Parameters:

queryIndex Index of query point.

referenceNode Candidate node to be recursed into.

oldScore Old score produced by Score() (or Rescore()).

template<typename MetricType , typename TreeType > double \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::Rescore (TreeType &queryNode, TreeType &referenceNode, const doubleoldScore) 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.

Parameters:

queryNode Candidate query node to recurse into.

referenceNode Candidate reference node to recurse into.

oldScore Old score produced by Score() (or Rescore()).

template<typename MetricType , typename TreeType > double \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::Score (const size_tqueryIndex, 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).

Parameters:

queryIndex Index of query point.

referenceNode Candidate node to be recursed into.

template<typename MetricType , typename TreeType > double \fBmlpack::range::RangeSearchRules\fP< 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).

Parameters:

queryNode Candidate query node to recurse into.

referenceNode Candidate reference node to recurse into.

template<typename MetricType , typename TreeType > const \fBTraversalInfoType\fP& \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::\fBTraversalInfo\fP () const\fC [inline]\fP

Definition at line 113 of file range_search_rules.hpp.

References mlpack::range::RangeSearchRules< MetricType, TreeType >::traversalInfo.

template<typename MetricType , typename TreeType > \fBTraversalInfoType\fP& \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::\fBTraversalInfo\fP ()\fC [inline]\fP

Definition at line 114 of file range_search_rules.hpp.

References mlpack::range::RangeSearchRules< MetricType, TreeType >::traversalInfo.

Member Data Documentation

template<typename MetricType , typename TreeType > std::vector<std::vector<double> >& \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::distances\fC [private]\fP

The vector the resultant neighbor distances should be stored in.

Definition at line 130 of file range_search_rules.hpp.

template<typename MetricType , typename TreeType > size_t \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::lastQueryIndex\fC [private]\fP

The last query index.

Definition at line 136 of file range_search_rules.hpp.

template<typename MetricType , typename TreeType > size_t \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::lastReferenceIndex\fC [private]\fP

The last reference index.

Definition at line 138 of file range_search_rules.hpp.

template<typename MetricType , typename TreeType > MetricType& \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::metric\fC [private]\fP

The instantiated metric.

Definition at line 133 of file range_search_rules.hpp.

template<typename MetricType , typename TreeType > std::vector<std::vector<size_t> >& \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::neighbors\fC [private]\fP

The vector the resultant neighbor indices should be stored in.

Definition at line 127 of file range_search_rules.hpp.

template<typename MetricType , typename TreeType > const arma::mat& \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::querySet\fC [private]\fP

The query set.

Definition at line 121 of file range_search_rules.hpp.

template<typename MetricType , typename TreeType > const \fBmath::Range\fP& \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::range\fC [private]\fP

The range of distances for which we are searching.

Definition at line 124 of file range_search_rules.hpp.

template<typename MetricType , typename TreeType > const arma::mat& \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::referenceSet\fC [private]\fP

The reference set.

Definition at line 118 of file range_search_rules.hpp.

template<typename MetricType , typename TreeType > \fBTraversalInfoType\fP \fBmlpack::range::RangeSearchRules\fP< MetricType, TreeType >::traversalInfo\fC [private]\fP

Definition at line 146 of file range_search_rules.hpp.

Referenced by mlpack::range::RangeSearchRules< MetricType, TreeType >::TraversalInfo().

Author

Generated automatically by Doxygen for MLPACK from the source code.