12 #ifndef MLPACK_CORE_TREE_HOLLOW_BALL_BOUND_HPP
13 #define MLPACK_CORE_TREE_HOLLOW_BALL_BOUND_HPP
31 template<
typename TMetricType = metric::LMetric<2, true>,
32 typename ElemType =
double>
43 arma::Col<ElemType> center;
45 arma::Col<ElemType> hollowCenter;
76 template<
typename VecType>
78 const ElemType outerRadius,
79 const VecType& center);
104 const arma::Col<ElemType>&
Center()
const {
return center; }
106 arma::Col<ElemType>&
Center() {
return center; }
109 const arma::Col<ElemType>&
HollowCenter()
const {
return hollowCenter; }
114 size_t Dim()
const {
return center.n_elem; }
128 template<
typename VecType>
129 bool Contains(
const VecType& point)
const;
141 template<
typename VecType>
142 void Center(VecType& center)
const { center = this->center; }
147 template<
typename VecType>
160 template<
typename VecType>
173 template<
typename VecType>
175 const VecType& other,
193 template<
typename MatType>
217 template<
typename Archive>
218 void Serialize(Archive& ar,
const unsigned int version);
222 template<
typename MetricType,
typename ElemType>
232 #include "hollow_ball_bound_impl.hpp"
234 #endif // MLPACK_CORE_TREE_HOLLOW_BALL_BOUND_HPP
T Hi() const
Get the upper bound.
ElemType MinWidth() const
Get the minimum width of the bound (this is same as the diameter).
TMetricType MetricType
A public version of the metric type.
const MetricType & Metric() const
Returns the distance metric used in this bound.
ElemType OuterRadius() const
Get the outer radius of the ball.
A class to obtain compile-time traits about BoundType classes.
ElemType Diameter() const
Returns the diameter of the ballbound.
HollowBallBound & operator=(const HollowBallBound &other)
For the same reason as the copy constructor: to prevent memory leaks.
The core includes that mlpack expects; standard C++ includes and Armadillo.
ElemType InnerRadius() const
Get the innner radius of the ball.
ElemType & InnerRadius()
Modify the inner radius of the ball.
arma::Col< ElemType > & HollowCenter()
Modify the center point of the hollow.
ElemType MaxDistance(const VecType &point, typename boost::enable_if< IsVector< VecType >> *=0) const
Computes maximum distance.
void Center(VecType ¢er) const
Place the center of BallBound into the given vector.
const arma::Col< ElemType > & Center() const
Get the center point of the ball.
arma::Col< ElemType > & Center()
Modify the center point of the ball.
HollowBallBound()
Empty Constructor.
MetricType & Metric()
Modify the distance metric used in this bound.
math::RangeType< ElemType > operator[](const size_t i) const
Get the range in a certain dimension.
T Lo() const
Get the lower bound.
ElemType MinDistance(const VecType &point, typename boost::enable_if< IsVector< VecType >> *=0) const
Calculates minimum bound-to-point squared distance.
const arma::Col< ElemType > & HollowCenter() const
Get the center point of the hollow.
math::RangeType< ElemType > RangeDistance(const VecType &other, typename boost::enable_if< IsVector< VecType >> *=0) const
Calculates minimum and maximum bound-to-point distance.
static const bool HasTightBounds
If true, then the bounds for each dimension are tight.
Hollow ball bound encloses a set of points at a specific distance (radius) from a specific point (cen...
const HollowBallBound & operator|=(const MatType &data)
Expand the bound to include the given point.
~HollowBallBound()
Destructor to release allocated memory.
size_t Dim() const
Get the dimensionality of the ball.
If value == true, then VecType is some sort of Armadillo vector or subview.
void Serialize(Archive &ar, const unsigned int version)
Serialize the bound.
ElemType & OuterRadius()
Modify the outer radius of the ball.
bool Contains(const VecType &point) const
Determines if a point is within this bound.