We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
mul!
HermOrSym
1 parent 2376bf8 commit 3d12196Copy full SHA for 3d12196
3 files changed
src/SparseArrays.jl
@@ -19,7 +19,7 @@ import Base: Matrix, Vector
19
import LinearAlgebra: mul!, ldiv!, rdiv!, cholesky, adjoint!, diag, eigen, dot,
20
issymmetric, istril, istriu, lu, tr, transpose!, tril!, triu!, isbanded,
21
cond, diagm, factorize, ishermitian, norm, opnorm, lmul!, rmul!, tril, triu,
22
- matprod_dest, generic_matvecmul!, generic_matmatmul!, copytrito!
+ matprod_dest, generic_matvecmul!, generic_matmatmul!, generic_matmatmul_wrapper!, copytrito!
23
24
import Base: adjoint, argmin, argmax, Array, broadcast, circshift!, complex, Complex,
25
conj, conj!, convert, copy, copy!, copyto!, count, diff, findall, findmax, findmin,
src/linalg.jl
@@ -117,7 +117,7 @@ function _At_or_Ac_mul_B!(tfun::Function, C, A, B, α, β)
117
C
118
end
119
120
-Base.@constprop :aggressive function generic_matmatmul!(C::StridedMatrix, tA, tB, A::DenseMatrixUnion, B::SparseMatrixCSCUnion2, alpha::Number, beta::Number)
+Base.@constprop :aggressive function generic_matmatmul_wrapper!(C::StridedMatrix, tA, tB, A::DenseMatrixUnion, B::SparseMatrixCSCUnion2, alpha::Number, beta::Number, ::LinearAlgebra.BlasFlag.SyrkHerkGemm)
121
transA = tA == 'N' ? identity : tA == 'T' ? transpose : adjoint
122
if tB == 'N'
123
_spmul!(C, transA(A), B, alpha, beta)
@@ -128,6 +128,9 @@ Base.@constprop :aggressive function generic_matmatmul!(C::StridedMatrix, tA, tB
128
129
return C
130
131
+Base.@constprop :aggressive generic_matmatmul_wrapper!(C::StridedMatrix, tA, tB, A::DenseMatrixUnion, B::SparseMatrixCSCUnion2, alpha::Number, beta::Number, @nospecialize(val)) =
132
+ LinearAlgebra._generic_matmatmul!(C, wrap(A, tA), wrap(B, tB), alpha, beta)
133
+
134
function _spmul!(C::StridedMatrix, X::DenseMatrixUnion, A::SparseMatrixCSCUnion2, α::Number, β::Number)
135
mX, nX = size(X)
136
nX == size(A, 1) ||
test/linalg.jl
@@ -236,6 +236,13 @@ end
236
237
238
239
+@testset "Dense times symmetric/Hermitian sparse matrix multiplication" begin
240
+ A = [1 3; 2 4]
241
+ As = sparse(A)
242
+ B = [1 1; 1 1]
243
+ @test mul!(copy(B), B, Hermitian(A), true, true) == mul!(copy(B), B, Hermitian(As), true, true)
244
+end
245
246
@testset "in-place sparse-sparse mul!" begin
247
for n in (20, 30)
248
sA = sprandn(ComplexF64, n, n, 0.1); A = Array(sA)
0 commit comments