4949
5050function linearsolve_forwarddiff_solve (cache:: DualLinearCache , alg, args... ; kwargs... )
5151 # Solve the primal problem
52+ @info " here"
5253 dual_u0 = copy (cache. linear_cache. u)
5354 sol = solve! (cache. linear_cache, alg, args... ; kwargs... )
5455 primal_b = copy (cache. linear_cache. b)
@@ -131,7 +132,7 @@ function SciMLBase.init(
131132 verbose:: Bool = false ,
132133 Pl = nothing ,
133134 Pr = nothing ,
134- assumptions = nothing ,
135+ assumptions = OperatorAssumptions ( issquare (prob . A)) ,
135136 sensealg = LinearSolveAdjoint (),
136137 kwargs... )
137138 (; A, b, u0, p) = prob
@@ -144,15 +145,15 @@ function SciMLBase.init(
144145
145146 primal_prob = remake (prob; A = new_A, b = new_b, u0 = new_u0)
146147
147- assumptions = OperatorAssumptions (issquare (primal_prob. A))
148-
149148 if get_dual_type (prob. A) != = nothing
150149 dual_type = get_dual_type (prob. A)
151150 elseif get_dual_type (prob. b) != = nothing
152151 dual_type = get_dual_type (prob. b)
153152 end
153+ Main. @infiltrate
154154 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,
156157 maxiters = maxiters, verbose = verbose, Pl = Pl, Pr = Pr, assumptions = assumptions,
157158 sensealg = sensealg, u0 = new_u0, kwargs... )
158159 return DualLinearCache (non_partial_cache, dual_type, ∂_A, ∂_b, ! isnothing (∂_b) ? zero .(∂_b) : ∂_b, A, b, zeros (dual_type, length (b)))
0 commit comments