31.01.2014 Views

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

Version 5.0 The LEDA User Manual

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

interval<br />

x(const bigfloat& a);<br />

creates an instance x of type interval and initializes it with the<br />

smallest possible interval containing a<br />

interval<br />

x(const real& a);<br />

creates an instance x of type interval and initializes it with the<br />

smallest possible interval containing a<br />

interval<br />

x(const rational& a);<br />

creates an instance x of type interval and initializes it with the<br />

smallest possible interval containing a<br />

2. Operations<br />

<strong>The</strong> arithmetic operations +, −, ∗, /, sqrt, +=, −=, ∗=, /= and the stream operators are<br />

all available. Important: If the advanced implementation interval round outside is<br />

used, the user has to guarantee that for each interval operation the IEEE754 rounding<br />

mode ”towards +∞” is active. This can be achieved by calling the function<br />

fpu :: round up( ). To avoid side effects with library functions that require the default<br />

IEEE754 rounding mode to nearest, the function fpu :: round nearest( ) can be used to<br />

reset the rounding mode.<br />

double x.to double( ) returns the midpoint of the interval x as an approximation<br />

for the exact real number represented by x.<br />

double x.get double error( ) returns the diameter of the interval x which is the<br />

maximal error of the approximation x.to double( )<br />

of the exact real number represented by x.<br />

bool x.is a point( ) returns true if and only if the interval x consists of<br />

a single point.<br />

bool x.is finite( ) returns true if and only if the interval x is a finite<br />

interval.<br />

bool x.contains(double x) returns true if and only if the interval x contains the<br />

number x<br />

double x.upper bound( ) returns the upper bound of the interval x.<br />

double x.lower bound( ) returns the lower bound of the interval x.<br />

void x.set range(VOLATILE I double x, VOLATILE I double y)<br />

sets the current interval to [x, y].

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!