Skip to content

Commit

Permalink
Add post step call instead of solution_accepted
Browse files Browse the repository at this point in the history
  • Loading branch information
arvigj committed Dec 6, 2023
1 parent ab7091d commit 148752f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/polysolve/nonlinear/Solver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ namespace polysolve::nonlinear
objFunc.solution_changed(x);
}

objFunc.post_step(this->m_current.iterations, x);

const auto g_norm_tol = this->m_stop.gradNorm;
this->m_stop.gradNorm = first_grad_norm_tol;

Expand All @@ -195,7 +197,6 @@ namespace polysolve::nonlinear
this->m_stop.fDelta, this->m_stop.gradNorm, this->m_stop.xDelta);

update_solver_info(objFunc.value(x));
objFunc.step_accepted(this->m_current.iterations, x);

int f_delta_step_cnt = 0;
double f_delta = 0;
Expand Down Expand Up @@ -374,7 +375,6 @@ namespace polysolve::nonlinear
this->m_status = cppoptlib::Status::IterationLimit;

update_solver_info(energy);
objFunc.step_accepted(this->m_current.iterations, x);

// reset the tolerance, since in the first iter it might be smaller
this->m_stop.gradNorm = g_norm_tol;
Expand Down

0 comments on commit 148752f

Please sign in to comment.