59#define PRESOL_NAME "dualcomp"
60#define PRESOL_DESC "compensate single up-/downlocks by singleton continuous variables"
66#define PRESOL_PRIORITY -50
67#define PRESOL_MAXROUNDS -1
68#define PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE
70#define DEFAULT_COMP_ONLY_DIS_VARS FALSE
79 SCIP_Bool componlydisvars;
129 SCIP_Bool deltaisinf;
131 SCIP_Bool multrowbyminusone;
150 for( ; rowpnt < rowend; rowpnt++ )
181 multrowbyminusone =
FALSE;
185 multrowbyminusone =
TRUE;
195 multrowbyminusone =
TRUE;
205 if( multrowbyminusone )
224 for( ; rowpnt < rowend; rowpnt++, valpnt++ )
245 if( multrowbyminusone )
246 offset += (-coef) * lb;
264 if( multrowbyminusone )
265 offset += coef * (-ub);
267 offset += (-coef) * (-ub);
284 if( multrowbyminusone )
295 offset += (-coef) * lb;
309 delta += (-coef) * (ub - lb);
323 offset += (-coef) * (-ub);
337 delta += (-coef) * (ub - lb);
345 if( multrowbyminusone )
359 offset += coef * (-ub);
374 delta += coef * (ub - lb);
397 delta += coef * (ub - lb);
411 if( multrowbyminusone )
419 offset += (-coef) * lb;
429 offset += (-coef) * (-ub);
434 if( multrowbyminusone )
442 offset += coef * (-ub);
459 if( trytofix && varstofix[col] ==
NOFIX)
473#ifdef SCIP_MORE_DEBUG
475 SCIPdebugMsg(
scip,
"%s, bds=[%.2f,%.2f], obj=%.2f, nnonzs=%d, type=%s, fix=ub, %.1f <= %.1f\n",
491#ifdef SCIP_MORE_DEBUG
493 SCIPdebugMsg(
scip,
"%s, bds=[%.2f,%.2f], obj=%.2f, nnonzs=%d, type=%s, fix=lb, %.1f <= %.1f\n",
532 SCIP_Bool initialized;
534 SCIP_Bool infeasible;
560 naddconss, ndelconss, nchgcoefs, nchgbds, nfixedvars) );
573 if( initialized && complete )
596 for(
i = 0;
i < ncols;
i++)
623 for( ; (colpnt < colend); colpnt++, valpnt++ )
681 for( ; (colpnt < colend); colpnt++, valpnt++ )
731 int numupperboundfixings;
732 int numlowerboundfixings;
733 int numcontinuousfixings;
734 int numdiscretefixings;
736 oldnfixedvars = *nfixedvars;
737 numupperboundfixings = 0;
738 numlowerboundfixings = 0;
739 numcontinuousfixings = 0;
740 numdiscretefixings = 0;
743 for( v = ncols - 1; v >= 0; --v )
771 numlowerboundfixings++;
774 numcontinuousfixings++;
776 numdiscretefixings++;
778 else if( varstofix[v] ==
FIXATUB )
800 numupperboundfixings++;
803 numcontinuousfixings++;
805 numdiscretefixings++;
813 numlowerboundfixings, numupperboundfixings,
814 numcontinuousfixings, numdiscretefixings);
863 "presolving/dualcomp/componlydisvars",
864 "should only discrete variables be compensated?",
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
int SCIPgetNContVars(SCIP *scip)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPincludePresolDualcomp(SCIP *scip)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Bool SCIPisNLPEnabled(SCIP *scip)
SCIP_RETCODE SCIPsetPresolFree(SCIP *scip, SCIP_PRESOL *presol,)
void SCIPpresolSetData(SCIP_PRESOL *presol, SCIP_PRESOLDATA *presoldata)
SCIP_PRESOLDATA * SCIPpresolGetData(SCIP_PRESOL *presol)
SCIP_RETCODE SCIPsetPresolCopy(SCIP *scip, SCIP_PRESOL *presol,)
SCIP_RETCODE SCIPincludePresolBasic(SCIP *scip, SCIP_PRESOL **presolptr, const char *name, const char *desc, int priority, int maxrounds, SCIP_PRESOLTIMING timing, SCIP_DECL_PRESOLEXEC((*presolexec)), SCIP_PRESOLDATA *presoldata)
const char * SCIPpresolGetName(SCIP_PRESOL *presol)
int SCIPgetNActivePricers(SCIP *scip)
SCIP_Bool SCIPinProbing(SCIP *scip)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPvarGetNLocksUpType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
int SCIPvarGetNLocksDownType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_Bool SCIPallowStrongDualReds(SCIP *scip)
assert(minobj< SCIPgetCutoffbound(scip))
int * SCIPmatrixGetColIdxPtr(SCIP_MATRIX *matrix, int col)
int SCIPmatrixGetRowNNonzs(SCIP_MATRIX *matrix, int row)
int SCIPmatrixGetColNDownlocks(SCIP_MATRIX *matrix, int col)
int SCIPmatrixGetColNNonzs(SCIP_MATRIX *matrix, int col)
SCIP_Bool SCIPmatrixIsRowRhsInfinity(SCIP_MATRIX *matrix, int row)
int SCIPmatrixGetColNUplocks(SCIP_MATRIX *matrix, int col)
SCIP_Real SCIPmatrixGetRowLhs(SCIP_MATRIX *matrix, int row)
SCIP_Real * SCIPmatrixGetRowValPtr(SCIP_MATRIX *matrix, int row)
SCIP_Real SCIPmatrixGetRowRhs(SCIP_MATRIX *matrix, int row)
SCIP_Real * SCIPmatrixGetColValPtr(SCIP_MATRIX *matrix, int col)
SCIP_RETCODE SCIPmatrixCreate(SCIP *scip, SCIP_MATRIX **matrixptr, SCIP_Bool onlyifcomplete, SCIP_Bool *initialized, SCIP_Bool *complete, SCIP_Bool *infeasible, int *naddconss, int *ndelconss, int *nchgcoefs, int *nchgbds, int *nfixedvars)
int SCIPmatrixGetNColumns(SCIP_MATRIX *matrix)
void SCIPmatrixFree(SCIP *scip, SCIP_MATRIX **matrix)
SCIP_VAR * SCIPmatrixGetVar(SCIP_MATRIX *matrix, int col)
int * SCIPmatrixGetRowIdxPtr(SCIP_MATRIX *matrix, int row)
void SCIPmatrixPrintRow(SCIP *scip, SCIP_MATRIX *matrix, int row)
int SCIPmatrixGetNRows(SCIP_MATRIX *matrix)
memory allocation routines
#define BMSclearMemoryArray(ptr, num)
enum Fixingdirection FIXINGDIRECTION
#define DEFAULT_COMP_ONLY_DIS_VARS
enum Lockcompensation LOCKCOMPENSATION
enum Fixingdirection FIXINGDIRECTION
static SCIP_RETCODE compensateVarLock(SCIP *scip, SCIP_MATRIX *matrix, int col, int row, SCIP_Real val, SCIP_Bool twosides, LOCKCOMPENSATION compensation, FIXINGDIRECTION *varstofix, int *nfixings)
dual compensation presolver
public methods for matrix
public methods for message output
public methods for presolvers
public methods for problem variables
public methods for memory management
public methods for message handling
public methods for nonlinear relaxation
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for presolving plugins
public methods for variable pricer plugins
public methods for global and local (sub)problems
public methods for the probing mode
public methods for SCIP variables
#define SCIP_DECL_PRESOLCOPY(x)
struct SCIP_PresolData SCIP_PRESOLDATA
#define SCIP_DECL_PRESOLFREE(x)
#define SCIP_DECL_PRESOLEXEC(x)
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_VARTYPE_CONTINUOUS