23 #ifndef __MLPACK_METHODS_NEIGHBOR_SEARCH_NEAREST_NEIGHBOR_SORT_HPP
24 #define __MLPACK_METHODS_NEIGHBOR_SEARCH_NEAREST_NEIGHBOR_SORT_HPP
59 const arma::Col<size_t>& indices,
71 static inline bool IsBetter(
const double value,
const double ref)
81 template<
typename TreeType>
83 const TreeType* referenceNode);
91 template<
typename TreeType>
93 const TreeType* referenceNode,
94 const double centerToCenterDistance);
108 template<
typename TreeType>
110 const TreeType* referenceNode,
111 const TreeType* referenceChildNode,
112 const double centerToCenterDistance);
118 template<
typename VecType,
typename TreeType>
120 const TreeType* referenceNode);
128 template<
typename VecType,
typename TreeType>
130 const TreeType* referenceNode,
131 const double pointToCenterDistance);
156 return std::max(a - b, 0.0);
164 if (a == DBL_MAX || b == DBL_MAX)
174 #include "nearest_neighbor_sort_impl.hpp"
static double CombineWorst(const double a, const double b)
Return the worst combination of the two distances.
Linear algebra utility functions, generally performed on matrices or vectors.
static double CombineBest(const double a, const double b)
Return the best combination of the two distances.
static double WorstDistance()
Return what should represent the worst 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 sho...
This class implements the necessary methods for the SortPolicy template parameter of the NeighborSear...
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 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.