00001 00023 #ifndef __MLPACK_METHODS_NEIGHBOR_SEARCH_NEIGHBOR_SEARCH_STAT_HPP 00024 #define __MLPACK_METHODS_NEIGHBOR_SEARCH_NEIGHBOR_SEARCH_STAT_HPP 00025 00026 #include <mlpack/core.hpp> 00027 00028 namespace mlpack { 00029 namespace neighbor { 00030 00035 template<typename SortPolicy> 00036 class NeighborSearchStat 00037 { 00038 private: 00041 double firstBound; 00046 double secondBound; 00048 double bound; 00049 00051 void* lastDistanceNode; 00053 double lastDistance; 00054 00055 public: 00060 NeighborSearchStat() : 00061 firstBound(SortPolicy::WorstDistance()), 00062 secondBound(SortPolicy::WorstDistance()), 00063 bound(SortPolicy::WorstDistance()), 00064 lastDistanceNode(NULL), 00065 lastDistance(0.0) { } 00066 00071 template<typename TreeType> 00072 NeighborSearchStat(TreeType& /* node */) : 00073 firstBound(SortPolicy::WorstDistance()), 00074 secondBound(SortPolicy::WorstDistance()), 00075 bound(SortPolicy::WorstDistance()), 00076 lastDistanceNode(NULL), 00077 lastDistance(0.0) { } 00078 00080 double FirstBound() const { return firstBound; } 00082 double& FirstBound() { return firstBound; } 00084 double SecondBound() const { return secondBound; } 00086 double& SecondBound() { return secondBound; } 00088 double Bound() const { return bound; } 00090 double& Bound() { return bound; } 00092 void* LastDistanceNode() const { return lastDistanceNode; } 00094 void*& LastDistanceNode() { return lastDistanceNode; } 00096 double LastDistance() const { return lastDistance; } 00098 double& LastDistance() { return lastDistance; } 00099 }; 00100 00101 }; // namespace neighbor 00102 }; // namespace mlpack 00103 00104 #endif