problem.presolverow
problem.presolverow |
- -3: Failed to presolve the row due to presolve dual reductions;
- -2: Failed to presolve the row due to presolve duplicate column reductions;
- -1: Failed to presolve the row due to an error. Check the Optimizer error code for the cause;
- 0: The row was successfully presolved;
- 1: The row was presolved, but may be relaxed.
drhsp, status = problem.presolverow(qrtype, mcolso, dvalo, drhso, maxcoeffs, mcolsp, dvalp)
qrtype
|
The type of the row:
|
||||
mcolso
|
Array containing the columns (i.e.
xpress.var objects, indices, or names) of the row to presolve.
|
||||
dvalo
|
Array 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.
|
||||
mcolsp
|
Array which will be filled with the columns of the presolved row.
|
||||
dvalp
|
Array which will be filled with the coefficients of the presolved row.
|
presind = [] prescoe = [] prhs, status = p.presolverow('L', [1,2], [2,1], 1.0, p.attributes.cols, presind, prescoe)
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 problem.presolverow 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 problem.presolverow is 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 problem.loadsecurevecs function. This way the Optimizer is left free to apply all possible reductions to the remaining columns.