Skip to content

Commit

Permalink
allow reinit! to bypass precisfresh
Browse files Browse the repository at this point in the history
  • Loading branch information
oscardssmith authored Oct 16, 2024
1 parent 9064d62 commit 536f8ec
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/common.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,15 @@ function SciMLBase.reinit!(cache::LinearCache;
b = cache.b,
u = cache.u,
p = nothing,
reinit_cache = false,)
reinit_cache = false,
reuse_precs = false)
(; alg, cacheval, abstol, reltol, maxiters, verbose, assumptions, sensealg) = cache


isfresh = isnothing(A)
precsisfresh = isfresh || isnothing(p)
isfresh = !isnothing(A)
precsisfresh = reuse_precs || isfresh || !isnothing(p)
isfresh |= cache.isfresh
precsisfresh |= cache.precsisfresh

A = isnothing(A) ? cache.A : A
b = isnothing(b) ? cache.b : b
Expand Down

0 comments on commit 536f8ec

Please sign in to comment.