#include <Interval_Type.h>
Public Methods | |
| Interval(Type) (Type a, Type b) | |
| Interval(Type) () | |
| Interval(Type) (const Interval(Type) &i) | |
| void | scan (Is is) |
| void | print (Os os) const |
| void | get (Type &a, Type &b) const |
| Type | getLower () const |
| Type | getUpper () const |
| void | set (Type a, Type b) |
| bool | in (Type x, real tolerance=0) const |
| bool | ok () const |
Friends | |
| Os& | operator<< (Os &os, const Interval(Type) &i) |
| Is& | operator>> (Is &is, Interval(Type) &i) |
| Interval(Type) | operator+ (Type m, Interval(Type) i) |
| Interval(Type) | operator+ (Interval(Type) i, Type m) |
| Interval(Type) | operator+ (Interval(Type) i1, Interval(Type) i2) |
| Interval(Type) | operator * (Interval(Type) i, Type s) |
NAME: Interval(Type) - interval [a,b], where a and b are of type Type
DESCRIPTION:
The class represents an interval `$`[a,b]`$` where `$`a`$` and `$`b`$` are of type "Type". Usually "Type" will be "real" or "int". The class can perform some simple arithmetic operations on the intervals, see the examples below.
|
|
There is an empty constructor that declares the interval `$`[0,0]`$`. A proper interval must then be set bye the "scan" function. "scan" reads a string, for example, ""[3,5]"" and declares an interval `$`[3,5]`$`. The other constructor takes the end points of the interval as arguments. |
|
|
See documentation of one of the overloaded constructor. |
|
|
See documentation of one of the overloaded constructor. |
|
|
returns the lower and upper interval limits. |
|
|
returns the lower interval limit. |
|
|
returns the upper interval limit. |
|
|
returns "true" if `$`x`\in` [a,b]`$`, where `$`x`$` is the argument "x" to the function. |
|
|
checks whether `$`a<b`$`, if so, "true" is returned, otherwise "false" is returned. |
|
|
prints the interval in a "scan"-readable syntax. The end points are formatted according to the format state of the "Os" object that is sent to "print" as argument. |
|
|
reads the interval. The syntax is ""[a,b]"". |
|
|
sets the lower ("a") and upper ("b") interval limits. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|