12 #ifndef MLPACK_METHODS_RANGE_SEARCH_RANGE_SEARCH_RULES_HPP 13 #define MLPACK_METHODS_RANGE_SEARCH_RANGE_SEARCH_RULES_HPP 27 template<
typename MetricType,
typename TreeType>
45 const arma::mat& querySet,
47 std::vector<std::vector<size_t> >& neighbors,
48 std::vector<std::vector<double> >& distances,
50 const bool sameSet =
false);
58 double BaseCase(
const size_t queryIndex,
const size_t referenceIndex);
68 double Score(
const size_t queryIndex, TreeType& referenceNode);
81 double Rescore(
const size_t queryIndex,
82 TreeType& referenceNode,
83 const double oldScore)
const;
93 double Score(TreeType& queryNode, TreeType& referenceNode);
106 double Rescore(TreeType& queryNode,
107 TreeType& referenceNode,
108 const double oldScore)
const;
126 const arma::mat& referenceSet;
129 const arma::mat& querySet;
135 std::vector<std::vector<size_t> >& neighbors;
138 std::vector<std::vector<double> >& distances;
147 size_t lastQueryIndex;
149 size_t lastReferenceIndex;
154 void AddResult(
const size_t queryIndex,
155 TreeType& referenceNode);
157 TraversalInfoType traversalInfo;
169 #include "range_search_rules_impl.hpp" The TraversalInfo class holds traversal information which is used in dual-tree (and single-tree) trav...
Linear algebra utility functions, generally performed on matrices or vectors.
double Score(const size_t queryIndex, TreeType &referenceNode)
Get the score for recursion order.
size_t Scores() const
Get the number of scores (that is, calls to RangeDistance()).
const TraversalInfoType & TraversalInfo() const
double Rescore(const size_t queryIndex, TreeType &referenceNode, const double oldScore) const
Re-evaluate the score for recursion order.
size_t BaseCases() const
Get the number of base cases.
double BaseCase(const size_t queryIndex, const size_t referenceIndex)
Compute the base case between the given query point and reference point.
The RangeSearchRules class is a template helper class used by RangeSearch class when performing range...
TraversalInfoType & TraversalInfo()
tree::TraversalInfo< TreeType > TraversalInfoType
size_t MinimumBaseCases() const
Get the minimum number of base cases we need to perform to have acceptable results.
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.