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>
76 template<
typename VecType>
78 const ElemType outerRadius,
79 const VecType& center);
114 size_t Dim()
const {
return center.n_elem; }
128 template<
typename VecType>
129 bool Contains(
const VecType& point)
const;
141 template<
typename VecType>
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>
226 const static bool HasTightBounds =
false;
232 #include "hollow_ball_bound_impl.hpp" 234 #endif // MLPACK_CORE_TREE_HOLLOW_BALL_BOUND_HPP arma::Col< ElemType > center
The center of the ball bound.
size_t Dim() const
Get the dimensionality of the ball.
arma::Col< ElemType > & HollowCenter()
Modify the center point of the hollow.
MetricType & Metric()
Modify the distance metric used in this bound.
HollowBallBound & operator=(const HollowBallBound &other)
For the same reason as the copy constructor: to prevent memory leaks.
math::RangeType< ElemType > operator[](const size_t i) const
Get the range in a certain dimension.
bool Contains(const VecType &point) const
Determines if a point is within this bound.
ElemType MaxDistance(const VecType &point, typename std::enable_if_t< IsVector< VecType >::value > *=0) const
Computes maximum distance.
Linear algebra utility functions, generally performed on matrices or vectors.
A class to obtain compile-time traits about BoundType classes.
math::RangeType< ElemType > RangeDistance(const VecType &other, typename std::enable_if_t< IsVector< VecType >::value > *=0) const
Calculates minimum and maximum bound-to-point distance.
arma::Col< ElemType > hollowCenter
The center of the hollow.
The core includes that mlpack expects; standard C++ includes and Armadillo.
const MetricType & Metric() const
Returns the distance metric used in this bound.
TMetricType MetricType
A public version of the metric type.
arma::Col< ElemType > & Center()
Modify the center point of the ball.
ElemType InnerRadius() const
Get the innner radius of the ball.
ElemType MinDistance(const VecType &point, typename std::enable_if_t< IsVector< VecType >::value > *=0) const
Calculates minimum bound-to-point squared distance.
ElemType & OuterRadius()
Modify the outer radius of the ball.
void Center(VecType ¢er) const
Place the center of BallBound into the given vector.
HollowBallBound()
Empty Constructor.
const HollowBallBound & operator|=(const MatType &data)
Expand the bound to include the given point.
ElemType & InnerRadius()
Modify the inner radius of the ball.
T Lo() const
Get the lower bound.
~HollowBallBound()
Destructor to release allocated memory.
math::RangeType< ElemType > radii
The inner and the outer radii of the bound.
MetricType * metric
The metric used in this bound.
ElemType Diameter() const
Returns the diameter of the ballbound.
ElemType MinWidth() const
Get the minimum width of the bound (this is same as the diameter).
bool ownsMetric
To know whether this object allocated memory to the metric member variable.
void Serialize(Archive &ar, const unsigned int version)
Serialize the bound.
ElemType OuterRadius() const
Get the outer radius of the ball.
T Hi() const
Get the upper bound.
Hollow ball bound encloses a set of points at a specific distance (radius) from a specific point (cen...
const arma::Col< ElemType > & Center() const
Get the center point of the ball.
If value == true, then VecType is some sort of Armadillo vector or subview.
const arma::Col< ElemType > & HollowCenter() const
Get the center point of the hollow.
typename enable_if< B, T >::type enable_if_t