MLPACK  1.0.8
Public Member Functions | Private Attributes | List of all members
mlpack::bound::PeriodicHRectBound< t_pow > Class Template Reference

Hyper-rectangle bound for an L-metric. More...

Collaboration diagram for mlpack::bound::PeriodicHRectBound< t_pow >:
Collaboration graph
[legend]

Public Member Functions

 PeriodicHRectBound ()
 Empty constructor. More...
 
 PeriodicHRectBound (arma::vec box)
 Specifies the box size. More...
 
 PeriodicHRectBound (const PeriodicHRectBound &other)
 
 ~PeriodicHRectBound ()
 Destructor: clean up memory. More...
 
const arma::vec & Box () const
 Returns the box vector. More...
 
void Centroid (arma::vec &centroid) const
 
void Clear ()
 Resets all dimensions to the empty set. More...
 
bool Contains (const arma::vec &point) const
 Determines if a point is within this bound. More...
 
size_t Dim () const
 Gets the dimensionality. More...
 
double MaxDistance (const arma::vec &point) const
 Calculates maximum bound-to-point squared distance in the periodic bound case. More...
 
double MaxDistance (const PeriodicHRectBound &other) const
 Computes maximum bound-to-bound squared distance in the periodic bound case. More...
 
double MinDistance (const arma::vec &point) const
 Calculates minimum bound-to-point squared distance in the periodic bound case. More...
 
double MinDistance (const PeriodicHRectBound &other) const
 Calculates minimum bound-to-bound squared distance in the periodic bound case. More...
 
PeriodicHRectBoundoperator= (const PeriodicHRectBound &other)
 
math::Rangeoperator[] (size_t i)
 Sets and gets the range for a particular dimension. More...
 
const math::Range operator[] (size_t i) const
 
PeriodicHRectBoundoperator|= (const arma::vec &vector)
 Expands this region to include a new point. More...
 
PeriodicHRectBoundoperator|= (const PeriodicHRectBound &other)
 Expands this region to encompass another bound. More...
 
math::Range RangeDistance (const arma::vec &point) const
 Calculates minimum and maximum bound-to-point squared distance in the periodic bound case. More...
 
math::Range RangeDistance (const PeriodicHRectBound &other) const
 Calculates minimum and maximum bound-to-bound squared distance in the periodic bound case. More...
 
void SetBoxSize (arma::vec box)
 Modifies the box to the desired dimenstions. More...
 
std::string ToString () const
 Returns a string representation of an object. More...
 

Private Attributes

math::Rangebounds
 
arma::vec box
 
size_t dim
 

Detailed Description

template<int t_pow = 2>
class mlpack::bound::PeriodicHRectBound< t_pow >

Hyper-rectangle bound for an L-metric.

Template parameter t_pow is the metric to use; use 2 for Euclidean (L2).

Definition at line 38 of file periodichrectbound.hpp.

Constructor & Destructor Documentation

template<int t_pow = 2>
mlpack::bound::PeriodicHRectBound< t_pow >::PeriodicHRectBound ( )

Empty constructor.

template<int t_pow = 2>
mlpack::bound::PeriodicHRectBound< t_pow >::PeriodicHRectBound ( arma::vec  box)

Specifies the box size.

The dimensionality is set to the same of the box size, and the bounds are initialized to be empty.

template<int t_pow = 2>
mlpack::bound::PeriodicHRectBound< t_pow >::PeriodicHRectBound ( const PeriodicHRectBound< t_pow > &  other)
template<int t_pow = 2>
mlpack::bound::PeriodicHRectBound< t_pow >::~PeriodicHRectBound ( )

Destructor: clean up memory.

Member Function Documentation

template<int t_pow = 2>
const arma::vec& mlpack::bound::PeriodicHRectBound< t_pow >::Box ( ) const
inline

Returns the box vector.

Definition at line 72 of file periodichrectbound.hpp.

References mlpack::bound::PeriodicHRectBound< t_pow >::box.

template<int t_pow = 2>
void mlpack::bound::PeriodicHRectBound< t_pow >::Centroid ( arma::vec &  centroid) const
template<int t_pow = 2>
void mlpack::bound::PeriodicHRectBound< t_pow >::Clear ( )

Resets all dimensions to the empty set.

template<int t_pow = 2>
bool mlpack::bound::PeriodicHRectBound< t_pow >::Contains ( const arma::vec &  point) const

Determines if a point is within this bound.

template<int t_pow = 2>
size_t mlpack::bound::PeriodicHRectBound< t_pow >::Dim ( ) const
inline

Gets the dimensionality.

Definition at line 80 of file periodichrectbound.hpp.

References mlpack::bound::PeriodicHRectBound< t_pow >::dim.

template<int t_pow = 2>
double mlpack::bound::PeriodicHRectBound< t_pow >::MaxDistance ( const arma::vec &  point) const

Calculates maximum bound-to-point squared distance in the periodic bound case.

template<int t_pow = 2>
double mlpack::bound::PeriodicHRectBound< t_pow >::MaxDistance ( const PeriodicHRectBound< t_pow > &  other) const

Computes maximum bound-to-bound squared distance in the periodic bound case.

template<int t_pow = 2>
double mlpack::bound::PeriodicHRectBound< t_pow >::MinDistance ( const arma::vec &  point) const

Calculates minimum bound-to-point squared distance in the periodic bound case.

template<int t_pow = 2>
double mlpack::bound::PeriodicHRectBound< t_pow >::MinDistance ( const PeriodicHRectBound< t_pow > &  other) const

Calculates minimum bound-to-bound squared distance in the periodic bound case.

Example: bound1.MinDistance(other) for minimum squared distance.

template<int t_pow = 2>
PeriodicHRectBound& mlpack::bound::PeriodicHRectBound< t_pow >::operator= ( const PeriodicHRectBound< t_pow > &  other)
template<int t_pow = 2>
math::Range& mlpack::bound::PeriodicHRectBound< t_pow >::operator[] ( size_t  i)

Sets and gets the range for a particular dimension.

template<int t_pow = 2>
const math::Range mlpack::bound::PeriodicHRectBound< t_pow >::operator[] ( size_t  i) const
template<int t_pow = 2>
PeriodicHRectBound& mlpack::bound::PeriodicHRectBound< t_pow >::operator|= ( const arma::vec &  vector)

Expands this region to include a new point.

template<int t_pow = 2>
PeriodicHRectBound& mlpack::bound::PeriodicHRectBound< t_pow >::operator|= ( const PeriodicHRectBound< t_pow > &  other)

Expands this region to encompass another bound.

template<int t_pow = 2>
math::Range mlpack::bound::PeriodicHRectBound< t_pow >::RangeDistance ( const arma::vec &  point) const

Calculates minimum and maximum bound-to-point squared distance in the periodic bound case.

template<int t_pow = 2>
math::Range mlpack::bound::PeriodicHRectBound< t_pow >::RangeDistance ( const PeriodicHRectBound< t_pow > &  other) const

Calculates minimum and maximum bound-to-bound squared distance in the periodic bound case.

template<int t_pow = 2>
void mlpack::bound::PeriodicHRectBound< t_pow >::SetBoxSize ( arma::vec  box)

Modifies the box to the desired dimenstions.

template<int t_pow = 2>
std::string mlpack::bound::PeriodicHRectBound< t_pow >::ToString ( ) const

Returns a string representation of an object.

Member Data Documentation

template<int t_pow = 2>
math::Range* mlpack::bound::PeriodicHRectBound< t_pow >::bounds
private

Definition at line 155 of file periodichrectbound.hpp.

template<int t_pow = 2>
arma::vec mlpack::bound::PeriodicHRectBound< t_pow >::box
private
template<int t_pow = 2>
size_t mlpack::bound::PeriodicHRectBound< t_pow >::dim
private

The documentation for this class was generated from the following file: