Ball bound that works in the regular Euclidean metric space. More...
Public Types | |
typedef VecType | Vec |
Public Member Functions | |
BallBound (const double radius, const VecType ¢er) | |
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 ¢roid) 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 BallBound & | operator|= (const MatType &data) |
Expand the bound to include the given point. | |
const BallBound & | operator|= (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 |
Ball bound that works in the regular Euclidean metric space.
VecType | Type of vector (arma::vec or arma::spvec). |
Definition at line 38 of file ballbound.hpp.
typedef VecType mlpack::bound::BallBound< VecType >::Vec |
Definition at line 41 of file ballbound.hpp.
mlpack::bound::BallBound< VecType >::BallBound | ( | ) | [inline] |
Definition at line 48 of file ballbound.hpp.
mlpack::bound::BallBound< VecType >::BallBound | ( | const size_t | dimension | ) | [inline] |
Create the ball bound with the specified dimensionality.
dimension | Dimensionality of ball bound. |
Definition at line 55 of file ballbound.hpp.
mlpack::bound::BallBound< VecType >::BallBound | ( | const double | radius, | |
const VecType & | center | |||
) | [inline] |
Create the ball bound with the specified radius and center.
Definition at line 63 of file ballbound.hpp.
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.
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.
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.
bool mlpack::bound::BallBound< VecType >::Contains | ( | const VecType & | point | ) | const |
Determines if a point is within this bound.
double mlpack::bound::BallBound< VecType >::MaxDistance | ( | const BallBound< VecType > & | other | ) | const |
Computes maximum distance.
double mlpack::bound::BallBound< VecType >::MaxDistance | ( | const VecType & | point | ) | const |
Computes maximum distance.
double mlpack::bound::BallBound< VecType >::MinDistance | ( | const BallBound< VecType > & | other | ) | const |
Calculates minimum bound-to-bound squared distance.
double mlpack::bound::BallBound< VecType >::MinDistance | ( | const VecType & | point | ) | const |
Calculates minimum bound-to-point squared distance.
math::Range mlpack::bound::BallBound< VecType >::operator[] | ( | const size_t | i | ) | const |
const BallBound& mlpack::bound::BallBound< VecType >::operator|= | ( | const MatType & | data | ) | [inline] |
const BallBound& mlpack::bound::BallBound< VecType >::operator|= | ( | const BallBound< VecType > & | other | ) |
Expand the bound to include the given node.
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.
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.
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.
math::Range mlpack::bound::BallBound< VecType >::RangeDistance | ( | const VecType & | other | ) | const |
Calculates minimum and maximum bound-to-point distance.
std::string mlpack::bound::BallBound< VecType >::ToString | ( | ) | const |
Returns a string representation of this object.
VecType mlpack::bound::BallBound< VecType >::center [private] |
Definition at line 45 of file ballbound.hpp.
Referenced by mlpack::bound::BallBound< VecType >::Center().
double mlpack::bound::BallBound< VecType >::radius [private] |
Definition at line 44 of file ballbound.hpp.
Referenced by mlpack::bound::BallBound< VecType >::Radius().