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.");
96 size_t Dim()
const {
return dim; }
103 {
return bounds[i]; }
111 const MetricType&
Metric()
const {
return metric; }
120 void Center(arma::Col<ElemType>& center)
const;
127 ElemType Volume()
const;
134 template<
typename VecType>
135 ElemType MinDistance(
const VecType& point,
144 ElemType MinDistance(
const HRectBound& other)
const;
151 template<
typename VecType>
152 ElemType MaxDistance(
const VecType& point,
161 ElemType MaxDistance(
const HRectBound& other)
const;
177 template<
typename VecType>
179 const VecType& point,
189 template<
typename MatType>
202 template<
typename VecType>
203 bool Contains(
const VecType& point)
const;
225 ElemType Overlap(
const HRectBound& bound)
const;
230 ElemType Diameter()
const;
235 template<
typename Archive>
236 void serialize(Archive& ar,
const uint32_t version);
250 template<
typename MetricType,
typename ElemType>
254 const static bool HasTightBounds =
true;
260 #include "hrectbound_impl.hpp" 262 #endif // MLPACK_CORE_TREE_HRECTBOUND_HPP typename enable_if< B, T >::type enable_if_t
Linear algebra utility functions, generally performed on matrices or vectors.
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.