Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more tests for the option warm-start #961

Merged
merged 2 commits into from
Feb 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/Breakage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ jobs:
done >> summary.md

- name: PR comment with file
uses: actions/github-script@v6
uses: actions/github-script@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down
4 changes: 3 additions & 1 deletion src/bicgstab.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ kwargs_bicgstab = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose,
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand All @@ -189,6 +190,7 @@ kwargs_bicgstab = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose,
stats.solved, stats.inconsistent = false, false
stats.timer = start_time |> ktimer
stats.status = "Breakdown bᴴc = 0"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
4 changes: 3 additions & 1 deletion src/bilq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ kwargs_bilq = (:c, :transfer_to_bicg, :M, :N, :ldiv, :atol, :rtol, :itmax, :time
stats.solved = true
stats.inconsistent = false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand All @@ -181,6 +182,7 @@ kwargs_bilq = (:c, :transfer_to_bicg, :M, :N, :ldiv, :atol, :rtol, :itmax, :time
stats.inconsistent = false
stats.timer = start_time |> ktimer
stats.status = "Breakdown bᴴc = 0"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
2 changes: 2 additions & 0 deletions src/bilqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ kwargs_bilqr = (:transfer_to_bicg, :atol, :rtol, :itmax, :timemax, :verbose, :hi
stats.solved_dual = false
stats.timer = start_time |> ktimer
stats.status = "Breakdown bᴴc = 0"
warm_start && kaxpy!(n, one(FC), Δx, x)
warm_start && kaxpy!(n, one(FC), Δy, t)
solver.warm_start = false
return solver
end
Expand Down
3 changes: 2 additions & 1 deletion src/car.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ kwargs_car = (:M, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :history, :ca
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
3 changes: 2 additions & 1 deletion src/cg.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ kwargs_cg = (:M, :ldiv, :radius, :linesearch, :atol, :rtol, :itmax, :timemax, :v
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
3 changes: 2 additions & 1 deletion src/cg_lanczos.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,8 @@ kwargs_cg_lanczos = (:M, :ldiv, :check_curvature, :atol, :rtol, :itmax, :timemax
stats.Anorm = zero(T)
stats.indefinite = false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
2 changes: 1 addition & 1 deletion src/cg_lanczos_shift.jl
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ kwargs_cg_lanczos_shift = (:M, :ldiv, :check_curvature, :atol, :rtol, :itmax, :t
stats.niter = 0
stats.solved = true
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
return solver
end

Expand Down
2 changes: 1 addition & 1 deletion src/cgls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ kwargs_cgls = (:M, :ldiv, :radius, :λ, :atol, :rtol, :itmax, :timemax, :verbose
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
history && push!(rNorms, zero(T))
history && push!(ArNorms, zero(T))
return solver
Expand Down
2 changes: 1 addition & 1 deletion src/cgls_lanczos_shift.jl
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ kwargs_cgls_lanczos_shift = (:M, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose
stats.niter = 0
stats.solved = true
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
return solver
end

Expand Down
2 changes: 1 addition & 1 deletion src/cgne.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ kwargs_cgne = (:N, :ldiv, :λ, :atol, :rtol, :itmax, :timemax, :verbose, :histor
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
return solver
end
λ > 0 && kcopy!(m, s, r) # s ← r
Expand Down
4 changes: 3 additions & 1 deletion src/cgs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,8 @@ kwargs_cgs = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :hist
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand All @@ -178,6 +179,7 @@ kwargs_cgs = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :hist
stats.solved, stats.inconsistent = false, false
stats.timer = start_time |> ktimer
stats.status = "Breakdown bᴴc = 0"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start =false
return solver
end
Expand Down
3 changes: 3 additions & 0 deletions src/cr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
stats.timer = start_time |> ktimer
stats.status = "x is a zero-residual solution"
history && push!(ArNorms, zero(T))
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down Expand Up @@ -219,6 +220,7 @@
stats.timer = start_time |> ktimer
stats.status = "nonpositive curvature"
iter == 0 && kcopy!(n, x, b) # x ← b
solver.warm_start = false
return solver
end
elseif pAp ≤ 0 && radius == 0
Expand Down Expand Up @@ -384,6 +386,7 @@
stats.inconsistent = false
stats.timer = start_time |> ktimer
stats.status = "solver encountered numerical issues"
warm_start && kaxpy!(n, one(FC), Δx, x)

Check warning on line 389 in src/cr.jl

View check run for this annotation

Codecov / codecov/patch

src/cr.jl#L389

Added line #L389 was not covered by tests
solver.warm_start = false
return solver
end
Expand Down
2 changes: 1 addition & 1 deletion src/craig.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ kwargs_craig = (:M, :N, :ldiv, :transfer_to_lsqr, :sqd, :λ, :btol, :conlim, :at
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
return solver
end
β₁² = β₁^2
Expand Down
4 changes: 2 additions & 2 deletions src/craigmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
history && push!(rNorms, β)
history && push!(ArNorms, zero(T))
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
return solver
end

Expand Down Expand Up @@ -226,7 +226,7 @@
history && push!(rNorms, β)
history && push!(ArNorms, zero(T))
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a minimum least-squares solution"
stats.status = "x is a minimum least-squares solution"

Check warning on line 229 in src/craigmr.jl

View check run for this annotation

Codecov / codecov/patch

src/craigmr.jl#L229

Added line #L229 was not covered by tests
return solver
end
kscal!(n, one(FC)/α, v)
Expand Down
2 changes: 1 addition & 1 deletion src/crls.jl
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ kwargs_crls = (:M, :ldiv, :radius, :λ, :atol, :rtol, :itmax, :timemax, :verbose
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
history && push!(ArNorms, zero(T))
return solver
end
Expand Down
2 changes: 1 addition & 1 deletion src/crmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ kwargs_crmr = (:N, :ldiv, :λ, :atol, :rtol, :itmax, :timemax, :verbose, :histor
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
history && push!(ArNorms, zero(T))
return solver
end
Expand Down
3 changes: 2 additions & 1 deletion src/diom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ kwargs_diom = (:M, :N, :ldiv, :reorthogonalization, :atol, :rtol, :itmax, :timem
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
3 changes: 2 additions & 1 deletion src/dqgmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,8 @@ kwargs_dqgmres = (:M, :N, :ldiv, :reorthogonalization, :atol, :rtol, :itmax, :ti
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
3 changes: 2 additions & 1 deletion src/fgmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ kwargs_fgmres = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :i
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
3 changes: 2 additions & 1 deletion src/fom.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ kwargs_fom = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :itma
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
3 changes: 2 additions & 1 deletion src/gmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ kwargs_gmres = (:M, :N, :ldiv, :restart, :reorthogonalization, :atol, :rtol, :it
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
2 changes: 1 addition & 1 deletion src/lnlq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ kwargs_lnlq = (:M, :N, :ldiv, :transfer_to_craig, :sqd, :λ, :σ, :utolx, :utoly
stats.error_with_bnd = false
history && push!(rNorms, bNorm)
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
return solver
end

Expand Down
4 changes: 2 additions & 2 deletions src/lslq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@
history && push!(rNorms, zero(T))
history && push!(ArNorms, zero(T))
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
return solver
end
β = β₁
Expand All @@ -256,7 +256,7 @@
history && push!(rNorms, β₁)
history && push!(ArNorms, zero(T))
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a minimum least-squares solution"
stats.status = "x is a minimum least-squares solution"

Check warning on line 259 in src/lslq.jl

View check run for this annotation

Codecov / codecov/patch

src/lslq.jl#L259

Added line #L259 was not covered by tests
return solver
end
kscal!(n, one(FC)/α, v)
Expand Down
4 changes: 2 additions & 2 deletions src/lsmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
history && push!(rNorms, zero(T))
history && push!(ArNorms, zero(T))
return solver
Expand Down Expand Up @@ -268,7 +268,7 @@
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a minimum least-squares solution"
stats.status = "x is a minimum least-squares solution"

Check warning on line 271 in src/lsmr.jl

View check run for this annotation

Codecov / codecov/patch

src/lsmr.jl#L271

Added line #L271 was not covered by tests
return solver
end
kscal!(n, one(FC)/α, v)
Expand Down
4 changes: 2 additions & 2 deletions src/lsqr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
history && push!(rNorms, zero(T))
history && push!(ArNorms, zero(T))
return solver
Expand Down Expand Up @@ -250,7 +250,7 @@
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a minimum least-squares solution"
stats.status = "x is a minimum least-squares solution"

Check warning on line 253 in src/lsqr.jl

View check run for this annotation

Codecov / codecov/patch

src/lsqr.jl#L253

Added line #L253 was not covered by tests
return solver
end
kscal!(n, one(FC)/α, v)
Expand Down
3 changes: 2 additions & 1 deletion src/minares.jl
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,8 @@ kwargs_minares = (:M, :ldiv, :λ, :atol, :rtol, :Artol, :itmax, :timemax, :verbo
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
4 changes: 3 additions & 1 deletion src/minres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,11 @@ kwargs_minres = (:M, :ldiv, :λ, :atol, :rtol, :etol, :conlim, :itmax, :timemax,
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
history && push!(rNorms, β₁)
history && push!(ArNorms, zero(T))
history && push!(Aconds, zero(T))
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down Expand Up @@ -330,6 +331,7 @@ kwargs_minres = (:M, :ldiv, :λ, :atol, :rtol, :etol, :conlim, :itmax, :timemax,
stats.solved, stats.inconsistent = true, true
stats.timer = start_time |> ktimer
stats.status = "x is a minimum least-squares solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
3 changes: 2 additions & 1 deletion src/minres_qlp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ kwargs_minres_qlp = (:M, :ldiv, :λ, :atol, :rtol, :Artol, :itmax, :timemax, :ve
stats.niter = 0
stats.solved, stats.inconsistent = true, false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
4 changes: 3 additions & 1 deletion src/qmr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,8 @@ kwargs_qmr = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :hist
stats.solved = true
stats.inconsistent = false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand All @@ -187,6 +188,7 @@ kwargs_qmr = (:c, :M, :N, :ldiv, :atol, :rtol, :itmax, :timemax, :verbose, :hist
stats.inconsistent = false
stats.timer = start_time |> ktimer
stats.status = "Breakdown bᴴc = 0"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
3 changes: 2 additions & 1 deletion src/symmlq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,8 @@ kwargs_symmlq = (:M, :ldiv, :transfer_to_cg, :λ, :λest, :atol, :rtol, :etol, :
history && push!(rNorms, zero(T))
history && push!(rcgNorms, zero(T))
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
3 changes: 2 additions & 1 deletion src/usymlq.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,8 @@ kwargs_usymlq = (:transfer_to_usymcg, :atol, :rtol, :itmax, :timemax, :verbose,
stats.solved = true
stats.inconsistent = false
stats.timer = start_time |> ktimer
stats.status = "x = 0 is a zero-residual solution"
stats.status = "x is a zero-residual solution"
warm_start && kaxpy!(n, one(FC), Δx, x)
solver.warm_start = false
return solver
end
Expand Down
Loading
Loading