|
Boost Users : |
From: Andy Little (andy_at_[hidden])
Date: 2006-08-28 05:09:40
"Guillaume Melquiond" <guillaume.melquiond_at_[hidden]> wrote in message
news:1156754913.5030.5.camel_at_localhost...
> Le dimanche 27 août 2006 à 13:46 +0100, Andy Little a écrit :
>> Shouldnt this work?:
>>
>> #include <boost/numeric/interval.hpp>
>>
>> int main()
>> {
>> boost::numeric::interval<double> v(.5);
>> cos(v);
>> }
>
> With the default interval policies, transcendental functions are not
> enabled since they usually do not provide the inclusion property of
> interval arithmetic. This is why you get a compile-time error.
>
> For specific policies, you can take a look at the find_root.cpp and
> transc.cpp examples. The first one provides non-guaranteed interval
> functions by relying on the standard library. The second one provides
> guaranteed interval functions by relying on an external library.
Thanks for the reply. I must admit I just skimmed the docs, but on the first
page its says,
under the heading :
*sqrt log exp sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh fmod*
"The functions sqrt, log, exp, sin, cos, tan, asin, acos, atan, sinh, cosh,
tanh, asinh, acosh, atanh are also defined. There is not much to say; these
functions extend the traditional functions to the intervals and respect the
basic property of interval arithmetic. They use the checking policy to produce
empty intervals when the input interval is strictly outside of the domain of the
function."
The bit I read was "There is not much to say". and I assumed from that they
should work by default.
http://www.boost.org/libs/numeric/interval/doc/interval.htm#opers
Is it worth modifying the text of the docs:
"The functions sqrt, log, exp, sin, cos, tan, asin, acos, atan, sinh, cosh,
tanh, asinh, acosh, atanh are also defined. With the default interval policies,
transcendental functions are not enabled since they usually do not provide the
inclusion property of interval arithmetic, so you will get a compile-time error
unless you provide a valid policy. These functions extend the traditional
functions to the intervals and respect the basic property of interval
arithmetic. They use the checking policy to produce empty intervals when the
input interval is strictly outside of the domain of the function."
I can do the mods, but someone else will have to apply them(no CVS access) and I
will have to embed them in a post.
regards
Andy Little
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net