MLPACK
1.0.4
|
Hyper-rectangle bound for an L-metric. More...
Public Member Functions | |
HRectBound () | |
Empty constructor; creates a bound of dimensionality 0. | |
HRectBound (const size_t dimension) | |
Initializes to specified dimensionality with each dimension the empty set. | |
HRectBound (const HRectBound &other) | |
~HRectBound () | |
Destructor: clean up memory. | |
void | Centroid (arma::vec ¢roid) const |
Calculates the centroid of the range, placing it into the given vector. | |
void | Clear () |
Resets all dimensions to the empty set (so that this bound contains nothing). | |
template<typename VecType > | |
bool | Contains (const VecType &point) const |
Determines if a point is within this bound. | |
size_t | Dim () const |
Gets the dimensionality. | |
template<typename VecType > | |
double | MaxDistance (const VecType &point) const |
Calculates maximum bound-to-point squared distance. | |
double | MaxDistance (const HRectBound &other) const |
Computes maximum distance. | |
template<typename VecType > | |
double | MinDistance (const VecType &point) const |
Calculates minimum bound-to-point distance. | |
double | MinDistance (const HRectBound &other) const |
Calculates minimum bound-to-bound distance. | |
HRectBound & | operator= (const HRectBound &other) |
math::Range & | operator[] (const size_t i) |
Sets and gets the range for a particular dimension. | |
const math::Range & | operator[] (const size_t i) const |
template<typename MatType > | |
HRectBound & | operator|= (const MatType &data) |
Expands this region to include new points. | |
HRectBound & | operator|= (const HRectBound &other) |
Expands this region to encompass another bound. | |
math::Range | RangeDistance (const HRectBound &other) const |
Calculates minimum and maximum bound-to-bound distance. | |
template<typename VecType > | |
math::Range | RangeDistance (const VecType &point) const |
Calculates minimum and maximum bound-to-point distance. | |
Private Attributes | |
math::Range * | bounds |
The bounds for each dimension. | |
size_t | dim |
The dimensionality of the bound. |
Hyper-rectangle bound for an L-metric.
This should be used in conjunction with the LMetric class. Be sure to use the same template parameters for LMetric as you do for HRectBound -- otherwise odd results may occur.
Power | The metric to use; use 2 for Euclidean (L2). |
TakeRoot | Whether or not the root should be taken (see LMetric documentation). |
Definition at line 43 of file hrectbound.hpp.
mlpack::bound::HRectBound< Power, TakeRoot >::HRectBound | ( | ) |
Empty constructor; creates a bound of dimensionality 0.
mlpack::bound::HRectBound< Power, TakeRoot >::HRectBound | ( | const size_t | dimension | ) |
Initializes to specified dimensionality with each dimension the empty set.
mlpack::bound::HRectBound< Power, TakeRoot >::HRectBound | ( | const HRectBound< Power, TakeRoot > & | other | ) |
mlpack::bound::HRectBound< Power, TakeRoot >::~HRectBound | ( | ) |
Destructor: clean up memory.
void mlpack::bound::HRectBound< Power, TakeRoot >::Centroid | ( | arma::vec & | centroid | ) | const |
Calculates the centroid of the range, placing it into the given vector.
centroid | Vector which the centroid will be written to. |
void mlpack::bound::HRectBound< Power, TakeRoot >::Clear | ( | ) |
Resets all dimensions to the empty set (so that this bound contains nothing).
bool mlpack::bound::HRectBound< Power, TakeRoot >::Contains | ( | const VecType & | point | ) | const |
Determines if a point is within this bound.
size_t mlpack::bound::HRectBound< Power, TakeRoot >::Dim | ( | ) | const [inline] |
Gets the dimensionality.
Definition at line 75 of file hrectbound.hpp.
References mlpack::bound::HRectBound< Power, TakeRoot >::dim.
double mlpack::bound::HRectBound< Power, TakeRoot >::MaxDistance | ( | const VecType & | point | ) | const |
Calculates maximum bound-to-point squared distance.
point | Point to which the maximum distance is requested. |
double mlpack::bound::HRectBound< Power, TakeRoot >::MaxDistance | ( | const HRectBound< Power, TakeRoot > & | other | ) | const |
Computes maximum distance.
other | Bound to which the maximum distance is requested. |
double mlpack::bound::HRectBound< Power, TakeRoot >::MinDistance | ( | const VecType & | point | ) | const |
Calculates minimum bound-to-point distance.
point | Point to which the minimum distance is requested. |
double mlpack::bound::HRectBound< Power, TakeRoot >::MinDistance | ( | const HRectBound< Power, TakeRoot > & | other | ) | const |
Calculates minimum bound-to-bound distance.
other | Bound to which the minimum distance is requested. |
HRectBound& mlpack::bound::HRectBound< Power, TakeRoot >::operator= | ( | const HRectBound< Power, TakeRoot > & | other | ) |
math::Range& mlpack::bound::HRectBound< Power, TakeRoot >::operator[] | ( | const size_t | i | ) |
Sets and gets the range for a particular dimension.
const math::Range& mlpack::bound::HRectBound< Power, TakeRoot >::operator[] | ( | const size_t | i | ) | const |
HRectBound& mlpack::bound::HRectBound< Power, TakeRoot >::operator|= | ( | const MatType & | data | ) |
Expands this region to include new points.
MatType | Type of matrix; could be Mat, SpMat, a subview, or just a vector. |
data | Data points to expand this region to include. |
HRectBound& mlpack::bound::HRectBound< Power, TakeRoot >::operator|= | ( | const HRectBound< Power, TakeRoot > & | other | ) |
Expands this region to encompass another bound.
math::Range mlpack::bound::HRectBound< Power, TakeRoot >::RangeDistance | ( | const HRectBound< Power, TakeRoot > & | other | ) | const |
Calculates minimum and maximum bound-to-bound distance.
other | Bound to which the minimum and maximum distances are requested. |
math::Range mlpack::bound::HRectBound< Power, TakeRoot >::RangeDistance | ( | const VecType & | point | ) | const |
Calculates minimum and maximum bound-to-point distance.
point | Point to which the minimum and maximum distances are requested. |
math::Range* mlpack::bound::HRectBound< Power, TakeRoot >::bounds [private] |
The bounds for each dimension.
Definition at line 162 of file hrectbound.hpp.
size_t mlpack::bound::HRectBound< Power, TakeRoot >::dim [private] |
The dimensionality of the bound.
Definition at line 160 of file hrectbound.hpp.
Referenced by mlpack::bound::HRectBound< Power, TakeRoot >::Dim().