diff options
author | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-09-13 11:24:46 +0900 |
---|---|---|
committer | DongHun Kwak <dh0128.kwak@samsung.com> | 2017-09-13 11:25:39 +0900 |
commit | 4fadd968fa12130524c8380f33fcfe25d4de79e5 (patch) | |
tree | fd26a490cd15388d42fc6652b3c5c13012e7f93e /boost/numeric | |
parent | b5c87084afaef42b2d058f68091be31988a6a874 (diff) | |
download | boost-upstream/1.65.0.tar.gz boost-upstream/1.65.0.tar.bz2 boost-upstream/1.65.0.zip |
Imported Upstream version 1.65.0upstream/1.65.0
Change-Id: Icf8400b375482cb11bcf77440a6934ba360d6ba4
Signed-off-by: DongHun Kwak <dh0128.kwak@samsung.com>
Diffstat (limited to 'boost/numeric')
34 files changed, 67 insertions, 47 deletions
diff --git a/boost/numeric/interval.hpp b/boost/numeric/interval.hpp index e6f976df03..1f75543072 100644 --- a/boost/numeric/interval.hpp +++ b/boost/numeric/interval.hpp @@ -1,7 +1,7 @@ /* Boost interval.hpp header file * * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/arith.hpp b/boost/numeric/interval/arith.hpp index c0320c45ef..0d598be7d0 100644 --- a/boost/numeric/interval/arith.hpp +++ b/boost/numeric/interval/arith.hpp @@ -1,7 +1,7 @@ /* Boost interval/arith.hpp template implementation file * * Copyright 2000 Jens Maurer - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002-2003 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/arith2.hpp b/boost/numeric/interval/arith2.hpp index 5501929e4b..b0aba7c04c 100644 --- a/boost/numeric/interval/arith2.hpp +++ b/boost/numeric/interval/arith2.hpp @@ -4,7 +4,7 @@ * functions: fmod, sqrt, square, pov, inverse and * a multi-interval division. * - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002-2003 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/checking.hpp b/boost/numeric/interval/checking.hpp index 2db486a0be..f40ba65a55 100644 --- a/boost/numeric/interval/checking.hpp +++ b/boost/numeric/interval/checking.hpp @@ -1,6 +1,6 @@ /* Boost interval/checking.hpp template implementation file * - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/compare.hpp b/boost/numeric/interval/compare.hpp index f21753e711..0b4b751af1 100644 --- a/boost/numeric/interval/compare.hpp +++ b/boost/numeric/interval/compare.hpp @@ -1,6 +1,6 @@ /* Boost interval/compare.hpp template implementation file * - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/compare/explicit.hpp b/boost/numeric/interval/compare/explicit.hpp index 8c68be8916..f66dc641ed 100644 --- a/boost/numeric/interval/compare/explicit.hpp +++ b/boost/numeric/interval/compare/explicit.hpp @@ -1,7 +1,7 @@ /* Boost interval/compare/explicit.hpp template implementation file * * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/constants.hpp b/boost/numeric/interval/constants.hpp index a3a42efece..6a228343ec 100644 --- a/boost/numeric/interval/constants.hpp +++ b/boost/numeric/interval/constants.hpp @@ -1,6 +1,6 @@ /* Boost interval/constants.hpp template implementation file * - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/detail/alpha_rounding_control.hpp b/boost/numeric/interval/detail/alpha_rounding_control.hpp index d9a6079e1b..25b6ff617f 100644 --- a/boost/numeric/interval/detail/alpha_rounding_control.hpp +++ b/boost/numeric/interval/detail/alpha_rounding_control.hpp @@ -1,6 +1,6 @@ /* Boost interval/detail/alpha_rounding_control.hpp file * - * Copyright 2005 Felix Höfling, Guillaume Melquiond + * Copyright 2005 Felix Höfling, Guillaume Melquiond * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/detail/bcc_rounding_control.hpp b/boost/numeric/interval/detail/bcc_rounding_control.hpp index e3aaf046c5..c55d0823b2 100644 --- a/boost/numeric/interval/detail/bcc_rounding_control.hpp +++ b/boost/numeric/interval/detail/bcc_rounding_control.hpp @@ -1,7 +1,7 @@ /* Boost interval/detail/bcc_rounding_control.hpp file * * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/detail/bugs.hpp b/boost/numeric/interval/detail/bugs.hpp index b9b421a230..e15bd0cfb3 100644 --- a/boost/numeric/interval/detail/bugs.hpp +++ b/boost/numeric/interval/detail/bugs.hpp @@ -1,7 +1,7 @@ /* Boost interval/detail/bugs.hpp file * * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/detail/c99_rounding_control.hpp b/boost/numeric/interval/detail/c99_rounding_control.hpp index 71d13e787a..2ba7847f7a 100644 --- a/boost/numeric/interval/detail/c99_rounding_control.hpp +++ b/boost/numeric/interval/detail/c99_rounding_control.hpp @@ -1,7 +1,7 @@ /* Boost interval/detail/c99_rounding_control.hpp file * * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/detail/c99sub_rounding_control.hpp b/boost/numeric/interval/detail/c99sub_rounding_control.hpp index 92c9b5c8a8..a8684df6a3 100644 --- a/boost/numeric/interval/detail/c99sub_rounding_control.hpp +++ b/boost/numeric/interval/detail/c99sub_rounding_control.hpp @@ -1,7 +1,7 @@ /* Boost interval/detail/c99sub_rounding_control.hpp file * * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/detail/interval_prototype.hpp b/boost/numeric/interval/detail/interval_prototype.hpp index ac9029b70b..47ba447b65 100644 --- a/boost/numeric/interval/detail/interval_prototype.hpp +++ b/boost/numeric/interval/detail/interval_prototype.hpp @@ -1,6 +1,6 @@ /* Boost interval/detail/interval_prototype.hpp file * - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/detail/msvc_rounding_control.hpp b/boost/numeric/interval/detail/msvc_rounding_control.hpp index ccf1e8b476..2ad3fc19ce 100644 --- a/boost/numeric/interval/detail/msvc_rounding_control.hpp +++ b/boost/numeric/interval/detail/msvc_rounding_control.hpp @@ -1,7 +1,7 @@ /* Boost interval/detail/msvc_rounding_control.hpp file * * Copyright 2000 Maarten Keijzer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or @@ -91,7 +91,7 @@ struct x86_rounding { _control87(hard2msvc(mode), _MCW_EM | _MCW_RC -#if !defined(_M_AMD64) && !defined(_M_ARM) +#if !defined(_M_AMD64) && !defined(_M_ARM) && !defined(_M_ARM64) // x64 ignores _MCW_PC and _MCW_IC, and the Debug CRT library actually // asserts when these are passed to _control87. // MSDN says on '_control87' that changing precision (_MCW_PC) or diff --git a/boost/numeric/interval/detail/ppc_rounding_control.hpp b/boost/numeric/interval/detail/ppc_rounding_control.hpp index d2cf4c80f3..87fe8ee665 100644 --- a/boost/numeric/interval/detail/ppc_rounding_control.hpp +++ b/boost/numeric/interval/detail/ppc_rounding_control.hpp @@ -1,7 +1,7 @@ /* Boost interval/detail/ppc_rounding_control.hpp file * * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * Copyright 2005 Guillaume Melquiond * * Distributed under the Boost Software License, Version 1.0. diff --git a/boost/numeric/interval/detail/sparc_rounding_control.hpp b/boost/numeric/interval/detail/sparc_rounding_control.hpp index 6ba5baf038..2b08bec5cf 100644 --- a/boost/numeric/interval/detail/sparc_rounding_control.hpp +++ b/boost/numeric/interval/detail/sparc_rounding_control.hpp @@ -1,7 +1,7 @@ /* Boost interval/detail/sparc_rounding_control.hpp file * * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/detail/test_input.hpp b/boost/numeric/interval/detail/test_input.hpp index 58695fec3c..9f93bb04ef 100644 --- a/boost/numeric/interval/detail/test_input.hpp +++ b/boost/numeric/interval/detail/test_input.hpp @@ -1,6 +1,6 @@ /* Boost interval/detail/test_input.hpp file * - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/detail/x86_rounding_control.hpp b/boost/numeric/interval/detail/x86_rounding_control.hpp index c35f16d914..3594d01691 100644 --- a/boost/numeric/interval/detail/x86_rounding_control.hpp +++ b/boost/numeric/interval/detail/x86_rounding_control.hpp @@ -1,7 +1,7 @@ /* Boost interval/detail/x86_rounding_control.hpp file * * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/detail/x86gcc_rounding_control.hpp b/boost/numeric/interval/detail/x86gcc_rounding_control.hpp index 079d681df9..da5513b552 100644 --- a/boost/numeric/interval/detail/x86gcc_rounding_control.hpp +++ b/boost/numeric/interval/detail/x86gcc_rounding_control.hpp @@ -1,7 +1,7 @@ /* Boost interval/detail/x86gcc_rounding_control.hpp file * * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/ext/x86_fast_rounding_control.hpp b/boost/numeric/interval/ext/x86_fast_rounding_control.hpp index 7f89a4e549..a505ead092 100644 --- a/boost/numeric/interval/ext/x86_fast_rounding_control.hpp +++ b/boost/numeric/interval/ext/x86_fast_rounding_control.hpp @@ -7,7 +7,7 @@ * overflow would happen without it. Indeed, only * values in range are correctly rounded. * - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/interval.hpp b/boost/numeric/interval/interval.hpp index 0b2d0eec6e..e89af484fb 100644 --- a/boost/numeric/interval/interval.hpp +++ b/boost/numeric/interval/interval.hpp @@ -1,6 +1,6 @@ /* Boost interval/interval.hpp header file * - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002-2003 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/limits.hpp b/boost/numeric/interval/limits.hpp index 973681dbc5..36fd3a397b 100644 --- a/boost/numeric/interval/limits.hpp +++ b/boost/numeric/interval/limits.hpp @@ -1,7 +1,7 @@ /* Boost interval/limits.hpp template implementation file * * Copyright 2000 Jens Maurer - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002-2003 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/rounded_arith.hpp b/boost/numeric/interval/rounded_arith.hpp index 2520274a6a..4bb869122a 100644 --- a/boost/numeric/interval/rounded_arith.hpp +++ b/boost/numeric/interval/rounded_arith.hpp @@ -1,6 +1,6 @@ /* Boost interval/rounded_arith.hpp template implementation file * - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002-2003 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/rounded_transc.hpp b/boost/numeric/interval/rounded_transc.hpp index ac4982e31c..ef6e28b3f9 100644 --- a/boost/numeric/interval/rounded_transc.hpp +++ b/boost/numeric/interval/rounded_transc.hpp @@ -1,6 +1,6 @@ /* Boost interval/rounded_transc.hpp template implementation file * - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002-2003 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/rounding.hpp b/boost/numeric/interval/rounding.hpp index f69e2e4b53..bf5b3c2719 100644 --- a/boost/numeric/interval/rounding.hpp +++ b/boost/numeric/interval/rounding.hpp @@ -1,6 +1,6 @@ /* Boost interval/rounding.hpp template implementation file * - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002-2003 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/transc.hpp b/boost/numeric/interval/transc.hpp index 8d7a7a1acd..b9b7e60c4e 100644 --- a/boost/numeric/interval/transc.hpp +++ b/boost/numeric/interval/transc.hpp @@ -1,7 +1,7 @@ /* Boost interval/transc.hpp template implementation file * * Copyright 2000 Jens Maurer - * Copyright 2002 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or diff --git a/boost/numeric/interval/utility.hpp b/boost/numeric/interval/utility.hpp index c89cdb1e93..97c6bad81c 100644 --- a/boost/numeric/interval/utility.hpp +++ b/boost/numeric/interval/utility.hpp @@ -1,7 +1,7 @@ /* Boost interval/utility.hpp template implementation file * * Copyright 2000 Jens Maurer - * Copyright 2002-2003 Hervé Brönnimann, Guillaume Melquiond, Sylvain Pion + * Copyright 2002-2003 HervĂ© Brönnimann, Guillaume Melquiond, Sylvain Pion * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or @@ -248,7 +248,6 @@ bisect(const interval<T, Policies>& x) template<class T, class Policies> inline T norm(const interval<T, Policies>& x) { - typedef interval<T, Policies> I; if (interval_lib::detail::test_input(x)) { typedef typename Policies::checking checking; return checking::nan(); diff --git a/boost/numeric/odeint/integrate/integrate_n_steps.hpp b/boost/numeric/odeint/integrate/integrate_n_steps.hpp index 7f3a49bddc..5cc8aa0e7b 100644 --- a/boost/numeric/odeint/integrate/integrate_n_steps.hpp +++ b/boost/numeric/odeint/integrate/integrate_n_steps.hpp @@ -23,6 +23,7 @@ #include <boost/numeric/odeint/stepper/stepper_categories.hpp> #include <boost/numeric/odeint/integrate/null_observer.hpp> #include <boost/numeric/odeint/integrate/detail/integrate_n_steps.hpp> +#include <boost/numeric/odeint/integrate/check_adapter.hpp> namespace boost { namespace numeric { diff --git a/boost/numeric/odeint/integrate/max_step_checker.hpp b/boost/numeric/odeint/integrate/max_step_checker.hpp index 6808a57bdb..654c95bc7d 100644 --- a/boost/numeric/odeint/integrate/max_step_checker.hpp +++ b/boost/numeric/odeint/integrate/max_step_checker.hpp @@ -69,7 +69,7 @@ public: if( m_steps++ >= m_max_steps ) { char error_msg[200]; - sprintf(error_msg, "Max number of iterations exceeded (%d).", m_max_steps); + std::sprintf(error_msg, "Max number of iterations exceeded (%d).", m_max_steps); BOOST_THROW_EXCEPTION( no_progress_error(error_msg) ); } } @@ -101,7 +101,7 @@ public: if( m_steps++ >= m_max_steps ) { char error_msg[200]; - sprintf(error_msg, "Max number of iterations exceeded (%d). A new step size was not found.", m_max_steps); + std::sprintf(error_msg, "Max number of iterations exceeded (%d). A new step size was not found.", m_max_steps); BOOST_THROW_EXCEPTION( step_adjustment_error(error_msg) ); } } @@ -111,4 +111,4 @@ public: } // namespace numeric } // namespace boost -#endif
\ No newline at end of file +#endif diff --git a/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp b/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp index 2f7cc4c6fb..f3edce1989 100644 --- a/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp +++ b/boost/numeric/odeint/stepper/adams_bashforth_moulton.hpp @@ -150,6 +150,12 @@ public : } + void reset(void) + { + m_adams_bashforth.reset(); + } + + private: @@ -175,7 +181,7 @@ private: { m_resizer.adjust_size( in , detail::bind( &stepper_type::template resize_impl< StateInOut > , detail::ref( *this ) , detail::_1 ) ); m_adams_bashforth.do_step( system , in , t , m_x.m_v , dt ); - m_adams_moulton.do_step( system , in , m_x.m_v , t , out , dt , m_adams_bashforth.step_storage() ); + m_adams_moulton.do_step( system , in , m_x.m_v , t+dt , out , dt , m_adams_bashforth.step_storage() ); } else { @@ -293,6 +299,11 @@ private: * \param dt The step size. */ + /** + * \fn adams_bashforth_moulton::reset( void ) + * \brief Resets the internal buffers of the stepper. + */ + } // odeint } // numeric diff --git a/boost/numeric/odeint/stepper/bulirsch_stoer.hpp b/boost/numeric/odeint/stepper/bulirsch_stoer.hpp index 4b908333ba..02c37492b9 100644 --- a/boost/numeric/odeint/stepper/bulirsch_stoer.hpp +++ b/boost/numeric/odeint/stepper/bulirsch_stoer.hpp @@ -98,6 +98,7 @@ public: m_interval_sequence( m_k_max+1 ) , m_coeff( m_k_max+1 ) , m_cost( m_k_max+1 ) , + m_facmin_table( m_k_max+1 ) , m_table( m_k_max ) , STEPFAC1( 0.65 ) , STEPFAC2( 0.94 ) , STEPFAC3( 0.02 ) , STEPFAC4( 4.0 ) , KFAC1( 0.8 ) , KFAC2( 0.9 ) { @@ -112,21 +113,14 @@ public: else m_cost[i] = m_cost[i-1] + m_interval_sequence[i]; m_coeff[i].resize(i); + m_facmin_table[i] = pow BOOST_PREVENT_MACRO_SUBSTITUTION( STEPFAC3 , static_cast< value_type >(1) / static_cast< value_type >( 2*i+1 ) ); for( size_t k = 0 ; k < i ; ++k ) { const value_type r = static_cast< value_type >( m_interval_sequence[i] ) / static_cast< value_type >( m_interval_sequence[k] ); m_coeff[i][k] = 1.0 / ( r*r - static_cast< value_type >( 1.0 ) ); // coefficients for extrapolation } - - // crude estimate of optimal order - - m_current_k_opt = 4; - /* no calculation because log10 might not exist for value_type! - const value_type logfact( -log10( max BOOST_PREVENT_MACRO_SUBSTITUTION( eps_rel , static_cast< value_type >(1.0E-12) ) ) * 0.6 + 0.5 ); - m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<value_type>( 1 ) , min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<value_type>( m_k_max-1 ) , logfact )); - */ } - + reset(); } @@ -282,7 +276,7 @@ public: { m_current_k_opt = min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<int>(m_k_max-1) , static_cast<int>(m_current_k_opt)+1 ); new_h = h_opt[k]; - new_h *= m_cost[m_current_k_opt]/m_cost[k]; + new_h *= static_cast<value_type>(m_cost[m_current_k_opt])/static_cast<value_type>(m_cost[k]); } else new_h = h_opt[m_current_k_opt]; break; @@ -344,6 +338,12 @@ public: { m_first = true; m_last_step_rejected = false; + // crude estimate of optimal order + m_current_k_opt = 4; + /* no calculation because log10 might not exist for value_type! + const value_type logfact( -log10( max BOOST_PREVENT_MACRO_SUBSTITUTION( eps_rel , static_cast< value_type >(1.0E-12) ) ) * 0.6 + 0.5 ); + m_current_k_opt = max BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<value_type>( 1 ) , min BOOST_PREVENT_MACRO_SUBSTITUTION( static_cast<value_type>( m_k_max-1 ) , logfact )); + */ } @@ -417,7 +417,7 @@ private: BOOST_USING_STD_MAX(); using std::pow; value_type expo( 1.0/(2*k+1) ); - value_type facmin = pow BOOST_PREVENT_MACRO_SUBSTITUTION( STEPFAC3 , expo ); + value_type facmin = m_facmin_table[k]; value_type fac; if (error == 0.0) fac=1.0/facmin; @@ -506,6 +506,7 @@ private: int_vector m_interval_sequence; // stores the successive interval counts value_matrix m_coeff; int_vector m_cost; // costs for interval count + value_vector m_facmin_table; // for precomputed facmin to save pow calls state_table_type m_table; // sequence of states for extrapolation diff --git a/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp b/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp index d876ca3d36..6a1eed15fb 100644 --- a/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp +++ b/boost/numeric/odeint/stepper/bulirsch_stoer_dense_out.hpp @@ -110,6 +110,7 @@ public: m_interval_sequence( m_k_max+1 ) , m_coeff( m_k_max+1 ) , m_cost( m_k_max+1 ) , + m_facmin_table( m_k_max+1 ) , m_table( m_k_max ) , m_mp_states( m_k_max+1 ) , m_derivs( m_k_max+1 ) , @@ -125,9 +126,13 @@ public: m_interval_sequence[i] = 2 + 4*i; // 2 6 10 14 ... m_derivs[i].resize( m_interval_sequence[i] ); if( i == 0 ) + { m_cost[i] = m_interval_sequence[i]; - else + } else + { m_cost[i] = m_cost[i-1] + m_interval_sequence[i]; + } + m_facmin_table[i] = pow BOOST_PREVENT_MACRO_SUBSTITUTION( STEPFAC3 , static_cast< value_type >(1) / static_cast< value_type >( 2*i+1 ) ); m_coeff[i].resize(i); for( size_t k = 0 ; k < i ; ++k ) { @@ -429,7 +434,7 @@ private: using std::pow; value_type expo = static_cast<value_type>(1)/(m_interval_sequence[k-1]); - value_type facmin = pow BOOST_PREVENT_MACRO_SUBSTITUTION( STEPFAC3 , expo ); + value_type facmin = m_facmin_table[k]; value_type fac; if (error == 0.0) fac = static_cast<value_type>(1)/facmin; @@ -692,6 +697,7 @@ private: int_vector m_interval_sequence; // stores the successive interval counts value_matrix m_coeff; int_vector m_cost; // costs for interval count + value_vector m_facmin_table; // for precomputed facmin to save pow calls state_vector_type m_table; // sequence of states for extrapolation diff --git a/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp b/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp index 8ae627fe1c..aac2b02dca 100644 --- a/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp +++ b/boost/numeric/odeint/stepper/controlled_runge_kutta.hpp @@ -143,7 +143,7 @@ public: error = max BOOST_PREVENT_MACRO_SUBSTITUTION ( static_cast<value_type>( pow( static_cast<value_type>(5.0) , -static_cast<value_type>(stepper_order) ) ) , error); - time_type dt_old = dt; + // time_type dt_old = dt; unused variable warning //error too small - increase dt and keep the evolution and limit scaling factor to 5.0 dt *= static_cast<value_type>(9)/static_cast<value_type>(10) * pow(error, static_cast<value_type>(-1) / stepper_order); diff --git a/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp b/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp index 0e5edd32c0..61d6e51191 100644 --- a/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp +++ b/boost/numeric/odeint/stepper/rosenbrock4_controller.hpp @@ -163,6 +163,8 @@ public: if( m_max_dt != static_cast<time_type>(0) ) { dt = detail::min_abs(m_max_dt, dt_new); + } else { + dt = dt_new; } m_last_rejected = false; return success; |