DHrectBound< t_pow > Class Template Reference

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

Collaboration diagram for DHrectBound< t_pow >:
[legend]

List of all members.

Public Member Functions

DHrectBoundAdd (const DHrectBound &other, const Vector &size)
 Expand this bounding box in periodic coordinates, minimizing added volume.
DHrectBoundAdd (const Vector &other, const Vector &size)
 Expand this bounding box to encompass another point.
DHrectBoundAdd (const DHrectBound &other, const Vector &size)
 Expand this bounding box in periodic coordinates, minimizing added volume.
DHrectBoundAdd (const Vector &other, const Vector &size)
 Expand this bounding box to encompass another point.
void AverageBoxesInit (const DHrectBound &box1, const DHrectBound &box2)
 Makes this (uninitialized) box the average of the two arguments, i.e.
void AverageBoxesInit (const DHrectBound &box1, const DHrectBound &box2)
 Makes this (uninitialized) box the average of the two arguments, i.e.
double CalculateMaxDistanceSq () const
 Calculates the maximum distance within the rectangle.
double CalculateMaxDistanceSq () const
 Calculates the maximum distance within the rectangle.
void CalculateMidpoint (Vector *centroid) const
 Calculates the midpoint of the range.
void CalculateMidpoint (Vector *centroid) const
 Calculates the midpoint of the range.
void CalculateMidpointOverwrite (Vector *centroid) const
 Calculates the midpoint of the range.
void CalculateMidpointOverwrite (Vector *centroid) const
 Calculates the midpoint of the range.
bool Contains (const Vector &point, const Vector &box) const
bool Contains (const Vector &point) const
 Determines if a point is within this bound.
bool Contains (const Vector &point, const Vector &box) const
bool Contains (const Vector &point) const
 Determines if a point is within this bound.
index_t dim () const
 Gets the dimensionality.
index_t dim () const
 Gets the dimensionality.
const DRangeget (index_t i) const
 Gets the range for a particular dimension.
const DRangeget (index_t i) const
 Gets the range for a particular dimension.
void Init (index_t dimension)
 Initializes to specified dimensionality with each dimension the empty set.
void Init (index_t dimension)
 Initializes to specified dimensionality with each dimension the empty set.
double MaxDelta (const DHrectBound &other, double box_width, int dim) const
double MaxDelta (const DHrectBound &other, double box_width, int dim) const
double MaxDistanceSq (const DHrectBound &other, const Vector &offset) const
 Computes maximum distance with offset.
double MaxDistanceSq (const DHrectBound &other) const
 Computes maximum distance.
double MaxDistanceSq (const double *point) const
 Calculates maximum bound-to-point squared distance.
double MaxDistanceSq (const Vector &point) const
 Calculates maximum bound-to-point squared distance.
double MaxDistanceSq (const DHrectBound &other, const Vector &offset) const
 Computes maximum distance with offset.
double MaxDistanceSq (const DHrectBound &other) const
 Computes maximum distance.
double MaxDistanceSq (const double *point) const
 Calculates maximum bound-to-point squared distance.
double MaxDistanceSq (const Vector &point) const
 Calculates maximum bound-to-point squared distance.
double MidDistanceSq (const DHrectBound &other) const
 Calculates midpoint-to-midpoint bounding box distance.
double MidDistanceSq (const DHrectBound &other) const
 Calculates midpoint-to-midpoint bounding box distance.
double MinDelta (const DHrectBound &other, double box_width, int dim) const
double MinDelta (const DHrectBound &other, double box_width, int dim) const
double MinDistanceSq (const DHrectBound &other) const
 Calculates minimum bound-to-bound squared distance.
double MinDistanceSq (const Vector &point) const
 Calculates minimum bound-to-point squared distance.
double MinDistanceSq (const DHrectBound &other, const Vector &offset) const
 Calcualtes minimum bound-to-bound squared distance, with an offset between their respective coordinate systems.
double MinDistanceSq (const double *mpoint) const
 Calculates minimum bound-to-point squared distance.
double MinDistanceSq (const DHrectBound &other) const
 Calculates minimum bound-to-bound squared distance.
double MinDistanceSq (const Vector &point) const
 Calculates minimum bound-to-point squared distance.
double MinDistanceSq (const DHrectBound &other, const Vector &offset) const
 Calcualtes minimum bound-to-bound squared distance, with an offset between their respective coordinate systems.
double MinDistanceSq (const double *mpoint) const
 Calculates minimum bound-to-point squared distance.
double MinimaxDistanceSq (const DHrectBound &other) const
 Computes minimax distance, where the other node is trying to avoid me.
double MinimaxDistanceSq (const DHrectBound &other) const
 Computes minimax distance, where the other node is trying to avoid me.
double MinToMidSq (const DHrectBound &other) const
 Calculates closest-to-their-midpoint bounding box distance, i.e.
double MinToMidSq (const DHrectBound &other) const
 Calculates closest-to-their-midpoint bounding box distance, i.e.
DHrectBoundoperator|= (const DHrectBound &other)
 Expands this region to encompass another bound.
DHrectBoundoperator|= (const Vector &vector)
 Expands this region to include a new point.
DHrectBoundoperator|= (const DHrectBound &other)
 Expands this region to encompass another bound.
DHrectBoundoperator|= (const Vector &vector)
 Expands this region to include a new point.
double PeriodicMaxDistanceSq (const Vector &point, const Vector &box_size) const
double PeriodicMaxDistanceSq (const DHrectBound &other, const Vector &box_size) const
 Computes maximum distance between boxes in periodic coordinate system.
double PeriodicMaxDistanceSq (const Vector &point, const Vector &box_size) const
double PeriodicMaxDistanceSq (const DHrectBound &other, const Vector &box_size) const
 Computes maximum distance between boxes in periodic coordinate system.
double PeriodicMinDistanceSq (const Vector &point, const Vector &box_size) const
double PeriodicMinDistanceSq (const DHrectBound &other, const Vector &box_size) const
 Computes minimum distance between boxes in periodic coordinate system.
double PeriodicMinDistanceSq (const Vector &point, const Vector &box_size) const
double PeriodicMinDistanceSq (const DHrectBound &other, const Vector &box_size) const
 Computes minimum distance between boxes in periodic coordinate system.
DRange RangeDistanceSq (const Vector &point) const
 Calculates minimum and maximum bound-to-point squared distance.
DRange RangeDistanceSq (const DHrectBound &other) const
 Calculates minimum and maximum bound-to-bound squared distance.
DRange RangeDistanceSq (const Vector &point) const
 Calculates minimum and maximum bound-to-point squared distance.
DRange RangeDistanceSq (const DHrectBound &other) const
 Calculates minimum and maximum bound-to-bound squared distance.
void Reset ()
 Resets all dimensions to the empty set.
void Reset ()
 Resets all dimensions to the empty set.

Static Public Attributes

static const int PREFERRED_POWER = t_pow

Detailed Description

template<int t_pow = 2>
class DHrectBound< 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 57 of file bounds.h.


Member Function Documentation

template<int t_pow = 2>
DHrectBound& DHrectBound< t_pow >::Add ( const DHrectBound< t_pow > &  other,
const Vector size 
) [inline]

Expand this bounding box in periodic coordinates, minimizing added volume.

Definition at line 674 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
DHrectBound& DHrectBound< t_pow >::Add ( const Vector other,
const Vector size 
) [inline]

Expand this bounding box to encompass another point.

Done to minimize added volume in periodic coordinates.

Definition at line 644 of file bounds.h.

References DRange::hi, GenVector< T >::length(), and DRange::lo.

template<int t_pow = 2>
DHrectBound& DHrectBound< t_pow >::Add ( const DHrectBound< t_pow > &  other,
const Vector size 
) [inline]

Expand this bounding box in periodic coordinates, minimizing added volume.

Definition at line 674 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
DHrectBound& DHrectBound< t_pow >::Add ( const Vector other,
const Vector size 
) [inline]

Expand this bounding box to encompass another point.

Done to minimize added volume in periodic coordinates.

Definition at line 644 of file bounds.h.

References DRange::hi, GenVector< T >::length(), and DRange::lo.

template<int t_pow = 2>
void DHrectBound< t_pow >::AverageBoxesInit ( const DHrectBound< t_pow > &  box1,
const DHrectBound< t_pow > &  box2 
) [inline]

Makes this (uninitialized) box the average of the two arguments, i.e.

the max and min of each range is the average of the maxes and mins of the arguments.

Added by: Bill March, 5/7

Definition at line 90 of file bounds.h.

References DHrectBound< t_pow >::dim(), DHrectBound< t_pow >::get(), and DHrectBound< t_pow >::Init().

template<int t_pow = 2>
void DHrectBound< t_pow >::AverageBoxesInit ( const DHrectBound< t_pow > &  box1,
const DHrectBound< t_pow > &  box2 
) [inline]

Makes this (uninitialized) box the average of the two arguments, i.e.

the max and min of each range is the average of the maxes and mins of the arguments.

Added by: Bill March, 5/7

Definition at line 90 of file bounds.h.

References DHrectBound< t_pow >::dim(), DHrectBound< t_pow >::get(), and DHrectBound< t_pow >::Init().

template<int t_pow = 2>
double DHrectBound< t_pow >::CalculateMaxDistanceSq (  )  const [inline]

Calculates the maximum distance within the rectangle.

Definition at line 161 of file bounds.h.

References math::Sqr().

template<int t_pow = 2>
double DHrectBound< t_pow >::CalculateMaxDistanceSq (  )  const [inline]

Calculates the maximum distance within the rectangle.

Definition at line 161 of file bounds.h.

References math::Sqr().

template<int t_pow = 2>
void DHrectBound< t_pow >::CalculateMidpoint ( Vector centroid  )  const [inline]

Calculates the midpoint of the range.

Definition at line 170 of file bounds.h.

References GenVector< T >::Init(), and DRange::mid().

template<int t_pow = 2>
void DHrectBound< t_pow >::CalculateMidpoint ( Vector centroid  )  const [inline]

Calculates the midpoint of the range.

Definition at line 170 of file bounds.h.

References GenVector< T >::Init(), and DRange::mid().

template<int t_pow = 2>
void DHrectBound< t_pow >::CalculateMidpointOverwrite ( Vector centroid  )  const [inline]

Calculates the midpoint of the range.

Definition at line 177 of file bounds.h.

References DRange::mid().

template<int t_pow = 2>
void DHrectBound< t_pow >::CalculateMidpointOverwrite ( Vector centroid  )  const [inline]

Calculates the midpoint of the range.

Definition at line 177 of file bounds.h.

References DRange::mid().

template<int t_pow = 2>
bool DHrectBound< t_pow >::Contains ( const Vector point  )  const [inline]

Determines if a point is within this bound.

Definition at line 120 of file bounds.h.

References DHrectBound< t_pow >::Contains(), and GenVector< T >::length().

template<int t_pow = 2>
bool DHrectBound< t_pow >::Contains ( const Vector point  )  const [inline]

Determines if a point is within this bound.

Definition at line 120 of file bounds.h.

References GenVector< T >::length().

Referenced by DHrectBound< t_pow >::Contains().

template<int t_pow = 2>
index_t DHrectBound< t_pow >::dim (  )  const [inline]

Gets the dimensionality.

Definition at line 146 of file bounds.h.

template<int t_pow = 2>
index_t DHrectBound< t_pow >::dim (  )  const [inline]

Gets the dimensionality.

Definition at line 146 of file bounds.h.

Referenced by DHrectBound< t_pow >::AverageBoxesInit().

template<int t_pow = 2>
const DRange& DHrectBound< t_pow >::get ( index_t  i  )  const [inline]

Gets the range for a particular dimension.

Definition at line 153 of file bounds.h.

template<int t_pow = 2>
const DRange& DHrectBound< t_pow >::get ( index_t  i  )  const [inline]

Gets the range for a particular dimension.

Definition at line 153 of file bounds.h.

Referenced by DHrectBound< t_pow >::AverageBoxesInit(), DatasetScaler::ScaleDataByMinMax(), and DatasetScaler::TranslateDataByMin().

template<int t_pow = 2>
void DHrectBound< t_pow >::Init ( index_t  dimension  )  [inline]

Initializes to specified dimensionality with each dimension the empty set.

Definition at line 75 of file bounds.h.

References DHrectBound< t_pow >::Reset().

template<int t_pow = 2>
void DHrectBound< t_pow >::Init ( index_t  dimension  )  [inline]

Initializes to specified dimensionality with each dimension the empty set.

Definition at line 75 of file bounds.h.

References DHrectBound< t_pow >::Reset().

Referenced by DHrectBound< t_pow >::AverageBoxesInit(), DatasetScaler::ScaleDataByMinMax(), and DatasetScaler::TranslateDataByMin().

template<int t_pow = 2>
double DHrectBound< t_pow >::MaxDistanceSq ( const DHrectBound< t_pow > &  other,
const Vector offset 
) const [inline]

Computes maximum distance with offset.

Definition at line 321 of file bounds.h.

template<int t_pow = 2>
double DHrectBound< t_pow >::MaxDistanceSq ( const DHrectBound< t_pow > &  other  )  const [inline]

Computes maximum distance.

Definition at line 303 of file bounds.h.

template<int t_pow = 2>
double DHrectBound< t_pow >::MaxDistanceSq ( const double *  point  )  const [inline]

Calculates maximum bound-to-point squared distance.

Definition at line 289 of file bounds.h.

template<int t_pow = 2>
double DHrectBound< t_pow >::MaxDistanceSq ( const Vector point  )  const [inline]

Calculates maximum bound-to-point squared distance.

Definition at line 273 of file bounds.h.

References GenVector< T >::length().

template<int t_pow = 2>
double DHrectBound< t_pow >::MaxDistanceSq ( const DHrectBound< t_pow > &  other,
const Vector offset 
) const [inline]

Computes maximum distance with offset.

Definition at line 321 of file bounds.h.

template<int t_pow = 2>
double DHrectBound< t_pow >::MaxDistanceSq ( const DHrectBound< t_pow > &  other  )  const [inline]

Computes maximum distance.

Definition at line 303 of file bounds.h.

template<int t_pow = 2>
double DHrectBound< t_pow >::MaxDistanceSq ( const double *  point  )  const [inline]

Calculates maximum bound-to-point squared distance.

Definition at line 289 of file bounds.h.

template<int t_pow = 2>
double DHrectBound< t_pow >::MaxDistanceSq ( const Vector point  )  const [inline]

Calculates maximum bound-to-point squared distance.

Definition at line 273 of file bounds.h.

References GenVector< T >::length().

template<int t_pow = 2>
double DHrectBound< t_pow >::MidDistanceSq ( const DHrectBound< t_pow > &  other  )  const [inline]

Calculates midpoint-to-midpoint bounding box distance.

Definition at line 599 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
double DHrectBound< t_pow >::MidDistanceSq ( const DHrectBound< t_pow > &  other  )  const [inline]

Calculates midpoint-to-midpoint bounding box distance.

Definition at line 599 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
double DHrectBound< t_pow >::MinDistanceSq ( const DHrectBound< t_pow > &  other  )  const [inline]

Calculates minimum bound-to-bound squared distance.

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

Definition at line 247 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
double DHrectBound< t_pow >::MinDistanceSq ( const Vector point  )  const [inline]

Calculates minimum bound-to-point squared distance.

Definition at line 237 of file bounds.h.

References GenVector< T >::length(), DHrectBound< t_pow >::MinDistanceSq(), and GenVector< T >::ptr().

template<int t_pow = 2>
double DHrectBound< t_pow >::MinDistanceSq ( const DHrectBound< t_pow > &  other,
const Vector offset 
) const [inline]

Calcualtes minimum bound-to-bound squared distance, with an offset between their respective coordinate systems.

Definition at line 213 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
double DHrectBound< t_pow >::MinDistanceSq ( const double *  mpoint  )  const [inline]

Calculates minimum bound-to-point squared distance.

Definition at line 187 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
double DHrectBound< t_pow >::MinDistanceSq ( const DHrectBound< t_pow > &  other  )  const [inline]

Calculates minimum bound-to-bound squared distance.

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

Definition at line 247 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
double DHrectBound< t_pow >::MinDistanceSq ( const Vector point  )  const [inline]

Calculates minimum bound-to-point squared distance.

Definition at line 237 of file bounds.h.

References GenVector< T >::length(), DHrectBound< t_pow >::MinDistanceSq(), and GenVector< T >::ptr().

template<int t_pow = 2>
double DHrectBound< t_pow >::MinDistanceSq ( const DHrectBound< t_pow > &  other,
const Vector offset 
) const [inline]

Calcualtes minimum bound-to-bound squared distance, with an offset between their respective coordinate systems.

Definition at line 213 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
double DHrectBound< t_pow >::MinDistanceSq ( const double *  mpoint  )  const [inline]

Calculates minimum bound-to-point squared distance.

Definition at line 187 of file bounds.h.

References DRange::hi, and DRange::lo.

Referenced by DHrectBound< t_pow >::MinDistanceSq().

template<int t_pow = 2>
double DHrectBound< t_pow >::MinimaxDistanceSq ( const DHrectBound< t_pow > &  other  )  const [inline]

Computes minimax distance, where the other node is trying to avoid me.

Definition at line 577 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
double DHrectBound< t_pow >::MinimaxDistanceSq ( const DHrectBound< t_pow > &  other  )  const [inline]

Computes minimax distance, where the other node is trying to avoid me.

Definition at line 577 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
double DHrectBound< t_pow >::MinToMidSq ( const DHrectBound< t_pow > &  other  )  const [inline]

Calculates closest-to-their-midpoint bounding box distance, i.e.

calculates their midpoint and finds the minimum box-to-point distance.

Equivalent to: other.CalcMidpoint(&other_midpoint) return MinDistanceSqToPoint(other_midpoint)

Definition at line 551 of file bounds.h.

References DRange::hi, DRange::lo, and DRange::mid().

template<int t_pow = 2>
double DHrectBound< t_pow >::MinToMidSq ( const DHrectBound< t_pow > &  other  )  const [inline]

Calculates closest-to-their-midpoint bounding box distance, i.e.

calculates their midpoint and finds the minimum box-to-point distance.

Equivalent to: other.CalcMidpoint(&other_midpoint) return MinDistanceSqToPoint(other_midpoint)

Definition at line 551 of file bounds.h.

References DRange::hi, DRange::lo, and DRange::mid().

template<int t_pow = 2>
DHrectBound& DHrectBound< t_pow >::operator|= ( const DHrectBound< t_pow > &  other  )  [inline]

Expands this region to encompass another bound.

Definition at line 629 of file bounds.h.

template<int t_pow = 2>
DHrectBound& DHrectBound< t_pow >::operator|= ( const Vector vector  )  [inline]

Expands this region to include a new point.

Definition at line 616 of file bounds.h.

References GenVector< T >::length().

template<int t_pow = 2>
DHrectBound& DHrectBound< t_pow >::operator|= ( const DHrectBound< t_pow > &  other  )  [inline]

Expands this region to encompass another bound.

Definition at line 629 of file bounds.h.

template<int t_pow = 2>
DHrectBound& DHrectBound< t_pow >::operator|= ( const Vector vector  )  [inline]

Expands this region to include a new point.

Definition at line 616 of file bounds.h.

References GenVector< T >::length().

template<int t_pow = 2>
double DHrectBound< t_pow >::PeriodicMaxDistanceSq ( const DHrectBound< t_pow > &  other,
const Vector box_size 
) const [inline]

Computes maximum distance between boxes in periodic coordinate system.

Definition at line 393 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
double DHrectBound< t_pow >::PeriodicMaxDistanceSq ( const DHrectBound< t_pow > &  other,
const Vector box_size 
) const [inline]

Computes maximum distance between boxes in periodic coordinate system.

Definition at line 393 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
double DHrectBound< t_pow >::PeriodicMinDistanceSq ( const DHrectBound< t_pow > &  other,
const Vector box_size 
) const [inline]

Computes minimum distance between boxes in periodic coordinate system.

Definition at line 341 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
double DHrectBound< t_pow >::PeriodicMinDistanceSq ( const DHrectBound< t_pow > &  other,
const Vector box_size 
) const [inline]

Computes minimum distance between boxes in periodic coordinate system.

Definition at line 341 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
DRange DHrectBound< t_pow >::RangeDistanceSq ( const Vector point  )  const [inline]

Calculates minimum and maximum bound-to-point squared distance.

Definition at line 515 of file bounds.h.

References DRange::hi, GenVector< T >::length(), DRange::lo, and GenVector< T >::ptr().

template<int t_pow = 2>
DRange DHrectBound< t_pow >::RangeDistanceSq ( const DHrectBound< t_pow > &  other  )  const [inline]

Calculates minimum and maximum bound-to-bound squared distance.

Definition at line 486 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
DRange DHrectBound< t_pow >::RangeDistanceSq ( const Vector point  )  const [inline]

Calculates minimum and maximum bound-to-point squared distance.

Definition at line 515 of file bounds.h.

References DRange::hi, GenVector< T >::length(), DRange::lo, and GenVector< T >::ptr().

template<int t_pow = 2>
DRange DHrectBound< t_pow >::RangeDistanceSq ( const DHrectBound< t_pow > &  other  )  const [inline]

Calculates minimum and maximum bound-to-bound squared distance.

Definition at line 486 of file bounds.h.

References DRange::hi, and DRange::lo.

template<int t_pow = 2>
void DHrectBound< t_pow >::Reset (  )  [inline]

Resets all dimensions to the empty set.

Definition at line 111 of file bounds.h.

References DRange::InitEmptySet().

template<int t_pow = 2>
void DHrectBound< t_pow >::Reset (  )  [inline]

Resets all dimensions to the empty set.

Definition at line 111 of file bounds.h.

References DRange::InitEmptySet().

Referenced by DHrectBound< t_pow >::Init().


The documentation for this class was generated from the following files:
Generated on Mon Jan 24 12:04:40 2011 for FASTlib by  doxygen 1.6.3