2 * odeint_rk4_lorenz.cpp
4 * Copyright 2011-2012 Mario Mulansky
5 * Copyright 2012 Karsten Ahnert
7 * Distributed under the Boost Software License, Version 1.0.
8 * (See accompanying file LICENSE_1_0.txt or
9 * copy at http://www.boost.org/LICENSE_1_0.txt)
13 #include <boost/array.hpp>
15 #include <boost/numeric/odeint/stepper/runge_kutta4_classic.hpp>
16 #include <boost/numeric/odeint/stepper/runge_kutta4.hpp>
17 #include <boost/numeric/odeint/algebra/array_algebra.hpp>
19 #include "rk_performance_test_case.hpp"
23 typedef boost::array< double , 3 > state_type;
24 typedef boost::numeric::odeint::runge_kutta4< state_type , double , state_type , double ,
25 boost::numeric::odeint::array_algebra > rk4_odeint_type;
31 void reset_init_cond()
35 m_x[0] = 10.0 * rand() / RAND_MAX;
36 m_x[1] = 10.0 * rand() / RAND_MAX;
37 m_x[2] = 10.0 * rand() / RAND_MAX;
39 /* hand chosen random (cf fortran) */
47 inline void do_step( const double dt )
49 m_stepper.do_step( lorenz() , m_x , m_t , dt );
53 double state( const size_t i ) const
59 rk4_odeint_type m_stepper;
68 odeint_wrapper stepper;