15 #ifndef __MLPACK_METHODS_NEIGHBOR_SEARCH_NEAREST_NEIGHBOR_SORT_HPP
16 #define __MLPACK_METHODS_NEIGHBOR_SEARCH_NEAREST_NEIGHBOR_SORT_HPP
51 const arma::Col<size_t>& indices,
63 static inline bool IsBetter(
const double value,
const double ref)
73 template<
typename TreeType>
75 const TreeType* referenceNode);
83 template<
typename TreeType>
85 const TreeType* referenceNode,
86 const double centerToCenterDistance);
100 template<
typename TreeType>
102 const TreeType* referenceNode,
103 const TreeType* referenceChildNode,
104 const double centerToCenterDistance);
110 template<
typename VecType,
typename TreeType>
112 const TreeType* referenceNode);
120 template<
typename VecType,
typename TreeType>
122 const TreeType* referenceNode,
123 const double pointToCenterDistance);
148 return std::max(a - b, 0.0);
156 if (a == DBL_MAX || b == DBL_MAX)
166 #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.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
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.