DRange Struct Reference

Simple real-valued range. More...

List of all members.

Public Member Functions

bool Contains (double d) const
 Determines if a point is contained within the range.
bool Contains (double d) const
 Determines if a point is contained within the range.
 DRange (double lo_in, double hi_in)
 Initializes to specified values.
 DRange (double lo_in, double hi_in)
 Initializes to specified values.
 EXPAND_EQUALS (DRange)
 EXPAND_EQUALS (DRange)
 EXPAND_HETERO_LESS_THAN (double, DRange)
 EXPAND_HETERO_LESS_THAN (DRange, double)
 EXPAND_HETERO_LESS_THAN (double, DRange)
 EXPAND_HETERO_LESS_THAN (DRange, double)
 EXPAND_LESS_THAN (DRange)
 EXPAND_LESS_THAN (DRange)
void Init (double lo_in, double hi_in)
 Initializes to a range of values.
void Init (double lo_in, double hi_in)
 Initializes to a range of values.
void InitEmptySet ()
 Initialize to an empty set, where lo > hi.
void InitEmptySet ()
 Initialize to an empty set, where lo > hi.
void InitUniversalSet ()
 Initializes to -infinity to infinity.
void InitUniversalSet ()
 Initializes to -infinity to infinity.
double interpolate (double factor) const
 Interpolates (factor) * hi + (1 - factor) * lo.
double interpolate (double factor) const
 Interpolates (factor) * hi + (1 - factor) * lo.
void MaxWith (double v)
 Takes the maximum of upper and lower bounds independently.
void MaxWith (const DRange &range)
 Takes the maximum of upper and lower bounds independently.
void MaxWith (double v)
 Takes the maximum of upper and lower bounds independently.
void MaxWith (const DRange &range)
 Takes the maximum of upper and lower bounds independently.
double mid () const
 Gets the midpoint of this range.
double mid () const
 Gets the midpoint of this range.
void MinWith (double v)
 Takes the minimum of upper and lower bounds independently.
void MinWith (const DRange &range)
 Takes the minimum of upper and lower bounds independently.
void MinWith (double v)
 Takes the minimum of upper and lower bounds independently.
void MinWith (const DRange &range)
 Takes the minimum of upper and lower bounds independently.
 OBJECT_TRAVERSAL (DRange)
 OBJECT_TRAVERSAL (DRange)
const DRangeoperator&= (const DRange &other)
 Shrinks range to be the overlap with another range, becoming an empty set if there is no overlap.
const DRangeoperator&= (double d)
 Sets this range to include only the specified value, or becomes an empty set if the range does not contain the number.
const DRangeoperator&= (const DRange &other)
 Shrinks range to be the overlap with another range, becoming an empty set if there is no overlap.
const DRangeoperator&= (double d)
 Sets this range to include only the specified value, or becomes an empty set if the range does not contain the number.
const DRangeoperator*= (double d)
 Scales upper and lower bounds.
const DRangeoperator*= (double d)
 Scales upper and lower bounds.
const DRangeoperator+= (double d)
 Adds to the upper and lower independently.
const DRangeoperator+= (const DRange &other)
 Sums the upper and lower independently.
const DRangeoperator+= (double d)
 Adds to the upper and lower independently.
const DRangeoperator+= (const DRange &other)
 Sums the upper and lower independently.
const DRangeoperator-= (double d)
 Subtracts from the upper and lower independently.
const DRangeoperator-= (const DRange &other)
 Subtracts from the upper and lower.
const DRangeoperator-= (double d)
 Subtracts from the upper and lower independently.
const DRangeoperator-= (const DRange &other)
 Subtracts from the upper and lower.
const DRangeoperator|= (const DRange &other)
 Expands range to include the other range.
const DRangeoperator|= (double d)
 Simulate an union by growing the range if necessary.
const DRangeoperator|= (const DRange &other)
 Expands range to include the other range.
const DRangeoperator|= (double d)
 Simulate an union by growing the range if necessary.
void Reset (double lo_in, double hi_in)
 Resets to a range of values.
void Reset (double lo_in, double hi_in)
 Resets to a range of values.
double width () const
 Gets the span of the range, hi - lo.
double width () const
 Gets the span of the range, hi - lo.

Public Attributes

double hi
 The upper bound.
double lo
 The lower bound.

Friends

DRange operator* (double d, const DRange &r)
 Scales upper and lower bounds.
DRange operator* (const DRange &r, double d)
 Scales upper and lower bounds.
DRange operator* (double d, const DRange &r)
 Scales upper and lower bounds.
DRange operator* (const DRange &r, double d)
 Scales upper and lower bounds.
DRange operator+ (const DRange &a, double b)
DRange operator+ (const DRange &a, const DRange &b)
DRange operator+ (const DRange &a, double b)
DRange operator+ (const DRange &a, const DRange &b)
DRange operator- (const DRange &a, double b)
DRange operator- (const DRange &a, const DRange &b)
DRange operator- (const DRange &r)
 Scales upper and lower bounds.
DRange operator- (const DRange &a, double b)
DRange operator- (const DRange &a, const DRange &b)
DRange operator- (const DRange &r)
 Scales upper and lower bounds.
bool operator< (double a, const DRange &b)
 Compares if a value is STRICTLY less than this range.
bool operator< (const DRange &a, double b)
 Compares if this is STRICTLY less than a value.
bool operator< (const DRange &a, const DRange &b)
 Compares if this is STRICTLY less than another range.
bool operator< (double a, const DRange &b)
 Compares if a value is STRICTLY less than this range.
bool operator< (const DRange &a, double b)
 Compares if this is STRICTLY less than a value.
bool operator< (const DRange &a, const DRange &b)
 Compares if this is STRICTLY less than another range.
bool operator== (const DRange &a, const DRange &b)
 Compares if this is STRICTLY equal to another range.
bool operator== (const DRange &a, const DRange &b)
 Compares if this is STRICTLY equal to another range.

Detailed Description

Simple real-valued range.

EXPERIMENTAL FEATURE.

Definition at line 244 of file math_lib.h.


Constructor & Destructor Documentation

DRange::DRange ( double  lo_in,
double  hi_in 
) [inline]

Initializes to specified values.

Definition at line 262 of file math_lib.h.

DRange::DRange ( double  lo_in,
double  hi_in 
) [inline]

Initializes to specified values.

Definition at line 262 of file math_lib.h.


Member Function Documentation

bool DRange::Contains ( double  d  )  const [inline]

Determines if a point is contained within the range.

Definition at line 535 of file math_lib.h.

References hi, and lo.

bool DRange::Contains ( double  d  )  const [inline]

Determines if a point is contained within the range.

Definition at line 535 of file math_lib.h.

References hi.

void DRange::Init ( double  lo_in,
double  hi_in 
) [inline]

Initializes to a range of values.

Definition at line 279 of file math_lib.h.

References hi, and lo.

void DRange::Init ( double  lo_in,
double  hi_in 
) [inline]

Initializes to a range of values.

Definition at line 279 of file math_lib.h.

References hi.

void DRange::InitEmptySet (  )  [inline]

Initialize to an empty set, where lo > hi.

Definition at line 267 of file math_lib.h.

References hi, and lo.

void DRange::InitEmptySet (  )  [inline]

Initialize to an empty set, where lo > hi.

Definition at line 267 of file math_lib.h.

References hi.

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

void DRange::InitUniversalSet (  )  [inline]

Initializes to -infinity to infinity.

Definition at line 273 of file math_lib.h.

References hi, and lo.

void DRange::InitUniversalSet (  )  [inline]

Initializes to -infinity to infinity.

Definition at line 273 of file math_lib.h.

References hi.

double DRange::interpolate ( double  factor  )  const [inline]

Interpolates (factor) * hi + (1 - factor) * lo.

Definition at line 312 of file math_lib.h.

References lo, and width().

double DRange::interpolate ( double  factor  )  const [inline]

Interpolates (factor) * hi + (1 - factor) * lo.

Definition at line 312 of file math_lib.h.

References width().

void DRange::MaxWith ( double  v  )  [inline]

Takes the maximum of upper and lower bounds independently.

Definition at line 481 of file math_lib.h.

References hi, and lo.

void DRange::MaxWith ( const DRange range  )  [inline]

Takes the maximum of upper and lower bounds independently.

Definition at line 457 of file math_lib.h.

References hi, and lo.

void DRange::MaxWith ( double  v  )  [inline]

Takes the maximum of upper and lower bounds independently.

Definition at line 481 of file math_lib.h.

References hi.

void DRange::MaxWith ( const DRange range  )  [inline]

Takes the maximum of upper and lower bounds independently.

Definition at line 457 of file math_lib.h.

References hi, and lo.

double DRange::mid (  )  const [inline]

Gets the midpoint of this range.

Definition at line 305 of file math_lib.h.

References hi, and lo.

double DRange::mid (  )  const [inline]

Gets the midpoint of this range.

Definition at line 305 of file math_lib.h.

References hi.

Referenced by DHrectBound< t_pow >::CalculateMidpoint(), DHrectBound< t_pow >::CalculateMidpointOverwrite(), and DHrectBound< t_pow >::MinToMidSq().

void DRange::MinWith ( double  v  )  [inline]

Takes the minimum of upper and lower bounds independently.

Definition at line 493 of file math_lib.h.

References hi, and lo.

void DRange::MinWith ( const DRange range  )  [inline]

Takes the minimum of upper and lower bounds independently.

Definition at line 469 of file math_lib.h.

References hi, and lo.

void DRange::MinWith ( double  v  )  [inline]

Takes the minimum of upper and lower bounds independently.

Definition at line 493 of file math_lib.h.

References hi.

void DRange::MinWith ( const DRange range  )  [inline]

Takes the minimum of upper and lower bounds independently.

Definition at line 469 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator&= ( const DRange other  )  [inline]

Shrinks range to be the overlap with another range, becoming an empty set if there is no overlap.

Definition at line 360 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator&= ( double  d  )  [inline]

Sets this range to include only the specified value, or becomes an empty set if the range does not contain the number.

Definition at line 333 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator&= ( const DRange other  )  [inline]

Shrinks range to be the overlap with another range, becoming an empty set if there is no overlap.

Definition at line 360 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator&= ( double  d  )  [inline]

Sets this range to include only the specified value, or becomes an empty set if the range does not contain the number.

Definition at line 333 of file math_lib.h.

References hi.

const DRange& DRange::operator*= ( double  d  )  [inline]

Scales upper and lower bounds.

Definition at line 376 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator*= ( double  d  )  [inline]

Scales upper and lower bounds.

Definition at line 376 of file math_lib.h.

References hi.

const DRange& DRange::operator+= ( double  d  )  [inline]

Adds to the upper and lower independently.

Definition at line 413 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator+= ( const DRange other  )  [inline]

Sums the upper and lower independently.

Definition at line 396 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator+= ( double  d  )  [inline]

Adds to the upper and lower independently.

Definition at line 413 of file math_lib.h.

References hi.

const DRange& DRange::operator+= ( const DRange other  )  [inline]

Sums the upper and lower independently.

Definition at line 396 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator-= ( double  d  )  [inline]

Subtracts from the upper and lower independently.

Definition at line 420 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator-= ( const DRange other  )  [inline]

Subtracts from the upper and lower.

THIS SWAPS THE ORDER OF HI AND LO, assuming a worst case result. This is NOT an undo of the + operator.

Definition at line 406 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator-= ( double  d  )  [inline]

Subtracts from the upper and lower independently.

Definition at line 420 of file math_lib.h.

References hi.

const DRange& DRange::operator-= ( const DRange other  )  [inline]

Subtracts from the upper and lower.

THIS SWAPS THE ORDER OF HI AND LO, assuming a worst case result. This is NOT an undo of the + operator.

Definition at line 406 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator|= ( const DRange other  )  [inline]

Expands range to include the other range.

Definition at line 346 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator|= ( double  d  )  [inline]

Simulate an union by growing the range if necessary.

Definition at line 319 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator|= ( const DRange other  )  [inline]

Expands range to include the other range.

Definition at line 346 of file math_lib.h.

References hi, and lo.

const DRange& DRange::operator|= ( double  d  )  [inline]

Simulate an union by growing the range if necessary.

Definition at line 319 of file math_lib.h.

References hi.

void DRange::Reset ( double  lo_in,
double  hi_in 
) [inline]

Resets to a range of values.

Since there is no dynamic memory this is the same as Init, but calling Reset instead of Init probably looks more similar to surrounding code.

Definition at line 290 of file math_lib.h.

References hi, and lo.

void DRange::Reset ( double  lo_in,
double  hi_in 
) [inline]

Resets to a range of values.

Since there is no dynamic memory this is the same as Init, but calling Reset instead of Init probably looks more similar to surrounding code.

Definition at line 290 of file math_lib.h.

References hi.

double DRange::width (  )  const [inline]

Gets the span of the range, hi - lo.

Definition at line 298 of file math_lib.h.

References hi, and lo.

double DRange::width (  )  const [inline]

Gets the span of the range, hi - lo.

Definition at line 298 of file math_lib.h.

References hi.

Referenced by interpolate().


Friends And Related Function Documentation

DRange operator* ( double  d,
const DRange r 
) [friend]

Scales upper and lower bounds.

Definition at line 390 of file math_lib.h.

DRange operator* ( const DRange r,
double  d 
) [friend]

Scales upper and lower bounds.

Definition at line 384 of file math_lib.h.

DRange operator* ( double  d,
const DRange r 
) [friend]

Scales upper and lower bounds.

Definition at line 390 of file math_lib.h.

DRange operator* ( const DRange r,
double  d 
) [friend]

Scales upper and lower bounds.

Definition at line 384 of file math_lib.h.

DRange operator- ( const DRange r  )  [friend]

Scales upper and lower bounds.

Definition at line 371 of file math_lib.h.

DRange operator- ( const DRange r  )  [friend]

Scales upper and lower bounds.

Definition at line 371 of file math_lib.h.

bool operator< ( double  a,
const DRange b 
) [friend]

Compares if a value is STRICTLY less than this range.

Definition at line 527 of file math_lib.h.

bool operator< ( const DRange a,
double  b 
) [friend]

Compares if this is STRICTLY less than a value.

Definition at line 520 of file math_lib.h.

bool operator< ( const DRange a,
const DRange b 
) [friend]

Compares if this is STRICTLY less than another range.

Definition at line 505 of file math_lib.h.

bool operator< ( double  a,
const DRange b 
) [friend]

Compares if a value is STRICTLY less than this range.

Definition at line 527 of file math_lib.h.

bool operator< ( const DRange a,
double  b 
) [friend]

Compares if this is STRICTLY less than a value.

Definition at line 520 of file math_lib.h.

bool operator< ( const DRange a,
const DRange b 
) [friend]

Compares if this is STRICTLY less than another range.

Definition at line 505 of file math_lib.h.

bool operator== ( const DRange a,
const DRange b 
) [friend]

Compares if this is STRICTLY equal to another range.

Definition at line 512 of file math_lib.h.

bool operator== ( const DRange a,
const DRange b 
) [friend]

Compares if this is STRICTLY equal to another range.

Definition at line 512 of file math_lib.h.


Member Data Documentation

double DRange::hi
double DRange::lo

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