15 #ifndef __MLPACK_METHODS_NEIGHBOR_SEARCH_FURTHEST_NEIGHBOR_SORT_HPP 16 #define __MLPACK_METHODS_NEIGHBOR_SEARCH_FURTHEST_NEIGHBOR_SORT_HPP 47 const arma::Col<size_t>& indices,
59 static inline bool IsBetter(
const double value,
const double ref)
69 template<
typename TreeType>
71 const TreeType* referenceNode);
79 template<
typename TreeType>
81 const TreeType* referenceNode,
82 const double centerToCenterDistance);
96 template<
typename TreeType>
98 const TreeType* referenceNode,
99 const TreeType* referenceChildNode,
100 const double centerToCenterDistance);
107 template<
typename VecType,
typename TreeType>
109 const TreeType* referenceNode);
117 template<
typename VecType,
typename TreeType>
119 const TreeType* referenceNode,
120 const double pointToCenterDistance);
145 if (a == DBL_MAX || b == DBL_MAX)
154 {
return std::max(a - b, 0.0); }
161 #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.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
static double WorstDistance()
Return what should represent the worst possible distance with this particular sort policy...