Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 09:58:37

0001 /*
0002  [auto_generated]
0003  boost/numeric/odeint/integrate/integrate_adaptive.hpp
0004 
0005  [begin_description]
0006  Adaptive integration of ODEs.
0007  [end_description]
0008 
0009  Copyright 2011-2013 Karsten Ahnert
0010  Copyright 2011-2015 Mario Mulansky
0011 
0012  Distributed under the Boost Software License, Version 1.0.
0013  (See accompanying file LICENSE_1_0.txt or
0014  copy at http://www.boost.org/LICENSE_1_0.txt)
0015  */
0016 
0017 
0018 #ifndef BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED
0020 
0021 #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
0022 #include <boost/numeric/odeint/integrate/null_observer.hpp>
0023 #include <boost/numeric/odeint/integrate/detail/integrate_adaptive.hpp>
0024 
0025 namespace boost {
0026 namespace numeric {
0027 namespace odeint {
0028 
0029 
0030 /*
0031  * the two overloads are needed in order to solve the forwarding problem
0032  */
0033 template< class Stepper , class System , class State , class Time , class Observer >
0034 size_t integrate_adaptive(
0035         Stepper stepper , System system , State &start_state ,
0036         Time start_time , Time end_time , Time dt ,
0037         Observer observer )
0038 {
0039     typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
0040     return detail::integrate_adaptive(
0041             stepper , system , start_state ,
0042             start_time , end_time , dt ,
0043             observer , stepper_category() );
0044 
0045     /*
0046      * Suggestion for a new extendable version:
0047      *
0048      * integrator_adaptive< Stepper , System, State , Time , Observer , typename Stepper::stepper_category > integrator;
0049      * return integrator.run( stepper , system , start_state , start_time , end_time , dt , observer );
0050      */
0051 }
0052 
0053 /**
0054  * \brief Second version to solve the forwarding problem,
0055  * can be called with Boost.Range as start_state.
0056  */
0057 template< class Stepper , class System , class State , class Time , class Observer >
0058 size_t integrate_adaptive(
0059         Stepper stepper , System system , const State &start_state ,
0060         Time start_time , Time end_time , Time dt ,
0061         Observer observer )
0062 {
0063     typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
0064     return detail::integrate_adaptive(
0065             stepper , system , start_state ,
0066             start_time , end_time , dt ,
0067             observer , stepper_category() );
0068 }
0069 
0070 
0071 
0072 
0073 /**
0074  * \brief integrate_adaptive without an observer.
0075  */
0076 template< class Stepper , class System , class State , class Time >
0077 size_t integrate_adaptive(
0078         Stepper stepper , System system , State &start_state ,
0079         Time start_time , Time end_time , Time dt )
0080 {
0081     return integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , null_observer() );
0082 }
0083 
0084 /**
0085  * \brief Second version to solve the forwarding problem,
0086  * can be called with Boost.Range as start_state.
0087  */
0088 template< class Stepper , class System , class State , class Time >
0089 size_t integrate_adaptive(
0090         Stepper stepper , System system , const State &start_state ,
0091         Time start_time , Time end_time , Time dt )
0092 {
0093     return integrate_adaptive( stepper , system , start_state , start_time , end_time , dt , null_observer() );
0094 }
0095 
0096 
0097 /************* DOXYGEN ************/
0098 
0099     /** 
0100      * \fn integrate_adaptive( Stepper stepper , System system , State &start_state , Time start_time , Time end_time , Time dt , Observer observer )
0101      * \brief Integrates the ODE with adaptive step size.
0102      * 
0103      * This function integrates the ODE given by system with the given stepper.
0104      * The observer is called after each step. If the stepper has no error 
0105      * control, the step size remains constant and the observer is called at
0106      * equidistant time points t0+n*dt. If the stepper is a ControlledStepper,
0107      * the step size is adjusted and the observer is called in non-equidistant
0108      * intervals.
0109      *
0110      * \param stepper The stepper to be used for numerical integration.
0111      * \param system Function/Functor defining the rhs of the ODE.
0112      * \param start_state The initial condition x0.
0113      * \param start_time The initial time t0.
0114      * \param end_time The final integration time tend.
0115      * \param dt The time step between observer calls, _not_ necessarily the 
0116      * time step of the integration.
0117      * \param observer Function/Functor called at equidistant time intervals.
0118      * \return The number of steps performed.
0119      */
0120 
0121 } // namespace odeint
0122 } // namespace numeric
0123 } // namespace boost
0124 
0125 
0126 
0127 #endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_ADAPTIVE_HPP_INCLUDED