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

Range Class Reference

#include <Range.h>

Collaboration diagram for Range:

Collaboration graph
[legend]
List of all members.

Detailed Description

Expresses a range of values.

Author:
Stephane Bonneaud <gandalf@slac.stanford.edu>

Paul F. Kunz <Paul_Kunz@slac.stanford.edu>

Sanket Malde <sanket@stanford.edu>

Oded Wurman <owurman@stanford.edu>

Definition at line 32 of file Range.h.

Public Member Functions

bool excludes (double value) const
 Returns true if the argument value is outside the range.
double fraction (double value) const
 Returns the fraction of the range that value represents.
double high () const
 Returns the maximum of the range object.
bool includes (double value) const
 Returns true if the argument value is inside the range.
double length () const
 Returns the length of the range object.
double low () const
 Returns the minimum of the range object.
int numberOfBins (double width) const
 Returns the number of bins of width width required to fill the range.
double pos () const
 Returns the first positive element in range.
 Range (const std::vector< double > &array)
 A constructor taking its range from the range of data in the vector array.
 Range (double x, double y, double p=DBL_MAX)
 A constructor that sets the range to {x, y}, with a pos argument of p if it is supplied, otherwise DBL_MAX.
 Range ()
 The following constructors sets the range to {0.0, 0.0} but sets m_empty to true.
void setEmpty (bool yes=true)
 Sets the range to empty.
void setHigh (double x)
 Sets the maximum of the range object.
void setIntersect (const Range &range)
 Forms the intersect with the range in the argument.
void setLength (double val, bool high_hold=false)
 Sets the length of the range.
void setLow (double x)
 Sets the minimum of the range object.
void setPos (double x)
 Sets the first positive element in range.
template<class Iterator>
void setRange (Iterator first, Iterator end)
 Sets the range from the data sequence.
void setRange (double low, double high, double pos)
 Changes the current Range.
void setUnion (const Range &range)
 Forms the union with the range range.

Private Attributes

bool m_empty
 A flag indicating that the range is empty.
double m_max
 The maximum in the range.
double m_min
 The minimum in the range.
double m_pos
 The minimum positive value in the range, for log scale.

Friends

std::ostream & operator<< (std::ostream &, const Range &)
 Displays the state of the Range object.


Constructor & Destructor Documentation

Range::Range  ) 
 

The following constructors sets the range to {0.0, 0.0} but sets m_empty to true.

Definition at line 34 of file Range.cxx.

Range::Range double  x,
double  y,
double  p = DBL_MAX
 

A constructor that sets the range to {x, y}, with a pos argument of p if it is supplied, otherwise DBL_MAX.

Definition at line 42 of file Range.cxx.

References m_empty, m_max, m_min, and m_pos.

Range::Range const std::vector< double > &  array  ) 
 

A constructor taking its range from the range of data in the vector array.

Definition at line 78 of file Range.cxx.

References setRange().


Member Function Documentation

bool Range::excludes double  value  )  const
 

Returns true if the argument value is outside the range.

Returns true if the value is stricly less than the lower bound or strictly greater than the upper bound.

Definition at line 159 of file Range.cxx.

References m_max.

Referenced by ContourPointRep::createContours(), ContourPointRep::drawContourTicks(), NTupleProjector::inRange(), MapMatrixProjector::inRange(), and Map1Projector::inRange().

double Range::fraction double  value  )  const
 

Returns the fraction of the range that value represents.

Definition at line 166 of file Range.cxx.

References m_max, and m_min.

double Range::high  )  const
 

Returns the maximum of the range object.

Definition at line 100 of file Range.cxx.

References m_max.

Referenced by LogTransform::adjustLogValues(), AxisModelLog::adjustLogValues(), LogTransform::adjustValues(), LinearTransform::adjustValues(), AxisModelLog::adjustValues(), AxisModelLinear::adjustValues(), BinnerAxis::axisGetHigh(), BinnerAxis::binEdges(), AxisModelLog::calcHigh(), AxisModelLinear::calcHigh(), AxisModelLog::calcLow(), AxisModelLinear::calcLow(), XYTransform::calcRectangle(), Lambert::calcRectangle(), HammerAito::calcRectangle(), CompositePlotter::calcUserRectangle(), BinnerAxisLog::calcWidthParm(), TupleCutXML::createElement(), QtCut::cutRange(), AxisRepBase::drawAxesLines(), AxisRepBase::drawGridLines(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), CutRangeRep::drawNormalRange(), ContourPointRep::drawProjectedValues(), ColorSymbolPointRep::drawProjectedValues(), ColorBoxPointRep::drawProjectedValues(), ErrorBarRep::drawXError(), AxisRepBase::drawXTickLabels(), AxisRepBase::drawXTickLines(), ErrorBarRep::drawYError(), AxisRepBase::drawYTickLabels(), AxisRepBase::drawYTickLines(), LineProjector::fillDataSource(), LineProjector::fillProjectedValues(), LogTransform::genTicks(), LinearTransform::genTicks(), Lambert::genTicks(), HammerAito::genTicks(), DyHist1DProjector::getAverage(), PlotterBase::getHighRangeOnX(), BinnerAxisLog::getNob(), QtDisplay::getRange(), AxisModelBase::getRange(), PeriodicBinaryTransform::moduloAddX(), PeriodicBinaryTransform::moduloAddY(), PeriodicBinaryTransform::moduloSubX(), PeriodicBinaryTransform::moduloSubY(), CompositePlotter::prepareToDraw(), AxisWidget::processHighSliderMoved(), AxisWidget::processLowSliderMoved(), CompositePlotter::processReturnValue(), AxisWidget::processTextBoxReturnPressed(), AxisWidget::processZoomPanCheckBoxClicked(), BinnerAxisXML::setAttributes(), AxisModelXML::setAttributes(), Inspector::setDragOn(), Inspector::setHighRange(), Inspector::setLowRange(), ContourPointRep::setMinMax(), BinnerAxisLinear::setOffset(), ProfileProjector::setRange(), Profile2DProjector::setRange(), Hist2DProjImp::setRange(), Hist1DProjImp::setRange(), BinnerAxisLog::setRange(), AxisModelBase::setRange(), LogTransform::setTickStep(), LinearTransform::setTickStep(), Lambert::setTickStep(), HammerAito::setTickStep(), AxisModelLog::setTickStep(), Inspector::updateAxisTab(), AxisWidget::updateCutControlValues(), LogTransform::validate(), Lambert::validate(), and HammerAito::validate().

bool Range::includes double  value  )  const
 

Returns true if the argument value is inside the range.

Returns true if the value is greater than or equal to the lower bound and less than or equal to the upper bound.

Definition at line 152 of file Range.cxx.

References m_max, and m_min.

Referenced by TupleCut::acceptRow(), SymbolPointRep::drawProjectedValue(), ColorSymbolPointRep::drawProjectedValues(), NTupleProjector::getAverage(), and DyHist1DProjector::getAverage().

double Range::length  )  const [inline]
 

Returns the length of the range object.

Definition at line 159 of file Range.h.

References m_max, and m_min.

Referenced by LogTransform::adjustValues(), AxisModelLog::adjustValues(), BinnerAxisLinear::axisBinWidth(), BinnerAxisLinear::axisSetNumberOfBins(), BinnerAxisLinear::BinnerAxisLinear(), AxisModelLinear::calcHigh(), AxisModelLinear::calcLow(), BinsFunction::createValuesArray(), BinToUsrDefinedScale::doubleToColor(), BinToMovingBrkPt::doubleToColor(), BinToKamaeScale::doubleToColor(), BinToGreyScale::doubleToColor(), BinToFullColorScale::doubleToColor(), BinToColorScaleMovingBrkPt::doubleToColor(), BinToColorScale::doubleToColor(), BinTo3ColorScale::doubleToColor(), AxisRepColor::drawColorScale(), ErrorBarRep::drawXError(), ErrorBarRep::drawYError(), BinnerAxisLinear::getCoordinate(), AxisWidget::getHighFromSlider(), AxisWidget::getLowFromSlider(), BinnerAxisLinear::getNob(), AxisWidget::getPositionFromSlider(), AxisWidget::getWidthFromSlider(), Map3Projector::getZValue(), ProjectorBase::preferredRange(), AxisWidget::processHighSliderMoved(), AxisWidget::processLowSliderMoved(), Inspector::setHighRange(), BinnerAxisLinear::setRange(), AxisModelBase::setRange(), AxisWidget::setSlider(), AxisWidget::setSliderZero(), LinearTransform::setTickStep(), Lambert::setTickStep(), HammerAito::setTickStep(), and BinsFunction::smoothCurve().

double Range::low  )  const
 

Returns the minimum of the range object.

Definition at line 87 of file Range.cxx.

References m_min.

Referenced by LogTransform::adjustLogValues(), AxisModelLog::adjustLogValues(), LogTransform::adjustValues(), LinearTransform::adjustValues(), AxisModelLog::adjustValues(), AxisModelLinear::adjustValues(), BinnerAxisLinear::axisBinNumber(), BinnerAxis::axisGetLow(), BinnerAxis::binEdges(), AxisModelLog::calcHigh(), AxisModelLinear::calcHigh(), AxisModelLog::calcLow(), AxisModelLinear::calcLow(), XYTransform::calcRectangle(), Lambert::calcRectangle(), HammerAito::calcRectangle(), CompositePlotter::calcUserRectangle(), BinnerAxisLog::calcWidthParm(), TupleCutXML::createElement(), BinsFunction::createValuesArray(), QtCut::cutRange(), BinToUsrDefinedScale::doubleToColor(), BinToMovingBrkPt::doubleToColor(), BinToKamaeScale::doubleToColor(), BinToGreyScale::doubleToColor(), BinToFullColorScale::doubleToColor(), BinToColorScaleMovingBrkPt::doubleToColor(), BinToColorScale::doubleToColor(), BinTo3ColorScale::doubleToColor(), AxisRepBase::drawAxesLines(), AxisRepColor::drawColorScale(), AxisRepBase::drawGridLines(), CutRangeRep::drawInvertedRange1D(), CutRangeRep::drawInvertedRange2D(), CutRangeRep::drawNormalRange(), ContourPointRep::drawProjectedValues(), ColorSymbolPointRep::drawProjectedValues(), ColorBoxPointRep::drawProjectedValues(), ErrorBarRep::drawXError(), AxisRepBase::drawXTickLabels(), AxisRepBase::drawXTickLines(), ErrorBarRep::drawYError(), AxisRepBase::drawYTickLabels(), AxisRepBase::drawYTickLines(), LineProjector::fillDataSource(), LineProjector::fillProjectedValues(), LogTransform::genTicks(), DyHist1DProjector::getAverage(), BinnerAxisLinear::getCoordinate(), AxisWidget::getHighFromSlider(), AxisWidget::getLowFromSlider(), PlotterBase::getLowRangeOnX(), BinnerAxisLog::getNob(), AxisWidget::getPositionFromSlider(), QtDisplay::getRange(), AxisModelBase::getRange(), PeriodicBinaryTransform::moduloAddX(), PeriodicBinaryTransform::moduloAddY(), PeriodicBinaryTransform::moduloSubX(), PeriodicBinaryTransform::moduloSubY(), ProjectorBase::preferredRange(), CompositePlotter::prepareToDraw(), AxisWidget::processHighSliderMoved(), AxisWidget::processLowSliderMoved(), CompositePlotter::processReturnValue(), AxisWidget::processTextBoxReturnPressed(), AxisWidget::processZoomPanCheckBoxClicked(), BinnerAxisXML::setAttributes(), AxisModelXML::setAttributes(), BinnerAxisLog::setBins(), BinnerAxisLog::setBinWidth(), Inspector::setDragOn(), LogTransform::setFirstTick(), LinearTransform::setFirstTick(), Lambert::setFirstTick(), HammerAito::setFirstTick(), Inspector::setHighRange(), Inspector::setLowRange(), ContourPointRep::setMinMax(), BinnerAxisLog::setOffset(), BinnerAxisLinear::setOffset(), ProfileProjector::setRange(), Profile2DProjector::setRange(), Hist2DProjImp::setRange(), Hist1DProjImp::setRange(), BinnerAxisLog::setRange(), AxisModelBase::setRange(), AxisWidget::setSlider(), LogTransform::setTickStep(), LinearTransform::setTickStep(), Lambert::setTickStep(), HammerAito::setTickStep(), AxisModelLog::setTickStep(), Inspector::updateAxisTab(), AxisWidget::updateCutControlValues(), LogTransform::validate(), Lambert::validate(), and HammerAito::validate().

int Range::numberOfBins double  width  )  const
 

Returns the number of bins of width width required to fill the range.

Definition at line 205 of file Range.cxx.

References m_max, and m_min.

Referenced by BinnerAxisLinear::getNob().

double Range::pos  )  const
 

Returns the first positive element in range.

Definition at line 113 of file Range.cxx.

References m_pos.

Referenced by LogTransform::adjustLogValues(), AxisModelLog::adjustLogValues(), LogTransform::adjustValues(), LinearTransform::adjustValues(), AxisModelLog::adjustValues(), AxisModelLinear::adjustValues(), CompositePlotter::autoScaleZ(), AxisModelLog::calcHigh(), AxisModelLinear::calcHigh(), AxisModelLog::calcLow(), AxisModelLinear::calcLow(), ColorSymbolPointRep::drawProjectedValues(), LineProjector::getPosOn(), DyHist2DProjector::getPosOn(), Hist2DProjImp::getPosOnValue(), Hist1DProjImp::getPosOnValue(), AxisWidget::processHighSliderMoved(), AxisWidget::processLowSliderMoved(), AxisWidget::processTextBoxReturnPressed(), Inspector::setDragOn(), Inspector::setHighRange(), Inspector::setLowRange(), AxisModelBase::setRange(), and LogTransform::validate().

void Range::setEmpty bool  yes = true  ) 
 

Sets the range to empty.

See also:
m_empty.

Definition at line 171 of file Range.cxx.

References m_empty.

Referenced by AxisModelBase::setUnionRange().

void Range::setHigh double  x  ) 
 

Sets the maximum of the range object.

Definition at line 106 of file Range.cxx.

References m_max, and m_min.

Referenced by FitsController::checkForImage(), ProjectorBase::preferredRange(), AxisWidget::processHighSliderMoved(), BinnerAxisLog::setBinWidth(), BinnerAxisLog::setRange(), LogTransform::validate(), Lambert::validate(), and HammerAito::validate().

void Range::setIntersect const Range range  ) 
 

Forms the intersect with the range in the argument.

Definition at line 194 of file Range.cxx.

References m_max, m_min, m_pos, std::max(), and std::min().

Referenced by AxisModelBase::setIntersectRange().

void Range::setLength double  val,
bool  high_hold = false
 

Sets the length of the range.

The boolean high_hold determines which end is held fixed and which one is modified.

Definition at line 141 of file Range.cxx.

References m_max, and m_min.

Referenced by FitsController::checkForImage(), BinnerAxisLinear::setBinWidth(), and BinnerAxisLinear::setRange().

void Range::setLow double  x  ) 
 

Sets the minimum of the range object.

Definition at line 93 of file Range.cxx.

References m_max, and m_min.

Referenced by FitsController::checkForImage(), ProjectorBase::preferredRange(), Hist2DProjImp::preferredRange(), Hist1DProjImp::preferredRange(), AxisWidget::processLowSliderMoved(), BinnerAxisLog::setRange(), LogTransform::validate(), Lambert::validate(), and HammerAito::validate().

void Range::setPos double  x  ) 
 

Sets the first positive element in range.

Definition at line 119 of file Range.cxx.

References m_max, m_min, and m_pos.

Referenced by CompositePlotter::autoScaleZ(), and AxisModelBase::setRangePos().

template<class Iterator>
void Range::setRange Iterator  first,
Iterator  end
 

Sets the range from the data sequence.

Definition at line 168 of file Range.h.

References m_max, m_min, m_pos, std::max(), and std::min().

void Range::setRange double  low,
double  high,
double  pos
 

Changes the current Range.

Definition at line 126 of file Range.cxx.

References m_max, m_min, and m_pos.

Referenced by MapMatrixProjector::dataRangeOn(), LineProjector::dataRangeOn(), NTuple::fillRange(), FitsNTuple::fillRange(), DataSource::fillRange(), AxisWidget::processHighSliderMoved(), AxisWidget::processLowSliderMoved(), AxisWidget::processTextBoxReturnPressed(), Range(), Inspector::setDragOn(), and AxisModelBase::setRange().

void Range::setUnion const Range range  ) 
 

Forms the union with the range range.

The resulting range of the object extends from the lower range of the two objects to the upper range of the two. If the range was empty (

See also:
m_empty), then the result is the range range.

Definition at line 176 of file Range.cxx.

References m_empty, m_max, m_min, m_pos, std::max(), and std::min().

Referenced by AxisModelBase::setUnionRange().


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  ,
const Range
[friend]
 

Displays the state of the Range object.


Member Data Documentation

bool Range::m_empty [private]
 

A flag indicating that the range is empty.

An empty range is one that has not yet been set to a value.

Definition at line 51 of file Range.h.

Referenced by Range(), setEmpty(), and setUnion().

double Range::m_max [private]
 

The maximum in the range.

Definition at line 42 of file Range.h.

Referenced by excludes(), fraction(), high(), includes(), length(), numberOfBins(), operator<<(), Range(), setHigh(), setIntersect(), setLength(), setLow(), setPos(), setRange(), and setUnion().

double Range::m_min [private]
 

The minimum in the range.

Definition at line 38 of file Range.h.

Referenced by fraction(), includes(), length(), low(), numberOfBins(), operator<<(), Range(), setHigh(), setIntersect(), setLength(), setLow(), setPos(), setRange(), and setUnion().

double Range::m_pos [private]
 

The minimum positive value in the range, for log scale.

Definition at line 46 of file Range.h.

Referenced by operator<<(), pos(), Range(), setIntersect(), setPos(), setRange(), and setUnion().


The documentation for this class was generated from the following files:
Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3