24 #ifndef __MLPACK_CORE_TREE_HRECTBOUND_HPP 25 #define __MLPACK_CORE_TREE_HRECTBOUND_HPP 43 template<
int Power = 2,
bool TakeRoot = true>
94 void Centroid(arma::vec& centroid)
const;
101 template<
typename VecType>
117 template<
typename VecType>
142 template<
typename VecType>
154 template<
typename MatType>
165 template<
typename VecType>
166 bool Contains(
const VecType& point)
const;
197 #include "hrectbound_impl.hpp" 199 #endif // __MLPACK_CORE_TREE_HRECTBOUND_HPP HRectBound & operator=(const HRectBound &other)
Same as copy constructor; necessary to prevent memory leaks.
std::string ToString() const
Returns a string representation of this object.
Linear algebra utility functions, generally performed on matrices or vectors.
double minWidth
Cached minimum width of bound.
double MaxDistance(const VecType &point, typename boost::enable_if< IsVector< VecType > > *=0) const
Calculates maximum bound-to-point squared distance.
const math::Range & operator[](const size_t i) const
Modify the range for a particular dimension. No bounds checking.
double & MinWidth()
Modify the minimum width of the bound.
Hyper-rectangle bound for an L-metric.
metric::LMetric< Power, TakeRoot > MetricType
This is the metric type that this bound is using.
double MinDistance(const VecType &point, typename boost::enable_if< IsVector< VecType > > *=0) const
Calculates minimum bound-to-point distance.
HRectBound()
Empty constructor; creates a bound of dimensionality 0.
HRectBound & operator|=(const MatType &data)
Expands this region to include new points.
size_t dim
The dimensionality of the bound.
math::Range * bounds
The bounds for each dimension.
double MinWidth() const
Get the minimum width of the bound.
The L_p metric for arbitrary integer p, with an option to take the root.
static MetricType Metric()
Return the metric associated with this bound.
math::Range RangeDistance(const HRectBound &other) const
Calculates minimum and maximum bound-to-bound distance.
void Clear()
Resets all dimensions to the empty set (so that this bound contains nothing).
double Diameter() const
Returns the diameter of the hyperrectangle (that is, the longest diagonal).
~HRectBound()
Destructor: clean up memory.
Definition of the Range class, which represents a simple range with a lower and upper bound...
bool Contains(const VecType &point) const
Determines if a point is within this bound.
size_t Dim() const
Gets the dimensionality.
void Centroid(arma::vec ¢roid) const
Calculates the centroid of the range, placing it into the given vector.
math::Range & operator[](const size_t i)
Get the range for a particular dimension.
If value == true, then VecType is some sort of Armadillo vector or subview.
Simple real-valued range.