#include <Interval.h>
Public Member Functions | |
Interval & | expand (double r) |
void | getBounds (Numeric *pmin, Numeric *pmax) const |
Interval () | |
Interval (const Numeric max) | |
Interval (const Numeric min, const Numeric max, const bool swapIfOutOfOrder=false) | |
bool | isInside (const Numeric value) const |
bool | isInsideLower (const Numeric value) const |
bool | isInsideUpper (const Numeric value) const |
bool | isInsideWithBounds (const Numeric value) const |
Numeric | length () const |
template<typename Num2 > | |
void | linearMap (const Interval< Num2 > &r, double *a, double *b) const |
const Numeric | max () const |
Numeric | midpoint () const |
const Numeric | min () const |
Interval & | moveMidpointTo0 () |
Interval & | operator*= (double r) |
Interval & | operator+= (const Numeric value) |
Interval & | operator-= (const Numeric value) |
Interval & | operator/= (double r) |
Interval | overlap (const Interval &r) const |
double | overlapFraction (const Interval &r) const |
Numeric | overlapLength (const Interval &r) const |
void | setBounds (const Numeric minval, const Numeric maxval, const bool swapIfOutOfOrder=false) |
void | setMax (const Numeric value) |
void | setMin (const Numeric value) |
Private Attributes | |
Numeric | max_ |
Numeric | min_ |
Representation of 1-d intervals. The following invariant is maintained: min() will not exceed max().
See BoxND class for rectangles, boxes, and hyperboxes.
Definition at line 25 of file Interval.h.
|
inline |
Both lower and upper interval bounds are set to Numeric()
Definition at line 28 of file Interval.h.
|
inlineexplicit |
Minimum is set to Numeric(), maximum to the given argument. An exception is thrown if the argument is smaller than Numeric().
Definition at line 34 of file Interval.h.
References npstat::Interval< Numeric >::max_, and npstat::Interval< Numeric >::min_.
|
inline |
Constructor from both bounds. Set "swapIfOutOfOrder" argument to "true" if the minimum can be larger than the maximum (in this case the bounds will be swapped internally).
Definition at line 44 of file Interval.h.
References npstat::Interval< Numeric >::max_, npstat::Interval< Numeric >::min_, and std::swap().
|
inline |
Scaling the bounds by a constant in such a way that the midpoint remains unchanged
Definition at line 230 of file Interval.h.
References alignCSCRings::r.
|
inline |
Return both bounds
Definition at line 84 of file Interval.h.
References npstat::Interval< Numeric >::max_, npstat::Interval< Numeric >::min_, and trackingParticleMuon_cfi::pmin.
|
inline |
Is the point completely inside the interval (and does not coincide with any bound)?
Definition at line 108 of file Interval.h.
References npstat::Interval< Numeric >::max_, and npstat::Interval< Numeric >::min_.
|
inline |
Is the point inside the interval or on the lower boundary?
Definition at line 96 of file Interval.h.
References npstat::Interval< Numeric >::max_, and npstat::Interval< Numeric >::min_.
|
inline |
Is the point inside the interval or on the upper boundary?
Definition at line 99 of file Interval.h.
References npstat::Interval< Numeric >::max_, and npstat::Interval< Numeric >::min_.
|
inline |
Is the point inside the interval or on one of the boundaries?
Definition at line 102 of file Interval.h.
References npstat::Interval< Numeric >::max_, and npstat::Interval< Numeric >::min_.
|
inline |
Interval length
Definition at line 90 of file Interval.h.
References npstat::Interval< Numeric >::max_, and npstat::Interval< Numeric >::min_.
void npstat::Interval< Numeric >::linearMap | ( | const Interval< Num2 > & | r, |
double * | a, | ||
double * | b | ||
) | const |
Derive the coefficients a and b such that the linear mapping y = a*x + b maps the lower limit of this interval into the lower limit of the argument interval and the upper limit of this interval into the upper limit of the argument interval
Definition at line 267 of file Interval.h.
References a, cms::cuda::assert(), b, and alignCSCRings::r.
|
inline |
Return the upper bound
Definition at line 81 of file Interval.h.
References npstat::Interval< Numeric >::max_.
Referenced by npstat::BoxND< unsigned >::BoxND(), npstat::BoxND< unsigned >::copyFrom(), npstat::ArrayRange::operator<(), and npstat::ArrayND< Num1, Len1, Dim1 >::processSubrangeLoop().
|
inline |
The middle point of the interval
Definition at line 93 of file Interval.h.
References npstat::Interval< Numeric >::max_, and npstat::Interval< Numeric >::min_.
|
inline |
Return the lower bound
Definition at line 78 of file Interval.h.
References npstat::Interval< Numeric >::min_.
Referenced by npstat::BoxND< unsigned >::BoxND(), npstat::BoxND< unsigned >::copyFrom(), npstat::ArrayRange::operator<(), and npstat::ArrayND< Num1, Len1, Dim1 >::processSubrangeLoop().
|
inline |
|
inline |
Scaling of both the minimum and the maximum by a constant. Minimum and maximum will be swapped internally in case the constant is negative.
Definition at line 213 of file Interval.h.
References alignCSCRings::r, and std::swap().
|
inline |
Shift both interval bounds by a constant
Definition at line 252 of file Interval.h.
References alignCSCRings::r.
|
inline |
Definition at line 259 of file Interval.h.
References alignCSCRings::r.
|
inline |
|
inline |
The following function returns default-constructed empty interval in case this interval and the argument interval do not overlap
Definition at line 179 of file Interval.h.
References npstat::Interval< Numeric >::max_, npstat::Interval< Numeric >::min_, alignCSCRings::r, and npstat::Interval< Numeric >::setBounds().
|
inline |
Same as overlapLength(r)/length() but a tad faster
Definition at line 203 of file Interval.h.
References alignCSCRings::r.
|
inline |
Same as overlap.length() but a tad faster
Definition at line 193 of file Interval.h.
References alignCSCRings::r.
|
inline |
Set both interval bounds
Definition at line 68 of file Interval.h.
References npstat::Interval< Numeric >::max_, npstat::Interval< Numeric >::min_, and std::swap().
Referenced by npstat::Interval< Numeric >::overlap().
|
inline |
Set the upper interval bound
Definition at line 61 of file Interval.h.
References npstat::Interval< Numeric >::max_, npstat::Interval< Numeric >::min_, and relativeConstraints::value.
|
inline |
Set the lower interval bound
Definition at line 54 of file Interval.h.
References npstat::Interval< Numeric >::max_, npstat::Interval< Numeric >::min_, and relativeConstraints::value.
|
private |
Definition at line 161 of file Interval.h.
Referenced by npstat::Interval< Numeric >::getBounds(), npstat::Interval< Numeric >::Interval(), npstat::Interval< Numeric >::isInside(), npstat::Interval< Numeric >::isInsideLower(), npstat::Interval< Numeric >::isInsideUpper(), npstat::Interval< Numeric >::isInsideWithBounds(), npstat::Interval< Numeric >::length(), npstat::Interval< Numeric >::max(), npstat::Interval< Numeric >::midpoint(), npstat::Interval< Numeric >::overlap(), npstat::Interval< Numeric >::setBounds(), npstat::Interval< Numeric >::setMax(), and npstat::Interval< Numeric >::setMin().
|
private |
Definition at line 160 of file Interval.h.
Referenced by npstat::Interval< Numeric >::getBounds(), npstat::Interval< Numeric >::Interval(), npstat::Interval< Numeric >::isInside(), npstat::Interval< Numeric >::isInsideLower(), npstat::Interval< Numeric >::isInsideUpper(), npstat::Interval< Numeric >::isInsideWithBounds(), npstat::Interval< Numeric >::length(), npstat::Interval< Numeric >::midpoint(), npstat::Interval< Numeric >::min(), npstat::Interval< Numeric >::overlap(), npstat::Interval< Numeric >::setBounds(), npstat::Interval< Numeric >::setMax(), and npstat::Interval< Numeric >::setMin().