using JuMP
# Block1
M = Model()
@variable(M, x[1:3] >= 1)
# Block2
M = Model()
@variable(M, x[1:3] .>= 1)
# Block3
M = Model()
@variable(M, x[1:3])
@constraint(M, x[1:3] >= 1)
# Block4
M = Model()
@variable(M, x[1:3])
@constraint(M, x[1:3] .>= 1)
Block1: OK.
Block2: OK.
Block3: Not OK.
Block4: OK.
Why? And what is the most correct way to define vectorized variables and constraints with JuMP
?
Many thanks!