Skip to content

Commit 6cb17ad

Browse files
committed
Fix MA tests
1 parent 30790bc commit 6cb17ad

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Utilities/functions.jl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,6 +1542,16 @@ end
15421542
function Base.:*(f::Union{MOI.SingleVariable, MOI.VectorOfVariables}, g::Number)
15431543
return operate(*, typeof(g), f, g)
15441544
end
1545+
# Used by sparse matrix multiplication after
1546+
# https://github.com/JuliaLang/julia/pull/33205
1547+
function Base.:*(f::TypedLike, g::Bool)
1548+
if g
1549+
return MA.copy_if_mutable(f)
1550+
else
1551+
return zero(typeof(f))
1552+
end
1553+
end
1554+
Base.:*(f::Bool, g::TypedLike) = g * f
15451555

15461556
function Base.:^(func::MOI.ScalarAffineFunction{T}, p::Integer) where T
15471557
if iszero(p)

0 commit comments

Comments
 (0)