diff --git a/examples/openmp/lorenz_ensemble_simple.cpp b/examples/openmp/lorenz_ensemble_simple.cpp index a145c815..fbaf2499 100644 --- a/examples/openmp/lorenz_ensemble_simple.cpp +++ b/examples/openmp/lorenz_ensemble_simple.cpp @@ -57,19 +57,21 @@ int main() { state_type X(n, point_type(10, 10, 10)); - typedef runge_kutta4< - state_type, double, - state_type, double, - openmp_range_algebra - > stepper; - const double t_max = 10.0, dt = 0.01; - integrate_const( - stepper(), - sys_func(R), X, - 0.0, t_max, dt - ); + // Simple stepper with constant step size + // typedef runge_kutta4 stepper; + + // integrate_const(stepper(), sys_func(R), X, 0.0, t_max, dt); + + // Controlled stepper with variable step size + typedef runge_kutta_fehlberg78 error_stepper_type; + typedef controlled_runge_kutta controlled_stepper_type; + controlled_stepper_type controlled_stepper; + + integrate_adaptive(controlled_stepper, sys_func(R), X, 0.0, t_max, dt); copy( X.begin(), X.end(), ostream_iterator(cout, "\n") ); diff --git a/include/boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp b/include/boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp index f5668e4d..295db647 100644 --- a/include/boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp +++ b/include/boost/numeric/odeint/external/openmp/openmp_range_algebra.hpp @@ -259,7 +259,7 @@ BOOST_ODEINT_GEN_FOR_EACH(BOOST_ODEINT_GEN_BODY) typedef typename norm_result_type< S >::type result_type; result_type init = static_cast< result_type >( 0 ); const size_t len = boost::size(s); - typename boost::range_iterator::type beg = boost::begin(s); + typename boost::range_iterator::type beg = boost::begin(s); # pragma omp parallel for reduction(max: init) schedule(dynamic) for( size_t i = 0 ; i < len ; ++i ) init = max( init , abs( beg[i] ) );