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_ADAPTIVE_ITERATOR_HPP_INCLUDED
0020 #define BOOST_NUMERIC_ODEINT_ITERATOR_ADAPTIVE_ITERATOR_HPP_INCLUDED
0021
0022 #include <boost/numeric/odeint/util/stepper_traits.hpp>
0023 #include <boost/numeric/odeint/util/unit_helper.hpp>
0024 #include <boost/numeric/odeint/stepper/stepper_categories.hpp>
0025 #include <boost/numeric/odeint/stepper/controlled_step_result.hpp>
0026 #include <boost/numeric/odeint/iterator/impl/adaptive_iterator_impl.hpp>
0027
0028 namespace boost {
0029 namespace numeric {
0030 namespace odeint {
0031
0032
0033 template< class Stepper , class System , class State
0034 #ifndef DOXYGEN_SKIP
0035 , class StepperTag = typename base_tag< typename traits::stepper_category< Stepper >::type >::type
0036 #endif
0037 >
0038 class adaptive_iterator : public adaptive_iterator_impl<
0039 adaptive_iterator< Stepper , System , State , StepperTag > ,
0040 Stepper , System , State , detail::ode_state_iterator_tag , StepperTag
0041 >
0042 {
0043 typedef typename traits::time_type< Stepper >::type time_type;
0044 typedef adaptive_iterator< Stepper , System , State , StepperTag > iterator_type;
0045
0046 public:
0047 adaptive_iterator( Stepper stepper , System sys , State &s , time_type t_start , time_type t_end , time_type dt )
0048 : adaptive_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_iterator_tag , StepperTag >( stepper , sys , s , t_start , t_end , dt )
0049 {}
0050
0051 adaptive_iterator( Stepper stepper , System sys , State &s )
0052 : adaptive_iterator_impl< iterator_type , Stepper , System , State , detail::ode_state_iterator_tag , StepperTag >( stepper , sys , s )
0053 {}
0054 };
0055
0056
0057
0058
0059 template< class Stepper , class System , class State >
0060 adaptive_iterator< Stepper , System , State > make_adaptive_iterator_begin(
0061 Stepper stepper ,
0062 System system ,
0063 State &x ,
0064 typename traits::time_type< Stepper >::type t_start ,
0065 typename traits::time_type< Stepper >::type t_end ,
0066 typename traits::time_type< Stepper >::type dt )
0067 {
0068 return adaptive_iterator< Stepper , System , State >( stepper , system , x , t_start , t_end , dt );
0069 }
0070
0071
0072 template< class Stepper , class System , class State >
0073 adaptive_iterator< Stepper , System , State > make_adaptive_iterator_end(
0074 Stepper stepper ,
0075 System system ,
0076 State &x )
0077 {
0078 return adaptive_iterator< Stepper , System , State >( stepper , system , x );
0079 }
0080
0081
0082 template< class Stepper , class System , class State >
0083 std::pair< adaptive_iterator< Stepper , System , State > , adaptive_iterator< Stepper , System , State > >
0084 make_adaptive_range(
0085 Stepper stepper ,
0086 System system ,
0087 State &x ,
0088 typename traits::time_type< Stepper >::type t_start ,
0089 typename traits::time_type< Stepper >::type t_end ,
0090 typename traits::time_type< Stepper >::type dt )
0091 {
0092 return std::make_pair(
0093 adaptive_iterator< Stepper , System , State >( stepper , system , x , t_start , t_end , dt ) ,
0094 adaptive_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
0170
0171
0172
0173
0174
0175
0176
0177 }
0178 }
0179 }
0180
0181
0182
0183 #endif