Hyper-rectangle bound for an L-metric. More...
Public Member Functions | |
DHrectBound & | Add (const DHrectBound &other, const Vector &size) |
Expand this bounding box in periodic coordinates, minimizing added volume. | |
DHrectBound & | Add (const Vector &other, const Vector &size) |
Expand this bounding box to encompass another point. | |
DHrectBound & | Add (const DHrectBound &other, const Vector &size) |
Expand this bounding box in periodic coordinates, minimizing added volume. | |
DHrectBound & | Add (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 DRange & | get (index_t i) const |
Gets the range for a particular dimension. | |
const DRange & | get (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. | |
DHrectBound & | operator|= (const DHrectBound &other) |
Expands this region to encompass another bound. | |
DHrectBound & | operator|= (const Vector &vector) |
Expands this region to include a new point. | |
DHrectBound & | operator|= (const DHrectBound &other) |
Expands this region to encompass another bound. | |
DHrectBound & | operator|= (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 |
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.
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.
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.
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.
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.
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().
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().
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().
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().
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().
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().
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().
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().
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().
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().
index_t DHrectBound< t_pow >::dim | ( | ) | const [inline] |
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().
const DRange& DHrectBound< t_pow >::get | ( | index_t | i | ) | const [inline] |
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().
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().
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().
double DHrectBound< t_pow >::MaxDistanceSq | ( | const DHrectBound< t_pow > & | other, | |
const Vector & | offset | |||
) | const [inline] |
double DHrectBound< t_pow >::MaxDistanceSq | ( | const DHrectBound< t_pow > & | other | ) | const [inline] |
double DHrectBound< t_pow >::MaxDistanceSq | ( | const double * | point | ) | const [inline] |
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().
double DHrectBound< t_pow >::MaxDistanceSq | ( | const DHrectBound< t_pow > & | other, | |
const Vector & | offset | |||
) | const [inline] |
double DHrectBound< t_pow >::MaxDistanceSq | ( | const DHrectBound< t_pow > & | other | ) | const [inline] |
double DHrectBound< t_pow >::MaxDistanceSq | ( | const double * | point | ) | const [inline] |
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().
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.
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.
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.
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().
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.
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.
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.
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().
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.
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().
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.
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.
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().
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().
DHrectBound& DHrectBound< t_pow >::operator|= | ( | const DHrectBound< t_pow > & | other | ) | [inline] |
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().
DHrectBound& DHrectBound< t_pow >::operator|= | ( | const DHrectBound< t_pow > & | other | ) | [inline] |
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().
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.
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.
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.
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.
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().
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.
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().
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.
void DHrectBound< t_pow >::Reset | ( | ) | [inline] |
Resets all dimensions to the empty set.
Definition at line 111 of file bounds.h.
References DRange::InitEmptySet().
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().