Skip to content

Commit

Permalink
Rebase and fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed May 27, 2021
1 parent f601aec commit 84fb708
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions src/variables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -692,11 +692,7 @@ function _moi_fix(
MOI.delete(moi_backend, _lower_bound_index(variable))
end
end
moi_add_constraint(
model,
MOI.SingleVariable(index(variable)),
new_set,
)
moi_add_constraint(model, MOI.SingleVariable(index(variable)), new_set)
end
return
end
Expand Down Expand Up @@ -1028,18 +1024,10 @@ function _moi_constrain_variable(
)
end
if info.binary
moi_add_constraint(
model,
MOI.SingleVariable(index),
MOI.ZeroOne(),
)
moi_add_constraint(model, MOI.SingleVariable(index), MOI.ZeroOne())
end
if info.integer
moi_add_constraint(
model,
MOI.SingleVariable(index),
MOI.Integer(),
)
moi_add_constraint(model, MOI.SingleVariable(index), MOI.Integer())
end
if info.has_start
MOI.set(
Expand Down Expand Up @@ -1101,7 +1089,12 @@ function _moi_add_constrained_variable(
) where {S<:MOI.AbstractScalarSet}
if MOI.supports_add_constrained_variable(moi_backend, S)
var_index, _ = MOI.add_constrained_variable(moi_backend, set)
_moi_constrain_variable(model, moi_backend, var_index, scalar_variable.info)
_moi_constrain_variable(
model,
moi_backend,
var_index,
scalar_variable.info,
)
if !isempty(name)
MOI.set(moi_backend, MOI.VariableName(), var_index, name)
end
Expand Down

0 comments on commit 84fb708

Please sign in to comment.