- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我需要在安装了 gcc/g++ (7.2.0) 和 boost (1.66) 的 linux (CentOs 6.7) 服务器上运行一些代码(编辑: 不仅是 1.66,还有一个旧版本boost 版本受到干扰。保持机器清洁伙计们)。我使用如下策略指定了我的间隔类型:
// test.cpp
#include <boost/numeric/interval.hpp>
namespace bn = boost::numeric;
namespace bi = bn::interval_lib;
using Interval = bn::interval<
double,
bi::policies<
bi::save_state<bi::rounded_transc_std<double> >,
bi::checking_base<double>
>
>;
现在我想做一些简单的计算,比如:
// still test.cpp
int main()
{
Interval iv_arg {1.0};
Interval res = sin(iv_arg);
}
在我的本地机器上,一台 mac,用 clang 编译工作得很好。但是,一旦我尝试在服务器上运行它,使用 g++ -std=c++11 test.cpp
编译,我就收到了错误:
/usr/include/boost/numeric/interval/rounded_arith.hpp:71:59: error: 'to_int' was not declared in this scope, and no declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive] T int_down(const T& x) { this->downward(); return to_int(x); } ~~~~~~^~~ /usr/include/boost/numeric/interval/rounded_arith.hpp:71:59: note: declarations in dependent base 'boost::numeric::interval_lib::detail::c99_rounding' are not found by unqualified lookup /usr/include/boost/numeric/interval/rounded_arith.hpp:71:59: note: use 'this->to_int' instead
还有一些信息似乎与主题无关,但如果有帮助,我可以将其包括在内。我试着谷歌了一下,但找不到任何相关的东西。如果可能的话,我想找到一个不需要对服务器进行任何更改的解决方案。有没有人有过类似的想法或遇到过类似的问题?
最佳答案
编译它的第一个 boost 版本是 1.58
关于c++ - gcc 正弦和 boost 编译错误 :interval,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48927472/
我写的函数有问题。想法是使用 taylor 展开而不是 js 数学对象来计算 sin 和 cosin 值(在 radians 上运行) .这些是方程式: sin(x) = (x^1)/1! - (x^
我不知道这是编程还是数学问题,但我整理了一些FFT的简短示例。我加载了440hz的波并在顶部添加了一些正弦波,但是由于某种原因,频谱中存在一个我不理解的“波”。 据我了解,频谱应该具有相同的| Y(f
这个问题在这里已经有了答案: Java Math.cos(Math.toRadians()) returns weird values (4 个答案) 关闭 10 年前。 我正在编写一个程序,我必须
我想在 ios4 中实现一个正弦和余弦计算器: if([operation isEqual:@"sin"]){ operand = (operand*M_PI/180.0); oper
我使用 256 个元素为 VHDL 制作了一个正弦 LUT。 我使用 MIDI 输入,因此值范围为 8.17Hz(注 #0)到 12543.85z(注 #127)。 我有另一个 LUT 计算必须发送到
我想在ios4中实现一个正弦和余弦计算器: if([operation isEqual:@"sin"]){ operand = (operand*M_PI/180.0); operan
我是一名优秀的程序员,十分优秀!