MLPACK  1.0.7
Public Types | Public Member Functions | Private Attributes | List of all members
mlpack::bound::BallBound< VecType > Class Template Reference

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

Public Types

typedef VecType Vec
 

Public Member Functions

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

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
VecTypeType 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
dimensionDimensionality 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
radiusRadius of ball bound.
centerCenter 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>
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>
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>
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 VecType &  point) const

Computes maximum distance.

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 >::MinDistance ( const VecType &  point) const

Calculates minimum bound-to-point squared 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>
math::Range mlpack::bound::BallBound< VecType >::operator[] ( const size_t  i) const
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>
template<typename MatType >
const BallBound& mlpack::bound::BallBound< VecType >::operator|= ( const MatType &  data)

Expand the bound to include the given point.

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

Template Parameters
MatTypeType of matrix; could be arma::mat, arma::spmat, or a vector.
dataData points to add.
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>
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>
math::Range mlpack::bound::BallBound< VecType >::RangeDistance ( const VecType &  other) const

Calculates minimum and maximum bound-to-point distance.

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>
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: