16 #ifndef __MLPACK_CORE_TREE_HRECTBOUND_HPP
17 #define __MLPACK_CORE_TREE_HRECTBOUND_HPP
31 template<
typename MetricType>
34 static const bool Value =
false;
38 template<
int Power,
bool TakeRoot>
55 template<
typename MetricType = metric::LMetric<2, true>>
60 "HRectBound can only be used with the LMetric<> metric type.");
110 void Center(arma::vec& center)
const;
124 template<
typename VecType>
140 template<
typename VecType>
165 template<
typename VecType>
177 template<
typename MatType>
188 template<
typename VecType>
189 bool Contains(
const VecType& point)
const;
199 template<
typename Archive>
200 void Serialize(Archive& ar,
const unsigned int version);
212 template<
typename MetricType>
222 #include "hrectbound_impl.hpp"
224 #endif // __MLPACK_CORE_TREE_HRECTBOUND_HPP
double MinWidth() const
Get the minimum width of the bound.
const math::Range & operator[](const size_t i) const
Modify the range for a particular dimension. No bounds checking.
double minWidth
Cached minimum width of bound.
Linear algebra utility functions, generally performed on matrices or vectors.
A class to obtain compile-time traits about BoundType classes.
~HRectBound()
Destructor: clean up memory.
math::Range & operator[](const size_t i)
Get the range for a particular dimension.
math::Range RangeDistance(const HRectBound &other) const
Calculates minimum and maximum bound-to-bound distance.
size_t Dim() const
Gets the dimensionality.
void Serialize(Archive &ar, const unsigned int version)
Serialize the bound object.
double Diameter() const
Returns the diameter of the hyperrectangle (that is, the longest diagonal).
math::Range * bounds
The bounds for each dimension.
Hyper-rectangle bound for an L-metric.
void Clear()
Resets all dimensions to the empty set (so that this bound contains nothing).
HRectBound()
Empty constructor; creates a bound of dimensionality 0.
Simple real-valued range.
HRectBound & operator|=(const MatType &data)
Expands this region to include new points.
double MaxDistance(const VecType &point, typename boost::enable_if< IsVector< VecType > > *=0) const
Calculates maximum bound-to-point squared distance.
double MinDistance(const VecType &point, typename boost::enable_if< IsVector< VecType > > *=0) const
Calculates minimum bound-to-point distance.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
double Volume() const
Calculate the volume of the hyperrectangle.
void Center(arma::vec ¢er) const
Calculates the center of the range, placing it into the given vector.
Definition of the Range class, which represents a simple range with a lower and upper bound...
double & MinWidth()
Modify the minimum width of the bound.
size_t dim
The dimensionality of the bound.
bool Contains(const VecType &point) const
Determines if a point is within this bound.
static const bool HasTightBounds
If true, then the bounds for each dimension are tight.
HRectBound & operator=(const HRectBound &other)
Same as copy constructor; necessary to prevent memory leaks.
If value == true, then VecType is some sort of Armadillo vector or subview.