diff --git a/src/LinearSolve.jl b/src/LinearSolve.jl index 4c94150df..37ed234f4 100644 --- a/src/LinearSolve.jl +++ b/src/LinearSolve.jl @@ -490,7 +490,7 @@ export LUFactorization, SVDFactorization, QRFactorization, GenericFactorization, export LinearSolveFunction, DirectLdiv!, show_algorithm_choices export KrylovJL, KrylovJL_CG, KrylovJL_MINRES, KrylovJL_GMRES, - KrylovJL_BICGSTAB, KrylovJL_LSMR, KrylovJL_CRAIGMR, + KrylovJL_BICGSTAB, KrylovJL_LSMR, KrylovJL_CRAIGMR, KrylovJL_FGMRES, IterativeSolversJL, IterativeSolversJL_CG, IterativeSolversJL_GMRES, IterativeSolversJL_BICGSTAB, IterativeSolversJL_MINRES, IterativeSolversJL_IDRS, KrylovKitJL, KrylovKitJL_CG, KrylovKitJL_GMRES, KrylovJL_MINARES diff --git a/src/iterative_wrappers.jl b/src/iterative_wrappers.jl index 7f30e0e39..3ecb1b936 100644 --- a/src/iterative_wrappers.jl +++ b/src/iterative_wrappers.jl @@ -63,6 +63,17 @@ function KrylovJL_GMRES(args...; kwargs...) KrylovJL(args...; KrylovAlg = Krylov.gmres!, kwargs...) end +""" +```julia +KrylovJL_FGMRES(args...; gmres_restart = 0, window = 0, kwargs...) +``` + +A generic FGMRES implementation for square non-Hermitian linear systems +""" +function KrylovJL_FGMRES(args...; kwargs...) + KrylovJL(args...; KrylovAlg = Krylov.fgmres!, kwargs...) +end + """ ```julia KrylovJL_BICGSTAB(args...; kwargs...) diff --git a/test/basictests.jl b/test/basictests.jl index 953e6a56e..dc7e0ad1f 100644 --- a/test/basictests.jl +++ b/test/basictests.jl @@ -390,7 +390,9 @@ end ("Default", KrylovJL(kwargs...)), ("CG", KrylovJL_CG(kwargs...)), ("GMRES", KrylovJL_GMRES(kwargs...)), + ("FGMRES", KrylovJL_FGMRES(kwargs...)), ("GMRES_prec", KrylovJL_GMRES(; precs, ldiv = false, kwargs...)), + ("FGMRES_prec", KrylovJL_FGMRES(; precs, ldiv = false, kwargs...)), # ("BICGSTAB",KrylovJL_BICGSTAB(kwargs...)), ("MINRES", KrylovJL_MINRES(kwargs...)), ("MINARES", KrylovJL_MINARES(kwargs...))