Skip to content

Commit

Permalink
Minor bugfix in tolerances
Browse files Browse the repository at this point in the history
  • Loading branch information
JordiManyer committed Oct 16, 2023
1 parent dec2d77 commit d10fe7e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/SolverInterfaces/SolverTolerances.jl
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function set_solver_tolerances!(a::SolverTolerances{T};
return a
end

function finished_flag(tols::SolverTolerances,niter,e_r,e_a)
function finished_flag(tols::SolverTolerances,niter,e_a,e_r)
if !finished(tols,niter,e_r,e_a)
@warn "finished_flag() called with unfinished solver!"
end
Expand All @@ -49,11 +49,11 @@ function finished_flag(tols::SolverTolerances,niter,e_r,e_a)
end
end

function finished(tols::SolverTolerances,niter,e_r,e_a)
return (niter >= tols.maxiter) || converged(tols,niter,e_r,e_a)
function finished(tols::SolverTolerances,niter,e_a,e_r)
return (niter >= tols.maxiter) || converged(tols,niter,e_a,e_r)
end

function converged(tols::SolverTolerances,niter,e_r,e_a)
function converged(tols::SolverTolerances,niter,e_a,e_r)
return (e_r < tols.rtol) || (e_a < tols.atol)
end

Expand Down

0 comments on commit d10fe7e

Please sign in to comment.