SciML / LinearSolve.jl

LinearSolve.jl: High-Performance Unified Interface for Linear Solvers in Julia. Easily switch between factorization and Krylov methods, add preconditioners, and all in one interface.
https://docs.sciml.ai/LinearSolve/stable/
Other
248 stars 53 forks source link

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

Open j-fu opened 1 year ago

j-fu commented 1 year ago

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...