3 boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp
6 Coefficients for the Adams Moulton 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_MOULTON_COEFFICIENTS_HPP_INCLUDED
19 #define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_COEFFICIENTS_HPP_INCLUDED
22 #include <boost/array.hpp>
30 template< class Value , size_t Steps >
31 class adams_moulton_coefficients ;
33 template< class Value >
34 class adams_moulton_coefficients< Value , 1 > : public boost::array< Value , 1 >
37 adams_moulton_coefficients( void )
38 : boost::array< Value , 1 >()
40 (*this)[0] = static_cast< Value >( 1 );
45 template< class Value >
46 class adams_moulton_coefficients< Value , 2 > : public boost::array< Value , 2 >
49 adams_moulton_coefficients( void )
50 : boost::array< Value , 2 >()
52 (*this)[0] = static_cast< Value >( 1 ) / static_cast< Value >( 2 );
53 (*this)[1] = static_cast< Value >( 1 ) / static_cast< Value >( 2 );
58 template< class Value >
59 class adams_moulton_coefficients< Value , 3 > : public boost::array< Value , 3 >
62 adams_moulton_coefficients( void )
63 : boost::array< Value , 3 >()
65 (*this)[0] = static_cast< Value >( 5 ) / static_cast< Value >( 12 );
66 (*this)[1] = static_cast< Value >( 2 ) / static_cast< Value >( 3 );
67 (*this)[2] = -static_cast< Value >( 1 ) / static_cast< Value >( 12 );
72 template< class Value >
73 class adams_moulton_coefficients< Value , 4 > : public boost::array< Value , 4 >
76 adams_moulton_coefficients( void )
77 : boost::array< Value , 4 >()
79 (*this)[0] = static_cast< Value >( 3 ) / static_cast< Value >( 8 );
80 (*this)[1] = static_cast< Value >( 19 ) / static_cast< Value >( 24 );
81 (*this)[2] = -static_cast< Value >( 5 ) / static_cast< Value >( 24 );
82 (*this)[3] = static_cast< Value >( 1 ) / static_cast< Value >( 24 );
87 template< class Value >
88 class adams_moulton_coefficients< Value , 5 > : public boost::array< Value , 5 >
91 adams_moulton_coefficients( void )
92 : boost::array< Value , 5 >()
94 (*this)[0] = static_cast< Value >( 251 ) / static_cast< Value >( 720 );
95 (*this)[1] = static_cast< Value >( 323 ) / static_cast< Value >( 360 );
96 (*this)[2] = -static_cast< Value >( 11 ) / static_cast< Value >( 30 );
97 (*this)[3] = static_cast< Value >( 53 ) / static_cast< Value >( 360 );
98 (*this)[4] = -static_cast< Value >( 19 ) / static_cast< Value >( 720 );
103 template< class Value >
104 class adams_moulton_coefficients< Value , 6 > : public boost::array< Value , 6 >
107 adams_moulton_coefficients( void )
108 : boost::array< Value , 6 >()
110 (*this)[0] = static_cast< Value >( 95 ) / static_cast< Value >( 288 );
111 (*this)[1] = static_cast< Value >( 1427 ) / static_cast< Value >( 1440 );
112 (*this)[2] = -static_cast< Value >( 133 ) / static_cast< Value >( 240 );
113 (*this)[3] = static_cast< Value >( 241 ) / static_cast< Value >( 720 );
114 (*this)[4] = -static_cast< Value >( 173 ) / static_cast< Value >( 1440 );
115 (*this)[5] = static_cast< Value >( 3 ) / static_cast< Value >( 160 );
119 template< class Value >
120 class adams_moulton_coefficients< Value , 7 > : public boost::array< Value , 7 >
123 adams_moulton_coefficients( void )
124 : boost::array< Value , 7 >()
126 (*this)[0] = static_cast< Value >( 19087 ) / static_cast< Value >( 60480 );
127 (*this)[1] = static_cast< Value >( 2713 ) / static_cast< Value >( 2520 );
128 (*this)[2] = -static_cast< Value >( 15487 ) / static_cast< Value >( 20160 );
129 (*this)[3] = static_cast< Value >( 586 ) / static_cast< Value >( 945 );
130 (*this)[4] = -static_cast< Value >( 6737 ) / static_cast< Value >( 20160 );
131 (*this)[5] = static_cast< Value >( 263 ) / static_cast< Value >( 2520 );
132 (*this)[6] = -static_cast< Value >( 863 ) / static_cast< Value >( 60480 );
137 template< class Value >
138 class adams_moulton_coefficients< Value , 8 > : public boost::array< Value , 8 >
141 adams_moulton_coefficients( void )
142 : boost::array< Value , 8 >()
144 (*this)[0] = static_cast< Value >( 5257 ) / static_cast< Value >( 17280 );
145 (*this)[1] = static_cast< Value >( 139849 ) / static_cast< Value >( 120960 );
146 (*this)[2] = -static_cast< Value >( 4511 ) / static_cast< Value >( 4480 );
147 (*this)[3] = static_cast< Value >( 123133 ) / static_cast< Value >( 120960 );
148 (*this)[4] = -static_cast< Value >( 88547 ) / static_cast< Value >( 120960 );
149 (*this)[5] = static_cast< Value >( 1537 ) / static_cast< Value >( 4480 );
150 (*this)[6] = -static_cast< Value >( 11351 ) / static_cast< Value >( 120960 );
151 (*this)[7] = static_cast< Value >( 275 ) / static_cast< Value >( 24192 );
168 #endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_COEFFICIENTS_HPP_INCLUDED