Skip to content

Commit

Permalink
Disambiguate Zeros * OneElement (#311)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub authored Dec 2, 2023
1 parent 164ff23 commit 1a9746c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/oneelement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function *(A::AbstractFillMatrix, x::OneElementVector)
val = getindex_value(A) * getindex_value(x)
Fill(val, (axes(A,1),))
end
*(A::AbstractZerosMatrix, x::OneElementVector) = mult_zeros(A, x)

function *(A::OneElementMatrix, B::AbstractFillVector)
check_matmul_sizes(A, B)
Expand Down
2 changes: 2 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2023,6 +2023,8 @@ end
@test F * x isa Fill
@test F * x == Array(F) * Array(x)
end

@test Zeros{Int8}(2,2) * OneElement{Int16}(2,2) === Zeros{Int16}(2)
end
@testset "OneElementMatrix * AbstractFillVector" begin
@testset for ind in testinds(A)
Expand Down

0 comments on commit 1a9746c

Please sign in to comment.