File indexing completed on 2025-01-18 09:42:54
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020 #ifndef BOOST_NUMERIC_ODEINT_ITERATOR_N_STEP_TIME_ITERATOR_HPP_INCLUDED
0021 #define BOOST_NUMERIC_ODEINT_ITERATOR_N_STEP_TIME_ITERATOR_HPP_INCLUDED
0022
0023
0024 #include <boost/numeric/odeint/util/stepper_traits.hpp>
0025 #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
0026 #include <boost/numeric/odeint/iterator/detail/ode_iterator_base.hpp>
0027 #include <boost/numeric/odeint/iterator/impl/n_step_iterator_impl.hpp>
0028
0029
0030 namespace boost {
0031 namespace numeric {
0032 namespace odeint {
0033
0034
0035
0036 template< class Stepper , class System , class State
0037 #ifndef DOXYGEN_SKIP
0038 , class StepperTag = typename base_tag< typename traits::stepper_category< Stepper >::type >::type
0039 #endif
0040 >
0041 class n_step_time_iterator : public n_step_iterator_impl<
0042 n_step_time_iterator< Stepper , System , State , StepperTag > ,
0043 Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag
0044 >
0045 {
0046 typedef typename traits::time_type< Stepper >::type time_type;
0047 typedef n_step_time_iterator< Stepper , System , State , StepperTag > iterator_type;
0048
0049 public:
0050 n_step_time_iterator( Stepper stepper , System sys , State &s , time_type t , time_type dt , size_t num_of_steps )
0051 : n_step_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag >( stepper , sys , s , t , dt , num_of_steps )
0052 {}
0053
0054 n_step_time_iterator( Stepper stepper , System sys , State &s )
0055 : n_step_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_time_iterator_tag , StepperTag >( stepper , sys , s )
0056 {}
0057 };
0058
0059
0060
0061 template< class Stepper , class System , class State >
0062 n_step_time_iterator< Stepper , System, State > make_n_step_time_iterator_begin(
0063 Stepper stepper ,
0064 System system ,
0065 State &x ,
0066 typename traits::time_type< Stepper >::type t ,
0067 typename traits::time_type< Stepper >::type dt ,
0068 size_t num_of_steps )
0069 {
0070 return n_step_time_iterator< Stepper , System , State >( stepper , system , x , t , dt , num_of_steps );
0071 }
0072
0073 template< class Stepper , class System , class State >
0074 n_step_time_iterator< Stepper , System , State > make_n_step_time_iterator_end(
0075 Stepper stepper ,
0076 System system ,
0077 State &x )
0078 {
0079 return n_step_time_iterator< Stepper , System , State >( stepper , system , x );
0080 }
0081
0082 template< class Stepper , class System , class State >
0083 std::pair< n_step_time_iterator< Stepper , System , State > , n_step_time_iterator< Stepper , System , State > >
0084 make_n_step_time_range(
0085 Stepper stepper ,
0086 System system ,
0087 State &x ,
0088 typename traits::time_type< Stepper >::type t ,
0089 typename traits::time_type< Stepper >::type dt ,
0090 size_t num_of_steps )
0091 {
0092 return std::make_pair(
0093 n_step_time_iterator< Stepper , System , State >( stepper , system , x , t , dt , num_of_steps ) ,
0094 n_step_time_iterator< Stepper , System , State >( stepper , system , x )
0095 );
0096 }
0097
0098
0099
0100
0101
0102
0103
0104
0105
0106
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118
0119
0120
0121
0122
0123
0124
0125
0126
0127
0128
0129
0130
0131
0132
0133
0134
0135
0136
0137
0138
0139
0140
0141
0142
0143
0144
0145
0146
0147
0148
0149
0150
0151
0152
0153
0154
0155
0156
0157
0158
0159
0160
0161
0162
0163
0164
0165 }
0166 }
0167 }
0168
0169 #endif