diff options
Diffstat (limited to 'boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp')
-rw-r--r-- | boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp b/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp index 8a866c562e..6695ba6a97 100644 --- a/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp +++ b/boost/numeric/odeint/stepper/rosenbrock4_dense_output.hpp @@ -7,7 +7,7 @@ [end_description] Copyright 2011-2012 Karsten Ahnert - Copyright 2011-2012 Mario Mulansky + Copyright 2011-2015 Mario Mulansky Copyright 2012 Christoph Koke Distributed under the Boost Software License, Version 1.0. @@ -27,6 +27,8 @@ #include <boost/numeric/odeint/stepper/rosenbrock4_controller.hpp> #include <boost/numeric/odeint/util/is_resizeable.hpp> +#include <boost/numeric/odeint/integrate/max_step_checker.hpp> + namespace boost { namespace numeric { @@ -73,16 +75,13 @@ public: template< class System > std::pair< time_type , time_type > do_step( System system ) { - const size_t max_count = 1000; - + failed_step_checker fail_checker; // to throw a runtime_error if step size adjustment fails controlled_step_result res = fail; m_t_old = m_t; - size_t count = 0; do { res = m_stepper.try_step( system , get_current_state() , m_t , get_old_state() , m_dt ); - if( count++ == max_count ) - throw std::overflow_error( "rosenbrock4 : too much iterations!"); + fail_checker(); // check for overflow of failed steps } while( res == fail ); m_stepper.stepper().prepare_dense_output(); |