Initializing help system before first use

XPRBsetindicator

XPRBsetindicator


Purpose
Set the indicator constraint type.
Synopsis
int XPRBsetindicator(XPRBctr ctr, int dir, XPRBvar b);
Arguments
ctr 
Reference to a previously created inequality or range constraint.
dstat 
The indicator type, which must be one of:
-1 
indicator constraint with condition b=0;
ordinary constraint;
indicator constraint with condition b=1.
Reference to a previously created binary variable.
Return value
0 if function executed successfully, 1 otherwise.
Example
The following turns the constraint ctr1 into the indicator constraint b=1 ⇒ ctr1.
XPRBprob prob;
XPRBctr ctr1;
XPRBvar b;
   ...
ctr1 = XPRBnewctr(prob, "r1", XPRB_L);
b = XPRBnewvar(prob, XPRB_BV, "b", 0, 1);
XPRBsetindicator(ctr1, 1, b);
Further information
1. This function changes the type of a previously defined constraint from ordinary constraint to indicator constraint and vice versa.
2. Indicator constraints are defined by associating a binary variable and an implication sense with a linear inequality or range constraint.
3. Constraint properties 'include vars', 'model cut', 'delayed constraint', and 'indicator constraint' are mutually exclusive. When changing from one of these types to another you must first reset the correponding type to 0.
Related topics