93
93
94
94
function linearsolve_forwarddiff_solve (cache:: DualLinearCache , alg, args... ; kwargs... )
95
95
# Solve the primal problem
96
- # Main.@infiltrate
97
96
dual_u0 = copy (cache. linear_cache. u)
98
- # Main.@infiltrate
99
97
sol = solve! (cache. linear_cache, alg, args... ; kwargs... )
100
98
primal_b = copy (cache. linear_cache. b)
101
99
uu = sol. u
@@ -107,7 +105,6 @@ function linearsolve_forwarddiff_solve(cache::DualLinearCache, alg, args...; kwa
107
105
∂_b = cache. partials_b
108
106
109
107
rhs_list = xp_linsolve_rhs (uu, ∂_A, ∂_b)
110
- # Main.@infiltrate
111
108
112
109
cache. linear_cache. u = dual_u0
113
110
# We can reuse the linear cache, because the same factorization will work for the partials.
@@ -183,13 +180,6 @@ function linearsolve_dual_solution(u::Number, partials,
183
180
return dual_type (u, partials)
184
181
end
185
182
186
- # function linearsolve_dual_solution(
187
- # u::AbstractArray, partials, dual_type)
188
- # partials_list = RecursiveArrayTools.VectorOfArray(partials)
189
- # return map(((uᵢ, pᵢ),) -> dual_type(uᵢ, Partials(Tuple(pᵢ))),
190
- # zip(u, partials_list[i, :] for i in 1:length(partials_list[1])))
191
- # end
192
-
193
183
function linearsolve_dual_solution (u:: AbstractArray , partials,
194
184
dual_type:: Type{<:Dual{T, V, P}} ) where {T, V <: AbstractFloat , P}
195
185
# Handle single-level duals for arrays
@@ -256,7 +246,6 @@ function SciMLBase.init(
256
246
elseif get_dual_type (prob. b) != = nothing
257
247
dual_type = get_dual_type (prob. b)
258
248
end
259
- # Main.@infiltrate
260
249
non_partial_cache = init (
261
250
primal_prob, alg, args... ; alias = alias, abstol = abstol, reltol = reltol,
262
251
maxiters = maxiters, verbose = verbose, Pl = Pl, Pr = Pr, assumptions = assumptions,
@@ -269,11 +258,9 @@ function SciMLBase.solve!(cache::DualLinearCache, args...; kwargs...)
269
258
end
270
259
271
260
function SciMLBase. solve! (cache:: DualLinearCache , alg:: SciMLLinearSolveAlgorithm , args... ; kwargs... )
272
- # Main.@infiltrate
273
261
sol,
274
262
partials = linearsolve_forwarddiff_solve (
275
263
cache:: DualLinearCache , cache. alg, args... ; kwargs... )
276
- # Main.@infiltrate
277
264
dual_sol = linearsolve_dual_solution (sol. u, partials, cache. dual_type)
278
265
279
266
cache. dual_u = dual_sol
0 commit comments