From b3d8f21dd2e466c2f2a86ead556a3c5ace99f203 Mon Sep 17 00:00:00 2001 From: Farhad Rahbarnia <31899325+farhadrclass@users.noreply.github.com> Date: Mon, 3 Mar 2025 20:03:13 -0500 Subject: [PATCH] Update src/minres.jl Co-authored-by: Dominique --- src/minres.jl | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/minres.jl b/src/minres.jl index 9c2bf13b1..a955eee20 100644 --- a/src/minres.jl +++ b/src/minres.jl @@ -299,16 +299,17 @@ kwargs_minres = (:M, :ldiv, :linesearch ,:λ, :atol, :rtol, :etol, :conlim, :itm ArNorm = ϕbar * root # = ‖Aᴴrₖ₋₁‖ history && push!(ArNorms, ArNorm) - # Check if -ve curvature encountered. + # Check for nonpositive curvature if linesearch - if cs * γbar ≥ 0 # or eps(T) - (verbose > 0) && @printf(iostream, "nonpositive curvature detected: cs * γbar = %e\n", cs * γbar) + cγ = cs * γbar + if cγ ≥ 0 + (verbose > 0) && @printf(iostream, "nonpositive curvature detected: cs * γbar = %e\n", cγ) stats.solved = true stats.niter = iter stats.inconsistent = false stats.timer = start_time |> ktimer stats.status = "nonpositive curvature" - iter == 1 && kcopy!(n, x, b) # x ← b # we start at iteration 1 + iter == 1 && kcopy!(n, x, r) solver.warm_start = false return solver end