@@ -80,14 +80,13 @@ function LinearSolverCache(alg, linsolve, A, b, u; stats, kwargs...)
80
80
@bb u_ = copy (u_fixed)
81
81
linprob = LinearProblem (A, b; u0 = u_, kwargs... )
82
82
83
- weight = __init_ones (u_fixed)
84
83
if __hasfield (alg, Val (:precs ))
85
84
precs = alg. precs
86
85
Pl_, Pr_ = precs (A, nothing , u, ntuple (Returns (nothing ), 6 )... )
87
86
else
88
87
precs, Pl_, Pr_ = nothing , nothing , nothing
89
88
end
90
- Pl, Pr = __wrapprecs (Pl_, Pr_, weight )
89
+ Pl, Pr = __wrapprecs (Pl_, Pr_, u )
91
90
92
91
# Unalias here, we will later use these as caches
93
92
lincache = init (linprob, linsolve; alias_A = false , alias_b = false , Pl, Pr)
@@ -128,10 +127,8 @@ function (cache::LinearSolverCache)(;
128
127
b != = nothing && (cache. lincache. b = b)
129
128
linu != = nothing && __set_lincache_u! (cache, linu)
130
129
131
- Plprev = cache. lincache. Pl isa ComposePreconditioner ? cache. lincache. Pl. outer :
132
- cache. lincache. Pl
133
- Prprev = cache. lincache. Pr isa ComposePreconditioner ? cache. lincache. Pr. outer :
134
- cache. lincache. Pr
130
+ Plprev = cache. lincache. Pl
131
+ Prprev = cache. lincache. Pr
135
132
136
133
if cache. precs === nothing
137
134
_Pl, _Pr = nothing , nothing
@@ -141,10 +138,7 @@ function (cache::LinearSolverCache)(;
141
138
end
142
139
143
140
if (_Pl != = nothing || _Pr != = nothing )
144
- _weight = weight === nothing ?
145
- (cache. lincache. Pr isa Diagonal ? cache. lincache. Pr. diag :
146
- cache. lincache. Pr. inner. diag) : weight
147
- Pl, Pr = __wrapprecs (_Pl, _Pr, _weight)
141
+ Pl, Pr = __wrapprecs (_Pl, _Pr, linu)
148
142
cache. lincache. Pl = Pl
149
143
cache. lincache. Pr = Pr
150
144
end
@@ -242,9 +236,9 @@ function __set_lincache_A(lincache, new_A)
242
236
end
243
237
end
244
238
245
- function __wrapprecs (_Pl, _Pr, weight )
246
- Pl = _Pl != = nothing ?= _Pl : IdentityOperator (length (weight ))
247
- Pr = _Pr != = nothing ? _Pr : IdentityOperator (length (weight ))
239
+ function __wrapprecs (_Pl, _Pr, u )
240
+ Pl = _Pl != = nothing ?= _Pl : IdentityOperator (length (u ))
241
+ Pr = _Pr != = nothing ? _Pr : IdentityOperator (length (u ))
248
242
return Pl, Pr
249
243
end
250
244
0 commit comments