@@ -163,8 +163,6 @@ ode_rk45_tol(const F& f,
163163 bool observer_initial_recorded = false ;
164164 size_t time_index = 0 ;
165165
166- max_step_checker step_checker (max_num_steps);
167-
168166 // avoid recording of the initial state which is included by the
169167 // conventions of odeint in the output
170168 auto filtered_observer
@@ -175,7 +173,6 @@ ode_rk45_tol(const F& f,
175173 }
176174 y.emplace_back (ode_store_sensitivities (f, coupled_state, y0, t0,
177175 ts[time_index], msgs, args...));
178- step_checker.reset ();
179176 time_index++;
180177 };
181178
@@ -189,7 +186,8 @@ ode_rk45_tol(const F& f,
189186 runge_kutta_dopri5<Eigen::VectorXd, double , Eigen::VectorXd, double ,
190187 vector_space_algebra>()),
191188 std::ref (coupled_system), initial_coupled_state, std::begin (ts_vec),
192- std::end (ts_vec), step_size, filtered_observer, step_checker);
189+ std::end (ts_vec), step_size, filtered_observer,
190+ max_step_checker (max_num_steps));
193191
194192 return y;
195193}
0 commit comments