Shouldnt this work?:
#include
Le dimanche 27 août 2006 à 13:46 +0100, Andy Little a écrit :
Shouldnt this work?:
#include
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. Best regards, Guillaume
"Guillaume Melquiond"
Le dimanche 27 août 2006 à 13:46 +0100, Andy Little a écrit :
Shouldnt this work?:
#include
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
Le lundi 28 août 2006 à 10:09 +0100, Andy Little a écrit :
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.
[...]
The bit I read was "There is not much to say". and I assumed from that they should work by default.
Looking at it now, I agree it was not really clear. It should have been specified that the functions will fail to compile if the policies do not provide corresponding features.
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.
Do not bother writing a patch. I will do the changes directly. Thanks for the wording. Best regards, Guillaume
participants (2)
-
Andy Little
-
Guillaume Melquiond