Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:42:54

0001 /*
0002  [auto_generated]
0003  boost/numeric/odeint/stepper/detail/adams_moulton_call_algebra.hpp
0004 
0005  [begin_description]
0006  Algebra caller for the Adams Moulton method.
0007  [end_description]
0008 
0009  Copyright 2011-2012 Karsten Ahnert
0010  Copyright 2011 Mario Mulansky
0011 
0012  Distributed under the Boost Software License, Version 1.0.
0013  (See accompanying file LICENSE_1_0.txt or
0014  copy at http://www.boost.org/LICENSE_1_0.txt)
0015  */
0016 
0017 
0018 #ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_CALL_ALGEBRA_HPP_INCLUDED
0019 #define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_CALL_ALGEBRA_HPP_INCLUDED
0020 
0021 #include <boost/assert.hpp> 
0022 
0023 namespace boost {
0024 namespace numeric {
0025 namespace odeint {
0026 namespace detail {
0027 
0028 template< size_t Step , class Algebra , class Operations >
0029 struct adams_moulton_call_algebra;
0030 
0031 template< class Algebra , class Operations >
0032 struct adams_moulton_call_algebra< 1 , Algebra , Operations >
0033 {
0034     template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
0035     void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage& /* steps */ , const Coefficients &coef , Time dt ) const
0036     {
0037         typedef typename Coefficients::value_type value_type;
0038         algebra.for_each3( out , in , dxdt , typename Operations::template scale_sum2< value_type , Time >( 1.0 , dt * coef[0] ) );
0039     }
0040 };
0041 
0042 
0043 template< class Algebra , class Operations >
0044 struct adams_moulton_call_algebra< 2 , Algebra , Operations >
0045 {
0046     template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
0047     void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
0048     {
0049         typedef typename Coefficients::value_type value_type;
0050         algebra.for_each4( out , in , dxdt , steps[0].m_v ,
0051                 typename Operations::template scale_sum3< value_type , Time , Time >( 1.0 , dt * coef[0] , dt * coef[1] ) );
0052     }
0053 };
0054 
0055 
0056 template< class Algebra , class Operations >
0057 struct adams_moulton_call_algebra< 3 , Algebra , Operations >
0058 {
0059     template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
0060     void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
0061     {
0062         typedef typename Coefficients::value_type value_type;
0063         algebra.for_each5( out , in , dxdt , steps[0].m_v , steps[1].m_v ,
0064                 typename Operations::template scale_sum4< value_type , Time , Time >( 1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] ) );
0065     }
0066 };
0067 
0068 
0069 template< class Algebra , class Operations >
0070 struct adams_moulton_call_algebra< 4 , Algebra , Operations >
0071 {
0072     template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
0073     void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
0074     {
0075         typedef typename Coefficients::value_type value_type;
0076         algebra.for_each6( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v ,
0077                 typename Operations::template scale_sum5< value_type , Time , Time , Time >(
0078                         1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] ) );
0079     }
0080 };
0081 
0082 
0083 template< class Algebra , class Operations >
0084 struct adams_moulton_call_algebra< 5 , Algebra , Operations >
0085 {
0086     template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
0087     void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
0088     {
0089         typedef typename Coefficients::value_type value_type;
0090         algebra.for_each7( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v ,
0091                 typename Operations::template scale_sum6< value_type , Time , Time , Time , Time >(
0092                         1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] ) );
0093     }
0094 };
0095 
0096 
0097 template< class Algebra , class Operations >
0098 struct adams_moulton_call_algebra< 6 , Algebra , Operations >
0099 {
0100     template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
0101     void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
0102     {
0103         typedef typename Coefficients::value_type value_type;
0104         algebra.for_each8( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v ,
0105                 typename Operations::template scale_sum7< value_type , Time , Time , Time , Time , Time >(
0106                         1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] ) );
0107     }
0108 };
0109 
0110 
0111 template< class Algebra , class Operations >
0112 struct adams_moulton_call_algebra< 7 , Algebra , Operations >
0113 {
0114     template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
0115     void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
0116     {
0117         typedef typename Coefficients::value_type value_type;
0118         algebra.for_each9( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v , steps[5].m_v ,
0119                 typename Operations::template scale_sum8< value_type , Time , Time , Time , Time , Time , Time >(
0120                         1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] , dt * coef[6] ) );
0121     }
0122 };
0123 
0124 
0125 template< class Algebra , class Operations >
0126 struct adams_moulton_call_algebra< 8 , Algebra , Operations >
0127 {
0128     template< class StateIn , class StateOut , class DerivIn , class StepStorage , class Coefficients , class Time >
0129     void operator()( Algebra &algebra , const StateIn &in , StateOut &out , const DerivIn &dxdt , const StepStorage &steps , const Coefficients &coef , Time dt ) const
0130     {
0131         typedef typename Coefficients::value_type value_type;
0132         algebra.for_each10( out , in , dxdt , steps[0].m_v , steps[1].m_v , steps[2].m_v , steps[3].m_v , steps[4].m_v , steps[5].m_v , steps[6].m_v ,
0133                 typename Operations::template scale_sum9< value_type , Time , Time , Time , Time , Time , Time , Time >(
0134                         1.0 , dt * coef[0] , dt * coef[1] , dt * coef[2] , dt * coef[3] , dt * coef[4] , dt * coef[5] , dt * coef[6] , dt * coef[7] ) );
0135     }
0136 };
0137 
0138 
0139 
0140 
0141 } // detail
0142 } // odeint
0143 } // numeric
0144 } // boost
0145 
0146 
0147 
0148 #endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_CALL_ALGEBRA_HPP_INCLUDED