Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Range Class Reference

to specify 1-dim region or range by two floats More...

#include <Range.h>

List of all members.

Public Member Functions

virtual float center (void) const
 returns center.
virtual float center (void) const
 returns center.
virtual int dump (void) const
 displays debug information.
virtual int dump (void) const
 displays debug information.
virtual float high (float highIn)
 sets higher limit.
virtual float high (void) const
 returns higher limit.
virtual float high (float highIn)
 sets higher limit.
virtual float high (void) const
 returns higher limit.
virtual float low (float lowIn)
 sets lower limit.
virtual float low (void) const
 returns lower limit.
virtual float low (float lowIn)
 sets lower limit.
virtual float low (void) const
 returns lower limit.
bool operator & (const Range &) const
 returns true if two are overlaped each other.
bool operator & (const Range &) const
 returns true if two are overlaped each other.
bool operator!= (const Range &) const
 returns true if range is different.
bool operator!= (const Range &) const
 returns true if range is different.
Rangeoperator= (const Range &)
 Copy operator.
Rangeoperator= (const Range &)
 Copy operator.
bool operator== (const Range &) const
 returns true if range is the same.
bool operator== (const Range &) const
 returns true if range is the same.
 Range (float low, float high)
 Constructor.
 Range (const Range &)
 Copy constructor.
 Range ()
 Constructor.
 Range (float low, float high)
 Constructor.
 Range (const Range &)
 Copy constructor.
 Range ()
 Constructor.
virtual Rangeset (float low, float high)
 sets range.
virtual Rangeset (float low, float high)
 sets range.
virtual RangesetByCenter (float center, float width)
 sets range by center and width.
virtual RangesetByCenter (float center, float width)
 sets range by center and width.
virtual float width (void) const
 returns width.
virtual float width (void) const
 returns width.
bool within (const Range &) const
 returns true if given Range is within(included in) a range.
bool within (const float value) const
 returns true if given value is within a range.
bool within (const Range &) const
 returns true if given Range is within(included in) a range.
bool within (const float value) const
 returns true if given value is within a range.
bool within2 (const float value) const
 returns true if given value is within a range.
bool within2 (const float value) const
 returns true if given value is within a range.

Private Attributes

float _high
 Higher limit.
float _low
 Lower limit.


Detailed Description

to specify 1-dim region or range by two floats


Constructor & Destructor Documentation

Range::Range  ) 
 

Constructor.

00016              {
00017     _low = -999.;
00018     _high = -999.;
00019 }

Range::Range const Range  ) 
 

Copy constructor.

00021                              {
00022     _low = ib.low();
00023     _high = ib.high();
00024 }

Range::Range float  low,
float  high
 

Constructor.

00026                                                 {
00027     if (iHigh > iLow) {
00028         _low = iLow;
00029         _high = iHigh;
00030     }
00031     else {
00032         _low = iHigh;
00033         _high = iLow;
00034     }
00035 }

Range::Range  ) 
 

Constructor.

Range::Range const Range  ) 
 

Copy constructor.

Range::Range float  low,
float  high
 

Constructor.


Member Function Documentation

virtual float Range::center void   )  const [virtual]
 

returns center.

float Range::center void   )  const [inline, virtual]
 

returns center.

00129                         {
00130     return (_low + _high) / 2.;
00131 }

virtual int Range::dump void   )  const [virtual]
 

displays debug information.

int Range::dump void   )  const [virtual]
 

displays debug information.

00045                       {
00046     std::cout << _low << "~" << _high;
00047     return 0;
00048 }

virtual float Range::high float  highIn  )  [virtual]
 

sets higher limit.

virtual float Range::high void   )  const [virtual]
 

returns higher limit.

float Range::high float  highIn  )  [inline, virtual]
 

sets higher limit.

00122                    {
00123     if (i < _low) i = _low;
00124     return _high = i;
00125 }

float Range::high void   )  const [inline, virtual]
 

returns higher limit.

00116                       {
00117     return _high;
00118 }

virtual float Range::low float  lowIn  )  [virtual]
 

sets lower limit.

virtual float Range::low void   )  const [virtual]
 

returns lower limit.

float Range::low float  lowIn  )  [inline, virtual]
 

sets lower limit.

00109                   {
00110     if (i > _high) i = _high;
00111     return _low = i;
00112 }

float Range::low void   )  const [inline, virtual]
 

returns lower limit.

00103                      {
00104     return _low;
00105 }

bool Range::operator & const Range  )  const
 

returns true if two are overlaped each other.

bool Range::operator & const Range  )  const [inline]
 

returns true if two are overlaped each other.

00212                                         {
00213     if (within(a.low())) return true;
00214     if (within(a.high())) return true;
00215     if (a.within(low())) return true;
00216     if (a.within(high())) return true;
00217     return false;
00218 }

bool Range::operator!= const Range  )  const
 

returns true if range is different.

bool Range::operator!= const Range  )  const [inline]
 

returns true if range is different.

00205                                          {
00206     if ((* this) == a) return false;
00207     return true;
00208 }

Range& Range::operator= const Range  ) 
 

Copy operator.

Range & Range::operator= const Range  )  [inline]
 

Copy operator.

00163                                    {
00164     _low = ib.low();
00165     _high = ib.high();
00166     return * this;
00167 }

bool Range::operator== const Range  )  const
 

returns true if range is the same.

bool Range::operator== const Range  )  const
 

returns true if range is the same.

00038                                          {
00039     if (_low != a.low()) return false;
00040     if (_high != a.high()) return false;
00041     return true;
00042 }

virtual Range& Range::set float  low,
float  high
[virtual]
 

sets range.

Range & Range::set float  low,
float  high
[inline, virtual]
 

sets range.

00141                                   {
00142     if (iHigh > iLow) {
00143         _low = iLow;
00144         _high = iHigh;
00145     }
00146     else {
00147         _low = iHigh;
00148         _high = iLow;
00149     }
00150     return * this;
00151 }

virtual Range& Range::setByCenter float  center,
float  width
[virtual]
 

sets range by center and width.

Range & Range::setByCenter float  center,
float  width
[inline, virtual]
 

sets range by center and width.

00155                                             {
00156     _low = center - width;
00157     _high = center + width;
00158     return * this;
00159 }

virtual float Range::width void   )  const [virtual]
 

returns width.

float Range::width void   )  const [inline, virtual]
 

returns width.

00135                        {
00136     return (_high - _low);
00137 }

bool Range::within const Range  )  const
 

returns true if given Range is within(included in) a range.

bool Range::within const float  value  )  const
 

returns true if given value is within a range.

bool Range::within const Range  )  const [inline]
 

returns true if given Range is within(included in) a range.

00222                                    {
00223     if (within(a.low()) && within(a.high())) return true;
00224     return false;
00225 }

bool Range::within const float  value  )  const [inline]
 

returns true if given value is within a range.

00171                                 {
00172     if (_low == -999. && _high == -999.) {
00173         return false;
00174     }
00175     if (_low == -999.) {
00176         if (f <= _high) return true;
00177         return false;
00178     }
00179     if (_high == -999.) {
00180         if (f >= _low) return true;
00181     }
00182     if (f >= _low && f <= _high) return true;
00183     return false;
00184 }

bool Range::within2 const float  value  )  const
 

returns true if given value is within a range.

bool Range::within2 const float  value  )  const [inline]
 

returns true if given value is within a range.

00188                                  {
00189     if (_low == -999. && _high == -999.) {
00190         return true;
00191     }
00192     if (_low == -999.) {
00193         if (f <= _high) return true;
00194         return false;
00195     }
00196     if (_high == -999.) {
00197         if (f >= _low) return true;
00198     }
00199     if (f >= _low && f <= _high) return true;
00200     return false;
00201 }


Member Data Documentation

float Range::_high [private]
 

Higher limit.

float Range::_low [private]
 

Lower limit.


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:41:59 2011 for BOSS6.5.5 by  doxygen 1.3.9.1