49
49
50
50
function linearsolve_forwarddiff_solve (cache:: DualLinearCache , alg, args... ; kwargs... )
51
51
# Solve the primal problem
52
+ @info " here"
52
53
dual_u0 = copy (cache. linear_cache. u)
53
54
sol = solve! (cache. linear_cache, alg, args... ; kwargs... )
54
55
primal_b = copy (cache. linear_cache. b)
@@ -131,7 +132,7 @@ function SciMLBase.init(
131
132
verbose:: Bool = false ,
132
133
Pl = nothing ,
133
134
Pr = nothing ,
134
- assumptions = nothing ,
135
+ assumptions = OperatorAssumptions ( issquare (prob . A)) ,
135
136
sensealg = LinearSolveAdjoint (),
136
137
kwargs... )
137
138
(; A, b, u0, p) = prob
@@ -144,15 +145,15 @@ function SciMLBase.init(
144
145
145
146
primal_prob = remake (prob; A = new_A, b = new_b, u0 = new_u0)
146
147
147
- assumptions = OperatorAssumptions (issquare (primal_prob. A))
148
-
149
148
if get_dual_type (prob. A) != = nothing
150
149
dual_type = get_dual_type (prob. A)
151
150
elseif get_dual_type (prob. b) != = nothing
152
151
dual_type = get_dual_type (prob. b)
153
152
end
153
+ Main. @infiltrate
154
154
non_partial_cache = init (
155
- primal_prob, alg, args... ; alias = alias, abstol = abstol, reltol = reltol,
155
+ primal_prob, LinearSolve. defaultalg (primal_prob. A, primal_prob. b, assumptions), args... ;
156
+ alias = alias, abstol = abstol, reltol = reltol,
156
157
maxiters = maxiters, verbose = verbose, Pl = Pl, Pr = Pr, assumptions = assumptions,
157
158
sensealg = sensealg, u0 = new_u0, kwargs... )
158
159
return DualLinearCache (non_partial_cache, dual_type, ∂_A, ∂_b, ! isnothing (∂_b) ? zero .(∂_b) : ∂_b, A, b, zeros (dual_type, length (b)))
0 commit comments