Boost logo

Boost :

From: Jens Maurer (jmaurer_at_[hidden])
Date: 2000-03-04 05:57:35


Gavin Collings wrote:
> One question though,
> have you considered abandoning the class invariant low <= up in favour
> of an approach where there are no constraints upon the individual
> bounds. Reason: sometimes it's useful to distinguish a +/- from a -/+

This would introduce a lot more freedom into the definition
of the operators, i.e. you would have to state for each
operator if you wanted [low, up] or [up, low] for the result,
of course depending on the input. I cannot see any mathematical
definition for that which is as nice and concise as the one
currently in use (i.e. the invariant low <= up together with
I = op(I1) => for all x in I1: op(x) in I).
But probably I'm just being dense here. Do you have an
example where the distinction would indeed be useful?

An additional implementation note: I had to use "-ffloat-store"
with gcc on Linux/ix86 for the test program to be successful,
otherwise the FPU registers will somehow hold more precision
for the interval bounds calculation than for the calculation
of the single test value. That means the interval bounds
are better than the test value result => *bang*.

Jens Maurer


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk