23 #ifndef __MLPACK_METHODS_NEIGHBOR_SEARCH_FURTHEST_NEIGHBOR_SORT_HPP
24 #define __MLPACK_METHODS_NEIGHBOR_SEARCH_FURTHEST_NEIGHBOR_SORT_HPP
55 const arma::Col<size_t>& indices,
67 static inline bool IsBetter(
const double value,
const double ref)
77 template<
typename TreeType>
79 const TreeType* referenceNode);
87 template<
typename TreeType>
89 const TreeType* referenceNode,
90 const double centerToCenterDistance);
104 template<
typename TreeType>
106 const TreeType* referenceNode,
107 const TreeType* referenceChildNode,
108 const double centerToCenterDistance);
115 template<
typename VecType,
typename TreeType>
117 const TreeType* referenceNode);
125 template<
typename VecType,
typename TreeType>
127 const TreeType* referenceNode,
128 const double pointToCenterDistance);
153 if (a == DBL_MAX || b == DBL_MAX)
162 {
return std::max(a - b, 0.0); }
169 #include "furthest_neighbor_sort_impl.hpp"
Linear algebra utility functions, generally performed on matrices or vectors.
static double BestDistance()
Return what should represent the best possible distance with this particular sort policy...
static size_t SortDistance(const arma::vec &list, const arma::Col< size_t > &indices, double newDistance)
Return the index in the vector where the new distance should be inserted, or size_t() - 1 if it shoul...
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 BestPointToNodeDistance(const VecType &queryPoint, const TreeType *referenceNode)
Return the best possible distance between a node and a point.
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 double WorstDistance()
Return what should represent the worst possible distance with this particular sort policy...