14 #ifndef MLPACK_CORE_TREE_HRECTBOUND_HPP 15 #define MLPACK_CORE_TREE_HRECTBOUND_HPP 29 template<
typename MetricType>
32 static const bool Value =
false;
36 template<
int Power,
bool TakeRoot>
52 template<
typename MetricType = metric::LMetric<2, true>,
53 typename ElemType =
double>
58 "HRectBound can only be used with the LMetric<> metric type.");
92 size_t Dim()
const {
return dim; }
107 const MetricType&
Metric()
const {
return metric; }
116 void Center(arma::Col<ElemType>& center)
const;
123 ElemType Volume()
const;
130 template<
typename VecType>
131 ElemType MinDistance(
const VecType& point,
140 ElemType MinDistance(
const HRectBound& other)
const;
147 template<
typename VecType>
148 ElemType MaxDistance(
const VecType& point,
157 ElemType MaxDistance(
const HRectBound& other)
const;
173 template<
typename VecType>
175 const VecType& point,
185 template<
typename MatType>
198 template<
typename VecType>
199 bool Contains(
const VecType& point)
const;
221 ElemType Overlap(
const HRectBound& bound)
const;
226 ElemType Diameter()
const;
231 template<
typename Archive>
232 void serialize(Archive& ar,
const unsigned int version);
246 template<
typename MetricType,
typename ElemType>
250 const static bool HasTightBounds =
true;
256 #include "hrectbound_impl.hpp" 258 #endif // MLPACK_CORE_TREE_HRECTBOUND_HPP typename enable_if< B, T >::type enable_if_t
A class to obtain compile-time traits about BoundType classes.
The core includes that mlpack expects; standard C++ includes and Armadillo.
ElemType MinWidth() const
Get the minimum width of the bound.
const math::RangeType< ElemType > & operator[](const size_t i) const
Modify the range for a particular dimension. No bounds checking.
math::RangeType< ElemType > & operator[](const size_t i)
Get the range for a particular dimension.
Hyper-rectangle bound for an L-metric.
MetricType & Metric()
Modify the instantiated metric associated with the bound.
size_t Dim() const
Gets the dimensionality.
bool Contains(const AddressType1 &address, const AddressType2 &loBound, const AddressType3 &hiBound)
Returns true if an address is contained between two other addresses.
const MetricType & Metric() const
Get the instantiated metric associated with the bound.
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 ...
ElemType & MinWidth()
Modify the minimum width of the bound.
If value == true, then VecType is some sort of Armadillo vector or subview.