Skip to content

Commit 99a01fc

Browse files
committed
https://github.com/JuliaSmoothOptimizers/Krylov.jl/issues/612#issuecomment-1227391841
1 parent a5cd365 commit 99a01fc

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/iterative_wrappers.jl

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,8 @@ function SciMLBase.solve(cache::LinearCache, alg::KrylovJL; kwargs...)
151151
N = cache.Pr
152152

153153
# use no-op preconditioner for Krylov.jl (LinearAlgebra.I) when M/N is identity
154-
# TODO - https://github.com/JuliaSmoothOptimizers/Krylov.jl/issues/612#issuecomment-1227391841
155-
M = _isidentity_struct(M) ? I : InvertedOperator(M)
156-
N = _isidentity_struct(M) ? I : InvertedOperator(N)
154+
M = _isidentity_struct(M) ? I : M
155+
N = _isidentity_struct(M) ? I : N
157156

158157
atol = float(cache.abstol)
159158
rtol = float(cache.reltol)
@@ -162,7 +161,7 @@ function SciMLBase.solve(cache::LinearCache, alg::KrylovJL; kwargs...)
162161

163162
args = (cache.cacheval, cache.A, cache.b)
164163
kwargs = (atol = atol, rtol = rtol, itmax = itmax, verbose = verbose,
165-
history = true, alg.kwargs...)
164+
ldiv = true, history = true, alg.kwargs...)
166165

167166
if cache.cacheval isa Krylov.CgSolver
168167
N !== I &&

0 commit comments

Comments
 (0)