MLPACK  1.0.8
neighbor_search_stat.hpp
Go to the documentation of this file.
1 
23 #ifndef __MLPACK_METHODS_NEIGHBOR_SEARCH_NEIGHBOR_SEARCH_STAT_HPP
24 #define __MLPACK_METHODS_NEIGHBOR_SEARCH_NEIGHBOR_SEARCH_STAT_HPP
25 
26 #include <mlpack/core.hpp>
27 
28 namespace mlpack {
29 namespace neighbor {
30 
35 template<typename SortPolicy>
37 {
38  private:
41  double firstBound;
46  double secondBound;
48  double bound;
49 
53  double lastDistance;
54 
55  public:
61  firstBound(SortPolicy::WorstDistance()),
62  secondBound(SortPolicy::WorstDistance()),
63  bound(SortPolicy::WorstDistance()),
64  lastDistanceNode(NULL),
65  lastDistance(0.0) { }
66 
71  template<typename TreeType>
72  NeighborSearchStat(TreeType& /* node */) :
73  firstBound(SortPolicy::WorstDistance()),
74  secondBound(SortPolicy::WorstDistance()),
75  bound(SortPolicy::WorstDistance()),
76  lastDistanceNode(NULL),
77  lastDistance(0.0) { }
78 
80  double FirstBound() const { return firstBound; }
82  double& FirstBound() { return firstBound; }
84  double SecondBound() const { return secondBound; }
86  double& SecondBound() { return secondBound; }
88  double Bound() const { return bound; }
90  double& Bound() { return bound; }
92  void* LastDistanceNode() const { return lastDistanceNode; }
94  void*& LastDistanceNode() { return lastDistanceNode; }
96  double LastDistance() const { return lastDistance; }
98  double& LastDistance() { return lastDistance; }
99 };
100 
101 }; // namespace neighbor
102 }; // namespace mlpack
103 
104 #endif