headmyshoulder / odeint-v2

odeint - solving ordinary differential equations in c++ v2
http://headmyshoulder.github.com/odeint-v2/
Other
337 stars 102 forks source link

Compiling error with `quadmath/black_hole.cpp` example #242

Open solunter opened 5 years ago

solunter commented 5 years ago

I am trying to compile the multiprecision example quadmath/black_hole.cpp. But it failed and gave following errors:

black_hole.cpp:140:94: error: wrong number of template arguments (1, should be 3) dense_output_dopri5_type dopri5( controlled_dopri5_type( default_error_checker< my_float >( abs_err , rel_err , a_x , a_dxdt ) ) ); ^ In file included from ~/boost_1_68_0/include/boost/numeric/odeint.hpp:35:0, from black_hole.cpp:79: ~/boost_1_68_0/include/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp:56:7: note: provided for ‘template<class Value, class Algebra, class Operations> class boost::numeric::odeint::default_error_checker’ class default_error_checker ^ In file included from /usr/include/c++/5/algorithm:62:0, from black_hole.cpp:23: /usr/include/c++/5/bits/stl_algo.h: In instantiation of ‘_Funct std::for_each(_IIter, _IIter, _Funct) [with _IIter = boost::numeric::odeint::adaptive_time_iterator<boost::numeric::odeint::dense_output_runge_kutta<boost::numeric::odeint::controlled_runge_kutta<boost::numeric::odeint::runge_kutta_dopri5<std::vector<std::complex<__float128> >, float128> > >, radMod, std::vector<std::complex<float128> >, boost::numeric::odeint::dense_output_stepper_tag>; _Funct = main(int, char)::<lambda(const std::pair<std::vector<std::complex<__float128> >&, __float128>&)>]’: black_hole.cpp:146:9: required from here /usr/include/c++/5/bits/stl_algo.h:3767:5: error: no match for call to ‘(main(int, char)::<lambda(const std::pair<std::vector<std::complex<__float128> >&, float128>&)>) (boost::iterators::detail::iterator_facade_base<boost::numeric::odeint::adaptive_time_iterator<boost::numeric::odeint::dense_output_runge_kutta<boost::numeric::odeint::controlled_runge_kutta<boost::numeric::odeint::runge_kutta_dopri5<std::vector<std::complex<__float128> >, float128> > >, radMod, std::vector<std::complex<float128> >, boost::numeric::odeint::dense_output_stepper_tag>, std::pair<const std::vector<std::complex<float128> >, const float128>, boost::iterators::single_pass_traversal_tag, std::pair<const std::vector<std::complex<__float128> >&, const float128&>, long int, false, false>::reference)’ f(__first); ^ /usr/include/c++/5/bits/stl_algo.h:3767:5: note: candidate: void ()(const std::pair<std::vector<std::complex<float128> >&, float128>&) /usr/include/c++/5/bits/stl_algo.h:3767:5: note: candidate expects 2 arguments, 2 provided black_hole.cpp:144:68: note: candidate: main(int, char**)::<lambda(const std::pair<std::vector<std::complex<float128> >&, float128>&)> []( const std::pair< state_type&, my_float > &x ) { ^ black_hole.cpp:144:68: note: no known conversion for argument 1 from ‘boost::iterators::detail::iterator_facade_base<boost::numeric::odeint::adaptive_time_iterator<boost::numeric::odeint::dense_output_runge_kutta<boost::numeric::odeint::controlled_runge_kutta<boost::numeric::odeint::runge_kutta_dopri5<std::vector<std::complex<float128> >, float128> > >, radMod, std::vector<std::complex<float128> >, boost::numeric::odeint::dense_output_stepper_tag>, std::pair<const std::vector<std::complex<__float128> >, const __float128>, boost::iterators::single_pass_traversal_tag, std::pair<const std::vector<std::complex<__float128> >&, const float128&>, long int, false, false>::reference {aka std::pair<const std::vector<std::complex<float128> >&, const float128&>}’ to ‘const std::pair<std::vector<std::complex<float128> >&, __float128>&’

I am using gcc-5.4.0 and boost_1_68_0 on Ubuntu 16.04. It is just the original example without any changes. Why doesn't it work?

I would appreciate your help.