Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith committed Jul 1, 2024
1 parent a07a096 commit 61d38ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ext/LinearSolveIterativeSolversExt.jl
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 3 additions & 1 deletion src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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),
Expand All @@ -227,6 +228,7 @@ function SciMLBase.reinit!(cache::LinearCache;
cache.p = p
cache.Pl = Pl
cache.Pr = Pr
cache.isfresh = true
end
end

Expand Down

0 comments on commit 61d38ec

Please sign in to comment.