36 #define PRESOL_NAME "stuffing" 37 #define PRESOL_DESC "fix redundant singleton continuous variables" 38 #define PRESOL_PRIORITY -100 39 #define PRESOL_MAXROUNDS 0 40 #define PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE 86 assert(matrix !=
NULL);
87 assert(varstofix !=
NULL);
88 assert(nfixings !=
NULL);
104 for( col = 0; col < ncols; col++ )
113 if( rowprocessed[row] )
116 rowprocessed[row] =
TRUE;
131 for( ; (rowpnt < rowend); rowpnt++, valpnt++ )
161 upperconst += coef * lb;
162 lowerconst += coef * lb;
164 colindices[fillcnt] = idx;
165 colcoeffs[fillcnt] = coef;
181 upperconst += coef * ub;
182 lowerconst += coef * ub;
184 colindices[fillcnt] = idx;
185 colcoeffs[fillcnt] = -coef;
200 upperconst += coef * lb;
201 lowerconst += coef * lb;
218 upperconst += coef * ub;
219 lowerconst += coef * ub;
235 upperconst += coef * ub;
236 lowerconst += coef * lb;
240 upperconst += coef * lb;
241 lowerconst += coef * ub;
251 for( k = 0; k < fillcnt; k++ )
270 assert(colcoeffs[k] >= 0);
276 delta = -(lb - ub) * colcoeffs[k];
278 delta = (ub - lb) * colcoeffs[k];
282 if(
SCIPisLE(scip, delta, rhs - upperconst) )
291 else if(
SCIPisLE(scip, rhs, lowerconst) )
328 assert(presol !=
NULL);
345 assert(result !=
NULL);
381 oldnfixedvars = *nfixedvars;
384 for( v = ncols - 1; v >= 0; --v )
419 else if( varstofix[v] ==
FIXATUB )
449 if( *result !=
SCIP_CUTOFF && *nfixedvars > oldnfixedvars )
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)
SCIP_VAR * SCIPmatrixGetVar(SCIP_MATRIX *matrix, int col)
int SCIPmatrixGetNRows(SCIP_MATRIX *matrix)
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_RETCODE SCIPincludePresolStuffing(SCIP *scip)
static SCIP_DECL_PRESOLEXEC(presolExecStuffing)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
void SCIPmatrixFree(SCIP *scip, SCIP_MATRIX **matrix)
fix singleton continuous variables
int SCIPgetNActivePricers(SCIP *scip)
enum SCIP_Retcode SCIP_RETCODE
#define SCIPfreeBufferArray(scip, ptr)
SCIP_RETCODE SCIPmatrixCreate(SCIP *scip, SCIP_MATRIX **matrixptr, SCIP_Bool *initialized, SCIP_Bool *complete)
int SCIPgetNContVars(SCIP *scip)
static SCIP_DECL_PRESOLCOPY(presolCopyStuffing)
void SCIPsortRealRealIntInt(SCIP_Real *realarray1, SCIP_Real *realarray2, int *intarray1, int *intarray2, int len)
int SCIPmatrixGetRowNNonzs(SCIP_MATRIX *matrix, int row)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_Real SCIPmatrixGetRowLhs(SCIP_MATRIX *matrix, int row)
enum Fixingdirection FIXINGDIRECTION
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int * SCIPmatrixGetRowIdxPtr(SCIP_MATRIX *matrix, int row)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Bool SCIPisNLPEnabled(SCIP *scip)
SCIP_Real * SCIPmatrixGetRowValPtr(SCIP_MATRIX *matrix, int row)
#define SCIPallocBufferArray(scip, ptr, num)
int SCIPvarGetNLocksUp(SCIP_VAR *var)
int * SCIPmatrixGetColIdxPtr(SCIP_MATRIX *matrix, int col)
const char * SCIPpresolGetName(SCIP_PRESOL *presol)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
public methods for matrix
SCIP_Bool SCIPinProbing(SCIP *scip)
static SCIP_RETCODE singletonColumnStuffing(SCIP *scip, SCIP_MATRIX *matrix, FIXINGDIRECTION *varstofix, int *nfixings)
int SCIPvarGetNLocksDown(SCIP_VAR *var)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPmatrixIsRowRhsInfinity(SCIP_MATRIX *matrix, int row)
SCIP_RETCODE SCIPsetPresolCopy(SCIP *scip, SCIP_PRESOL *presol, SCIP_DECL_PRESOLCOPY((*presolcopy)))
SCIP_Bool SCIPallowDualReds(SCIP *scip)
SCIP_Bool SCIPisStopped(SCIP *scip)
int SCIPmatrixGetColNDownlocks(SCIP_MATRIX *matrix, int col)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
int SCIPmatrixGetColNUplocks(SCIP_MATRIX *matrix, int col)
#define BMSclearMemoryArray(ptr, num)
enum Fixingdirection FIXINGDIRECTION
int SCIPmatrixGetNColumns(SCIP_MATRIX *matrix)
int SCIPmatrixGetColNNonzs(SCIP_MATRIX *matrix, int col)