adams_moulton_coefficients.hpp 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /*
  2. [auto_generated]
  3. boost/numeric/odeint/stepper/detail/adams_moulton_coefficients.hpp
  4. [begin_description]
  5. Coefficients for the Adams Moulton method.
  6. [end_description]
  7. Copyright 2011-2012 Karsten Ahnert
  8. Copyright 2011-2012 Mario Mulansky
  9. Distributed under the Boost Software License, Version 1.0.
  10. (See accompanying file LICENSE_1_0.txt or
  11. copy at http://www.boost.org/LICENSE_1_0.txt)
  12. */
  13. #ifndef BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_COEFFICIENTS_HPP_INCLUDED
  14. #define BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_COEFFICIENTS_HPP_INCLUDED
  15. #include <boost/array.hpp>
  16. namespace boost {
  17. namespace numeric {
  18. namespace odeint {
  19. namespace detail {
  20. template< class Value , size_t Steps >
  21. class adams_moulton_coefficients ;
  22. template< class Value >
  23. class adams_moulton_coefficients< Value , 1 > : public boost::array< Value , 1 >
  24. {
  25. public:
  26. adams_moulton_coefficients( void )
  27. : boost::array< Value , 1 >()
  28. {
  29. (*this)[0] = static_cast< Value >( 1 );
  30. }
  31. };
  32. template< class Value >
  33. class adams_moulton_coefficients< Value , 2 > : public boost::array< Value , 2 >
  34. {
  35. public:
  36. adams_moulton_coefficients( void )
  37. : boost::array< Value , 2 >()
  38. {
  39. (*this)[0] = static_cast< Value >( 1 ) / static_cast< Value >( 2 );
  40. (*this)[1] = static_cast< Value >( 1 ) / static_cast< Value >( 2 );
  41. }
  42. };
  43. template< class Value >
  44. class adams_moulton_coefficients< Value , 3 > : public boost::array< Value , 3 >
  45. {
  46. public:
  47. adams_moulton_coefficients( void )
  48. : boost::array< Value , 3 >()
  49. {
  50. (*this)[0] = static_cast< Value >( 5 ) / static_cast< Value >( 12 );
  51. (*this)[1] = static_cast< Value >( 2 ) / static_cast< Value >( 3 );
  52. (*this)[2] = -static_cast< Value >( 1 ) / static_cast< Value >( 12 );
  53. }
  54. };
  55. template< class Value >
  56. class adams_moulton_coefficients< Value , 4 > : public boost::array< Value , 4 >
  57. {
  58. public:
  59. adams_moulton_coefficients( void )
  60. : boost::array< Value , 4 >()
  61. {
  62. (*this)[0] = static_cast< Value >( 3 ) / static_cast< Value >( 8 );
  63. (*this)[1] = static_cast< Value >( 19 ) / static_cast< Value >( 24 );
  64. (*this)[2] = -static_cast< Value >( 5 ) / static_cast< Value >( 24 );
  65. (*this)[3] = static_cast< Value >( 1 ) / static_cast< Value >( 24 );
  66. }
  67. };
  68. template< class Value >
  69. class adams_moulton_coefficients< Value , 5 > : public boost::array< Value , 5 >
  70. {
  71. public:
  72. adams_moulton_coefficients( void )
  73. : boost::array< Value , 5 >()
  74. {
  75. (*this)[0] = static_cast< Value >( 251 ) / static_cast< Value >( 720 );
  76. (*this)[1] = static_cast< Value >( 323 ) / static_cast< Value >( 360 );
  77. (*this)[2] = -static_cast< Value >( 11 ) / static_cast< Value >( 30 );
  78. (*this)[3] = static_cast< Value >( 53 ) / static_cast< Value >( 360 );
  79. (*this)[4] = -static_cast< Value >( 19 ) / static_cast< Value >( 720 );
  80. }
  81. };
  82. template< class Value >
  83. class adams_moulton_coefficients< Value , 6 > : public boost::array< Value , 6 >
  84. {
  85. public:
  86. adams_moulton_coefficients( void )
  87. : boost::array< Value , 6 >()
  88. {
  89. (*this)[0] = static_cast< Value >( 95 ) / static_cast< Value >( 288 );
  90. (*this)[1] = static_cast< Value >( 1427 ) / static_cast< Value >( 1440 );
  91. (*this)[2] = -static_cast< Value >( 133 ) / static_cast< Value >( 240 );
  92. (*this)[3] = static_cast< Value >( 241 ) / static_cast< Value >( 720 );
  93. (*this)[4] = -static_cast< Value >( 173 ) / static_cast< Value >( 1440 );
  94. (*this)[5] = static_cast< Value >( 3 ) / static_cast< Value >( 160 );
  95. }
  96. };
  97. template< class Value >
  98. class adams_moulton_coefficients< Value , 7 > : public boost::array< Value , 7 >
  99. {
  100. public:
  101. adams_moulton_coefficients( void )
  102. : boost::array< Value , 7 >()
  103. {
  104. (*this)[0] = static_cast< Value >( 19087 ) / static_cast< Value >( 60480 );
  105. (*this)[1] = static_cast< Value >( 2713 ) / static_cast< Value >( 2520 );
  106. (*this)[2] = -static_cast< Value >( 15487 ) / static_cast< Value >( 20160 );
  107. (*this)[3] = static_cast< Value >( 586 ) / static_cast< Value >( 945 );
  108. (*this)[4] = -static_cast< Value >( 6737 ) / static_cast< Value >( 20160 );
  109. (*this)[5] = static_cast< Value >( 263 ) / static_cast< Value >( 2520 );
  110. (*this)[6] = -static_cast< Value >( 863 ) / static_cast< Value >( 60480 );
  111. }
  112. };
  113. template< class Value >
  114. class adams_moulton_coefficients< Value , 8 > : public boost::array< Value , 8 >
  115. {
  116. public:
  117. adams_moulton_coefficients( void )
  118. : boost::array< Value , 8 >()
  119. {
  120. (*this)[0] = static_cast< Value >( 5257 ) / static_cast< Value >( 17280 );
  121. (*this)[1] = static_cast< Value >( 139849 ) / static_cast< Value >( 120960 );
  122. (*this)[2] = -static_cast< Value >( 4511 ) / static_cast< Value >( 4480 );
  123. (*this)[3] = static_cast< Value >( 123133 ) / static_cast< Value >( 120960 );
  124. (*this)[4] = -static_cast< Value >( 88547 ) / static_cast< Value >( 120960 );
  125. (*this)[5] = static_cast< Value >( 1537 ) / static_cast< Value >( 4480 );
  126. (*this)[6] = -static_cast< Value >( 11351 ) / static_cast< Value >( 120960 );
  127. (*this)[7] = static_cast< Value >( 275 ) / static_cast< Value >( 24192 );
  128. }
  129. };
  130. } // detail
  131. } // odeint
  132. } // numeric
  133. } // boost
  134. #endif // BOOST_NUMERIC_ODEINT_STEPPER_DETAIL_ADAMS_MOULTON_COEFFICIENTS_HPP_INCLUDED