From 61d38ec81209c3c9cc2079fe3771e15bbb3068c5 Mon Sep 17 00:00:00 2001 From: oscarddssmith Date: Mon, 1 Jul 2024 16:59:14 -0400 Subject: [PATCH] fixes --- ext/LinearSolveIterativeSolversExt.jl | 2 +- src/common.jl | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) 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