MLPACK  1.0.11
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
NeighborSearchStat(TreeType &)
Initialization for a fully initialized node.
void *& LastDistanceNode()
Modify the last distance evaluation node.
double secondBound
The second bound on the node&#39;s neighbor distances (B_2).
Linear algebra utility functions, generally performed on matrices or vectors.
Definition: load.hpp:31
double lastDistance
The last distance evaluation.
Extra data for each node in the tree.
double FirstBound() const
Get the first bound.
void * lastDistanceNode
The last distance evaluation node.
NeighborSearchStat()
Initialize the statistic with the worst possible distance according to our sorting policy...
double firstBound
The first bound on the node&#39;s neighbor distances (B_1).
double & Bound()
Modify the overall bound (it should be the better of the two bounds).
double & FirstBound()
Modify the first bound.
double LastDistance() const
Get the last distance calculation.
double & SecondBound()
Modify the second bound.
double bound
The better of the two bounds.
double SecondBound() const
Get the second bound.
void * LastDistanceNode() const
Get the last distance evaluation node.
double Bound() const
Get the overall bound (the better of the two bounds).
double & LastDistance()
Modify the last distance calculation.