Skip to content

Commit

Permalink
Merge pull request #558 from mertkipcak/main
Browse files Browse the repository at this point in the history
Add MinAres solver to iterative wrappers
  • Loading branch information
ChrisRackauckas authored Nov 14, 2024
2 parents de8b1c1 + 306b4b6 commit a183391
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/LinearSolve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export KrylovJL, KrylovJL_CG, KrylovJL_MINRES, KrylovJL_GMRES,
KrylovJL_BICGSTAB, KrylovJL_LSMR, KrylovJL_CRAIGMR,
IterativeSolversJL, IterativeSolversJL_CG, IterativeSolversJL_GMRES,
IterativeSolversJL_BICGSTAB, IterativeSolversJL_MINRES, IterativeSolversJL_IDRS,
KrylovKitJL, KrylovKitJL_CG, KrylovKitJL_GMRES
KrylovKitJL, KrylovKitJL_CG, KrylovKitJL_GMRES, KrylovJL_MINARES

export SimpleGMRES

Expand Down
13 changes: 13 additions & 0 deletions src/iterative_wrappers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,17 @@ function KrylovJL_CRAIGMR(args...; kwargs...)
KrylovJL(args...; KrylovAlg = Krylov.craigmr!, kwargs...)
end

"""
```julia
KrylovJL_MINARES(args...; kwargs...)
```
A generic MINARES implementation for Hermitian linear systems
"""
function KrylovJL_MINARES(args...; kwargs...)
KrylovJL(args...; KrylovAlg = Krylov.minares!, kwargs...)
end

function get_KrylovJL_solver(KrylovAlg)
KS = if (KrylovAlg === Krylov.lsmr!)
Krylov.LsmrSolver
Expand Down Expand Up @@ -163,6 +174,8 @@ function get_KrylovJL_solver(KrylovAlg)
Krylov.GpmrSolver
elseif (KrylovAlg === Krylov.fom!)
Krylov.FomSolver
elseif (KrylovAlg === Krylov.minares!)
Krylov.MinaresSolver
else
error("Invalid Krylov method detected")
end
Expand Down
3 changes: 2 additions & 1 deletion test/basictests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,8 @@ end
("GMRES", KrylovJL_GMRES(kwargs...)),
("GMRES_prec", KrylovJL_GMRES(; precs, ldiv = false, kwargs...)),
# ("BICGSTAB",KrylovJL_BICGSTAB(kwargs...)),
("MINRES", KrylovJL_MINRES(kwargs...))
("MINRES", KrylovJL_MINRES(kwargs...)),
("MINARES", KrylovJL_MINARES(kwargs...))
)
for (name, algorithm) in algorithms
@testset "$name" begin
Expand Down

0 comments on commit a183391

Please sign in to comment.