Skip to content

Instantly share code, notes, and snippets.

@t-uda t-uda/file1.sh
Created Aug 12, 2012

Embed
What would you like to do?
boost::numeric::interval<int>(3): C++ Boost 区間演算ライブラリ 超越関数 ref: http://qiita.com/items/e08ca64b318917e6d4ab
$ g++ test-interval-transc-error.cpp
In file included from /usr/include/boost/numeric/interval.hpp:30:0,
from test-interval-transc-error.cpp:2:
/usr/include/boost/numeric/interval/transc.hpp: In function ‘boost::numeric::interval<T, Policies> boost::numeric::exp(const boost::numeric::interval<T, Policies>&) [with T = double, Policies = boost::numeric::interval_lib::policies<boost::numeric::interval_lib::rounded_math<double>, boost::numeric::interval_lib::checking_strict<double> >]’:
test-interval-transc-error.cpp:12:30: instantiated from here
/usr/include/boost/numeric/interval/transc.hpp:34:64: error: ‘boost::numeric::interval_lib::policies<boost::numeric::interval_lib::rounded_math<double>, boost::numeric::interval_lib::checking_strict<double> >::rounding’ has no member named ‘exp_down’
/usr/include/boost/numeric/interval/transc.hpp:34:64: error: ‘boost::numeric::interval_lib::policies<boost::numeric::interval_lib::rounded_math<double>, boost::numeric::interval_lib::checking_strict<double> >::rounding’ has no member named ‘exp_up’
$ g++ test-interval-transc-change_rounding.cpp -o test-interval-transc-change_rounding.out
$ ./test-interval-transc-change_rounding.out
exp(1) = [2.71828,2.71828]
#include <iostream>
#include <boost/numeric/interval.hpp>
#include <boost/numeric/interval/io.hpp>
int main () {
using std::cout;
using std::endl;
using namespace boost::numeric;
typedef double R;
typedef interval_lib::change_rounding<
interval<R>,
interval_lib::save_state<
interval_lib::rounded_transc_opp<
R
>
>
>::type TranscIR;
const TranscIR x = 1;
cout << "exp(1) = " << exp(x) << endl;
return 0;
}
#include <iostream>
#include <boost/numeric/interval.hpp>
#include <boost/numeric/interval/io.hpp>
int main () {
using std::cout;
using std::endl;
using namespace boost::numeric;
typedef double R;
typedef interval<R> IR;
const IR x = 1;
cout << "exp(1) = " << exp(x) << endl;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.