15 #ifndef __MLPACK_CORE_TREE_BALLBOUND_HPP
16 #define __MLPACK_CORE_TREE_BALLBOUND_HPP
32 template<
typename VecType = arma::vec,
78 BallBound(
const double radius,
const VecType& center);
100 double Dim()
const {
return center.n_elem; }
114 bool Contains(
const VecType& point)
const;
126 template<
typename OtherVecType>
139 template<
typename OtherVecType>
152 template<
typename OtherVecType>
154 const OtherVecType& other,
177 template<
typename MatType>
200 #include "ballbound_impl.hpp"
202 #endif // __MLPACK_CORE_TREE_DBALLBOUND_HPP
bool Contains(const VecType &point) const
Determines if a point is within this bound.
BallBound()
Empty Constructor.
Linear algebra utility functions, generally performed on matrices or vectors.
const BallBound & operator|=(const BallBound &other)
Expand the bound to include the given node.
std::string ToString() const
Returns a string representation of this object.
void Centroid(VecType ¢roid) const
Place the centroid of BallBound into the given vector.
double MaxDistance(const OtherVecType &point, typename boost::enable_if< IsVector< OtherVecType > > *=0) const
Computes maximum distance.
math::Range operator[](const size_t i) const
Get the range in a certain dimension.
const VecType & Center() const
Get the center point of the ball.
double Dim() const
Get the dimensionality of the ball.
Ball bound encloses a set of points at a specific distance (radius) from a specific point (center)...
BallBound & operator=(const BallBound &other)
For the same reason as the Copy Constructor. To prevent memory leaks.
bool ownsMetric
To know whether this object allocated memory to the metric member variable.
double MinDistance(const OtherVecType &point, typename boost::enable_if< IsVector< OtherVecType > > *=0) const
Calculates minimum bound-to-point squared distance.
double Diameter() const
Returns the diameter of the ballbound.
VecType & Center()
Modify the center point of the ball.
TMetricType MetricType
Need this for Binary Space Partion Tree.
math::Range RangeDistance(const OtherVecType &other, typename boost::enable_if< IsVector< OtherVecType > > *=0) const
Calculates minimum and maximum bound-to-point distance.
double radius
The radius of the ball bound.
The L_p metric for arbitrary integer p, with an option to take the root.
double MinWidth() const
Get the minimum width of the bound (this is same as the diameter).
~BallBound()
Destructor to release allocated memory.
TMetricType * metric
The metric used in this bound.
TMetricType Metric() const
Returns the distance metric used in this bound.
VecType center
The center of the ball bound.
double & Radius()
Modify the radius of the ball.
double Radius() const
Get the radius of the ball.
If value == true, then VecType is some sort of Armadillo vector or subview.
Simple real-valued range.