Skip to content

Commit

Permalink
Remove {T} restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Jan 31, 2024
1 parent 637e4c2 commit 1df0a13
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/write.jl
Original file line number Diff line number Diff line change
Expand Up @@ -392,9 +392,9 @@ function _write_constraint(
io::IO,
::Set,
variables::Dict,
f::Union{MOI.ScalarAffineFunction{T},MOI.ScalarQuadraticFunction{T}},
s::Union{MOI.LessThan{T},MOI.GreaterThan{T},MOI.EqualTo{T}},
) where {T}
f::Union{MOI.ScalarAffineFunction,MOI.ScalarQuadraticFunction},
s::Union{MOI.LessThan,MOI.GreaterThan,MOI.EqualTo},
)
print(io, "constraint ", _to_string(variables, f))
println(io, _sense(s), _rhs(s) - f.constant, ";")
return
Expand All @@ -411,9 +411,9 @@ function _write_constraint(
io::IO,
::Set,
variables::Dict,
f::MOI.VectorAffineFunction{T},
s::MOI.Reified{S2},
) where {T,S2<:Union{MOI.LessThan{T},MOI.GreaterThan{T},MOI.EqualTo{T}}}
f::MOI.VectorAffineFunction,
s::MOI.Reified{<:Union{MOI.LessThan,MOI.GreaterThan,MOI.EqualTo}},
)
z, x = _to_epigraph(variables, f)
fx = string(x, _sense(s.set), _rhs(s.set) - f.constants[2])
println(io, "constraint $z <-> $fx;")
Expand All @@ -425,8 +425,8 @@ function _write_constraint(
predicates::Set,
variables::Dict,
f::MOI.ScalarNonlinearFunction,
s::Union{MOI.LessThan{T},MOI.GreaterThan{T},MOI.EqualTo{T}},
) where {T}
s::Union{MOI.LessThan,MOI.GreaterThan,MOI.EqualTo},
)
print(io, "constraint ")
_write_expression(io, predicates, variables, f)
println(io, _sense(s), _rhs(s), ";")
Expand Down

0 comments on commit 1df0a13

Please sign in to comment.