Skip to content

Commit

Permalink
Merge pull request #450 from SciML/ap/simple_gmres
Browse files Browse the repository at this point in the history
Type stable path to construct SimpleGMRES
  • Loading branch information
ChrisRackauckas authored Dec 22, 2023
2 parents 3b4f4ed + 593cd43 commit 9365b77
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/simplegmres.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,16 @@ struct SimpleGMRES{UBD} <: AbstractKrylovSubspaceMethod
blocksize::Int
warm_start::Bool

function SimpleGMRES{UBD}(; restart::Bool = true, blocksize::Int = 0,
warm_start::Bool = false, memory::Int = 20) where {UBD}
UBD && @assert blocksize > 0
return new{UBD}(restart, memory, blocksize, warm_start)
end

function SimpleGMRES(; restart::Bool = true, blocksize::Int = 0,
warm_start::Bool = false, memory::Int = 20)
return new{blocksize > 0}(restart, memory, blocksize, warm_start)
return SimpleGMRES{blocksize > 0}(; restart, memory, blocksize,
warm_start)
end
end

Expand Down

0 comments on commit 9365b77

Please sign in to comment.