Overview | Group | Index | Concepts |
The routine CPXaddindconstr
adds an indicator constraint
to the specified problem object. This routine may be called any time after a
call to CPXcreateprob
.
An indicator constraint is a linear constraint that is enforced only:
The linear constraint may be a less-than-or-equal-to constraint, a greater-than-or-equal-to constraint, or an equality constraint.
Example
status = CPXaddindconstr (env, lp, indicator, complemented, nzcnt, rhs, sense, ind, val, newindname);
env | A pointer to the CPLEX environment, as returned by |
lp | A pointer to a CPLEX LP problem object, as returned by |
indvar | The binary variable that acts as the indicator for this constraint. |
complemented | A Boolean value that specifies whether the indicator variable is complemented. The linear constraint must be satisfied when the indicator takes a value of 1 (one) if the indicator is not complemented, and similarly, the linear constraint must be satisfied when the indicator takes a value of 0 (zero) if the indicator is complemented. |
nzcnt | An integer that specifies the number of nonzero coefficients in the linear portion of the indicator constraint. This argument gives the length of the arrays |
rhs | The righthand side value for the linear portion of the indicator constraint. |
sense | The sense of the linear portion of the indicator constraint. |
linind | An array that with |
linval | An array that with |
indname_str | The name of the constraint to be added. May be NULL, in which case the new constraint is assigned a default name if the indicator constraints already resident in the CPLEX problem object have names; otherwise, no name is associated with the constraint. |