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.");
92 size_t Dim()
const {
return dim; }
110 void Center(arma::vec& center)
const;
117 double Volume()
const;
124 template<
typename VecType>
125 double MinDistance(
const VecType& point,
133 double MinDistance(
const HRectBound& other)
const;
140 template<
typename VecType>
141 double MaxDistance(
const VecType& point,
149 double MaxDistance(
const HRectBound& other)
const;
165 template<
typename VecType>
177 template<
typename MatType>
188 template<
typename VecType>
189 bool Contains(
const VecType& point)
const;
194 double Diameter()
const;
199 template<
typename Archive>
200 void Serialize(Archive& ar,
const unsigned int version);
212 template<
typename MetricType>
216 const static bool HasTightBounds =
true;
222 #include "hrectbound_impl.hpp" 224 #endif // __MLPACK_CORE_TREE_HRECTBOUND_HPP 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.
size_t Dim() const
Gets the dimensionality.
math::Range & operator[](const size_t i)
Get the range for a particular dimension.
double MinWidth() const
Get the minimum width of the bound.
math::Range * bounds
The bounds for each dimension.
Hyper-rectangle bound for an L-metric.
Simple real-valued range.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
Definition of the Range class, which represents a simple range with a lower and upper bound...
void Center(const arma::mat &x, arma::mat &xCentered)
Creates a centered matrix, where centering is done by subtracting the sum over the columns (a column ...
double & MinWidth()
Modify the minimum width of the bound.
size_t dim
The dimensionality of the bound.
If value == true, then VecType is some sort of Armadillo vector or subview.