Create empty constraint with JuMP

You’re looking for Constraints · JuMP

julia> model = Model()
A JuMP Model
Feasibility problem with:
Variables: 0
Model mode: AUTOMATIC
CachingOptimizer state: NO_OPTIMIZER
Solver name: No optimizer attached.

julia> @variable(model, x)
x

julia> c = @constraint(model, 0 <= 1)
0 ≤ 1.0

julia> set_normalized_coefficient(c, x, 1)

julia> c
x ≤ 1.0
2 Likes