File indexing completed on 2025-01-18 09:42:53
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
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
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
0094
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 }
0170 }
0171
0172
0173 #endif