【发布时间】:2013-04-07 09:12:34
【问题描述】:
我在使用 Boost 的 Interval 库时遇到问题
#include <boost/numeric/interval.hpp>
void test()
{
typedef boost::numeric::interval<double> Interval;
Interval i1(1.0, 2.0);
auto i2 = cos(i1);
}
我收到以下编译错误:
transc.hpp(73): error C2039: 'cos_down' : is not a member of 'boost::numeric::interval_lib::rounded_math<double>'
transc.hpp(73): error C2039: 'cos_up' : is not a member of 'boost::numeric::interval_lib::rounded_math<double>'
transc.hpp(75): error C2039: 'cos_up' : is not a member of 'boost::numeric::interval_lib::rounded_math<double>'
我尝试了interval_lib::policies 的几种组合,但无法编译示例。我不追求非常高的精度。我想要的基本上是添加两个间隔相当于添加两个doubles。
【问题讨论】:
-
弗拉基米尔,不幸的是,这并没有解决它。
-
这里是一个关于如何基于多精度库为超越函数创建舍入策略的示例:boost.org/doc/libs/1_61_0/libs/numeric/interval/examples/…
标签: c++ boost boost-interval