Initializing help system before first use

XPRSsetindicators

XPRSsetindicators


Purpose
Specifies that a set of rows in the matrix will be treated as indicator constraints, during a global search. An indicator constraint is made of a condition and a linear constraint. The condition is of the type " bin = value", where bin is a binary variable and value is either 0 or 1. The linear constraint is any linear row. During global search, a row configured as an indicator constraint is enforced only when condition holds, that is only if the indicator variable bin has the specified value.
Synopsis
int XPRS_CC XPRSsetindicators(XPRSprob prob, int nrows, const int mrows[], const int inds[], const int comps[]);
Arguments
prob 
The current problem.
nrows 
The number of indicator constraints.
mrows 
Integer array of length nrows containing the indices of the rows that define the linear constraint part for the indicator constraints.
inds 
Integer array of length nrows containing the column indices of the indicator variables.
comps 
Integer array of length nrows with the complement flags:
not an indicator constraint (in this case the corresponding entry in the inds array is ignored);
for indicator constraints with condition " bin = 1";
-1 
for indicator constraints with condition " bin = 0";
Example
This sets the first two matrix rows as indicator rows in the global problem prob; the first row controlled by condition x4=1 and the second row controlled by condition x5=0 (assuming x4 and x5 correspond to columns indices 4 and 5).
int mrows[] = {0,1};
int inds[] = {4,5};
int comps[] = {1,-1};

...
XPRSsetindicators(prob,2,mrows,inds,comps);
XPRSmipoptimize(prob,"");
Further information
Indicator rows must be set up before solving the problem. Any indicator row will be removed from the matrix after presolve and added to a special pool. An indicator row will be added back into the active matrix only when its associated condition holds. An indicator variable can be used in multiple indicator rows and can also appear in normal rows and in the objective function.
Related topics