MLPACK  1.0.8
hrectbound.hpp
Go to the documentation of this file.
1 
24 #ifndef __MLPACK_CORE_TREE_HRECTBOUND_HPP
25 #define __MLPACK_CORE_TREE_HRECTBOUND_HPP
26 
27 #include <mlpack/core.hpp>
30 
31 namespace mlpack {
32 namespace bound {
33 
43 template<int Power = 2, bool TakeRoot = true>
45 {
46  public:
49 
53  HRectBound();
54 
59  HRectBound(const size_t dimension);
60 
62  HRectBound(const HRectBound& other);
64  HRectBound& operator=(const HRectBound& other);
65 
67  ~HRectBound();
68 
73  void Clear();
74 
76  size_t Dim() const { return dim; }
77 
79  math::Range& operator[](const size_t i) { return bounds[i]; }
81  const math::Range& operator[](const size_t i) const { return bounds[i]; }
82 
88  void Centroid(arma::vec& centroid) const;
89 
95  template<typename VecType>
96  double MinDistance(const VecType& point) const;
97 
103  double MinDistance(const HRectBound& other) const;
104 
110  template<typename VecType>
111  double MaxDistance(const VecType& point) const;
112 
118  double MaxDistance(const HRectBound& other) const;
119 
126  math::Range RangeDistance(const HRectBound& other) const;
127 
134  template<typename VecType>
135  math::Range RangeDistance(const VecType& point) const;
136 
144  template<typename MatType>
145  HRectBound& operator|=(const MatType& data);
146 
150  HRectBound& operator|=(const HRectBound& other);
151 
155  template<typename VecType>
156  bool Contains(const VecType& point) const;
157 
161  double Diameter() const;
162 
166  std::string ToString() const;
167 
174 
175  private:
177  size_t dim;
180 };
181 
182 }; // namespace bound
183 }; // namespace mlpack
184 
185 #include "hrectbound_impl.hpp"
186 
187 #endif // __MLPACK_CORE_TREE_HRECTBOUND_HPP