Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:53

0001 
0002 /*
0003  [auto_generated]
0004  boost/numeric/odeint/iterator/const_step_time_iterator.hpp
0005 
0006  [begin_description]
0007  Iterator for iterating throught the solution of an ODE with constant step size. The dereferences types containes also the time.
0008  [end_description]
0009 
0010  Copyright 2012-2013 Karsten Ahnert
0011  Copyright 2013 Mario Mulansky
0012 
0013  Distributed under the Boost Software License, Version 1.0.
0014  (See accompanying file LICENSE_1_0.txt or
0015  copy at http://www.boost.org/LICENSE_1_0.txt)
0016  */
0017 
0018 
0019 #ifndef BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_TIME_ITERATOR_HPP_INCLUDED
0020 #define BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_TIME_ITERATOR_HPP_INCLUDED
0021 
0022 #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
0023 #include <boost/numeric/odeint/util/stepper_traits.hpp>
0024 #include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp>
0025 #include <boost/numeric/odeint/iterator/impl/const_step_iterator_impl.hpp>
0026 
0027 namespace boost {
0028 namespace numeric {
0029 namespace odeint {
0030 
0031     /* use the const_step_iterator_impl with the right tags */
0032     template< class Stepper , class System , class State
0033 #ifndef DOXYGEN_SKIP
0034         , class StepperTag = typename base_tag< typename traits::stepper_category< Stepper >::type >::type
0035 #endif
0036     >
0037     class const_step_time_iterator : public const_step_iterator_impl<
0038             const_step_time_iterator< Stepper , System , State , StepperTag > ,
0039             Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag
0040         >
0041     {
0042         typedef typename traits::time_type< Stepper >::type time_type;
0043         typedef const_step_time_iterator< Stepper , System , State , StepperTag > iterator_type;
0044 
0045     public:
0046         const_step_time_iterator( Stepper stepper , System sys , State &s , time_type t_start , time_type t_end , time_type dt )
0047             : const_step_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag >( stepper , sys , s , t_start , t_end , dt )
0048         {}
0049 
0050         const_step_time_iterator( Stepper stepper , System sys , State &s )
0051             : const_step_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag >( stepper , sys , s )
0052         {}
0053     };
0054 
0055     template< class Stepper , class System , class State >
0056     const_step_time_iterator< Stepper , System , State > make_const_step_time_iterator_begin(
0057         Stepper stepper ,
0058         System system , 
0059         State &x ,
0060         typename traits::time_type< Stepper >::type t_start ,
0061         typename traits::time_type< Stepper >::type t_end ,
0062         typename traits::time_type< Stepper >::type dt )
0063     {
0064         return const_step_time_iterator< Stepper , System , State >( stepper , system , x , t_start , t_end , dt );
0065     }
0066 
0067     template< class Stepper , class System , class State >
0068     const_step_time_iterator< Stepper , System , State > make_const_step_time_iterator_end(
0069         Stepper stepper ,
0070         System system , 
0071         State &x )
0072     {
0073         return const_step_time_iterator< Stepper , System , State >( stepper , system , x );
0074     }
0075 
0076 
0077     template< class Stepper , class System , class State >
0078     std::pair< const_step_time_iterator< Stepper , System , State > , const_step_time_iterator< Stepper , System , State > >
0079     make_const_step_time_range(
0080         Stepper stepper ,
0081         System system , 
0082         State &x ,
0083         typename traits::time_type< Stepper >::type t_start ,
0084         typename traits::time_type< Stepper >::type t_end ,
0085         typename traits::time_type< Stepper >::type dt )
0086     {
0087         return std::make_pair(
0088             const_step_time_iterator< Stepper , System , State >( stepper , system , x , t_start , t_end , dt ) ,
0089             const_step_time_iterator< Stepper , System , State >( stepper , system , x ) );
0090     }
0091 
0092     /**
0093      * \class const_step_time_iterator
0094      *
0095      * \brief ODE Iterator with constant step size. The value type of this iterator is a std::pair containing state and time.
0096      *
0097      * Implements an iterator representing the solution of an ODE from t_start
0098      * to t_end evaluated at steps with constant step size dt.
0099      * After each iteration the iterator dereferences to a pair containing
0100      * state and time at the next time point t+dt..
0101      * This iterator can be used with Steppers and
0102      * DenseOutputSteppers and it always makes use of the all the given steppers
0103      * capabilities. A for_each over such an iterator range behaves similar to
0104      * the integrate_const routine.
0105      *
0106      * const_step_time_iterator is a model of single-pass iterator.
0107      *
0108      * The value type of this iterator is a pair with the state type and time type of the stepper.
0109      *
0110      * \tparam Stepper The stepper type which should be used during the iteration.
0111      * \tparam System The type of the system function (ODE) which should be solved.
0112      * \tparam State The state type of the ODE.
0113      */
0114 
0115 
0116     /**
0117      * \fn make_const_step_time_iterator_begin( Stepper stepper , System system , State &x ,
0118         typename traits::time_type< Stepper >::type t_start ,
0119         typename traits::time_type< Stepper >::type t_end ,
0120         typename traits::time_type< Stepper >::type dt )
0121      *
0122      * \brief Factory function for const_step_time_iterator. Constructs a begin iterator.
0123      *
0124      * \param stepper The stepper to use during the iteration.
0125      * \param system The system function (ODE) to solve.
0126      * \param x The initial state. const_step_time_iterator stores a reference of s and changes its value during the iteration.
0127      * \param t_start The initial time.
0128      * \param t_end The end time, at which the iteration should stop.
0129      * \param dt The initial time step.
0130      * \returns The const step time iterator.
0131      */
0132 
0133 
0134     /**
0135      * \fn make_const_step_time_iterator_end( Stepper stepper , System system , State &x )
0136      * \brief Factory function for const_step_time_iterator. Constructs a end iterator.
0137      *
0138      * \param stepper The stepper to use during the iteration.
0139      * \param system The system function (ODE) to solve.
0140      * \param x The initial state. const_step_time_iterator store a reference of s and changes its value during the iteration.
0141      * \returns The const step time iterator.
0142      */
0143 
0144 
0145     /**
0146      * \fn make_const_step_time_range( Stepper stepper , System system , State &x ,
0147         typename traits::time_type< Stepper >::type t_start ,
0148         typename traits::time_type< Stepper >::type t_end ,
0149         typename traits::time_type< Stepper >::type dt)
0150      *
0151      * \brief Factory function to construct a single pass range of const_step_time_iterator. A range is here a pair of const_step_time_iterator.
0152      *
0153      * \param stepper The stepper to use during the iteration.
0154      * \param system The system function (ODE) to solve.
0155      * \param x The initial state. const_step_time_iterator stores a reference of s and changes its value during the iteration.
0156      * \param t The initial time.
0157      * \param t_end The end time, at which the iteration should stop.
0158      * \param dt The initial time step.
0159      * \returns The const step time range.
0160      */
0161 
0162 
0163 
0164 
0165 
0166 
0167 
0168 } // namespace odeint
0169 } // namespace numeric
0170 } // namespace boost
0171 
0172 
0173 #endif // BOOST_NUMERIC_ODEINT_ITERATOR_CONST_STEP_TIME_ITERATOR_HPP_INCLUDED