Go to the
previous,
next chapter.
This file defines the scalar interval operations and introduces the new
data type
INTERVAL
. All interval operations are based on BIAS
(see section
Basic Interval Arithmetic Subroutines).
- Data Type:
INTERVAL Variable [(REAL lower bound [, REAL upper bound])]
- Declares Variable as scalar interval. If only lower bound is present,
Variable is initialized to be a point interval with the value lower bound.
If both bounds are present, Variable is initialized to the interval
[lower bound...upper bound]. Example:
INTERVAL a(1.0);
declares the variable a
as scalar interval and initializes a
with
the point interval [1.0,1.0].
The basic operations +, -, *, and /, the unary operators
+ and - as well as +=, -=, *=, and /= are
defined for scalar intervals. REAL
values may also be used instead of intervals,
as long as one operand is of type INTERVAL
.
Comparisons of scalar intervals are possible with == and !=.
Inclusion properties may be tested with <= and < where the latter tests
for inclusion in the interior. For example:
a <= b
returns TRUE
, if the interval a
is contained in the interval b
.
Additionally, the following functions are provided:
- Constructor:
INTERVAL INTERVAL (REAL lower bound [, REAL upper bound])
- Returns/defines a scalar interval. If only lower bound is present,
A point interval with the value lower bound is returned.
Otherwise the interval [lower bound...upper bound] is returned.
- Function:
INTERVAL AddBounds (REAL r, REAL s)
- Returns an interval containing an enclosure of the true sum of
r and s.
- Function:
INTERVAL SubBounds (REAL r, REAL s)
- Returns an interval containing an enclosure of the true difference between
r and s.
- Function:
INTERVAL MulBounds (REAL r, REAL s)
- Returns an interval containing an enclosure of the true product of
r and s.
- Function:
INTERVAL DivBounds (REAL r, REAL s)
- Returns an interval containing an enclosure of the true quotient between
r and s.
- Function:
REAL Inf (INTERVAL a)
- Returns the lower bound (infimum) of the interval a.
- Function:
REAL Sup (INTERVAL a)
- Returns the upper bound (supremum) of the interval a.
- Function:
REAL Pred (REAL r)
- Returns the largest
REAL
number less than r.
- Function:
INTERVAL Pred (INTERVAL a)
- Returns the largest interval contained in the interior of a.
If no such interval exists, the result is undefined.
- Function:
REAL Succ (REAL r)
- Returns the smallest
REAL
number greater than r.
- Function:
INTERVAL Succ (INTERVAL a)
- Returns the smallest interval in which a is contained in the interior.
- Function:
INTERVAL Hull (REAL r)
- Returns the point interval [r,r].
- Function:
INTERVAL Hull (x, y)
- Returns the convex hull of x and y. The expressions x and y
may be either of type
REAL
or INTERVAL
.
- Function:
INTERVAL SymHull (REAL r)
- Returns the interval [-r,r].
- Function:
REAL Mid (INTERVAL a)
- Returns the midpoint of the interval a.
- Function:
REAL Diam (INTERVAL a)
- Returns the diameter of the interval a.
- Function:
REAL Abs (INTERVAL a)
- Returns the absolute value of the interval a.
- Function:
REAL Mig (INTERVAL a)
- Returns the mignitude of the interval a.
- Function:
REAL Distance (x, y)
- Returns the distance between x and y. The expressions x and y
may be either of type
REAL
or INTERVAL
.
- Function:
BOOL Intersection (INTERVAL a, INTERVAL b, INTERVAL c)
- If b and c intersect, the value
TRUE
is returned and a
contains the intersection. Otherwise FALSE
is returned and the contents of
a are undefined.