Skip to content

Commit

Permalink
Issue #3682 Call Integrator::reset after changes in u instead of just…
Browse files Browse the repository at this point in the history
… once

This also changes the behavior at first call since the call now happens after u has been set
  • Loading branch information
jaeandersson committed May 9, 2024
1 parent 581691c commit fe96011
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions casadi/core/integrator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,8 @@ int Integrator::eval(const double** arg, double** res,
// Is this the first call to reset?
bool first_call = true;

// Reset solver, take time to t0
// Take time to t0
m->t = t0_;
reset(m, first_call);

// Ensure that control is updated at the first iteration
casadi_int k_stop = -1;
Expand Down Expand Up @@ -404,7 +403,7 @@ int Integrator::eval(const double** arg, double** res,
if (next_event(m, p, u)) return 1;
// Reset the solver
if (reset_solver) {
// reset(m, first_call);
reset(m, first_call);
first_call = false;
}
// Advance solution
Expand Down

0 comments on commit fe96011

Please sign in to comment.