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.");
90 size_t Dim()
const {
return dim; }
109 void Center(arma::Col<ElemType>& center)
const;
116 ElemType Volume()
const;
123 template<
typename VecType>
124 ElemType MinDistance(
const VecType& point,
133 ElemType MinDistance(
const HRectBound& other)
const;
140 template<
typename VecType>
141 ElemType MaxDistance(
const VecType& point,
150 ElemType MaxDistance(
const HRectBound& other)
const;
166 template<
typename VecType>
168 const VecType& point,
178 template<
typename MatType>
189 template<
typename VecType>
190 bool Contains(
const VecType& point)
const;
210 ElemType Overlap(
const HRectBound& bound)
const;
215 ElemType Diameter()
const;
220 template<
typename Archive>
221 void Serialize(Archive& ar,
const unsigned int version);
233 template<
typename MetricType,
typename ElemType>
237 const static bool HasTightBounds =
true;
243 #include "hrectbound_impl.hpp" 245 #endif // MLPACK_CORE_TREE_HRECTBOUND_HPP ElemType MinWidth() const
Get the minimum width of the bound.
Linear algebra utility functions, generally performed on matrices or vectors.
const math::RangeType< ElemType > & operator[](const size_t i) const
Modify the range for a particular dimension. No bounds checking.
A class to obtain compile-time traits about BoundType classes.
size_t Dim() const
Gets the dimensionality.
The core includes that mlpack expects; standard C++ includes and Armadillo.
Archive & operator&(Archive &ar, FirstShim< T > t)
Catch when we call operator& with a FirstShim object.
math::RangeType< ElemType > & operator[](const size_t i)
Get the range for a particular dimension.
math::RangeType< ElemType > * bounds
The bounds for each dimension.
size_t dim
The dimensionality of the bound.
Hyper-rectangle bound for an L-metric.
ElemType minWidth
Cached minimum width of bound.
ElemType & MinWidth()
Modify the minimum width of the bound.
bool Contains(const AddressType1 &address, const AddressType2 &loBound, const AddressType3 &hiBound)
Returns true if an address is contained between two other addresses.
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 ...
If value == true, then VecType is some sort of Armadillo vector or subview.
typename enable_if< B, T >::type enable_if_t