Hollow ball bound encloses a set of points at a specific distance (radius) from a specific point (center) except points at a specific distance from another point (the center of the hole). More...
Public Types | |
typedef TMetricType | MetricType |
A public version of the metric type. More... | |
Public Member Functions | |
HollowBallBound () | |
Empty Constructor. More... | |
HollowBallBound (const size_t dimension) | |
Create the ball bound with the specified dimensionality. More... | |
template < typename VecType > | |
HollowBallBound (const ElemType innerRadius, const ElemType outerRadius, const VecType ¢er) | |
Create the ball bound with the specified radius and center. More... | |
HollowBallBound (const HollowBallBound &other) | |
Copy constructor. To prevent memory leaks. More... | |
HollowBallBound (HollowBallBound &&other) | |
Move constructor: take possession of another bound. More... | |
~HollowBallBound () | |
Destructor to release allocated memory. More... | |
const arma::Col< ElemType > & | Center () const |
Get the center point of the ball. More... | |
arma::Col< ElemType > & | Center () |
Modify the center point of the ball. More... | |
template < typename VecType > | |
void | Center (VecType ¢er) const |
Place the center of BallBound into the given vector. More... | |
template < typename VecType > | |
bool | Contains (const VecType &point) const |
Determines if a point is within this bound. More... | |
bool | Contains (const HollowBallBound &other) const |
Determines if another bound is within this bound. More... | |
ElemType | Diameter () const |
Returns the diameter of the ballbound. More... | |
size_t | Dim () const |
Get the dimensionality of the ball. More... | |
const arma::Col< ElemType > & | HollowCenter () const |
Get the center point of the hollow. More... | |
arma::Col< ElemType > & | HollowCenter () |
Modify the center point of the hollow. More... | |
ElemType | InnerRadius () const |
Get the innner radius of the ball. More... | |
ElemType & | InnerRadius () |
Modify the inner radius of the ball. More... | |
template < typename VecType > | |
ElemType | MaxDistance (const VecType &point, typename std::enable_if_t< IsVector< VecType >::value > *=0) const |
Computes maximum distance. More... | |
ElemType | MaxDistance (const HollowBallBound &other) const |
Computes maximum distance. More... | |
const MetricType & | Metric () const |
Returns the distance metric used in this bound. More... | |
MetricType & | Metric () |
Modify the distance metric used in this bound. More... | |
template < typename VecType > | |
ElemType | MinDistance (const VecType &point, typename std::enable_if_t< IsVector< VecType >::value > *=0) const |
Calculates minimum bound-to-point squared distance. More... | |
ElemType | MinDistance (const HollowBallBound &other) const |
Calculates minimum bound-to-bound squared distance. More... | |
ElemType | MinWidth () const |
Get the minimum width of the bound (this is same as the diameter). More... | |
HollowBallBound & | operator= (const HollowBallBound &other) |
For the same reason as the copy constructor: to prevent memory leaks. More... | |
HollowBallBound & | operator= (HollowBallBound &&other) |
Move assignment operator. More... | |
math::RangeType< ElemType > | operator[] (const size_t i) const |
Get the range in a certain dimension. More... | |
template < typename MatType > | |
const HollowBallBound & | operator|= (const MatType &data) |
Expand the bound to include the given point. More... | |
const HollowBallBound & | operator|= (const HollowBallBound &other) |
Expand the bound to include the given bound. More... | |
ElemType | OuterRadius () const |
Get the outer radius of the ball. More... | |
ElemType & | OuterRadius () |
Modify the outer radius of the ball. More... | |
template < typename VecType > | |
math::RangeType< ElemType > | RangeDistance (const VecType &other, typename std::enable_if_t< IsVector< VecType >::value > *=0) const |
Calculates minimum and maximum bound-to-point distance. More... | |
math::RangeType< ElemType > | RangeDistance (const HollowBallBound &other) const |
Calculates minimum and maximum bound-to-bound distance. More... | |
template < typename Archive > | |
void | serialize (Archive &ar, const uint32_t version) |
Serialize the bound. More... | |
Hollow ball bound encloses a set of points at a specific distance (radius) from a specific point (center) except points at a specific distance from another point (the center of the hole).
MetricType is the custom metric type that defaults to the Euclidean (L2) distance.
TMetricType | metric type used in the distance measure. |
ElemType | Type of element (float or double or similar). |
Definition at line 33 of file hollow_ball_bound.hpp.
typedef TMetricType MetricType |
A public version of the metric type.
Definition at line 37 of file hollow_ball_bound.hpp.
HollowBallBound | ( | ) |
Empty Constructor.
HollowBallBound | ( | const size_t | dimension | ) |
Create the ball bound with the specified dimensionality.
dimension | Dimensionality of ball bound. |
HollowBallBound | ( | const ElemType | innerRadius, |
const ElemType | outerRadius, | ||
const VecType & | center | ||
) |
Create the ball bound with the specified radius and center.
innerRadius | Inner radius of ball bound. |
outerRadius | Outer radius of ball bound. |
center | Center of ball bound. |
HollowBallBound | ( | const HollowBallBound< TMetricType, ElemType > & | other | ) |
Copy constructor. To prevent memory leaks.
HollowBallBound | ( | HollowBallBound< TMetricType, ElemType > && | other | ) |
Move constructor: take possession of another bound.
~HollowBallBound | ( | ) |
Destructor to release allocated memory.
|
inline |
Get the center point of the ball.
Definition at line 106 of file hollow_ball_bound.hpp.
|
inline |
Modify the center point of the ball.
Definition at line 108 of file hollow_ball_bound.hpp.
|
inline |
Place the center of BallBound into the given vector.
center | Vector which the centroid will be written to. |
Definition at line 148 of file hollow_ball_bound.hpp.
References HollowBallBound< TMetricType, ElemType >::MaxDistance(), HollowBallBound< TMetricType, ElemType >::MinDistance(), HollowBallBound< TMetricType, ElemType >::operator|=(), and HollowBallBound< TMetricType, ElemType >::RangeDistance().
bool Contains | ( | const VecType & | point | ) | const |
Determines if a point is within this bound.
point | Point to check the condition. |
Referenced by HollowBallBound< TMetricType, ElemType >::MinWidth().
bool Contains | ( | const HollowBallBound< TMetricType, ElemType > & | other | ) | const |
Determines if another bound is within this bound.
other | Bound to check the condition. |
|
inline |
Returns the diameter of the ballbound.
Definition at line 229 of file hollow_ball_bound.hpp.
References RangeType< T >::Hi().
|
inline |
Get the dimensionality of the ball.
Definition at line 116 of file hollow_ball_bound.hpp.
|
inline |
Get the center point of the hollow.
Definition at line 111 of file hollow_ball_bound.hpp.
|
inline |
Modify the center point of the hollow.
Definition at line 113 of file hollow_ball_bound.hpp.
|
inline |
Get the innner radius of the ball.
Definition at line 101 of file hollow_ball_bound.hpp.
References RangeType< T >::Lo().
|
inline |
Modify the inner radius of the ball.
Definition at line 103 of file hollow_ball_bound.hpp.
References RangeType< T >::Lo().
ElemType MaxDistance | ( | const VecType & | point, |
typename std::enable_if_t< IsVector< VecType >::value > * | = 0 |
||
) | const |
Computes maximum distance.
point | Point to which the maximum distance is requested. |
Referenced by HollowBallBound< TMetricType, ElemType >::Center().
ElemType MaxDistance | ( | const HollowBallBound< TMetricType, ElemType > & | other | ) | const |
Computes maximum distance.
other | Bound to which the maximum distance is requested. |
|
inline |
Returns the distance metric used in this bound.
Definition at line 232 of file hollow_ball_bound.hpp.
|
inline |
Modify the distance metric used in this bound.
Definition at line 234 of file hollow_ball_bound.hpp.
References HollowBallBound< TMetricType, ElemType >::serialize().
ElemType MinDistance | ( | const VecType & | point, |
typename std::enable_if_t< IsVector< VecType >::value > * | = 0 |
||
) | const |
Calculates minimum bound-to-point squared distance.
point | Point to which the minimum distance is requested. |
Referenced by HollowBallBound< TMetricType, ElemType >::Center().
ElemType MinDistance | ( | const HollowBallBound< TMetricType, ElemType > & | other | ) | const |
Calculates minimum bound-to-bound squared distance.
other | Bound to which the minimum distance is requested. |
|
inline |
Get the minimum width of the bound (this is same as the diameter).
For ball bounds, width along all dimensions remain same.
Definition at line 122 of file hollow_ball_bound.hpp.
References HollowBallBound< TMetricType, ElemType >::Contains(), RangeType< T >::Hi(), and HollowBallBound< TMetricType, ElemType >::operator[]().
HollowBallBound& operator= | ( | const HollowBallBound< TMetricType, ElemType > & | other | ) |
For the same reason as the copy constructor: to prevent memory leaks.
HollowBallBound& operator= | ( | HollowBallBound< TMetricType, ElemType > && | other | ) |
Move assignment operator.
math::RangeType<ElemType> operator[] | ( | const size_t | i | ) | const |
Get the range in a certain dimension.
Referenced by HollowBallBound< TMetricType, ElemType >::MinWidth().
const HollowBallBound& operator|= | ( | const MatType & | data | ) |
Expand the bound to include the given point.
The centroid will not be moved.
MatType | Type of matrix; could be arma::mat, arma::spmat, or a vector. |
data | Data points to add. |
Referenced by HollowBallBound< TMetricType, ElemType >::Center().
const HollowBallBound& operator|= | ( | const HollowBallBound< TMetricType, ElemType > & | other | ) |
Expand the bound to include the given bound.
The centroid will not be moved.
MatType | Type of matrix; could be arma::mat, arma::spmat, or a vector. |
data | Data points to add. |
|
inline |
Get the outer radius of the ball.
Definition at line 96 of file hollow_ball_bound.hpp.
References RangeType< T >::Hi().
|
inline |
Modify the outer radius of the ball.
Definition at line 98 of file hollow_ball_bound.hpp.
References RangeType< T >::Hi().
math::RangeType<ElemType> RangeDistance | ( | const VecType & | other, |
typename std::enable_if_t< IsVector< VecType >::value > * | = 0 |
||
) | const |
Calculates minimum and maximum bound-to-point distance.
other | Point to which the minimum and maximum distances are requested. |
Referenced by HollowBallBound< TMetricType, ElemType >::Center().
math::RangeType<ElemType> RangeDistance | ( | const HollowBallBound< TMetricType, ElemType > & | other | ) | const |
Calculates minimum and maximum bound-to-bound distance.
Example: bound1.MinDistanceSq(other) for minimum distance.
other | Bound to which the minimum and maximum distances are requested. |
void serialize | ( | Archive & | ar, |
const uint32_t | version | ||
) |
Serialize the bound.
Referenced by HollowBallBound< TMetricType, ElemType >::Metric().