You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For problems `Ax=b`, this allows the vector space of `x` (`vn`) to be
different from the vector space of `b` (`vm`); also for some bipartite
problems
[A B; C D] [x; y] = [b; c]
it allows `x` and `y` to be of different types.
The key change is to introduce `KrylovWorkspaceNext{T,FC,Sm,Sn}`, for
which `Sm` and `Sn` are the types of the length-`m` and length-`n`
vectors, respectively. `KrylovWorkspace{T,FC,S}` is now just a type
alias for `KrylovWorkspaceNext{T,FC,S,S}`. This is done for reasons of
backwards compatibility; in the next breaking release, we should rename
`KrylovWorkspaceNext` to `KrylovWorkspace`.
This PR exploits the new flexibility for CGLS, LSQR, TRICG, TRIMR, and
GPMR. Extending to other solvers is left as an exercise for the reader.
Fixes#1037
functioncgls!(workspace ::CglsWorkspace{T,FC,S}, $(def_args_cgls...); $(def_kwargs_cgls...)) where {T <:AbstractFloat, FC <:FloatOrComplex{T}, S<:AbstractVector{FC}}
129
+
functioncgls!(workspace ::CglsWorkspace{T,FC,Sm,Sn}, $(def_args_cgls...); $(def_kwargs_cgls...)) where {T <:AbstractFloat, FC <:FloatOrComplex{T}, Sm <:AbstractVector{FC}, Sn<:AbstractVector{FC}}
functiongpmr!(workspace ::GpmrWorkspace{T,FC,S}, $(def_args_gpmr...); $(def_kwargs_gpmr...)) where {T <:AbstractFloat, FC <:FloatOrComplex{T}, S<:AbstractVector{FC}}
160
+
functiongpmr!(workspace ::GpmrWorkspace{T,FC,Sm,Sn}, $(def_args_gpmr...); $(def_kwargs_gpmr...)) where {T <:AbstractFloat, FC <:FloatOrComplex{T}, Sm <:AbstractVector{FC}, Sn<:AbstractVector{FC}}
krylov_solve(::Val{Symbol($krylov)}, $(def_args...); $(def_kwargs...)) where {T <:AbstractFloat, FC <:FloatOrComplex{T}} =$(krylov)($(args...); $(kwargs...))
140
140
end
141
-
elseif krylov in (:diom, :dqgmres, :fom, :gmres, :fgmres, :gpmr)
141
+
elseif krylov in (:diom, :dqgmres, :fom, :gmres, :fgmres)
142
142
@evalbegin
143
143
function$(krylov)($(def_args...); memory::Int=20, $(def_kwargs...)) where {T <:AbstractFloat, FC <:FloatOrComplex{T}}
krylov_solve(::Val{Symbol($krylov)}, $(def_args...); $(def_kwargs...)) where {T <:AbstractFloat, FC <:FloatOrComplex{T}} =$(krylov)($(args...); $(kwargs...))
241
+
242
+
if!isempty($optargs)
243
+
function$(krylov)($(def_args...), $(def_optargs...); $(def_kwargs...)) where {T <:AbstractFloat, FC <:FloatOrComplex{T}}
0 commit comments