53 #define SEPA_NAME "zerohalf" 54 #define SEPA_DESC "{0,1/2}-cuts separator" 55 #define SEPA_PRIORITY -6000 57 #define SEPA_MAXBOUNDDIST 1.0 58 #define SEPA_USESSUBSCIP FALSE 59 #define SEPA_DELAY FALSE 61 #define DEFAULT_MAXROUNDS 5 62 #define DEFAULT_MAXROUNDSROOT 20 63 #define DEFAULT_MAXSEPACUTS 20 64 #define DEFAULT_MAXSEPACUTSROOT 100 65 #define DEFAULT_MAXCUTCANDS 2000 66 #define DEFAULT_MAXSLACK 0.0 67 #define DEFAULT_MAXSLACKROOT 0.0 68 #define DEFAULT_GOODSCORE 0.9 70 #define DEFAULT_BADSCORE 0.5 71 #define DEFAULT_MINVIOL 0.1 72 #define DEFAULT_DYNAMICCUTS TRUE 73 #define DEFAULT_MAXROWDENSITY 0.05 74 #define DEFAULT_DENSITYOFFSET 100 77 #define MAXDNOM 1000LL 78 #define MAXSCALE 1000.0 81 #define MAXREDUCTIONROUNDS 100 82 #define BOUNDSWITCH 0.5 83 #define MAXAGGRLEN(nvars) ((int)(0.1*(nvars)+1000)) 93 #define ROWIND_TYPE unsigned int 99 #define UNIQUE_INDEX(rowind) (3*(rowind).index + (rowind).type) 106 unsigned int index:30;
188 #define COLINFO_GET_MOD2COL(x) ((MOD2_COL*) (((uintptr_t)(x)) & ~((uintptr_t)1))) 189 #define COLINFO_GET_RHSOFFSET(x) ((int) (((uintptr_t)(x)) & ((uintptr_t)1))) 190 #define COLINFO_CREATE(mod2col, rhsoffset) ((void*) (((uintptr_t)(mod2col)) | ((uintptr_t)(rhsoffset)))) 249 if( slack1iszero && !slack2iszero )
251 if( slack2iszero && !slack1iszero )
253 if( !slack1iszero && !slack2iszero )
299 assert(mindelta <= 0.0);
300 assert(maxdelta >= 0.0);
302 *sval = val * scalar;
303 downval = floor(*sval);
309 if( downviol < upviol )
339 assert(scip != NULL);
341 assert(rowvals != NULL || rowlen == 0);
342 assert(rowcols != NULL || rowlen == 0);
343 assert(intvarpos != NULL);
344 assert(introw != NULL);
345 assert(success != NULL);
353 for( i = 0; i < rowlen; ++i )
359 transrowvals[transrowlen] =
sign * rowvals[i];
366 for( i = 0; i < rowlen; ++i )
385 val =
sign * rowvals[i];
405 if( closestvbdind >= 0 && (
SCIPisGT(scip, closestvbd, closestbound) || (localbound &&
SCIPisSumEQ(scip, closestvbd, closestbound))) )
410 closestbound = closestvbd;
433 if( closestvbdind >= 0 && (
SCIPisLT(scip, closestvbd, closestbound) || (localbound &&
SCIPisSumEQ(scip, closestvbd, closestbound))) )
438 closestbound = closestvbd;
446 if( closestvbdind >= 0 )
451 coef = val * vbdcoef;
452 transrowrhs -= val * vbdconst;
457 transrowvals[pos] += coef;
462 transrowvals[transrowlen] = coef;
468 local = local || localbound;
469 transrowrhs -= val * closestbound;
478 for( i = 0; i < transrowlen;)
480 intvarpos[transrowvars[i]] = 0;
484 transrowvals[i] = transrowvals[transrowlen];
485 transrowvars[i] = transrowvars[transrowlen];
491 if( transrowlen <= 1 )
518 transrowrhs *= intscalar;
524 for( i = 0; i < transrowlen; ++i )
530 getIntegralScalar(transrowvals[i], intscalar, mindelta, maxdelta, &newval, &intval);
532 if( !
SCIPisEQ(scip, intval, newval) )
534 if( intval < newval )
544 transrowrhs += (intval - newval) * lb;
556 transrowrhs += (intval - newval) * ub;
560 slack -= solval * intval;
561 transrowvals[i] = intval;
569 if( slack <= maxslack )
571 introw->
rhs = floorrhs;
572 introw->
slack = slack;
573 introw->
vals = transrowvals;
574 introw->
varinds = transrowvars;
575 introw->
len = transrowlen;
576 introw->
size = rowlen;
577 introw->
local = local;
580 if( !
SCIPisEQ(scip, floorrhs, transrowrhs) )
622 maxnonzeros = (int)(
SCIPgetNLPCols(scip) * sepadata->maxrowdensity) + sepadata->densityoffset;
624 for( i = 0; i < nrows; ++i )
648 lhsslack = activity - lhs;
655 rhsslack = rhs - activity;
657 if( rhsslack > maxslack && lhsslack > maxslack )
664 if( rhsslack <= maxslack )
669 rowlen, rowvals, rowcols, rhs, intvarpos, introw, &success) );
671 assert(success == 1 || success == 0);
675 if( lhsslack <= maxslack )
680 rowlen, rowvals, rowcols, -lhs, intvarpos, introw, &success) );
682 assert(success == 1 || success == 0);
717 mod2matrix->
cols[col->
pos] = col;
758 for( i = 0; i < nslots; ++i )
760 assert(rows[i] != row);
842 for( i = 0; i < rowlen; ++i )
844 if(
mod2(scip, rowvals[i]) == 1 )
854 row->
rhs = (row->
rhs + rhsoffset) % 2;
923 for( i = 0; i < introw->
len; ++i )
925 if(
mod2(scip, introw->
vals[i]) == 1 )
935 row->
rhs = (row->
rhs + rhsoffset) % 2;
970 for( i = 0; i < mod2matrix->
ncols; ++i )
976 for( i = 0; i < mod2matrix->
nrows; ++i )
1024 mod2matrix->
cols = NULL;
1026 mod2matrix->
ncols = 0;
1027 mod2matrix->
rows = NULL;
1029 mod2matrix->
nrows = 0;
1035 for( i = 0; i < nintvars; ++i )
1047 lbsol =
MAX(0.0, primsol - lb);
1055 ubsol =
MAX(0.0, ub - primsol);
1073 assert(ubsol > 0.0);
1078 assert(lbsol > 0.0);
1083 maxnonzeros = (int)(
SCIPgetNLPCols(scip) * sepadata->maxrowdensity) + sepadata->densityoffset;
1086 for( i = 0; i < nrows; ++i )
1113 lhsslack = activity - lhs;
1114 lhsmod2 =
mod2(scip, lhs);
1122 rhsslack = rhs - activity;
1123 rhsmod2 =
mod2(scip, rhs);
1126 if( rhsslack <= maxslack && lhsslack <= maxslack )
1128 if( lhsmod2 == rhsmod2 )
1145 else if( rhsslack <= maxslack )
1150 else if( lhsslack <= maxslack )
1189 for( i = 0; i < nslotscol1; ++i )
1214 for( i = 0; i < nslots; ++i )
1216 if( rows[i] != NULL )
1234 assert(row1 != NULL);
1235 assert(row2 != NULL);
1262 signature = row->
rhs;
1279 int position = row->
pos;
1288 --mod2matrix->
nrows;
1289 mod2matrix->
rows[position] = mod2matrix->
rows[mod2matrix->
nrows];
1290 mod2matrix->
rows[position]->
pos = position;
1319 assert(col != NULL);
1322 position = col->
pos;
1325 --mod2matrix->
ncols;
1326 mod2matrix->
cols[position] = mod2matrix->
cols[mod2matrix->
ncols];
1327 mod2matrix->
cols[position]->
pos = position;
1335 for( i = 0; i < nslots; ++i )
1337 if( rows[i] != NULL )
1358 SCIPhashGetKeyStandard, columnsEqual, columnGetSignature, NULL) );
1360 for( i = 0; i < mod2matrix->
ncols; )
1364 if( nnonzrows == 0 )
1368 else if( nnonzrows == 1 )
1376 while( rows[j] == NULL )
1392 ++sepadata->nreductions;
1400 if( identicalcol != NULL )
1402 assert(identicalcol != col);
1425 #define NONZERO(x) (COPYSIGN(1e-100, (x)) + (x)) 1444 for( i = 0; i < row->
len; ++i )
1451 nonzeroinds[(*nnz)++] = probindex;
1454 val += weight * row->
vals[i];
1455 tmpcoefs[probindex] =
NONZERO(val);
1468 *cutrank =
MAX(*cutrank, row->
rank);
1469 *cutislocal = *cutislocal || row->
local;
1486 for( i = 0; i < introw->
len; ++i )
1488 int probindex = introw->
varinds[i];
1493 nonzeroinds[(*nnz)++] = probindex;
1496 val += 0.5 * introw->
vals[i];
1497 tmpcoefs[probindex] =
NONZERO(val);
1500 *cutrhs += 0.5 * introw->
rhs;
1502 *cutrank =
MAX(*cutrank, introw->
rank);
1503 *cutislocal = *cutislocal || introw->
local;
1521 assert(scip != NULL);
1522 assert(cutcoefs != NULL);
1523 assert(cutinds != NULL);
1529 for( i = 0; i < cutnnz; ++i )
1530 activity += cutcoefs[i] *
SCIPgetVarSol(scip, vars[cutinds[i]]);
1532 return (activity - cutrhs) /
MAX(1e-6, norm);
1543 viol = 1.0 - row->
slack;
1558 viol = 1.0 - row->
slack;
1608 assert(row->
rhs == 1);
1624 for( i = 0; i < row->
nrowinds; ++i )
1629 addOrigRow(scip, tmpcoefs, &cutrhs, cutinds, &cutnnz, &cutrank, &cutislocal, rows[row->
rowinds[i].
index], 1);
1632 addOrigRow(scip, tmpcoefs, &cutrhs, cutinds, &cutnnz, &cutrank, &cutislocal, rows[row->
rowinds[i].
index], -1);
1637 addTransRow(tmpcoefs, &cutrhs, cutinds, &cutnnz, &cutrank, &cutislocal, introw);
1646 if( cutnnz > maxaggrlen )
1649 for( i = 0; i < cutnnz; ++i )
1658 for( i = 0; i < cutnnz; )
1666 if(
REALABS(coef - floorcoef) > 0.1 )
1739 if( floorcoef == 0.0 )
1742 cutinds[i] = cutinds[cutnnz];
1746 cutcoefs[i] = floorcoef;
1758 cutefficacy =
calcEfficacy(scip, cutcoefs, cutrhs, cutinds, cutnnz);
1769 assert(allowlocal || !cutislocal);
1782 for( v = 0; v < cutnnz; ++v )
1792 int pos = sepadata->ncuts++;
1794 if( sepadata->ncuts > sepadata->cutssize )
1799 sepadata->cutssize = newsize;
1802 sepadata->cuts[pos] = cut;
1803 sepadata->cutscores[pos] = cutefficacy + 1e-4 * (1 -
SCIProwIsLocal(cut));
1838 SCIPhashGetKeyStandard, rowsEqual, rowGetSignature, NULL) );
1840 for( i = 0; i < mod2matrix->
nrows; )
1851 sepadata->nreductions += row->
nnonzcols;
1858 if( identicalrow != NULL )
1860 assert(identicalrow != row);
1882 assert(mod2matrix->
rows[row->pos] == row && mod2matrix->
rows[identicalrow->pos] == identicalrow);
1883 assert(identicalrow->pos == i);
1884 assert(row->pos < i);
1902 if( sepadata->infeasible )
1941 row->
rhs ^= rowtoadd->
rhs;
1949 row->
slack = newslack;
1963 for( i = 0; i < rowtoadd->
nrowinds; ++i )
1988 for ( i = 0; i < rowtoadd->
nrowinds; ++i )
2007 while( i < row->nnonzcols && j < rowtoadd->nnonzcols )
2018 newnonzcols[k++] = row->
nonzcols[i++];
2023 newnonzcols[k++] = rowtoadd->
nonzcols[j++];
2027 while( i < row->nnonzcols )
2030 newnonzcols[k++] = row->
nonzcols[i++];
2033 while( j < rowtoadd->nnonzcols )
2036 newnonzcols[k++] = rowtoadd->
nonzcols[j++];
2060 assert(scip != NULL);
2061 assert(sepa != NULL);
2080 assert(sepadata != NULL);
2100 assert(result != NULL);
2101 assert(sepa != NULL);
2119 assert(sepadata != NULL);
2126 if( (depth == 0 && sepadata->maxroundsroot >= 0 && ncalls >= sepadata->maxroundsroot)
2127 || (depth > 0 && sepadata->maxrounds >= 0 && ncalls >= sepadata->maxrounds) )
2130 maxsepacuts = depth == 0 ? sepadata->maxsepacutsroot : sepadata->maxsepacuts;
2131 maxslack = depth == 0 ? sepadata->maxslackroot : sepadata->maxslack;
2138 sepadata->ncuts = 0;
2139 sepadata->cutssize = 0;
2140 sepadata->cutscores = NULL;
2141 sepadata->cuts = NULL;
2142 sepadata->infeasible =
FALSE;
2154 sepadata->nreductions = 0;
2160 SCIPdebugMsg(scip,
"preprocessed rows (%i rows, %i cols, %i cuts) \n", mod2matrix.
nrows, mod2matrix.
ncols,
2163 if( mod2matrix.
nrows == 0 )
2166 if( sepadata->ncuts >= sepadata->maxcutcands )
2176 ncancel = mod2matrix.
nrows;
2185 if( mod2matrix.
ncols == 0 )
2191 for( i = 0; i < ncancel; ++i )
2200 SCIPdebugMsg(scip,
"processing row %i/%i (%i/%i cuts)\n", i, mod2matrix.
nrows, sepadata->ncuts, sepadata->maxcutcands);
2211 assert( col != NULL );
2218 ++sepadata->nreductions;
2226 for( j = 0; j < nslots; ++j )
2228 if( rows[j] != NULL && rows[j] != row )
2229 nonzrows[nnonzrows++] = rows[j];
2232 for( j = 0; j < nnonzrows; ++j )
2247 if( sepadata->nreductions == 0 )
2254 for( i = 0; i < mod2matrix.
nrows && sepadata->ncuts < sepadata->maxcutcands; ++i )
2267 SCIPdebugMsg(scip,
"total number of cuts found: %i\n", sepadata->ncuts);
2273 if( sepadata->ncuts > 0 )
2281 goodscore = sepadata->goodscore * sepadata->cutscores[0];
2282 badscore = sepadata->badscore * sepadata->cutscores[0];
2285 for( i = 0; i < sepadata->ncuts; ++i )
2290 if( sepadata->cuts[i] == NULL )
2294 if( naccepted == maxsepacuts || sepadata->cutscores[i] < badscore )
2316 for( j = i + 1; j < sepadata->ncuts; ++j )
2320 if( sepadata->cuts[j] == NULL )
2331 (ortho < 0.9 && (
SCIProwIsLocal(sepadata->cuts[j]) || sepadata->cutscores[j] < goodscore)) )
2347 sepadata->ncuts = newncuts;
2353 if( sepadata->infeasible )
2382 assert(sepa != NULL);
2391 "maximal number of cmir separation rounds per node (-1: unlimited)",
2394 "separating/" SEPA_NAME "/maxroundsroot",
2395 "maximal number of cmir separation rounds in the root node (-1: unlimited)",
2399 "maximal number of cmir cuts separated per separation round",
2402 "separating/" SEPA_NAME "/maxsepacutsroot",
2403 "maximal number of cmir cuts separated per separation round in the root node",
2407 "maximal number of zerohalf cuts considered per separation round",
2411 "maximal slack of rows to be used in aggregation",
2414 "separating/" SEPA_NAME "/maxslackroot",
2415 "maximal slack of rows to be used in aggregation in the root node",
2419 "threshold for score of cut relative to best score to be considered good, so that less strict filtering is applied",
2423 "threshold for score of cut relative to best score to be discarded",
2427 "minimal violation to generate zerohalfcut for",
2431 "should generated cuts be removed from the LP if they are no longer tight?",
2434 "separating/" SEPA_NAME "/maxrowdensity",
2435 "maximal density of row to be used in aggregation",
2438 "separating/" SEPA_NAME "/densityoffset",
2439 "additional number of variables allowed in row on top of density",
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
SCIP_ROW ** SCIPgetLPRows(SCIP *scip)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
void SCIPaggrRowFree(SCIP *scip, SCIP_AGGRROW **aggrrow)
SCIP_Real * SCIPvarGetVlbCoefs(SCIP_VAR *var)
SCIP_Real SCIPfeastol(SCIP *scip)
#define COLINFO_CREATE(mod2col, rhsoffset)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
#define DEFAULT_MAXSLACKROOT
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE mod2matrixPreprocessRows(SCIP *scip, MOD2_MATRIX *mod2matrix, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, SCIP_Bool allowlocal)
SCIP_RETCODE SCIPhashsetRemove(SCIP_HASHSET *hashset, void *element)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
static void mod2matrixRemoveCol(SCIP *scip, MOD2_MATRIX *mod2matrix, MOD2_COL *col)
int SCIPhashsetGetNElements(SCIP_HASHSET *hashset)
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
void ** SCIPhashsetGetSlots(SCIP_HASHSET *hashset)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
static SCIP_DECL_HASHKEYVAL(columnGetSignature)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
int SCIProwGetNNonz(SCIP_ROW *row)
#define COLINFO_GET_RHSOFFSET(x)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
void SCIPsortDownRealPtr(SCIP_Real *realarray, void **ptrarray, int len)
SCIP_Real SCIPfeasRound(SCIP *scip, SCIP_Real val)
static SCIP_RETCODE mod2colUnlinkRow(MOD2_COL *col, MOD2_ROW *row)
static SCIP_RETCODE mod2matrixRemoveRow(SCIP *scip, MOD2_MATRIX *mod2matrix, MOD2_ROW *row)
SCIP_RETCODE SCIPincludeSepaZerohalf(SCIP *scip)
int SCIProwGetNLPNonz(SCIP_ROW *row)
#define DEFAULT_GOODSCORE
void SCIPswapPointers(void **pointer1, void **pointer2)
static SCIP_RETCODE mod2rowAddRow(SCIP *scip, BMS_BLKMEM *blkmem, MOD2_MATRIX *mod2matrix, MOD2_ROW *row, MOD2_ROW *rowtoadd)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_Bool SCIPcolIsIntegral(SCIP_COL *col)
SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
static SCIP_Real calcEfficacy(SCIP *scip, SCIP_Real *cutcoefs, SCIP_Real cutrhs, int *cutinds, int cutnnz)
static void mod2rowUnlinkCol(MOD2_ROW *row, MOD2_COL *col)
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_RETCODE SCIPhashsetCreate(SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem, int size)
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
enum SCIP_Retcode SCIP_RETCODE
int SCIPvarGetProbindex(SCIP_VAR *var)
SCIP_Bool SCIPhashsetExists(SCIP_HASHSET *hashset, void *element)
SCIP_Real SCIPgetVectorEfficacyNorm(SCIP *scip, SCIP_Real *vals, int nvals)
#define MAXAGGRLEN(nvars)
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_VAR ** SCIPvarGetVlbVars(SCIP_VAR *var)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
int SCIPgetNLPBranchCands(SCIP *scip)
SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols)
SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPACOPY((*sepacopy)))
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
int SCIPhashsetGetNSlots(SCIP_HASHSET *hashset)
int SCIPgetNContVars(SCIP *scip)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_RETCODE SCIPgetVarClosestVlb(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvlb, int *closestvlbidx)
#define DEFAULT_MAXROUNDSROOT
SCIP_Real SCIPfeasCeil(SCIP *scip, SCIP_Real val)
SCIP_SEPADATA * SCIPsepaGetData(SCIP_SEPA *sepa)
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
#define SCIP_DEFAULT_EPSILON
#define UNIQUE_INDEX(rowind)
#define SCIPallocCleanBufferArray(scip, ptr, num)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
#define MAXREDUCTIONROUNDS
static SCIP_DECL_SEPAEXECLP(sepaExeclpZerohalf)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
TRANSINTROW * transintrows
void SCIPhashsetFree(SCIP_HASHSET **hashset, BMS_BLKMEM *blkmem)
#define BMSmoveMemoryArray(ptr, source, num)
int SCIPsepaGetNCallsAtNode(SCIP_SEPA *sepa)
SCIP_Bool SCIPisEfficacious(SCIP *scip, SCIP_Real efficacy)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
SCIP_Bool SCIPsortedvecFindPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), void *val, int len, int *pos)
SCIP_Real * SCIPvarGetVubConstants(SCIP_VAR *var)
SCIPInterval sign(const SCIPInterval &x)
SCIP_Bool SCIProwIsIntegral(SCIP_ROW *row)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void SCIPsepaSetData(SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata)
int SCIPgetNLPRows(SCIP *scip)
SCIP_Bool SCIPisSumEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
void SCIPsortPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
#define SCIPensureBlockMemoryArray(scip, ptr, arraysizeptr, minsize)
SCIP_Real * SCIPvarGetVlbConstants(SCIP_VAR *var)
#define SCIPhashSignature64(a)
#define DEFAULT_MAXSEPACUTS
SCIP_RETCODE SCIPgetVarClosestVub(SCIP *scip, SCIP_VAR *var, SCIP_SOL *sol, SCIP_Real *closestvub, int *closestvubidx)
SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
#define DEFAULT_MAXROWDENSITY
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
SCIP_Real * SCIPvarGetVubCoefs(SCIP_VAR *var)
SCIP_Real SCIPgetRowLPActivity(SCIP *scip, SCIP_ROW *row)
static SCIP_DECL_HASHKEYEQ(columnsEqual)
void SCIPselectPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int k, int len)
#define DEFAULT_MAXCUTCANDS
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
SCIP_Bool SCIProwIsModifiable(SCIP_ROW *row)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
SCIP_RETCODE SCIPincludeSepaBasic(SCIP *scip, SCIP_SEPA **sepa, const char *name, const char *desc, int priority, int freq, SCIP_Real maxbounddist, SCIP_Bool usessubscip, SCIP_Bool delay, SCIP_DECL_SEPAEXECLP((*sepaexeclp)), SCIP_DECL_SEPAEXECSOL((*sepaexecsol)), SCIP_SEPADATA *sepadata)
#define SCIPallocBufferArray(scip, ptr, num)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
SCIP_Bool SCIPisSumGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_Real computeMaxViolation(MOD2_ROW *row)
static void addOrigRow(SCIP *scip, SCIP_Real *tmpcoefs, SCIP_Real *cutrhs, int *nonzeroinds, int *nnz, int *cutrank, SCIP_Bool *cutislocal, SCIP_ROW *row, int sign)
static int mod2(SCIP *scip, SCIP_Real val)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_Bool SCIPcutsTightenCoefficients(SCIP *scip, SCIP_Bool cutislocal, SCIP_Real *cutcoefs, SCIP_Real *cutrhs, int *cutinds, int *cutnnz, int *nchgcoefs)
static SCIP_RETCODE mod2MatrixAddTransRow(SCIP *scip, MOD2_MATRIX *mod2matrix, SCIP_HASHMAP *origcol2col, int transrowind)
int SCIPgetDepth(SCIP *scip)
static void destroyMod2Matrix(SCIP *scip, MOD2_MATRIX *mod2matrix)
SCIP_RETCODE SCIPaddPoolCut(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPcreateEmptyRowSepa(SCIP *scip, SCIP_ROW **row, SCIP_SEPA *sepa, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
static void addTransRow(SCIP_Real *tmpcoefs, SCIP_Real *cutrhs, int *nonzeroinds, int *nnz, int *cutrank, SCIP_Bool *cutislocal, TRANSINTROW *introw)
static SCIP_RETCODE mod2MatrixAddCol(SCIP *scip, MOD2_MATRIX *mod2matrix, SCIP_HASHMAP *origvar2col, SCIP_VAR *origvar, SCIP_Real solval, int rhsoffset)
static SCIP_DECL_SORTPTRCOMP(compareColIndex)
#define BMScopyMemoryArray(ptr, source, num)
Constraint handler for linear constraints in their most general form, .
static void getIntegralScalar(SCIP_Real val, SCIP_Real scalar, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Real *sval, SCIP_Real *intval)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
#define DEFAULT_DENSITYOFFSET
SCIP_Bool SCIPisCutNew(SCIP *scip, SCIP_ROW *row)
int SCIProwGetRank(SCIP_ROW *row)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
int SCIPgetNVars(SCIP *scip)
static SCIP_RETCODE mod2MatrixAddOrigRow(SCIP *scip, BMS_BLKMEM *blkmem, MOD2_MATRIX *mod2matrix, SCIP_HASHMAP *origcol2col, SCIP_ROW *origrow, SCIP_Real slack, ROWIND_TYPE side, int rhsmod2)
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa, SCIP_DECL_SEPAFREE((*sepafree)))
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define DEFAULT_DYNAMICCUTS
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
#define COLINFO_GET_MOD2COL(x)
void SCIProwChgRank(SCIP_ROW *row, int rank)
static SCIP_RETCODE buildMod2Matrix(SCIP *scip, SCIP_SEPADATA *sepadata, BMS_BLKMEM *blkmem, MOD2_MATRIX *mod2matrix, SCIP_Bool allowlocal, SCIP_Real maxslack)
static void checkRow(MOD2_ROW *row)
data structures for LP management
static SCIP_RETCODE mod2MatrixTransformContRows(SCIP *scip, SCIP_SEPADATA *sepadata, MOD2_MATRIX *mod2matrix, SCIP_Bool allowlocal, SCIP_Real maxslack)
SCIP_RETCODE SCIPhashsetInsert(SCIP_HASHSET *hashset, BMS_BLKMEM *blkmem, void *element)
#define SEPA_MAXBOUNDDIST
static SCIP_RETCODE transformNonIntegralRow(SCIP *scip, SCIP_Bool allowlocal, SCIP_Real maxslack, int sign, SCIP_Bool local, int rank, int rowlen, SCIP_Real *rowvals, SCIP_COL **rowcols, SCIP_Real rhs, int *intvarpos, TRANSINTROW *introw, SCIP_Bool *success)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
int SCIProwGetLPPos(SCIP_ROW *row)
static SCIP_Real computeViolation(MOD2_ROW *row)
#define SCIPfreeCleanBufferArray(scip, ptr)
SCIP_Bool SCIPisStopped(SCIP *scip)
#define DEFAULT_MAXROUNDS
SCIP_RETCODE SCIPaggrRowCreate(SCIP *scip, SCIP_AGGRROW **aggrrow)
SCIP_VAR ** SCIPvarGetVubVars(SCIP_VAR *var)
SCIP_RETCODE SCIPcalcIntegralScalar(SCIP_Real *vals, int nvals, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Longint maxdnom, SCIP_Real maxscale, SCIP_Real *intscalar, SCIP_Bool *success)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPgetVarSol(SCIP *scip, SCIP_VAR *var)
int SCIPgetNLPCols(SCIP *scip)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
#define BMSallocBlockMemory(mem, ptr)
SCIP_Real SCIPsumepsilon(SCIP *scip)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_Bool SCIPisSumLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
void SCIPswapInts(int *value1, int *value2)
struct BMS_BlkMem BMS_BLKMEM
static SCIP_RETCODE mod2matrixPreprocessColumns(SCIP *scip, MOD2_MATRIX *mod2matrix, SCIP_SEPADATA *sepadata)
SCIP_Longint SCIPgetNLPs(SCIP *scip)
static SCIP_RETCODE generateZerohalfCut(SCIP *scip, MOD2_MATRIX *mod2matrix, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, SCIP_Bool allowlocal, MOD2_ROW *row)
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
static SCIP_RETCODE mod2colLinkRow(BMS_BLKMEM *blkmem, MOD2_COL *col, MOD2_ROW *row)
static SCIP_DECL_SEPAFREE(sepaFreeZerohalf)
struct SCIP_SepaData SCIP_SEPADATA
SCIP_Real SCIProwGetOrthogonality(SCIP_ROW *row1, SCIP_ROW *row2, char orthofunc)
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)
#define DEFAULT_MAXSEPACUTSROOT
static SCIP_DECL_SEPACOPY(sepaCopyZerohalf)