|
85 | 85 |
|
86 | 86 | function Base.setproperty!(cache::LinearCache, name::Symbol, x)
|
87 | 87 | if name === :A
|
| 88 | + if hasproperty(cache.alg, :precs) |
| 89 | + Pl, Pr = cache.alg.precs(A, cache.p) |
| 90 | + setfield!(cache, :Pl, Pl) |
| 91 | + setfield!(cache, :Pr, Pr) |
| 92 | + end |
88 | 93 | setfield!(cache, :isfresh, true)
|
| 94 | + elseif name === :p |
| 95 | + if hasproperty(cache.alg, :precs) |
| 96 | + Pl, Pr = cache.alg.precs(cache.A, p) |
| 97 | + setfield!(cache, :Pl, Pl) |
| 98 | + setfield!(cache, :Pr, Pr) |
| 99 | + end |
89 | 100 | elseif name === :b
|
90 | 101 | # In case there is something that needs to be done when b is updated
|
91 | 102 | update_cacheval!(cache, :b, x)
|
@@ -174,12 +185,14 @@ function SciMLBase.init(prob::LinearProblem, alg::SciMLLinearSolveAlgorithm,
|
174 | 185 | if isnothing(Pl)
|
175 | 186 | Pl = _Pl
|
176 | 187 | else
|
177 |
| - @warn "passing Preconditioners at `init`/`solve` time is deprecated. Instead add a `precs` function to your algorithm." |
| 188 | + # TODO: deprecate once all docs are updated to the new form |
| 189 | + #@warn "passing Preconditioners at `init`/`solve` time is deprecated. Instead add a `precs` function to your algorithm." |
178 | 190 | end
|
179 | 191 | if isnothing(Pr)
|
180 | 192 | Pr = _Pr
|
181 | 193 | else
|
182 |
| - @warn "passing Preconditioners at `init`/`solve` time is deprecated. Instead add a `precs` function to your algorithm." |
| 194 | + # TODO: deprecate once all docs are updated to the new form |
| 195 | + #@warn "passing Preconditioners at `init`/`solve` time is deprecated. Instead add a `precs` function to your algorithm." |
183 | 196 | end
|
184 | 197 | cacheval = init_cacheval(alg, A, b, u0_, Pl, Pr, maxiters, abstol, reltol, verbose,
|
185 | 198 | assumptions)
|
|
0 commit comments