Skip to content

Commit

Permalink
Resolve ambiguity in OneElementMatrix * ZerosVector (#314)
Browse files Browse the repository at this point in the history
  • Loading branch information
jishnub authored Dec 3, 2023
1 parent 1a9746c commit ba796e8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/oneelement.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ function *(A::AbstractFillMatrix, x::OneElementVector)
end
*(A::AbstractZerosMatrix, x::OneElementVector) = mult_zeros(A, x)

*(A::OneElementMatrix, x::AbstractZerosVector) = mult_zeros(A, x)

function *(A::OneElementMatrix, B::AbstractFillVector)
check_matmul_sizes(A, B)
val = getindex_value(A) * getindex_value(B)
Expand Down
4 changes: 4 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2033,6 +2033,10 @@ end
@test O * v isa OneElement
@test O * v == Array(O) * Array(v)
end

A = OneElement(2,(2,2),(5,4))
B = Zeros(4)
@test A * B === Zeros(5)
end
end

Expand Down

0 comments on commit ba796e8

Please sign in to comment.