Logical constraints as binary variables
Describes logical constraints as terms in expressions.
Linear or logical constraints can appear as terms in
numeric expressions. A linear constraint appearing as a term in a
numeric expression behaves like a binary value. For example, given x
and y as variables, you can write the
following lines to get the truth value of x
≥ y in a binary value:
IloIntVar b(env, 0, 1);
model.add(b == (x >= y));
It is important to note here that only linear constraints can appear as
arguments of logical constraints extracted by IloCplex.
That is, quadratic constraints are not handled in logical constraints.
Similarly, quadratic terms cannot appear as arguments of logical expressions
such as IloMin, IloMax, IloAbs,
and IloPiecewiseLinear.