See #3769 (comment)
Problem
Consider:
model = Model();
@variable(model, x[1:2, 1:2])
@constraint(model, x >= 0)
Does this mean:
@constraint(model, x >= 0, Nonnegatives())
or
@constraint(model, x >= 0, PSDCone())
Because of this ambiguity, we currently disallow the x >= 0 syntax for matrix sets.
Suggestion
@LebedevRI suggests that we introduce the ⪰ operator with the following behavior:
@constraint(model, x ⪰ y, set)
# lowers to
@constraint(model, x - y in set)
Examples
@constraint(model, x >= 0)
# lowers to
@constraint(model, x ⪰ 0, Nonnegatives())
@constraint(model, x <= 0)
# lowers to
@constraint(model, x ⪰ 0, Nonpositives())
@constraint(model, x ⪰ 0)
# ERROR: missing a set that defines the partial order
@constraint(model, x >= 0, set)
# lowers to
@constraint(model, x ⪰ 0, set)
Tradeoffs
The biggest pro is that it clarifies the distinction between ≥ and ⪰.
This is also the biggest con: I worry that users will not make the distinction, and people will write x >= 0 expecting that to be a PSD constraint when it is really a nonnegative constraint.
Currenntly, they need to opt-in by passing a set to avoid the ambiguity.
See #3769 (comment)
Problem
Consider:
Does this mean:
or
Because of this ambiguity, we currently disallow the
x >= 0syntax for matrix sets.Suggestion
@LebedevRI suggests that we introduce the
⪰operator with the following behavior:Examples
Tradeoffs
The biggest pro is that it clarifies the distinction between
≥and⪰.This is also the biggest con: I worry that users will not make the distinction, and people will write
x >= 0expecting that to be a PSD constraint when it is really a nonnegative constraint.Currenntly, they need to opt-in by passing a set to avoid the ambiguity.