From 3c0df88eef11eda88427a04862466ecbbc22b204 Mon Sep 17 00:00:00 2001 From: Mert Kipcak Date: Wed, 13 Nov 2024 13:50:57 -0800 Subject: [PATCH 1/3] Add MinAres solver to iterative wrappers --- src/iterative_wrappers.jl | 13 +++++++++++++ test/basictests.jl | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/src/iterative_wrappers.jl b/src/iterative_wrappers.jl index f487463c..05891cc7 100644 --- a/src/iterative_wrappers.jl +++ b/src/iterative_wrappers.jl @@ -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 @@ -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 diff --git a/test/basictests.jl b/test/basictests.jl index f9ddd302..aeafcc5e 100644 --- a/test/basictests.jl +++ b/test/basictests.jl @@ -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(kwards...)) ) for (name, algorithm) in algorithms @testset "$name" begin From 9f069c413e4e3eb5b0545181f20ba41f097d98e6 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Wed, 13 Nov 2024 21:59:41 -0100 Subject: [PATCH 2/3] Update LinearSolve.jl --- src/LinearSolve.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LinearSolve.jl b/src/LinearSolve.jl index ef86452b..eacfafab 100644 --- a/src/LinearSolve.jl +++ b/src/LinearSolve.jl @@ -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 From 306b4b63c4c5e3cd2d7057181a5b0ba2fedd0bb3 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Wed, 13 Nov 2024 23:01:57 -0100 Subject: [PATCH 3/3] Update test/basictests.jl --- test/basictests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/basictests.jl b/test/basictests.jl index aeafcc5e..64ea0c3d 100644 --- a/test/basictests.jl +++ b/test/basictests.jl @@ -275,7 +275,7 @@ end ("GMRES_prec", KrylovJL_GMRES(; precs, ldiv = false, kwargs...)), # ("BICGSTAB",KrylovJL_BICGSTAB(kwargs...)), ("MINRES", KrylovJL_MINRES(kwargs...)), - ("MINARES", KrylovJL_MINARES(kwards...)) + ("MINARES", KrylovJL_MINARES(kwargs...)) ) for (name, algorithm) in algorithms @testset "$name" begin