diff options
Diffstat (limited to 'boost/numeric/odeint/integrate/integrate.hpp')
-rw-r--r-- | boost/numeric/odeint/integrate/integrate.hpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/boost/numeric/odeint/integrate/integrate.hpp b/boost/numeric/odeint/integrate/integrate.hpp index 6cb96c0f1..446656b58 100644 --- a/boost/numeric/odeint/integrate/integrate.hpp +++ b/boost/numeric/odeint/integrate/integrate.hpp @@ -48,6 +48,15 @@ integrate( System system , State &start_state , Time start_time , Time end_time return integrate_adaptive( stepper_type() , system , start_state , start_time , end_time , dt , observer ); } +template< class Value , class System , class State , class Time , class Observer > +size_t +integrate( System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer ) +{ + typedef controlled_runge_kutta< runge_kutta_dopri5< State , Value , State , Time > > stepper_type; + return integrate_adaptive( stepper_type() , system , start_state , start_time , end_time , dt , observer ); +} + + /* @@ -59,6 +68,13 @@ size_t integrate( System system , State &start_state , Time start_time , Time en return integrate( system , start_state , start_time , end_time , dt , null_observer() ); } +template< class Value , class System , class State , class Time > +size_t integrate( System system , State &start_state , Time start_time , Time end_time , Time dt ) +{ + return integrate< Value >( system , start_state , start_time , end_time , dt , null_observer() ); +} + + /** * \fn integrate( System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer ) @@ -70,6 +86,9 @@ size_t integrate( System system , State &start_state , Time start_time , Time en * integration with step size control, thus dt changes during the integration. * This method uses standard error bounds of 1E-6. * After each step, the observer is called. + * + * \attention A second version of this function template exists which explicitly + * expects the value type as template parameter, i.e. integrate< double >( sys , x , t0 , t1 , dt , obs ); * * \param system The system function to solve, hence the r.h.s. of the * ordinary differential equation. @@ -92,6 +111,9 @@ size_t integrate( System system , State &start_state , Time start_time , Time en * integration with step size control, thus dt changes during the integration. * This method uses standard error bounds of 1E-6. * No observer is called. + * + * \attention A second version of this function template exists which explicitly + * expects the value type as template parameter, i.e. integrate< double >( sys , x , t0 , t1 , dt ); * * \param system The system function to solve, hence the r.h.s. of the * ordinary differential equation. |