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.
@@ -185,13 +182,6 @@ function linearsolve_dual_solution(u::Number, partials,
185
182
return dual_type (u, partials)
186
183
end
187
184
188
- # function linearsolve_dual_solution(
189
- # u::AbstractArray, partials, dual_type)
190
- # partials_list = RecursiveArrayTools.VectorOfArray(partials)
191
- # return map(((uᵢ, pᵢ),) -> dual_type(uᵢ, Partials(Tuple(pᵢ))),
192
- # zip(u, partials_list[i, :] for i in 1:length(partials_list[1])))
193
- # end
194
-
195
185
function linearsolve_dual_solution (u:: AbstractArray , partials,
196
186
dual_type:: Type{<:Dual{T, V, P}} ) where {T, V <: AbstractFloat , P}
197
187
# Handle single-level duals for arrays
@@ -258,7 +248,6 @@ function SciMLBase.init(
258
248
elseif get_dual_type (prob. b) != = nothing
259
249
dual_type = get_dual_type (prob. b)
260
250
end
261
- # Main.@infiltrate
262
251
non_partial_cache = init (
263
252
primal_prob, alg, args... ; alias = alias, abstol = abstol, reltol = reltol,
264
253
maxiters = maxiters, verbose = verbose, Pl = Pl, Pr = Pr, assumptions = assumptions,
@@ -271,11 +260,9 @@ function SciMLBase.solve!(cache::DualLinearCache, args...; kwargs...)
271
260
end
272
261
273
262
function SciMLBase. solve! (cache:: DualLinearCache , alg:: SciMLLinearSolveAlgorithm , args... ; kwargs... )
274
- # Main.@infiltrate
275
263
sol,
276
264
partials = linearsolve_forwarddiff_solve (
277
265
cache:: DualLinearCache , cache. alg, args... ; kwargs... )
278
- # Main.@infiltrate
279
266
dual_sol = linearsolve_dual_solution (sol. u, partials, cache. dual_type)
280
267
281
268
cache. dual_u = dual_sol
0 commit comments