MLPACK  1.0.10
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