14 #ifndef __MLPACK_CORE_TREE_BALLBOUND_HPP 15 #define __MLPACK_CORE_TREE_BALLBOUND_HPP 32 template<
typename VecType = arma::vec,
75 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>
191 template<
typename Archive>
192 void Serialize(Archive& ar,
const unsigned int version);
196 template<
typename VecType,
typename TMetricType>
200 const static bool HasTightBounds =
false;
206 #include "ballbound_impl.hpp" 208 #endif // __MLPACK_CORE_TREE_DBALLBOUND_HPP double MaxDistance(const OtherVecType &point, typename boost::enable_if< IsVector< OtherVecType > > *=0) const
Computes maximum distance.
const TMetricType & Metric() const
Returns the distance metric used in this bound.
BallBound()
Empty Constructor.
Linear algebra utility functions, generally performed on matrices or vectors.
double Radius() const
Get the radius of the ball.
A class to obtain compile-time traits about BoundType classes.
void Serialize(Archive &ar, const unsigned int version)
Serialize the bound.
const VecType & Center() const
Get the center point of the ball.
const BallBound & operator|=(const BallBound &other)
Expand the bound to include the given node.
void Center(VecType ¢er) const
Place the center of BallBound into the given vector.
TMetricType & Metric()
Modify the distance metric used in this bound.
math::Range operator[](const size_t i) const
Get the range in a certain dimension.
double MinDistance(const OtherVecType &point, typename boost::enable_if< IsVector< OtherVecType > > *=0) const
Calculates minimum bound-to-point squared distance.
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.
VecType & Center()
Modify the center point of the ball.
TMetricType MetricType
Needed for BinarySpaceTree.
math::Range RangeDistance(const OtherVecType &other, typename boost::enable_if< IsVector< OtherVecType > > *=0) const
Calculates minimum and maximum bound-to-point distance.
Simple real-valued range.
double radius
The radius of the ball bound.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
The L_p metric for arbitrary integer p, with an option to take the root.
double Diameter() const
Returns the diameter of the ballbound.
bool Contains(const VecType &point) const
Determines if a point is within this bound.
~BallBound()
Destructor to release allocated memory.
TMetricType * metric
The metric used in this bound.
double MinWidth() const
Get the minimum width of the bound (this is same as the diameter).
VecType center
The center of the ball bound.
double & Radius()
Modify the radius of the ball.
double Dim() const
Get the dimensionality of the ball.
If value == true, then VecType is some sort of Armadillo vector or subview.