MLPACK
1.0.8
|
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 ¢er) | |
Create the ball bound with the specified radius and center. More... | |
void | CalculateMidpoint (VecType ¢roid) 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 BallBound & | operator|= (const BallBound &other) |
Expand the bound to include the given node. More... | |
template<typename MatType > | |
const BallBound & | operator|= (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 |
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.
|
inline |
Definition at line 48 of file ballbound.hpp.
|
inline |
Create the ball bound with the specified dimensionality.
dimension | Dimensionality of ball bound. |
Definition at line 55 of file ballbound.hpp.
|
inline |
Create the ball bound with the specified radius and center.
radius | Radius of ball bound. |
center | Center of ball bound. |
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.
|
inline |
Get the center point of the ball.
Definition at line 72 of file ballbound.hpp.
References 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.
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 VecType & | point | ) | const |
Computes maximum distance.
double mlpack::bound::BallBound< VecType >::MaxDistance | ( | const BallBound< VecType > & | other | ) | const |
Computes maximum distance.
double mlpack::bound::BallBound< VecType >::MinDistance | ( | const VecType & | point | ) | const |
Calculates minimum bound-to-point squared distance.
double mlpack::bound::BallBound< VecType >::MinDistance | ( | const BallBound< VecType > & | other | ) | const |
Calculates minimum bound-to-bound squared distance.
math::Range mlpack::bound::BallBound< VecType >::operator[] | ( | const size_t | i | ) | const |
const BallBound& mlpack::bound::BallBound< VecType >::operator|= | ( | const BallBound< VecType > & | other | ) |
Expand the bound to include the given node.
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.
MatType | Type of matrix; could be arma::mat, arma::spmat, or a vector. |
data | Data points to add. |
|
inline |
Get the radius of the ball.
Definition at line 67 of file ballbound.hpp.
References 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.
math::Range mlpack::bound::BallBound< VecType >::RangeDistance | ( | const VecType & | other | ) | const |
Calculates minimum and maximum bound-to-point distance.
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.
std::string mlpack::bound::BallBound< VecType >::ToString | ( | ) | const |
Returns a string representation of this object.
|
private |
Definition at line 45 of file ballbound.hpp.
Referenced by mlpack::bound::BallBound< VecType >::Center().
|
private |
Definition at line 44 of file ballbound.hpp.
Referenced by mlpack::bound::BallBound< VecType >::Radius().