45 #define PRESOL_NAME "dualagg" 46 #define PRESOL_DESC "aggregate variables by dual arguments" 47 #define PRESOL_PRIORITY -12000 48 #define PRESOL_MAXROUNDS 0 49 #define PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE 77 assert(rowidx != NULL);
88 for(; (colpnt < colend); colpnt++, valpnt++)
104 assert(colpnt < colend);
105 for(colpnt++, valpnt++; (colpnt < colend); colpnt++, valpnt++)
107 assert(*valpnt > 0.0);
126 assert(rowidx != NULL);
127 assert(coef != NULL);
137 for(; (colpnt < colend); colpnt++, valpnt++)
153 assert(colpnt < colend);
154 for(colpnt++, valpnt++; (colpnt < colend); colpnt++, valpnt++)
156 assert(*valpnt < 0.0);
181 assert(binvaridx != NULL);
182 assert(aggtype != NULL);
206 for( ; (rowpnt < rowend); rowpnt++, valpnt++ )
210 if( *rowpnt == aggvaridx )
226 if(
SCIPisGE(scip, minact-bincoef, lhs) )
230 bnd = (lhs - maxact + coef*lb - bincoef) / coef;
233 *binvaridx = *rowpnt;
243 if(
SCIPisGE(scip, minact+bincoef, lhs) )
247 bnd = (lhs - maxact + coef*lb + bincoef) / coef;
250 *binvaridx = *rowpnt;
279 assert(binvaridx != NULL);
280 assert(aggtype != NULL);
304 for( ; (rowpnt < rowend); rowpnt++, valpnt++ )
308 if( *rowpnt == aggvaridx )
325 if(
SCIPisGE(scip, minact-bincoef, lhs) )
329 bnd = (lhs - maxact + coef*ub - bincoef) / coef;
332 *binvaridx = *rowpnt;
342 if(
SCIPisGE(scip, minact+bincoef, lhs) )
346 bnd = (lhs - maxact + coef*ub + bincoef) / coef;
349 *binvaridx = *rowpnt;
372 assert(scip != NULL);
373 assert(matrix != NULL);
374 assert(nvaragg != NULL);
375 assert(aggtypes != NULL);
376 assert(binvars != NULL);
380 for( i = 0; i < nvars; i++ )
404 aggtypes[i] = aggtype;
428 assert(scip != NULL);
429 assert(matrix != NULL);
430 assert(nvaragg != NULL);
431 assert(aggtypes != NULL);
432 assert(binvars != NULL);
436 for( i = 0; i < nvars; i++ )
443 aggtypes[i] ==
NOAGG )
462 aggtypes[i] = aggtype;
486 assert(result != NULL);
507 if( initialized && complete )
532 for( v = 0; v < ncols; v++ )
534 if( aggtypes[v] !=
NOAGG )
546 assert(binvars[v] != NULL);
550 ub, &infeasible, &redundant, &aggregated) );
556 lb, &infeasible, &redundant, &aggregated) );
573 if( (*naggrvars) > 0 )
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)
static SCIP_RETCODE findDownlockAggregations(SCIP *scip, SCIP_MATRIX *matrix, int *nvaragg, AGGRTYPE *aggtypes, SCIP_VAR **binvars)
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
static SCIP_RETCODE findUplockAggregations(SCIP *scip, SCIP_MATRIX *matrix, int *nvaragg, AGGRTYPE *aggtypes, SCIP_VAR **binvars)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
void SCIPmatrixFree(SCIP *scip, SCIP_MATRIX **matrix)
static void getUplockRowIdx(SCIP_MATRIX *matrix, int aggvaridx, int *rowidx, SCIP_Real *coef)
aggregate variables by dual arguments
int SCIPgetNActivePricers(SCIP *scip)
enum SCIP_Retcode SCIP_RETCODE
static SCIP_DECL_PRESOLEXEC(presolExecDualagg)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_Real SCIPmatrixGetRowMaxActivity(SCIP_MATRIX *matrix, int row)
SCIP_RETCODE SCIPmatrixCreate(SCIP *scip, SCIP_MATRIX **matrixptr, SCIP_Bool *initialized, SCIP_Bool *complete)
int SCIPmatrixGetRowNNonzs(SCIP_MATRIX *matrix, int row)
static void getBinVarIdxInUplockRow(SCIP *scip, SCIP_MATRIX *matrix, int aggvaridx, int *binvaridx, AGGRTYPE *aggtype)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_Real SCIPmatrixGetRowLhs(SCIP_MATRIX *matrix, int row)
SCIP_Real * SCIPmatrixGetColValPtr(SCIP_MATRIX *matrix, int col)
SCIP_RETCODE SCIPincludePresolDualagg(SCIP *scip)
static void getDownlockRowIdx(SCIP_MATRIX *matrix, int aggvaridx, int *rowidx, SCIP_Real *coef)
int * SCIPmatrixGetRowIdxPtr(SCIP_MATRIX *matrix, int row)
SCIP_Bool SCIPisNLPEnabled(SCIP *scip)
SCIP_Real SCIPmatrixGetColLb(SCIP_MATRIX *matrix, int col)
SCIP_Real * SCIPmatrixGetRowValPtr(SCIP_MATRIX *matrix, int row)
SCIP_Real SCIPmatrixGetColUb(SCIP_MATRIX *matrix, int col)
#define SCIPallocBufferArray(scip, ptr, num)
static void getBinVarIdxInDownlockRow(SCIP *scip, SCIP_MATRIX *matrix, int aggvaridx, int *binvaridx, AGGRTYPE *aggtype)
int * SCIPmatrixGetColIdxPtr(SCIP_MATRIX *matrix, int col)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
public methods for matrix
int SCIPgetNBinVars(SCIP *scip)
SCIP_Bool SCIPinProbing(SCIP *scip)
SCIP_Bool SCIPmatrixIsRowRhsInfinity(SCIP_MATRIX *matrix, int row)
SCIP_Bool SCIPallowDualReds(SCIP *scip)
SCIP_RETCODE SCIPaggregateVars(SCIP *scip, SCIP_VAR *varx, SCIP_VAR *vary, SCIP_Real scalarx, SCIP_Real scalary, SCIP_Real rhs, SCIP_Bool *infeasible, SCIP_Bool *redundant, SCIP_Bool *aggregated)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_Real SCIPmatrixGetRowMinActivity(SCIP_MATRIX *matrix, int row)
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)
int SCIPmatrixGetNColumns(SCIP_MATRIX *matrix)
int SCIPmatrixGetColNNonzs(SCIP_MATRIX *matrix, int col)