Skip to content

Commit f058211

Browse files
authored
Fix generic sparse-dense multiplication (#663)
1 parent 4f25e13 commit f058211

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

src/linalg.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ Base.@constprop :aggressive function spdensemul!(C, tA, tB, A, B, alpha, beta)
6969
T = eltype(C)
7070
_mul!(rangefun, diagop, odiagop, C, A, B, T(alpha), T(beta))
7171
else
72-
@stable_muladdmul LinearAlgebra._generic_matmatmul!(C, 'N', 'N', wrap(A, tA), wrap(B, tB), MulAddMul(alpha, beta))
72+
@stable_muladdmul LinearAlgebra._generic_matmatmul!(C, wrap(A, tA), wrap(B, tB), MulAddMul(alpha, beta))
7373
end
7474
return C
7575
end

test/linalg.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,14 @@ end
109109
end
110110
end
111111

112+
@testset "multiplication of special sparse with dense matrix" begin
113+
# this results in a call of the most generic multiplication code in LinearAlgebra.jl
114+
A = randn(2, 2)
115+
S = sparse(A)
116+
B = rand(1, 2)'
117+
@test Symmetric(S) * B Symmetric(A) * B
118+
end
119+
112120
@testset "sparse transpose adjoint" begin
113121
A = sprand(10, 10, 0.75)
114122
@test A' == SparseMatrixCSC(A')

0 commit comments

Comments
 (0)