MLPACK  1.0.4
furthest_neighbor_sort.hpp
Go to the documentation of this file.
00001 
00023 #ifndef __MLPACK_METHODS_NEIGHBOR_SEARCH_FURTHEST_NEIGHBOR_SORT_HPP
00024 #define __MLPACK_METHODS_NEIGHBOR_SEARCH_FURTHEST_NEIGHBOR_SORT_HPP
00025 
00026 #include <mlpack/core.hpp>
00027 
00028 namespace mlpack {
00029 namespace neighbor {
00030 
00037 class FurthestNeighborSort
00038 {
00039  public:
00054   static size_t SortDistance(const arma::vec& list, double newDistance);
00055 
00065   static inline bool IsBetter(const double value, const double ref)
00066   {
00067     return (value > ref);
00068   }
00069 
00075   template<typename TreeType>
00076   static double BestNodeToNodeDistance(const TreeType* queryNode,
00077                                        const TreeType* referenceNode);
00078 
00085   template<typename TreeType>
00086   static double BestNodeToNodeDistance(const TreeType* queryNode,
00087                                        const TreeType* referenceNode,
00088                                        const double centerToCenterDistance);
00089 
00102   template<typename TreeType>
00103   static double BestNodeToNodeDistance(const TreeType* queryNode,
00104                                        const TreeType* referenceNode,
00105                                        const TreeType* referenceChildNode,
00106                                        const double centerToCenterDistance);
00107 
00113   template<typename TreeType>
00114   static double BestPointToNodeDistance(const arma::vec& queryPoint,
00115                                         const TreeType* referenceNode);
00116 
00123   template<typename TreeType>
00124   static double BestPointToNodeDistance(const arma::vec& queryPoint,
00125                                         const TreeType* referenceNode,
00126                                         const double pointToCenterDistance);
00127 
00135   static inline double WorstDistance() { return 0; }
00136 
00144   static inline double BestDistance() { return DBL_MAX; }
00145 };
00146 
00147 }; // namespace neighbor
00148 }; // namespace mlpack
00149 
00150 // Include implementation of templated functions.
00151 #include "furthest_neighbor_sort_impl.hpp"
00152 
00153 #endif