-
-
Notifications
You must be signed in to change notification settings - Fork 77
Open
Description
When a user explicitly chooses Sparspak as solver in situations
with dual numbers, Sparspak should handle the problem directly as it was
implemented before the transition to LinearSolverForwardDiffExt instead
of being treated as a linear solver unable to handle dual numbers.
Minimal Reproducible Example 👇
using LinearSolve
using Sparspak
using SparseArrays
using ForwardDiff
using BenchmarkTools
N=100
x0=ForwardDiff.Dual{Float64}(1,(0.1,))
D=fill(x0,N)
A=spdiagm(-1=>D[2:end], 0=>2*D, 1=> D[2:end])
@btime begin
p=LinearProblem(A,D)
solve(p, SparspakFactorization())
end
@btime begin
sparspaklu(A)\D
end** Output **
4.954 ms (363 allocations: 16.01 MiB)
271.164 μs (238 allocations: 608.46 KiB)So, also, in fact, direct use of sparspak is indeed faster.
Metadata
Metadata
Assignees
Labels
No labels