File indexing completed on 2025-01-18 09:42:57
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_STEPPER_SYMPLECTIC_EULER_HPP_INCLUDED
0020
0021
0022 #include <boost/numeric/odeint/stepper/base/symplectic_rkn_stepper_base.hpp>
0023
0024 #include <boost/numeric/odeint/algebra/range_algebra.hpp>
0025 #include <boost/numeric/odeint/algebra/default_operations.hpp>
0026 #include <boost/numeric/odeint/algebra/algebra_dispatcher.hpp>
0027 #include <boost/numeric/odeint/algebra/operations_dispatcher.hpp>
0028
0029 #include <boost/array.hpp>
0030
0031 namespace boost {
0032 namespace numeric {
0033 namespace odeint {
0034
0035
0036 #ifndef DOXYGEN_SKIP
0037 namespace detail {
0038 namespace symplectic_euler_coef {
0039
0040 template< class Value >
0041 struct coef_a_type : public boost::array< Value , 1 >
0042 {
0043 coef_a_type( void )
0044 {
0045 (*this)[0] = static_cast< Value >( 1 );
0046 }
0047 };
0048
0049 template< class Value >
0050 struct coef_b_type : public boost::array< Value , 1 >
0051 {
0052 coef_b_type( void )
0053 {
0054 (*this)[0] = static_cast< Value >( 1 );
0055 }
0056 };
0057
0058 }
0059 }
0060 #endif
0061
0062
0063
0064 template<
0065 class Coor ,
0066 class Momentum = Coor ,
0067 class Value = double ,
0068 class CoorDeriv = Coor ,
0069 class MomentumDeriv = Coor ,
0070 class Time = Value ,
0071 class Algebra = typename algebra_dispatcher< Coor >::algebra_type ,
0072 class Operations = typename operations_dispatcher< Coor >::operations_type ,
0073 class Resizer = initially_resizer
0074 >
0075 #ifndef DOXYGEN_SKIP
0076 class symplectic_euler :
0077 public symplectic_nystroem_stepper_base
0078 <
0079 1 , 1 ,
0080 Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer
0081 >
0082 #else
0083 class symplectic_euler : public symplectic_nystroem_stepper_base
0084 #endif
0085 {
0086 public:
0087
0088 #ifndef DOXYGEN_SKIP
0089 typedef symplectic_nystroem_stepper_base<
0090 1 , 1 , Coor , Momentum , Value , CoorDeriv , MomentumDeriv , Time , Algebra , Operations , Resizer > stepper_base_type;
0091 #endif
0092 typedef typename stepper_base_type::algebra_type algebra_type;
0093 typedef typename stepper_base_type::value_type value_type;
0094
0095
0096 symplectic_euler( const algebra_type &algebra = algebra_type() )
0097 : stepper_base_type( detail::symplectic_euler_coef::coef_a_type< value_type >() ,
0098 detail::symplectic_euler_coef::coef_b_type< value_type >() ,
0099 algebra )
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 #endif