Skip to content

Commit f2c5004

Browse files
committed
Size checks in matrix-vector product
1 parent ffa65d1 commit f2c5004

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/matmul.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,13 @@ end
5151

5252
# Matrix-vector multiplication
5353
function (*)(A::StridedMaybeAdjOrTransMat{T}, x::StridedVector{S}) where {T<:BlasFloat,S<:Real}
54+
matmul_size_check(size(A), size(x))
5455
TS = promote_op(matprod, T, S)
5556
y = isconcretetype(TS) ? convert(AbstractVector{TS}, x) : x
5657
mul!(similar(x, TS, size(A,1)), A, y)
5758
end
5859
function (*)(A::AbstractMatrix{T}, x::AbstractVector{S}) where {T,S}
60+
matmul_size_check(size(A), size(x))
5961
TS = promote_op(matprod, T, S)
6062
mul!(similar(x, TS, axes(A,1)), A, x)
6163
end

0 commit comments

Comments
 (0)