Skip to content

Commit

Permalink
fixes iterative refinement edge case (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
goulart-paul authored Jun 2, 2023
1 parent c3f410e commit 16bda87
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/kktsolvers/kktsolver_directldl.jl
Original file line number Diff line number Diff line change
Expand Up @@ -380,12 +380,11 @@ function _iterative_refinement(

#compute the initial error
norme = _get_refine_error!(e,b,KKTsym,x)

isfinite(norme) || return is_success = false

for i = 1:IR_maxiter

# bail on numerical error
if !isfinite(norme) return is_success = false end

if(norme <= IR_abstol + IR_reltol*normb)
# within tolerance, or failed. Exit
break
Expand All @@ -398,7 +397,9 @@ function _iterative_refinement(
#prospective solution is x + dx. Use dx space to
#hold it for a check before applying to x
@. dx += x

norme = _get_refine_error!(e,b,KKTsym,dx)
isfinite(norme) || return is_success = false

improved_ratio = lastnorme/norme
if(improved_ratio < IR_stopratio)
Expand Down

0 comments on commit 16bda87

Please sign in to comment.