mlpack::bound::BallBound< VecType > Class Template Reference

Ball bound that works in the regular Euclidean metric space. More...

List of all members.

Public Types

typedef VecType Vec

Public Member Functions

 BallBound (const double radius, const VecType &center)
 Create the ball bound with the specified radius and center.
 BallBound (const size_t dimension)
 Create the ball bound with the specified dimensionality.
 BallBound ()
void CalculateMidpoint (VecType &centroid) const
 Gets the center.
VecType & Center ()
 Modify the center point of the ball.
const VecType & Center () const
 Get the center point of the ball.
bool Contains (const VecType &point) const
 Determines if a point is within this bound.
double MaxDistance (const BallBound &other) const
 Computes maximum distance.
double MaxDistance (const VecType &point) const
 Computes maximum distance.
double MinDistance (const BallBound &other) const
 Calculates minimum bound-to-bound squared distance.
double MinDistance (const VecType &point) const
 Calculates minimum bound-to-point squared distance.
math::Range operator[] (const size_t i) const
template<typename MatType >
const BallBoundoperator|= (const MatType &data)
 Expand the bound to include the given point.
const BallBoundoperator|= (const BallBound &other)
 Expand the bound to include the given node.
double & Radius ()
 Modify the radius of the ball.
double Radius () const
 Get the radius of the ball.
math::Range RangeDistance (const BallBound &other) const
 Calculates minimum and maximum bound-to-bound distance.
math::Range RangeDistance (const VecType &other) const
 Calculates minimum and maximum bound-to-point distance.
std::string ToString () const
 Returns a string representation of this object.

Private Attributes

VecType center
double radius

Detailed Description

template<typename VecType = arma::vec>
class mlpack::bound::BallBound< VecType >

Ball bound that works in the regular Euclidean metric space.

Template Parameters:
VecType Type of vector (arma::vec or arma::spvec).

Definition at line 38 of file ballbound.hpp.


Member Typedef Documentation

template<typename VecType = arma::vec>
typedef VecType mlpack::bound::BallBound< VecType >::Vec

Definition at line 41 of file ballbound.hpp.


Constructor & Destructor Documentation

template<typename VecType = arma::vec>
mlpack::bound::BallBound< VecType >::BallBound (  )  [inline]

Definition at line 48 of file ballbound.hpp.

template<typename VecType = arma::vec>
mlpack::bound::BallBound< VecType >::BallBound ( const size_t  dimension  )  [inline]

Create the ball bound with the specified dimensionality.

Parameters:
dimension Dimensionality of ball bound.

Definition at line 55 of file ballbound.hpp.

template<typename VecType = arma::vec>
mlpack::bound::BallBound< VecType >::BallBound ( const double  radius,
const VecType &  center 
) [inline]

Create the ball bound with the specified radius and center.

Parameters:
radius Radius of ball bound.
center Center of ball bound.

Definition at line 63 of file ballbound.hpp.


Member Function Documentation

template<typename VecType = arma::vec>
void mlpack::bound::BallBound< VecType >::CalculateMidpoint ( VecType &  centroid  )  const

Gets the center.

Don't really use this directly. This is only here for consistency with DHrectBound, so it can plug in more directly if a "centroid" is needed.

template<typename VecType = arma::vec>
VecType& mlpack::bound::BallBound< VecType >::Center (  )  [inline]

Modify the center point of the ball.

Definition at line 74 of file ballbound.hpp.

References mlpack::bound::BallBound< VecType >::center.

template<typename VecType = arma::vec>
const VecType& mlpack::bound::BallBound< VecType >::Center (  )  const [inline]

Get the center point of the ball.

Definition at line 72 of file ballbound.hpp.

References mlpack::bound::BallBound< VecType >::center.

template<typename VecType = arma::vec>
bool mlpack::bound::BallBound< VecType >::Contains ( const VecType &  point  )  const

Determines if a point is within this bound.

template<typename VecType = arma::vec>
double mlpack::bound::BallBound< VecType >::MaxDistance ( const BallBound< VecType > &  other  )  const

Computes maximum distance.

template<typename VecType = arma::vec>
double mlpack::bound::BallBound< VecType >::MaxDistance ( const VecType &  point  )  const

Computes maximum distance.

template<typename VecType = arma::vec>
double mlpack::bound::BallBound< VecType >::MinDistance ( const BallBound< VecType > &  other  )  const

Calculates minimum bound-to-bound squared distance.

template<typename VecType = arma::vec>
double mlpack::bound::BallBound< VecType >::MinDistance ( const VecType &  point  )  const

Calculates minimum bound-to-point squared distance.

template<typename VecType = arma::vec>
math::Range mlpack::bound::BallBound< VecType >::operator[] ( const size_t  i  )  const
template<typename VecType = arma::vec>
template<typename MatType >
const BallBound& mlpack::bound::BallBound< VecType >::operator|= ( const MatType &  data  )  [inline]

Expand the bound to include the given point.

The centroid is recalculated to be the center of all of the given points.

Template Parameters:
MatType Type of matrix; could be arma::mat, arma::spmat, or a vector.
data Data points to add.
template<typename VecType = arma::vec>
const BallBound& mlpack::bound::BallBound< VecType >::operator|= ( const BallBound< VecType > &  other  ) 

Expand the bound to include the given node.

template<typename VecType = arma::vec>
double& mlpack::bound::BallBound< VecType >::Radius (  )  [inline]

Modify the radius of the ball.

Definition at line 69 of file ballbound.hpp.

References mlpack::bound::BallBound< VecType >::radius.

template<typename VecType = arma::vec>
double mlpack::bound::BallBound< VecType >::Radius (  )  const [inline]

Get the radius of the ball.

Definition at line 67 of file ballbound.hpp.

References mlpack::bound::BallBound< VecType >::radius.

template<typename VecType = arma::vec>
math::Range mlpack::bound::BallBound< VecType >::RangeDistance ( const BallBound< VecType > &  other  )  const

Calculates minimum and maximum bound-to-bound distance.

Example: bound1.MinDistanceSq(other) for minimum distance.

template<typename VecType = arma::vec>
math::Range mlpack::bound::BallBound< VecType >::RangeDistance ( const VecType &  other  )  const

Calculates minimum and maximum bound-to-point distance.

template<typename VecType = arma::vec>
std::string mlpack::bound::BallBound< VecType >::ToString (  )  const

Returns a string representation of this object.


Member Data Documentation

template<typename VecType = arma::vec>
VecType mlpack::bound::BallBound< VecType >::center [private]

Definition at line 45 of file ballbound.hpp.

Referenced by mlpack::bound::BallBound< VecType >::Center().

template<typename VecType = arma::vec>
double mlpack::bound::BallBound< VecType >::radius [private]

Definition at line 44 of file ballbound.hpp.

Referenced by mlpack::bound::BallBound< VecType >::Radius().


The documentation for this class was generated from the following file:

Generated on 29 Sep 2016 for MLPACK by  doxygen 1.6.1