23 #ifndef __MLPACK_METHODS_NEIGHBOR_SEARCH_FURTHEST_NEIGHBOR_SORT_HPP
24 #define __MLPACK_METHODS_NEIGHBOR_SEARCH_FURTHEST_NEIGHBOR_SORT_HPP
54 static size_t SortDistance(
const arma::vec& list,
double newDistance);
65 static inline bool IsBetter(
const double value,
const double ref)
75 template<
typename TreeType>
77 const TreeType* referenceNode);
85 template<
typename TreeType>
87 const TreeType* referenceNode,
88 const double centerToCenterDistance);
102 template<
typename TreeType>
104 const TreeType* referenceNode,
105 const TreeType* referenceChildNode,
106 const double centerToCenterDistance);
113 template<
typename TreeType>
115 const TreeType* referenceNode);
123 template<
typename TreeType>
125 const TreeType* referenceNode,
126 const double pointToCenterDistance);
151 if (a == DBL_MAX || b == DBL_MAX)
160 {
return std::max(a - b, 0.0); }
167 #include "furthest_neighbor_sort_impl.hpp"
static double BestDistance()
Return what should represent the best possible distance with this particular sort policy...
static double BestNodeToNodeDistance(const TreeType *queryNode, const TreeType *referenceNode)
Return the best possible distance between two nodes.
static bool IsBetter(const double value, const double ref)
Return whether or not value is "better" than ref.
static double CombineBest(const double a, const double b)
Return the best combination of the two distances.
This class implements the necessary methods for the SortPolicy template parameter of the NeighborSear...
static double CombineWorst(const double a, const double b)
Return the worst combination of the two distances.
static size_t SortDistance(const arma::vec &list, double newDistance)
Return the index in the vector where the new distance should be inserted, or size_t() - 1 if it shoul...
static double WorstDistance()
Return what should represent the worst possible distance with this particular sort policy...
static double BestPointToNodeDistance(const arma::vec &queryPoint, const TreeType *referenceNode)
Return the best possible distance between a node and a point.