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
150 for( ; rowpnt < rowend; rowpnt++ )
179 multrowbyminusone =
FALSE;
183 multrowbyminusone =
TRUE;
193 multrowbyminusone =
TRUE;
203 if( multrowbyminusone )
222 for( ; rowpnt < rowend; rowpnt++, valpnt++ )
243 if( multrowbyminusone )
244 offset += (-coef) * lb;
262 if( multrowbyminusone )
263 offset += coef * (-ub);
265 offset += (-coef) * (-ub);
281 if( multrowbyminusone )
292 offset += (-coef) * lb;
306 delta += (-coef) * (ub - lb);
320 offset += (-coef) * (-ub);
334 delta += (-coef) * (ub - lb);
342 if( multrowbyminusone )
356 offset += coef * (-ub);
371 delta += coef * (ub - lb);
394 delta += coef * (ub - lb);
408 if( multrowbyminusone )
416 offset += (-coef) * lb;
426 offset += (-coef) * (-ub);
431 if( multrowbyminusone )
439 offset += coef * (-ub);
456 if( trytofix && varstofix[col] ==
NOFIX)
470#ifdef SCIP_MORE_DEBUG
472 SCIPdebugMsg(
scip,
"%s, bds=[%.2f,%.2f], obj=%.2f, nnonzs=%d, type=%s, fix=ub, %.1f <= %.1f\n",
488#ifdef SCIP_MORE_DEBUG
490 SCIPdebugMsg(
scip,
"%s, bds=[%.2f,%.2f], obj=%.2f, nnonzs=%d, type=%s, fix=lb, %.1f <= %.1f\n",
557 naddconss, ndelconss, nchgcoefs, nchgbds, nfixedvars) );
570 if( initialized && complete )
593 for(
i = 0;
i < ncols;
i++)
619 for( ; (colpnt < colend); colpnt++, valpnt++ )
677 for( ; (colpnt < colend); colpnt++, valpnt++ )
727 int numupperboundfixings;
728 int numlowerboundfixings;
729 int numcontinuousfixings;
730 int numdiscretefixings;
732 oldnfixedvars = *nfixedvars;
733 numupperboundfixings = 0;
734 numlowerboundfixings = 0;
735 numcontinuousfixings = 0;
736 numdiscretefixings = 0;
739 for( v = ncols - 1; v >= 0; --v )
767 numlowerboundfixings++;
770 numcontinuousfixings++;
772 numdiscretefixings++;
774 else if( varstofix[v] ==
FIXATUB )
796 numupperboundfixings++;
799 numcontinuousfixings++;
801 numdiscretefixings++;
809 numlowerboundfixings, numupperboundfixings,
810 numcontinuousfixings, numdiscretefixings);
859 "presolving/dualcomp/componlydisvars",
860 "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_Bool SCIPvarIsIntegral(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
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
struct SCIP_Matrix SCIP_MATRIX
#define SCIP_DECL_PRESOLCOPY(x)
struct SCIP_PresolData SCIP_PRESOLDATA
#define SCIP_DECL_PRESOLFREE(x)
struct SCIP_Presol SCIP_PRESOL
#define SCIP_DECL_PRESOLEXEC(x)
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_VARTYPE_CONTINUOUS