Skip to content

Commit 451f015

Browse files
jishnubKristofferC
authored andcommitted
Use eltype in adjoint matvec
1 parent 388fe10 commit 451f015

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/matmul.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -932,7 +932,7 @@ function __generic_matvecmul!(f::F, C::AbstractVector, A::AbstractVecOrMat, B::A
932932
@inbounds begin
933933
if length(B) == 0
934934
for k = eachindex(C)
935-
@stable_muladdmul _modify!(MulAddMul(alpha,beta), false, C, k)
935+
@stable_muladdmul _modify!(MulAddMul(alpha,beta), zero(eltype(C)), C, k)
936936
end
937937
else
938938
for k = eachindex(C)

test/matmul.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1188,6 +1188,9 @@ end
11881188
w = similar(v, size(A,1))
11891189
mul!(w, A, v)
11901190
@test all(iszero, w)
1191+
A = fill(m, 0, 2)
1192+
mul!(w, A', v)
1193+
@test all(iszero, w)
11911194
end
11921195

11931196
end # module TestMatmul

0 commit comments

Comments
 (0)