I am going to solve a differential equation with state space representation using armadillo matrix library and odeint ODE solver. As far as I am using Dormant-Prince method, is is fine, but Cash-Karp method fails:
#include <armadillo>
#include <boost/numeric/odeint.hpp>
using namespace boost::numeric::odeint;
typedef arma::vec::fixed<3> state_type;
int main()
{
// typedef runge_kutta_dopri5<state_type> stepper_type; // fine
typedef runge_kutta_cash_karp54<state_type> stepper_type; // fails on the next line
auto mystepper=make_controlled(1E-10,1E-10,stepper_type());
return 0;
}
The compiler error is:
main.cpp: In function ‘int main()’: main.cpp:220:59: error: invalid use of incomplete type ‘boost::numeric::odeint::result_of::make_controlled::fixed<3u>
::type {aka class boost::numeric::odeint::controlled_runge_kutta::fixed<3u> , boost::numeric::odeint::default_error_checker, boost::numeric::odeint::initially_resizer, boost::numeric::odeint::explicit_error_stepper_tag>}’ auto stepper_c=make_controlled(1E-10,1E-10,stepper_type()); ^ compilation terminated due to -Wfatal-errors. make: *** [main.o] Error 1
Aucun commentaire:
Enregistrer un commentaire