• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  [auto_generated]
3  boost/numeric/odeint/stepper/detail/adams_bashforth_coefficients.hpp
4 
5  [begin_description]
6  Definition of the coefficients for the Adams-Bashforth method.
7  [end_description]
8 
9  Copyright 2011-2012 Karsten Ahnert
10  Copyright 2011-2012 Mario Mulansky
11 
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)
15  */
16 
17 
18 #ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED
19 #define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED
20 
21 #include <boost/array.hpp>
22 
23 
24 namespace boost {
25 namespace numeric {
26 namespace odeint {
27 namespace detail {
28 
29 template< class Value , size_t Steps >
30 class adams_bashforth_coefficients ;
31 
32 template< class Value >
33 class adams_bashforth_coefficients< Value , 1 > : public boost::array< Value , 1 >
34 {
35 public:
adams_bashforth_coefficients(void)36     adams_bashforth_coefficients( void )
37     : boost::array< Value , 1 >()
38       {
39         (*this)[0] = static_cast< Value >( 1 );
40       }
41 };
42 
43 
44 template< class Value >
45 class adams_bashforth_coefficients< Value , 2 > : public boost::array< Value , 2 >
46 {
47 public:
adams_bashforth_coefficients(void)48     adams_bashforth_coefficients( void )
49     : boost::array< Value , 2 >()
50       {
51         (*this)[0] = static_cast< Value >( 3 ) / static_cast< Value >( 2 );
52         (*this)[1] = -static_cast< Value >( 1 ) / static_cast< Value >( 2 );
53       }
54 };
55 
56 
57 template< class Value >
58 class adams_bashforth_coefficients< Value , 3 > : public boost::array< Value , 3 >
59 {
60 public:
adams_bashforth_coefficients(void)61     adams_bashforth_coefficients( void )
62     : boost::array< Value , 3 >()
63       {
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 );
67       }
68 };
69 
70 
71 template< class Value >
72 class adams_bashforth_coefficients< Value , 4 > : public boost::array< Value , 4 >
73 {
74 public:
adams_bashforth_coefficients(void)75     adams_bashforth_coefficients( void )
76     : boost::array< Value , 4 >()
77       {
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 );
82       }
83 };
84 
85 
86 template< class Value >
87 class adams_bashforth_coefficients< Value , 5 > : public boost::array< Value , 5 >
88 {
89 public:
adams_bashforth_coefficients(void)90     adams_bashforth_coefficients( void )
91     : boost::array< Value , 5 >()
92       {
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 );
98       }
99 };
100 
101 
102 template< class Value >
103 class adams_bashforth_coefficients< Value , 6 > : public boost::array< Value , 6 >
104 {
105 public:
adams_bashforth_coefficients(void)106     adams_bashforth_coefficients( void )
107     : boost::array< Value , 6 >()
108       {
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 );
115       }
116 };
117 
118 
119 template< class Value >
120 class adams_bashforth_coefficients< Value , 7 > : public boost::array< Value , 7 >
121 {
122 public:
adams_bashforth_coefficients(void)123     adams_bashforth_coefficients( void )
124     : boost::array< Value , 7 >()
125       {
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 );
133       }
134 };
135 
136 
137 template< class Value >
138 class adams_bashforth_coefficients< Value , 8 > : public boost::array< Value , 8 >
139 {
140 public:
adams_bashforth_coefficients(void)141     adams_bashforth_coefficients( void )
142     : boost::array< Value , 8 >()
143       {
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 );
152       }
153 };
154 
155 
156 
157 
158 
159 
160 
161 } // detail
162 } // odeint
163 } // numeric
164 } // boost
165 
166 
167 
168 #endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_BASHFORTH_COEFFICIENTS_HPP_INCLUDED
169