File indexing completed on 2025-01-18 09:42:55
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef GENERATION_CONTROLLED_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED
0016 #define GENERATION_CONTROLLED_ADAMS_BASHFORTH_MOULTON_HPP_INCLUDED
0017
0018 #include <boost/numeric/odeint/stepper/adaptive_adams_bashforth_moulton.hpp>
0019 #include <boost/numeric/odeint/stepper/controlled_adams_bashforth_moulton.hpp>
0020 #include <boost/numeric/odeint/stepper/generation/make_controlled.hpp>
0021
0022 namespace boost {
0023 namespace numeric {
0024 namespace odeint {
0025
0026 template< size_t Steps, class State , class Value , class Deriv , class Time , class Algebra , class Operations , class Resizer >
0027 struct get_controller< adaptive_adams_bashforth_moulton< Steps, State , Value , Deriv , Time , Algebra , Operations , Resizer > >
0028 {
0029 typedef adaptive_adams_bashforth_moulton<Steps, State, Value, Deriv, Time, Algebra, Operations, Resizer> stepper_type;
0030 typedef controlled_adams_bashforth_moulton< stepper_type > type;
0031 };
0032
0033
0034 template< class Stepper >
0035 struct controller_factory< Stepper , controlled_adams_bashforth_moulton< Stepper > >
0036 {
0037 typedef Stepper stepper_type;
0038 typedef controlled_adams_bashforth_moulton< stepper_type > controller_type;
0039 typedef typename controller_type::step_adjuster_type step_adjuster_type;
0040 typedef typename stepper_type::value_type value_type;
0041 typedef typename stepper_type::value_type time_type;
0042
0043 controller_type operator()( value_type abs_error , value_type rel_error , const stepper_type &stepper )
0044 {
0045 return controller_type(step_adjuster_type(abs_error, rel_error));
0046 }
0047
0048 controller_type operator()( value_type abs_error , value_type rel_error ,
0049 time_type max_dt, const stepper_type &stepper )
0050 {
0051 return controller_type( step_adjuster_type(abs_error, rel_error, max_dt));
0052 }
0053 };
0054
0055 }
0056 }
0057 }
0058
0059 #endif