Purpose
Presolves a cut formulated in terms of the original variables such that it can be added to a
presolved matrix.
Synopsis
int XPRS_CC XPRSpresolvecut(XPRSprob prob, char qrtype, double drhso, int nzo, const int mcolso[], const double dvalo[],
double *drhsp, int *nzp, int mcolsp[], double dvalp[], int *status);
Arguments
prob
|
The current problem.
|
qrtype
|
The row type of the cut:
L
|
indicates a  cut;
|
E
|
indicates a = cut;
|
G
|
indicates a  cut.
|
|
drhso
|
The right-hand side constant of the cut to presolve.
|
nzo
|
Number of elements in the mcolso and dvalo arrays.
|
mcolso
|
Integer array of length nzo containing the column indices of the cut to presolve.
|
dvalo
|
Double array of length nzo containing the non-zero coefficients of the cut to presolve.
|
drhsp
|
Pointer to the double where the presolved right-hand side will be returned.
|
nzp
|
Pointer to the integer where the number of elements in the mcolsp and dvalp arrays will be returned.
|
mcolsp
|
Integer array which will be filled with the column indices of the presolved cut. It must be allocated to hold at least COLS elements.
|
dvalp
|
Double array which will be filled with the coefficients of the presolved cut. It must be allocated to hold at least COLS elements.
|
status
|
Status of the presolved cut:
0
|
The cut was successfully presolved;
|
1
|
Presolving the cut failed.
|
|
Related Controls
Integer
|
Turns presolve on or off.
|
|
Selects the presolve operations.
|
Example
Suppose we want to add the cut 2x
1 + x
2 
1 to our presolved matrix. This could be done in the following way:
int mindo[] = { 1, 2 };
int dvalo[] = { 2.0, 1.0 };
char qrtype = "L";
double drhso = 1.0;
int nzp, status, mtype, mstart[2], *mindp;
double drhsp, *dvalp;
...
XPRSpresolvecut(prob, qrtype, drhso, 2, mindo, dvalo, &drhsp,
&nzp, mindp, dvalp, &status);
if (!status) {
mtype = 0;
mstart[0] = 0; mstart[1] = nzp;
XPRSaddcuts(prob, 1, &mtype, &qrtype, &drhsp, mstart, mindp,
dvalp);
}
Further information
The are certain presolve operations that can prevent presolving a cut
successfully. These are singleton column removal, duplicate column removal and variable
eliminations. Thus, bits 0, 5 and 8 (total value 289) of PRESOLVEOPS should be cleared
before calling XPRSminim or XPRSmaxim on a matrix. Furthermore, bit 11 (value 2048) should be set to prevent some further reductions that conflict with presolving
cuts. A safe
settting of PRESOLVEOPS is therefore 2270.
Related topics
If you have any comments or suggestions about these pages,
please send mail to docs@dashoptimization.com.