MLPACK  1.0.11
dtb_stat.hpp
Go to the documentation of this file.
1 
22 #ifndef __MLPACK_METHODS_EMST_DTB_STAT_HPP
23 #define __MLPACK_METHODS_EMST_DTB_STAT_HPP
24 
25 #include <mlpack/core.hpp>
26 
27 namespace mlpack {
28 namespace emst {
29 
34 class DTBStat
35 {
36  private:
40 
44 
46  double bound;
47 
53 
54  public:
59  DTBStat() :
60  maxNeighborDistance(DBL_MAX),
61  minNeighborDistance(DBL_MAX),
62  bound(DBL_MAX),
63  componentMembership(-1) { }
64 
72  template<typename TreeType>
73  DTBStat(const TreeType& node) :
74  maxNeighborDistance(DBL_MAX),
75  minNeighborDistance(DBL_MAX),
76  bound(DBL_MAX),
78  ((node.NumPoints() == 1) && (node.NumChildren() == 0)) ?
79  node.Point(0) : -1) { }
80 
82  double MaxNeighborDistance() const { return maxNeighborDistance; }
85 
87  double MinNeighborDistance() const { return minNeighborDistance; }
90 
92  double Bound() const { return bound; }
94  double& Bound() { return bound; }
95 
97  int ComponentMembership() const { return componentMembership; }
100 
101 }; // class DTBStat
102 
103 }; // namespace emst
104 }; // namespace mlpack
105 
106 #endif // __MLPACK_METHODS_EMST_DTB_STAT_HPP
double minNeighborDistance
Lower bound on the distance to the nearest neighbor of any point in this node.
Definition: dtb_stat.hpp:43
double MaxNeighborDistance() const
Get the maximum neighbor distance.
Definition: dtb_stat.hpp:82
double & Bound()
Modify the total bound for pruning.
Definition: dtb_stat.hpp:94
int componentMembership
The index of the component that all points in this node belong to.
Definition: dtb_stat.hpp:52
double & MaxNeighborDistance()
Modify the maximum neighbor distance.
Definition: dtb_stat.hpp:84
DTBStat()
A generic initializer.
Definition: dtb_stat.hpp:59
int ComponentMembership() const
Get the component membership of this node.
Definition: dtb_stat.hpp:97
double maxNeighborDistance
Upper bound on the distance to the nearest neighbor of any point in this node.
Definition: dtb_stat.hpp:39
double MinNeighborDistance() const
Get the minimum neighbor distance.
Definition: dtb_stat.hpp:87
int & ComponentMembership()
Modify the component membership of this node.
Definition: dtb_stat.hpp:99
double bound
Total bound for pruning.
Definition: dtb_stat.hpp:46
double & MinNeighborDistance()
Modify the minimum neighbor distance.
Definition: dtb_stat.hpp:89
A statistic for use with MLPACK trees, which stores the upper bound on distance to nearest neighbors ...
Definition: dtb_stat.hpp:34
DTBStat(const TreeType &node)
This is called when a node is finished initializing.
Definition: dtb_stat.hpp:73
double Bound() const
Get the total bound for pruning.
Definition: dtb_stat.hpp:92