#include <Interval.h>
Public Member Functions | |
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 | 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) |
Interval & | operator*= (double r) |
Interval & | operator/= (double r) |
Interval & | operator+= (const Numeric value) |
Interval & | operator-= (const Numeric value) |
Interval & | expand (double r) |
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 29 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 35 of file Interval.h.
|
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 47 of file Interval.h.
|
inline |
Scaling the bounds by a constant in such a way that the midpoint remains unchanged
Definition at line 257 of file Interval.h.
|
inline |
Return both bounds
Definition at line 97 of file Interval.h.
|
inline |
Is the point completely inside the interval (and does not coincide with any bound)?
Definition at line 123 of file Interval.h.
|
inline |
Is the point inside the interval or on the lower boundary?
Definition at line 108 of file Interval.h.
|
inline |
Is the point inside the interval or on the upper boundary?
Definition at line 112 of file Interval.h.
|
inline |
Is the point inside the interval or on one of the boundaries?
Definition at line 116 of file Interval.h.
|
inline |
Interval length
Definition at line 101 of file Interval.h.
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 299 of file Interval.h.
|
inline |
Return the upper bound
Definition at line 94 of file Interval.h.
Referenced by npstat::ArrayRange::operator<().
|
inline |
The middle point of the interval
Definition at line 104 of file Interval.h.
|
inline |
Return the lower bound
Definition at line 91 of file Interval.h.
Referenced by npstat::ArrayRange::operator<().
|
inline |
Move the interval so that the midpoint ends up at 0
Definition at line 248 of file Interval.h.
|
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 238 of file Interval.h.
|
inline |
Shift both interval bounds by a constant
Definition at line 282 of file Interval.h.
|
inline |
Definition at line 290 of file Interval.h.
|
inline |
Definition at line 270 of file Interval.h.
|
inline |
The following function returns default-constructed empty interval in case this interval and the argument interval do not overlap
Definition at line 195 of file Interval.h.
|
inline |
Same as overlapLength(r)/length() but a tad faster
Definition at line 225 of file Interval.h.
|
inline |
Same as overlap.length() but a tad faster
Definition at line 212 of file Interval.h.
|
inline |
Set both interval bounds
Definition at line 78 of file Interval.h.
|
inline |
Set the upper interval bound
Definition at line 70 of file Interval.h.
|
inline |
Set the lower interval bound
Definition at line 62 of file Interval.h.
|
private |
Definition at line 177 of file Interval.h.
|
private |
Definition at line 176 of file Interval.h.