XPRSpresolverow
XPRSpresolverow |
int XPRS_CC XPRSpresolverow(XPRSprob prob, char qrtype, int nzo, const int mcolso[], const double dvalo[], double drhso, int maxcoeffs, int * nzp, int mcolsp[], double dvalp[], double * drhsp, int * status);
prob
|
The current problem.
|
||||||||||
qrtype
|
The type of the row:
|
||||||||||
nzo
|
Number of elements in the
mcolso and
dvalo arrays.
|
||||||||||
mcolso
|
Integer array of length
nzo containing the column indices of the row to presolve.
|
||||||||||
dvalo
|
Double array of length
nzo containing the non-zero coefficients of the row to presolve.
|
||||||||||
drhso
|
The right-hand side constant of the row to presolve.
|
||||||||||
maxcoeffs
|
Maximum number of elements to return in the
mcolsp and
dvalp arrays.
|
||||||||||
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 row. It must be allocated to hold at least
COLS elements.
|
||||||||||
dvalp
|
Double array which will be filled with the coefficients of the presolved row. It must be allocated to hold at least
COLS elements.
|
||||||||||
drhsp
|
Pointer to the double where the presolved right-hand side will be returned.
|
||||||||||
status
|
Status of the presolved row:
|
Turns presolve on or off.
|
|
Selects the presolve operations.
|
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; ... XPRSgetintattrib(prob, XPRS_COLS, &ncols); mindp = (int*) malloc(ncols*sizeof(int)); dvalp = (double*) malloc(ncols*sizeof(double)); XPRSpresolverow(prob, qrtype, 2, mindo, dvalo, drhso, ncols, &nzp, mindp, dvalp, &drhsp, &status); if (status >= 0) { mtype = 0; mstart[0] = 0; mstart[1] = nzp; XPRSaddcuts(prob, 1, &mtype, &qrtype, &drhsp, mstart, mindp, dvalp); }
There are certain presolve operations that can prevent a row from being presolved exactly. If the row contains a coefficient for a column that was eliminated due to duplicate column reductions or singleton column reductions, the row might have to be relaxed to remain valid for the presolved problem. The relaxation will be done automatically by the XPRSpresolverow function, but a return status of +1 will be returned. If it is not possible to relax the row, a status of -2 will be returned instead. Likewise, it is possible that certain dual reductions prevents the row from being presolved. In such a case a status of -3 will be returned instead.
If XPRSpresolverow will be used for presolving e.g. branching bounds or constraints, then dual reductions and duplicate column reductions should be disabled, by clearing the corresponding bits of PRESOLVEOPS. By clearing these bits, the default value for PRESOLVEOPS changes to 471.
If the user knows in advance which columns will have non-zero coefficients in rows that will be presolved, it is possible to protect these individual columns through the XPRSloadsecurevecs function. This way the Optimizer is left free to apply all possible reductions to the remaining columns.
© 2001-2020 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.