diff --git a/ext/LinearSolveIterativeSolversExt.jl b/ext/LinearSolveIterativeSolversExt.jl index 23ce663c..cb458964 100644 --- a/ext/LinearSolveIterativeSolversExt.jl +++ b/ext/LinearSolveIterativeSolversExt.jl @@ -1,7 +1,7 @@ module LinearSolveIterativeSolversExt using LinearSolve, LinearAlgebra -using LinearSolve: LinearCache +using LinearSolve: LinearCache, DEFAULT_PRECS import LinearSolve: IterativeSolversJL if isdefined(Base, :get_extension) diff --git a/src/common.jl b/src/common.jl index a7deb5b4..f93fa3f7 100644 --- a/src/common.jl +++ b/src/common.jl @@ -200,7 +200,7 @@ function SciMLBase.reinit!(cache::LinearCache; u = cache.u, p = nothing, reinit_cache = false,) - (; alg, cacheval, isfresh, abstol, reltol, maxiters, verbose, assumptions, sensealg) = cache + (; alg, cacheval, abstol, reltol, maxiters, verbose, assumptions, sensealg) = cache precs = hasproperty(alg, :precs) ? alg.precs : DEFAULT_PRECS Pl, Pr = if isnothing(A) || isnothing(p) @@ -214,6 +214,7 @@ function SciMLBase.reinit!(cache::LinearCache; else (cache.Pl, cache.Pr) end + isfresh = true if reinit_cache return LinearCache{typeof(A), typeof(b), typeof(u), typeof(p), typeof(alg), typeof(cacheval), @@ -227,6 +228,7 @@ function SciMLBase.reinit!(cache::LinearCache; cache.p = p cache.Pl = Pl cache.Pr = Pr + cache.isfresh = true end end