Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-17 09:53:59

0001 /*
0002  [auto_generated]
0003  boost/numeric/odeint/integrate/integrate_n_steps.hpp
0004 
0005  [begin_description]
0006  Integration of n steps with constant time size. Adaptive and dense-output methods are fully supported.
0007  [end_description]
0008 
0009  Copyright 2009-2011 Karsten Ahnert
0010  Copyright 2009-2011 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_N_STEPS_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED
0020 
0021 #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
0022 #include <boost/numeric/odeint/iterator/integrate/null_observer.hpp>
0023 #include <boost/numeric/odeint/iterator/integrate/detail/integrate_n_steps.hpp>
0024 
0025 namespace boost {
0026 namespace numeric {
0027 namespace odeint {
0028 
0029 
0030 /*
0031  * Integrates n steps
0032  *
0033  * the two overloads are needed in order to solve the forwarding problem
0034  */
0035 template< class Stepper , class System , class State , class Time , class Observer>
0036 Time integrate_n_steps(
0037         Stepper stepper , System system , State &start_state ,
0038         Time start_time , Time dt , size_t num_of_steps ,
0039         Observer observer )
0040 {
0041     typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
0042     return detail::integrate_n_steps(
0043                 stepper , system , start_state ,
0044                 start_time , dt , num_of_steps ,
0045                 observer , stepper_category() );
0046 }
0047 
0048 /**
0049  * \brief Solves the forwarding problem, can be called with Boost.Range as start_state.
0050  */
0051 template< class Stepper , class System , class State , class Time , class Observer >
0052 Time integrate_n_steps(
0053         Stepper stepper , System system , const State &start_state ,
0054         Time start_time , Time dt , size_t num_of_steps ,
0055         Observer observer )
0056 {
0057     typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
0058     return detail::integrate_n_steps(
0059                  stepper , system , start_state ,
0060                  start_time , dt , num_of_steps ,
0061                  observer , stepper_category() );
0062 }
0063 
0064 
0065 /**
0066  * \brief The same function as above, but without observer calls.
0067  */
0068 template< class Stepper , class System , class State , class Time >
0069 Time integrate_n_steps(
0070         Stepper stepper , System system , State &start_state ,
0071         Time start_time , Time dt , size_t num_of_steps )
0072 {
0073     return integrate_n_steps( stepper , system , start_state , start_time , dt , num_of_steps , null_observer() );
0074 }
0075 
0076 /**
0077  * \brief Solves the forwarding problem, can be called with Boost.Range as start_state.
0078  */
0079 template< class Stepper , class System , class State , class Time >
0080 Time integrate_n_steps(
0081         Stepper stepper , System system , const State &start_state ,
0082         Time start_time , Time dt , size_t num_of_steps )
0083 {
0084     return integrate_n_steps( stepper , system , start_state , start_time , dt , num_of_steps , null_observer() );
0085 }
0086 
0087 
0088 
0089 /************* DOXYGEN *************/
0090     /**
0091      * \fn Time integrate_n_steps( Stepper stepper , System system , State &start_state , Time start_time , Time dt , size_t num_of_steps , Observer observer )
0092      * \brief Integrates the ODE with constant step size.
0093      *
0094      * This function is similar to integrate_const. The observer is called at
0095      * equidistant time intervals t0 + n*dt.
0096      * If the Stepper is a normal stepper without step size control, dt is also
0097      * used for the numerical scheme. If a ControlledStepper is provided, the 
0098      * algorithm might reduce the step size to meet the error bounds, but it is 
0099      * ensured that the observer is always called at equidistant time points
0100      * t0 + n*dt. If a DenseOutputStepper is used, the step size also may vary
0101      * and the dense output is used to call the observer at equidistant time
0102      * points. The final integration time is always t0 + num_of_steps*dt.
0103      *
0104      * \param stepper The stepper to be used for numerical integration.
0105      * \param system Function/Functor defining the rhs of the ODE.
0106      * \param start_state The initial condition x0.
0107      * \param start_time The initial time t0.
0108      * \param dt The time step between observer calls, _not_ necessarily the 
0109      * time step of the integration.
0110      * \param num_of_steps Number of steps to be performed
0111      * \param observer Function/Functor called at equidistant time intervals.
0112      * \return The number of steps performed.
0113      */
0114 
0115 
0116 
0117 } // namespace odeint
0118 } // namespace numeric
0119 } // namespace boost
0120 
0121 
0122 
0123 #endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_N_STEPS_HPP_INCLUDED