3 boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp
6 Definition of the coefficients for the Adams-Bashforth method.
9 Copyright 2011-2012 Karsten Ahnert
10 Copyright 2011-2012 Mario Mulansky
12 Distributed under the Boost Software License, Version 1.0.
13 (See accompanying file LICENSE_1_0.txt or
14 copy at http://www.boost.org/LICENSE_1_0.txt)
18 #ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED
19 #define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED
21 #include <boost/array.hpp>
29 template< class Value , size_t Steps >
30 class adams_bashforth_coefficients ;
32 template< class Value >
33 class adams_bashforth_coefficients< Value , 1 > : public boost::array< Value , 1 >
36 adams_bashforth_coefficients( void )
37 : boost::array< Value , 1 >()
39 (*this)[0] = static_cast< Value >( 1 );
44 template< class Value >
45 class adams_bashforth_coefficients< Value , 2 > : public boost::array< Value , 2 >
48 adams_bashforth_coefficients( void )
49 : boost::array< Value , 2 >()
51 (*this)[0] = static_cast< Value >( 3 ) / static_cast< Value >( 2 );
52 (*this)[1] = -static_cast< Value >( 1 ) / static_cast< Value >( 2 );
57 template< class Value >
58 class adams_bashforth_coefficients< Value , 3 > : public boost::array< Value , 3 >
61 adams_bashforth_coefficients( void )
62 : boost::array< Value , 3 >()
64 (*this)[0] = static_cast< Value >( 23 ) / static_cast< Value >( 12 );
65 (*this)[1] = -static_cast< Value >( 4 ) / static_cast< Value >( 3 );
66 (*this)[2] = static_cast< Value >( 5 ) / static_cast< Value >( 12 );
71 template< class Value >
72 class adams_bashforth_coefficients< Value , 4 > : public boost::array< Value , 4 >
75 adams_bashforth_coefficients( void )
76 : boost::array< Value , 4 >()
78 (*this)[0] = static_cast< Value >( 55 ) / static_cast< Value >( 24 );
79 (*this)[1] = -static_cast< Value >( 59 ) / static_cast< Value >( 24 );
80 (*this)[2] = static_cast< Value >( 37 ) / static_cast< Value >( 24 );
81 (*this)[3] = -static_cast< Value >( 3 ) / static_cast< Value >( 8 );
86 template< class Value >
87 class adams_bashforth_coefficients< Value , 5 > : public boost::array< Value , 5 >
90 adams_bashforth_coefficients( void )
91 : boost::array< Value , 5 >()
93 (*this)[0] = static_cast< Value >( 1901 ) / static_cast< Value >( 720 );
94 (*this)[1] = -static_cast< Value >( 1387 ) / static_cast< Value >( 360 );
95 (*this)[2] = static_cast< Value >( 109 ) / static_cast< Value >( 30 );
96 (*this)[3] = -static_cast< Value >( 637 ) / static_cast< Value >( 360 );
97 (*this)[4] = static_cast< Value >( 251 ) / static_cast< Value >( 720 );
102 template< class Value >
103 class adams_bashforth_coefficients< Value , 6 > : public boost::array< Value , 6 >
106 adams_bashforth_coefficients( void )
107 : boost::array< Value , 6 >()
109 (*this)[0] = static_cast< Value >( 4277 ) / static_cast< Value >( 1440 );
110 (*this)[1] = -static_cast< Value >( 2641 ) / static_cast< Value >( 480 );
111 (*this)[2] = static_cast< Value >( 4991 ) / static_cast< Value >( 720 );
112 (*this)[3] = -static_cast< Value >( 3649 ) / static_cast< Value >( 720 );
113 (*this)[4] = static_cast< Value >( 959 ) / static_cast< Value >( 480 );
114 (*this)[5] = -static_cast< Value >( 95 ) / static_cast< Value >( 288 );
119 template< class Value >
120 class adams_bashforth_coefficients< Value , 7 > : public boost::array< Value , 7 >
123 adams_bashforth_coefficients( void )
124 : boost::array< Value , 7 >()
126 (*this)[0] = static_cast< Value >( 198721 ) / static_cast< Value >( 60480 );
127 (*this)[1] = -static_cast< Value >( 18637 ) / static_cast< Value >( 2520 );
128 (*this)[2] = static_cast< Value >( 235183 ) / static_cast< Value >( 20160 );
129 (*this)[3] = -static_cast< Value >( 10754 ) / static_cast< Value >( 945 );
130 (*this)[4] = static_cast< Value >( 135713 ) / static_cast< Value >( 20160 );
131 (*this)[5] = -static_cast< Value >( 5603 ) / static_cast< Value >( 2520 );
132 (*this)[6] = static_cast< Value >( 19087 ) / static_cast< Value >( 60480 );
137 template< class Value >
138 class adams_bashforth_coefficients< Value , 8 > : public boost::array< Value , 8 >
141 adams_bashforth_coefficients( void )
142 : boost::array< Value , 8 >()
144 (*this)[0] = static_cast< Value >( 16083 ) / static_cast< Value >( 4480 );
145 (*this)[1] = -static_cast< Value >( 1152169 ) / static_cast< Value >( 120960 );
146 (*this)[2] = static_cast< Value >( 242653 ) / static_cast< Value >( 13440 );
147 (*this)[3] = -static_cast< Value >( 296053 ) / static_cast< Value >( 13440 );
148 (*this)[4] = static_cast< Value >( 2102243 ) / static_cast< Value >( 120960 );
149 (*this)[5] = -static_cast< Value >( 115747 ) / static_cast< Value >( 13440 );
150 (*this)[6] = static_cast< Value >( 32863 ) / static_cast< Value >( 13440 );
151 (*this)[7] = -static_cast< Value >( 5257 ) / static_cast< Value >( 17280 );
168 #endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED