Skip to content

Commit

Permalink
add_constrained_variable with 2 sets
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Nov 2, 2024
1 parent 278fba5 commit d043c0e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/variables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ function add_constrained_variable(model::ModelLike, set::AbstractScalarSet)
return variable, constraint
end

function add_constrained_variable(model::ModelLike, set1::AbstractScalarSet, set2::AbstractScalarSet)
variable, constraint1 = add_constrained_variable(model, set1)
constraint2 = add_constraint(model, variable, set2)
return variable, constraint1, constraint2

Check warning on line 105 in src/variables.jl

View check run for this annotation

Codecov / codecov/patch

src/variables.jl#L102-L105

Added lines #L102 - L105 were not covered by tests
end

"""
supports_add_constrained_variables(
model::ModelLike,
Expand Down

0 comments on commit d043c0e

Please sign in to comment.