diff options
Diffstat (limited to 'boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp')
-rw-r--r-- | boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp b/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp index 6695ba6a97..d296246ae7 100644 --- a/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp +++ b/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp @@ -41,7 +41,8 @@ class rosenbrock4_dense_output public: typedef ControlledStepper controlled_stepper_type; - typedef typename controlled_stepper_type::stepper_type stepper_type; + typedef typename unwrap_reference< controlled_stepper_type >::type unwrapped_controlled_stepper_type; + typedef typename unwrapped_controlled_stepper_type::stepper_type stepper_type; typedef typename stepper_type::value_type value_type; typedef typename stepper_type::state_type state_type; typedef typename stepper_type::wrapped_state_type wrapped_state_type; @@ -54,7 +55,7 @@ public: typedef rosenbrock4_dense_output< ControlledStepper > dense_output_stepper_type; rosenbrock4_dense_output( const controlled_stepper_type &stepper = controlled_stepper_type() ) - : m_stepper( stepper ) , + : m_stepper( stepper ) , m_x1() , m_x2() , m_current_state_x1( true ) , m_t() , m_t_old() , m_dt() @@ -75,16 +76,17 @@ public: template< class System > std::pair< time_type , time_type > do_step( System system ) { + unwrapped_controlled_stepper_type &stepper = m_stepper; failed_step_checker fail_checker; // to throw a runtime_error if step size adjustment fails controlled_step_result res = fail; m_t_old = m_t; do { - res = m_stepper.try_step( system , get_current_state() , m_t , get_old_state() , m_dt ); + res = stepper.try_step( system , get_current_state() , m_t , get_old_state() , m_dt ); fail_checker(); // check for overflow of failed steps } while( res == fail ); - m_stepper.stepper().prepare_dense_output(); + stepper.stepper().prepare_dense_output(); this->toggle_current_state(); return std::make_pair( m_t_old , m_t ); } @@ -96,20 +98,23 @@ public: template< class StateOut > void calc_state( time_type t , StateOut &x ) { - m_stepper.stepper().calc_state( t , x , get_old_state() , m_t_old , get_current_state() , m_t ); + unwrapped_controlled_stepper_type &stepper = m_stepper; + stepper.stepper().calc_state( t , x , get_old_state() , m_t_old , get_current_state() , m_t ); } template< class StateOut > void calc_state( time_type t , const StateOut &x ) { - m_stepper.stepper().calc_state( t , x , get_old_state() , m_t_old , get_current_state() , m_t ); + unwrapped_controlled_stepper_type &stepper = m_stepper; + stepper.stepper().calc_state( t , x , get_old_state() , m_t_old , get_current_state() , m_t ); } template< class StateType > void adjust_size( const StateType &x ) { - m_stepper.adjust_size( x ); + unwrapped_controlled_stepper_type &stepper = m_stepper; + stepper.adjust_size( x ); resize_impl( x ); } |