Boost logo

Boost :

From: Matthew Austern (austern_at_[hidden])
Date: 2001-04-24 12:19:48


"Peter Schmitteckert (boost)" wrote:
>
> Salut,
>
> On Tuesday 24 April 2001 12:53, Dave wrote:
>
> > > has (?) replaced char[]. (We only need to convince the performance
> > > freaks that there is little or no cost involved.)
> >
> > Is that really possible? Surely one has to do 2-3 times as many
> > floating-point ops to handle intervals as raw numbers. I know that in my
> > application domain (simulation), nobody would be willing to pay that price.
> > Typically these simulations use iterative methods that only strive for a
> > few digits of accuracy before producing a result anyway.
>
> Well, you can use better algorithms.
> Suppose you want to calculate a zero of a function f(x).
>
> You will need just one function call to check if x has a
> zero in the interval -1..1:
> if f( interval<double>(-1,1) ) contains no zero then it is proven that there
> is no zero.

But isn't that just a matter of redefining the problem away?
When you write f(interval<double>(-1, 1)), what you really mean
is "the ordered pair (a, b) such that a is less than or equal
to f(x) for all x in [-1, 1] and b is greater than or equal to
f(x) for all x in [-1, 1]".

Certainly if you find such an (a, b), and if you know that f
is continuous, then you know whether or not f has a zero in
[-1, 1]. But you've turned a root-finding problem into a
minimax problem, which isn't necessarily easier.

                        --Matt


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