Skip to content

Commit 9f74b74

Browse files
committed
Use eltype in adjoint matvec
1 parent e03b8a1 commit 9f74b74

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
@@ -1180,6 +1180,9 @@ end
11801180
w = similar(v, size(A,1))
11811181
mul!(w, A, v)
11821182
@test all(iszero, w)
1183+
A = fill(m, 0, 2)
1184+
mul!(w, A', v)
1185+
@test all(iszero, w)
11831186
end
11841187

11851188
end # module TestMatmul

0 commit comments

Comments
 (0)