|
| DRange1d () |
| constructor for a NULL range. More...
|
|
| DRange1d (double low, double high) |
| Constructor from explicit low and high. More...
|
|
| DRange1d (DRange1dCR source) |
| copy constructor. More...
|
|
void | InitNull () |
| Set this range to the {NullRange}. More...
|
|
bool | IsNull () const |
| Test if the range is exactly the same as the null ranges returned by NullRange (). More...
|
|
bool | IsEmpty () const |
| Test if the range has {low > high}, i.e. there are no x for which {low &le x && x &le high}. More...
|
|
bool | IsEmptyOrSinglePoint () const |
| Test if the range has {high >= low}, i.e. is empty or just one point. More...
|
|
bool | IsSinglePoint () const |
| Test if the range is a single point. More...
|
|
bool | IsSinglePoint (double value) const |
| Test if the range is a particular single point. More...
|
|
bool | IsPositiveLength () const |
| Test if the range has {high > low}, i.e. has a non-empty set of points with properly sorted lower and upper limit. More...
|
|
bool | IsInfinitePositive () const |
| Test if the range has the largest possible {high}. More...
|
|
bool | IsInfiniteNegative () const |
| Test if the range has the most negative possible {low}. More...
|
|
bool | IsDoublyInfinite () const |
| Test if the range has the most negative {low} and most positive {high}. More...
|
|
bool | GetLowHigh (double &a, double &b) const |
| Get the low and high limits (unchecked). More...
|
|
double | Low () const |
| Get the low limit (unchecked). More...
|
|
double | High () const |
| Get the low limit (unchecked). More...
|
|
double | Length () const |
| Return {MAX(0, high - low)} The DRange1::NullRange returns 0. More...
|
|
bool | Contains (double a) const |
| Test if the range contains a given value. More...
|
|
void | Extend (double valueA) |
| Extend to include a value. More...
|
|
void | Extend (double valueA, double valueB) |
| Extend to include 2 values. More...
|
|
void | Extend (double *values, size_t count) |
| Extend to include an array of values. More...
|
|
void | Extend (bvector< double > &values) |
| Extend to include an array of values. More...
|
|
void | Extend (DRange1dCR other) |
| Extend to include (union) another (possibly null!!) range. More...
|
|
void | ExtendBySignedShift (double tol) |
| If non empty, shift endpoints by (-tol, +tol). More...
|
|
void | IntersectInPlace (DRange1dCR other) |
| Restrict to overlap with another (possibly null!!) range. More...
|
|
bool | StrictlyNonEmptyFractionalIntersection (DRange1dCR rangeB, DRange1dR fractionalIntersection) |
| Compute intersection of the instance with rangeB. More...
|
|
bool | IsSubsetOf (DRange1dCR other) const |
| Test if the instance range is a (possibly complete, possibly empty) subset of {other} range. More...
|
|
bool | HasNonEmptyIntersectionWith (DRange1dCR other) const |
| Test if the instance range is a (possibly complete, but not empty) subset of {other} range. More...
|
|
bool | HasPositiveLengthIntersectionWith (DRange1dCR other) const |
| Test if the instance range has a positive-length (more than single point) intersection with {other}. More...
|
|
bool | IsContainedIn (DRange1dCR other) const |
| Test if the instnace range is a (possibly complete) subset of {other} range. More...
|
|
double | MaxAbs (double defaultValeForNullRange=0.0) const |
| return the largest coordinate (absolute value) in the range. More...
|
|
bool | IsEqualInterval (DRange1dCR other) const |
| Test if equal intervals in point set sense. More...
|
|
bool | IsEqualLowHigh (DRange1dCR other) const |
| Direct equality test for low and high parts. More...
|
|
bool | IsSameMinMax (DRange1dCR other, double absTol) const |
| test for toleranced equality of (min max of) low and high. More...
|
|
bool | IsSameLowHigh (DRange1dCR other, double relTol) const |
| test for toleranced equality of low to low and high to high More...
|
|
bool | FractionToDouble (double fraction, double &x, double defaultReturnX=0.0) const |
| map fractional coordinate to real. Returns false if null range. More...
|
|
bool | DoubleToFraction (double x, double &fraction, double defaultReturnX=0.0) const |
| map real to fraction. Returns false if null range or single point. More...
|
|
double | GetTolerance (double absTol=1.0e-14, double localRelTol=1.0e-14, double globalRelTol=0.0) |
| return a tolerance computed as {absTol + localRelTol * Extent() + globalRelTol * MaxAbs ()} More...
|
|
bool | UpdateRay1dIntersection (double x0, double dxds, double xA, double xB) |
| Update a bounding interval of a line based on the variation of that line within one dimension. More...
|
|
|
static DRange1d | FromLowHigh (double low, double high) |
| Return a range with explicit (possibly reversed) low and high. More...
|
|
static DRange1d | NullRange () |
| Return a range which satisfies IsNull () More...
|
|
static DRange1d | InfiniteRange () |
| Return a complete range (-DBL_MAX to DBL_MAX) More...
|
|
static DRange1d | ZeroAndPositiveRange () |
| Return a complete 0 and positive range (0 to DBL_MAX) More...
|
|
static DRange1d | ZeroAndNegativeRange () |
| Return a complete 0 and negative range (-DBL_MAX to 0) More...
|
|
static DRange1d | From (double value) |
| Return a range containing a single value. More...
|
|
static DRange1d | From (double valueA, double valueB) |
| Return a (sorted) range of 2 values. More...
|
|
static DRange1d | From (double valueA, double valueB, double valueC) |
| Return a (sorted) range of 3 values. More...
|
|
static DRange1d | From (double *values, size_t n) |
| Return a (sorted) range of an array of values. More...
|
|
static DRange1d | FromAltitudes (bvector< DPoint3d > &points, DPlane3dCR plane) |
| Return a (sorted) range of altitudes of points. More...
|
|
static DRange1d | FromIntersection (DRange1dCR rangeA, DRange1dCR rangeB) |
| return the (possibly null) intersection of two ranges. More...
|
|
static DRange1d | FromUnion (DRange1dCR rangeA, DRange1dCR rangeB) |
| return the (possibly null) union of two ranges. More...
|
|
static void | SortLowInPlace (bvector< DRange1d > &data) |
| Sort on low values. More...
|
|
static void | SimplifyInPlace (bvector< DRange1d > &data) |
| Combine intervals so there are no overlaps. More...
|
|
static DRange1d | FromExtent (bvector< DRange1d > &data) |
| Return the encompassing single range. More...
|
|
static DRange1d | FromIntersection (bvector< DRange1d > &data) |
| Return the overall intersection. More...
|
|
static void | AppendClips (bvector< DRange1d > &dataA, DRange1dCR clipper, bvector< DRange1d > &dataOut) |
| Intersect each range in dataA with clipper. More...
|
|
static void | ClipInPlace (bvector< DRange1d > &dataA, DRange1dCR clipper) |
| Intersect each range in dataA with clipper. Retain non-empty result parts. More...
|
|
static void | IntersectSorted (bvector< DRange1d > &dataA, bvector< DRange1d > &dataB, bvector< DRange1d > &dataOut) |
| Intersect intervals in two pre-sorted sets. Output may NOT be the same as either input. More...
|
|
static void | UnionSorted (bvector< DRange1d > &dataA, bvector< DRange1d > &dataB, bvector< DRange1d > &dataOut) |
| Union of intervals in two pre-sorted sets. Output may NOT be the same as either input. More...
|
|
static void | DifferenceSorted (bvector< DRange1d > &dataA, bvector< DRange1d > &dataB, bvector< DRange1d > &dataOut) |
| Intersect intervals in two pre-sorted sets. Output may NOT be the same as either input. More...
|
|
static bool | IsIncreasing (bvector< DRange1d > &data, bool allowZeroLength=false, bool allowZeroGaps=false) |
| Test for increasing relationships, optionally allowing zero length. More...
|
|
static double | LengthSum (bvector< DRange1d > &data) |
| Sum the interval lengths. More...
|
|
A 1d interval with low and high values.
Useful typedefs for DRange1d
If you look closely at "names" for special intervals, there are several tricky distinctions:
-
{high > low} The "usual" interval with a strictly positive length. You can test for this with {IsPositiveLength ()}
-
{high == low} A single point interval. This has something int it (one point!) and is NOT empty. You can test for this with {IsSinglePoint()}
-
{high < low} The set of points x with {low < x < high} is empty. You can test for this with {IsEmpty()}
-
The initialization value NullInterval – this is a unique value. You can test for this with {IsNull()} The NullInterval is empty, but not all empty intervals are equal to the NullInterval if you compare the low and high values!!
Be aware that if the application needs to treat a single point interval as "empty" for its purposes, the use of "empty" will be what the methods call {IsEmptyOrSinglePoint()}