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_times.hpp
0004 
0005  [begin_description]
0006  Integration of ODEs with observation at user defined points
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_TIMES_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED
0020 
0021 #include <boost/range.hpp>
0022 
0023 #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
0024 #include <boost/numeric/odeint/iterator/integrate/null_observer.hpp>
0025 #include <boost/numeric/odeint/iterator/integrate/detail/integrate_times.hpp>
0026 
0027 namespace boost {
0028 namespace numeric {
0029 namespace odeint {
0030 
0031 
0032 /*
0033  * the two overloads are needed in order to solve the forwarding problem
0034  */
0035 template< class Stepper , class System , class State , class TimeIterator , class Time , class Observer >
0036 size_t integrate_times(
0037         Stepper stepper , System system , State &start_state ,
0038         TimeIterator times_start , TimeIterator times_end , Time dt ,
0039         Observer observer )
0040 {
0041     typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
0042     return detail::integrate_times(
0043             stepper , system , start_state ,
0044             times_start , times_end , dt ,
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 TimeIterator , class Time , class Observer >
0052 size_t integrate_times(
0053         Stepper stepper , System system , const State &start_state ,
0054         TimeIterator times_start , TimeIterator times_end , Time dt ,
0055         Observer observer )
0056 {
0057     typedef typename odeint::unwrap_reference< Stepper >::type::stepper_category stepper_category;
0058     return detail::integrate_times(
0059             stepper , system , start_state ,
0060             times_start , times_end , dt ,
0061             observer , stepper_category() );
0062 }
0063 
0064 /**
0065  * \brief The same function as above, but without observer calls.
0066  */
0067 template< class Stepper , class System , class State , class TimeRange , class Time , class Observer >
0068 size_t integrate_times(
0069         Stepper stepper , System system , State &start_state ,
0070         const TimeRange &times , Time dt ,
0071         Observer observer )
0072 {
0073     return integrate_times(
0074             stepper , system , start_state ,
0075             boost::begin( times ) , boost::end( times ) , dt , observer );
0076 }
0077 
0078 /**
0079  * \brief Solves the forwarding problem, can be called with Boost.Range as start_state.
0080  */
0081 template< class Stepper , class System , class State , class TimeRange , class Time , class Observer >
0082 size_t integrate_times(
0083         Stepper stepper , System system , const State &start_state ,
0084         const TimeRange &times , Time dt ,
0085         Observer observer )
0086 {
0087     return integrate_times(
0088             stepper , system , start_state ,
0089             boost::begin( times ) , boost::end( times ) , dt , observer );
0090 }
0091 
0092 
0093 
0094 
0095 /********* DOXYGEN ***********/
0096 
0097     /**
0098      * \fn size_t integrate_times( Stepper stepper , System system , State &start_state , TimeIterator times_start , TimeIterator times_end , Time dt , Observer observer )
0099      * \brief Integrates the ODE with observer calls at given time points.
0100      *
0101      * Integrates the ODE given by system using the given stepper. This function
0102      * does observer calls at the subsequent time points given by the range 
0103      * times_start, times_end. If the stepper has not step size control, the 
0104      * step size might be reduced occasionally to ensure observer calls exactly
0105      * at the time points from the given sequence. If the stepper is a 
0106      * ControlledStepper, the step size is adjusted to meet the error bounds, 
0107      * but also might be reduced occasionally to ensure correct observer calls.
0108      * If a DenseOutputStepper is provided, the dense output functionality is
0109      * used to call the observer at the given times. The end time of the 
0110      * integration is always *(end_time-1).
0111      *
0112      * \param stepper The stepper to be used for numerical integration.
0113      * \param system Function/Functor defining the rhs of the ODE.
0114      * \param start_state The initial condition x0.
0115      * \param times_start Iterator to the start time
0116      * \param times_end Iterator to the end time
0117      * \param dt The time step between observer calls, _not_ necessarily the 
0118      * time step of the integration.
0119      * \param observer Function/Functor called at equidistant time intervals.
0120      * \return The number of steps performed.
0121      */
0122 
0123 
0124 
0125 } // namespace odeint
0126 } // namespace numeric
0127 } // namespace boost
0128 
0129 
0130 
0131 #endif // BOOST_NUMERIC_ODEINT_INTEGRATE_INTEGRATE_TIMES_HPP_INCLUDED