LinearSolve.jl icon indicating copy to clipboard operation
LinearSolve.jl copied to clipboard

A*u doesn't specialize for sparse A and LinearProblem solution u

Open j-fu opened this issue 1 year ago • 0 comments

Here is an MWE:

using SparseArrays,LinearSolve
n=10000; 
A=spdiagm(-1=>-rand(n-1),0=>fill(2,n),1=>-rand(n-1));
b=ones(n);
x=solve(LinearProblem(A,b));
@time A*x;
@time A*x.u;

gives

0.507018 seconds (2 allocations: 78.172 KiB)
0.000102 seconds (3 allocations: 78.312 KiB)

Somewhere a Base.* for a SciMLBase.LinearSolution seems to be missing... Not sure where to put a PR...

j-fu avatar Jan 27 '23 17:01 j-fu