Chris@16: /* Chris@16: [auto_generated] Chris@16: boost/numeric/odeint/integrate/detail/integrate_const.hpp Chris@16: Chris@16: [begin_description] Chris@16: integrate const implementation Chris@16: [end_description] Chris@16: Chris@16: Copyright 2009-2012 Karsten Ahnert Chris@16: Copyright 2009-2012 Mario Mulansky Chris@16: Chris@16: Distributed under the Boost Software License, Version 1.0. Chris@16: (See accompanying file LICENSE_1_0.txt or Chris@16: copy at http://www.boost.org/LICENSE_1_0.txt) Chris@16: */ Chris@16: Chris@16: #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_CONST_HPP_INCLUDED Chris@16: #define BOOST_NUMERIC_ODEINT_INTEGRATE_DETAIL_INTEGRATE_CONST_HPP_INCLUDED Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace numeric { Chris@16: namespace odeint { Chris@16: namespace detail { Chris@16: Chris@16: // forward declaration Chris@16: template< class Stepper , class System , class State , class Time , class Observer > Chris@16: size_t integrate_adaptive( Chris@16: Stepper stepper , System system , State &start_state , Chris@16: Time &start_time , Time end_time , Time &dt , Chris@16: Observer observer , controlled_stepper_tag Chris@16: ); Chris@16: Chris@16: Chris@16: template< class Stepper , class System , class State , class Time , class Observer > Chris@16: size_t integrate_const( Chris@16: Stepper stepper , System system , State &start_state , Chris@16: Time start_time , Time end_time , Time dt , Chris@16: Observer observer , stepper_tag Chris@16: ) Chris@16: { Chris@16: typename odeint::unwrap_reference< Observer >::type &obs = observer; Chris@16: Chris@16: Time time = start_time; Chris@16: int step = 0; Chris@16: Chris@16: while( less_eq_with_sign( time+dt , end_time , dt ) ) Chris@16: { Chris@16: obs( start_state , time ); Chris@16: stepper.do_step( system , start_state , time , dt ); Chris@16: // direct computation of the time avoids error propagation happening when using time += dt Chris@16: // we need clumsy type analysis to get boost units working here Chris@16: ++step; Chris@16: time = start_time + static_cast< typename unit_value_type