48#define SEPA_NAME "rlt"
49#define SEPA_DESC "reformulation-linearization-technique separator"
50#define SEPA_PRIORITY 10
52#define SEPA_MAXBOUNDDIST 1.0
54#define SEPA_USESSUBSCIP FALSE
55#define SEPA_DELAY FALSE
57#define DEFAULT_MAXUNKNOWNTERMS 0
58#define DEFAULT_MAXUSEDVARS 100
59#define DEFAULT_MAXNCUTS -1
60#define DEFAULT_MAXROUNDS 1
61#define DEFAULT_MAXROUNDSROOT 10
62#define DEFAULT_ONLYEQROWS FALSE
63#define DEFAULT_ONLYCONTROWS FALSE
64#define DEFAULT_ONLYORIGINAL TRUE
65#define DEFAULT_USEINSUBSCIP FALSE
66#define DEFAULT_USEPROJECTION FALSE
67#define DEFAULT_DETECTHIDDEN FALSE
68#define DEFAULT_HIDDENRLT FALSE
69#define DEFAULT_ADDTOPOOL TRUE
71#define DEFAULT_GOODSCORE 1.0
73#define DEFAULT_BADSCORE 0.5
74#define DEFAULT_OBJPARALWEIGHT 0.0
75#define DEFAULT_EFFICACYWEIGHT 1.0
76#define DEFAULT_DIRCUTOFFDISTWEIGHT 0.0
77#define DEFAULT_GOODMAXPARALL 0.1
78#define DEFAULT_MAXPARALL 0.1
80#define MAXVARBOUND 1e+5
188 for( v = hashdata1->
nvars-1; v >= 0; --v )
191 if( hashdata1->
vars[v] != hashdata2->
vars[v] )
223 minidx =
MIN3(idx[0], idx[1], idx[2]);
224 maxidx =
MAX3(idx[0], idx[1], idx[2]);
225 if( idx[0] == maxidx )
226 mididx =
MAX(idx[1], idx[2]);
228 mididx =
MAX(idx[0],
MIN(idx[1], idx[2]));
231 assert(minidx <= mididx && mididx <= maxidx);
252 for( v1 = 0; v1 < 2; ++v1 )
260 if( adjacentvardata ==
NULL )
325 if( adjacentvardata ==
NULL )
428 for(
i = 0;
i < nconss; ++
i )
436 (*rows)[*nrows] = row;
466 for(
r = 0;
r < *nrows; ++
r )
471 if(
sepadata->onlyeqrows && !iseqrow )
503 rows[new_nrows] = prob_rows[
r];
524 if( n <= sepadata->sbilinvars )
579 if( xpos == INT_MAX )
590 assert(xpos >= 0 && xpos < sepadata->nbilinvars );
594 sepadata->varpriorities[xpos] += nlocks;
600 if( ypos == INT_MAX )
611 assert(ypos >= 0 && ypos < sepadata->nbilinvars);
615 sepadata->varpriorities[ypos] += nlocks;
707 assert(b1 != 0.0 || b2 != 0.0);
718 if( (b1 == 0.0 && c1 == 0.0) || (b2 == 0.0 && c2 == 0.0) )
722 if( a2 == 0.0 && b2 == 0.0 )
755 if( sidetype1 != sidetype2 )
761 SCIPdebugMsg(
scip,
"Ignoring a pair of linear relations because b1c2 = b2c1\n");
781 mult = 1/(b1*c2 - c1*b2);
786 SCIPdebugMsg(
scip,
"found suitable implied rels (w,x,y): %g<%s> + %g<%s> + %g<%s> <= %g\n", a1,
792 A = (b2*a1 - d1*b2 + d2*b1)*mult;
826 assert(binvarpos != implvarpos);
828 implvar = vars_xwy[implvarpos];
841 coefs[binvarpos] = binval ? globbnd - implbnd : implbnd - globbnd;
842 coefs[implvarpos] = 1.0;
843 *side = binval ? globbnd : implbnd;
845 SCIPdebugMsg(
scip,
"Got an implied relation with binpos = %d, implpos = %d, implbnd = %g, "
846 "bnd type = %s, binval = %u, glbbnd = %g\n", binvarpos, implvarpos, implbnd,
878 assert(binvarpos != implvarpos);
881 binvar = vars_xwy[binvarpos];
882 implvar = vars_xwy[implvarpos];
891 for(
i = 0;
i < (binvarpos == 0 ? 1 : 2); ++
i )
943 var1 = vars_xwy[varpos1];
944 var2 = vars_xwy[varpos2];
951 imax = (varpos1 == 0 || varpos2 == 0) ? 1 : 2;
956 for(
i = 0;
i < imax; ++
i )
964 coefs2[varpos1] = binvals[
i] ? 1.0 : -1.0;
965 coefs2[varpos2] = 1.0;
966 side2 = binvals[
i] ? 1.0 : 0.0;
978 coefs2[varpos1] = binvals[
i] ? 1.0 : -1.0;
979 coefs2[varpos2] = -1.0;
980 side2 = binvals[
i] ? 0.0 : -1.0;
1025 var1 = vars_xwy[varpos1];
1026 var2 = vars_xwy[varpos2];
1041 hashdata.
vars[pos1] = var1;
1042 hashdata.
vars[pos2] = var2;
1046 if( foundhashdata !=
NULL )
1121 for(
r = 0;
r < nrows; ++
r )
1144 searchhashdata.
nvars = 2;
1152 if( elementhashdata !=
NULL )
1155 row_list[
r] = elementhashdata->
firstrow;
1157 ++elementhashdata->
nrows;
1164 elementhashdata->
nvars = 2;
1165 elementhashdata->
nrows = 1;
1166 elementhashdata->
vars[0] = searchhashdata.
vars[0];
1167 elementhashdata->
vars[1] = searchhashdata.
vars[1];
1189 searchhashdata.
nvars = 3;
1198 if( elementhashdata !=
NULL )
1201 row_list[
r] = elementhashdata->
firstrow;
1203 ++elementhashdata->
nrows;
1210 elementhashdata->
nvars = 3;
1211 elementhashdata->
nrows = 1;
1212 elementhashdata->
vars[0] = searchhashdata.
vars[0];
1213 elementhashdata->
vars[1] = searchhashdata.
vars[1];
1214 elementhashdata->
vars[2] = searchhashdata.
vars[2];
1273 hashdataKeyEqConss, hashdataKeyValConss,
NULL) );
1275 hashdataKeyEqConss, hashdataKeyValConss,
NULL) );
1292 if( foundhashdata ==
NULL )
1302 for( xpos = 0; xpos < 3; ++xpos )
1305 vars_xwy[0] = foundhashdata->
vars[xpos];
1312 for( f = 0; f <= 1; ++f )
1317 for( r1 = foundhashdata->
firstrow; r1 != -1; r1 = row_list[r1] )
1320 row1 = prob_rows[r1];
1331 if( (!xfixing && coefs1[0] > 0.0) || (xfixing && coefs1[0] < 0.0) )
1348 for( permwy = 1; permwy <= 2; ++permwy )
1350 wpos = (xpos + permwy) % 3;
1351 ypos = (xpos - permwy + 3) % 3;
1352 vars_xwy[1] = foundhashdata->
vars[wpos];
1353 vars_xwy[2] = foundhashdata->
vars[ypos];
1367 for( r2 = row_list[r1]; r2 != -1; r2 = row_list[r2] )
1370 row2 = prob_rows[r2];
1382 if( (!xfixing && coefs2[0] > 0.0) || (xfixing && coefs2[0] < 0.0) )
1400 sidetype2, varmap, xfixing) );
1464 vars_xwy, side1, sidetype1, 1, 2, varmap, xfixing) );
1482 for( f = 0; f <= 1; ++f )
1520 if( vars_xwy[2] == vars_xwy[0] )
1536 if( vars_xwy[2] == vars_xwy[0] )
1547 relatedvars =
getAdjacentVars(vars_in_2rels, vars_xwy[1], &nrelatedvars);
1548 if( relatedvars ==
NULL )
1551 for( r2 = 0; r2 < nrelatedvars; ++r2 )
1553 vars_xwy[2] = relatedvars[r2];
1556 vars_xwy, side1, sidetype1, 1, 2, varmap, xfixing) );
1570 if( foundhashdata ==
NULL )
1636 assert(bilinterms[
i].nlockspos + bilinterms[
i].nlocksneg > 0);
1639 if( bilinterms[
i].aux.
var ==
NULL )
1649 bilinterms[
i].nlockspos + bilinterms[
i].nlocksneg) );
1654 int oldnterms =
sepadata->nbilinterms;
1663 if(
sepadata->nbilinterms > oldnterms )
1684 for( j = 0; j < bilinterms[
i].
nauxexprs; ++j )
1730 int* bestunderestimators,
1731 int* bestoverestimators
1756 bestunderestimators[j] = -1;
1757 bestoverestimators[j] = -1;
1763 prodviol = auxval - prodval;
1767 viol_below = prodviol;
1768 bestunderestimators[j] =
i;
1772 viol_above = -prodviol;
1773 bestoverestimators[j] =
i;
1787 int* currentnunknown,
1798 *currentnunknown = 0;
1808 ++(*currentnunknown);
1815 ++(*currentnunknown);
1819 *acceptable =
sepadata->maxunknownterms < 0 || *currentnunknown <=
sepadata->maxunknownterms;
1847 *coefaux += auxexpr->
coefs[0] * coef;
1854 *coef1 += auxexpr->
coefs[1] * coef;
1855 *coef2 += auxexpr->
coefs[2] * coef;
1859 *coef1 += auxexpr->
coefs[2] * coef;
1860 *coef2 += auxexpr->
coefs[1] * coef;
1862 *
cst += coef * auxexpr->
cst;
1917 signfactor = (uselb ? 1.0 : -1.0);
1918 boundfactor = (uselb ? -lbvar : ubvar);
1920 coefterm = coef * signfactor;
1921 coefcolvar = coef * boundfactor;
1933 if( idx >= 0 && terms[idx].nauxexprs > 0 )
1941 else if( (uselhs && coefterm > 0.0) || (!uselhs && coefterm < 0.0) )
1944 auxpos = bestoverest[idx];
1949 auxpos = bestunderest[idx];
1958 SCIPdebugMsg(
scip,
"auxiliary expression for <%s> and <%s> found, will be added to cut:\n",
1964 else if( idx >= 0 && terms[idx].nauxexprs == 0 && terms[idx].aux.
var !=
NULL )
1966 SCIPdebugMsg(
scip,
"auxvar for <%s> and <%s> found, will be added to cut:\n",
1968 coefauxvar += coefterm;
1969 auxvar = terms[idx].
aux.
var;
1973 else if( colvar !=
var )
2004 found_clique =
TRUE;
2010 *coefvar += coefterm;
2011 found_clique =
TRUE;
2025 coefcolvar += coefterm;
2026 found_clique =
TRUE;
2032 *coefvar += coefterm;
2033 coefcolvar += coefterm;
2035 found_clique =
TRUE;
2046 ubcolvar, refpointcolvar, uselhs, coefvar, &coefcolvar,
cst, success);
2062 *coefvar += coefterm;
2067 if( (uselhs && coefterm > 0.0) || (!uselhs && coefterm < 0.0) )
2095 *coefvar += coefcolvar;
2141 const char* rowname;
2173 consside = uselhs ?
lhs :
rhs;
2179 SCIPdebugMsg(
scip,
"cut generation for %srow <%s>, %s, and variable <%s> with its %s %g not possible\n",
2180 useprojrow ?
"projected " :
"", rowname, uselhs ?
"lhs" :
"rhs",
SCIPvarGetName(
var),
2181 uselb ?
"lower bound" :
"upper bound", uselb ? lbvar : ubvar);
2197 signfactor = (uselb ? 1.0 : -1.0);
2198 boundfactor = (uselb ? -lbvar : ubvar);
2217 &coefvar, &cstterm, success) );
2227 coefvar += signfactor * (rowcst - consside);
2228 finalside = boundfactor * (consside - rowcst) - cstterm;
2236 if( uselhs || computeEqCut )
2240 if( !uselhs || computeEqCut )
2245 SCIPdebugMsg(
scip,
"%scut was generated successfully:\n", useprojrow ?
"projected " :
"");
2273 simplerow->
nnonz = 0;
2274 simplerow->
size = 0;
2297 if( simplerow->
nnonz + 1 > simplerow->
size )
2304 simplerow->
size = newsize;
2310 ++(simplerow->
nnonz);
2326 if( simplerow->
size > 0 )
2363 for(
i = 0;
i < nrows; ++
i )
2367 if( (*projrows)[
i].
nnonz > 0 )
2389 for(
i = 0;
i < nrows; ++
i )
2394 for( j = 0; j < projrows[
i].
nnonz; ++j )
2398 if( projrows[
i].
coefs[j] < 0 )
2403 if( projrows[
i].
coefs[j] < 0 )
2409 if( projrows[
i].
coefs[j] != 1.0 )
2413 if( projrows[
i].
cst > 0 )
2415 else if( projrows[
i].
cst < 0 )
2435 for(
i = 0;
i < nrows; ++
i )
2455 unsigned int* row_marks,
2459 unsigned int newmark;
2465 if( (
a > 0.0 && violatedbelow) || (
a < 0.0 && violatedabove) )
2476 row_marks[pos] |= newmark;
2483 for(
i = *nmarked;
i > pos; --
i )
2485 row_idcs[
i] = row_idcs[
i-1];
2486 row_marks[
i] = row_marks[
i-1];
2488 row_idcs[pos] = ridx;
2489 row_marks[pos] = newmark;
2506 unsigned int* row_marks,
2553 for(
i = 0;
i < nbilinadjvars; ++
i )
2555 xi = bilinadjvars[
i];
2580 if( bestunderest ==
NULL || bestunderest[idx] == -1 )
2582 if( terms[idx].nauxexprs == 0 && terms[idx].aux.
var !=
NULL )
2584 assert(terms[idx].existing);
2590 violatedbelow =
FALSE;
2595 assert(bestunderest[idx] >= 0 && bestunderest[idx] < terms[idx].nauxexprs);
2599 terms[idx].aux.
exprs[bestunderest[idx]],
sol) - valj * vali));
2600 violatedbelow =
TRUE;
2603 if( bestoverest ==
NULL || bestoverest[idx] == -1 )
2605 if( terms[idx].nauxexprs == 0 && terms[idx].aux.
var !=
NULL )
2607 assert(terms[idx].existing);
2613 violatedabove =
FALSE;
2618 assert(bestoverest[idx] >= 0 && bestoverest[idx] < terms[idx].nauxexprs);
2622 terms[idx].aux.
exprs[bestoverest[idx]],
sol)));
2623 violatedabove =
TRUE;
2627 if( !violatedbelow && !violatedabove )
2642 for(
r = 0;
r < ncolrows; ++
r )
2654 addRowMark(ridx,
a, violatedbelow, violatedabove, row_idcs, row_marks, nmarked);
2668 int* bestunderestimators,
2669 int* bestoverestimators,
2696 assert(bestunderestimators !=
NULL && bestoverestimators !=
NULL);
2703 if( terms[
i].existing )
2706 assert(terms[
i].nauxexprs > 0);
2720 for( j = 0; j < 2; ++j )
2727 underestimate = j == 0;
2728 if( underestimate && bestoverestimators[
i] != -1 )
2729 auxexpr = terms[
i].
aux.
exprs[bestoverestimators[
i]];
2730 else if( !underestimate && bestunderestimators[
i] != -1 )
2731 auxexpr = terms[
i].
aux.
exprs[bestunderestimators[
i]];
2762 addAuxexprCoefs(terms[
i].
x, terms[
i].
y, auxexpr, -1.0, &auxcoef, &xcoef, &ycoef, &constant);
2766 &xcoef, &ycoef, &constant, &success);
2795 SCIPdebugMsg(
scip,
"\nMcCormick cut for hidden product <%s>*<%s> was created successfully, but is not violated",
2831 int* bestunderestimators,
2832 int* bestoverestimators,
2843 unsigned int* row_marks;
2873 bestoverestimators, row_marks, row_idcs, &nmarked) );
2875 assert(nmarked <= nrows);
2878 for(
r = 0;
r < nmarked; ++
r )
2881 int currentnunknown;
2909 buildeqcut = (currentnunknown == 0 && iseqrow);
2912 for( k = 0; k < 4; ++k )
2923 if( row_marks[
r] == 1 && uselb[k] == uselhs[k] )
2926 if( row_marks[
r] == 2 && uselb[k] != uselhs[k] )
2938 if( projrows[pos].
nnonz == 0 )
2943 bestoverestimators, xj, &success, uselb[k], uselhs[k], allowlocal, buildeqcut,
TRUE) );
2966 bestoverestimators, xj, &success, uselb[k], uselhs[k], allowlocal, buildeqcut,
FALSE) );
2979 if( ncuts + 1 > cutssize )
2992 SCIPdebugMsg(
scip,
"the generation of the cut failed or cut not violated and not added to cutpool\n");
3016 0.0, ncuts, 0,
sepadata->maxncuts == -1 ? ncuts :
sepadata->maxncuts, &nselectedcuts) );
3018 for(
i = 0;
i < ncuts; ++
i )
3022 if(
i < nselectedcuts )
3051 SCIPdebugMsg(
scip,
"exit separator because cut calculation is finished\n");
3159 SCIPdebugMsg(
scip,
"exit separator because round limit for this node is reached\n");
3175 SCIPdebugMsg(
scip,
"exit separator because there are no known bilinear terms\n");
3182 SCIPdebugMsg(
scip,
"exit separator because we are too close to terminating\n");
3189 SCIPdebugMsg(
scip,
"exit separator because there is no LP solution at hand\n");
3233 printProjRows(
scip, projrows, nrows,
NULL);
3244 int* bestunderestimators;
3245 int* bestoverestimators;
3261 allowlocal, bestunderestimators, bestoverestimators,
result) );
3321 "maximal number of rlt-cuts that are added per round (-1: unlimited)",
3325 "separating/" SEPA_NAME "/maxunknownterms",
3326 "maximal number of unknown bilinear terms a row is still used with (-1: unlimited)",
3331 "maximal number of variables used to compute rlt cuts (-1: unlimited)",
3336 "maximal number of separation rounds per node (-1: unlimited)",
3340 "separating/" SEPA_NAME "/maxroundsroot",
3341 "maximal number of separation rounds in the root node (-1: unlimited)",
3346 "if set to true, only equality rows are used for rlt cuts",
3350 "separating/" SEPA_NAME "/onlycontrows",
3351 "if set to true, only continuous rows are used for rlt cuts",
3355 "separating/" SEPA_NAME "/onlyoriginal",
3356 "if set to true, only original rows and variables are used",
3360 "separating/" SEPA_NAME "/useinsubscip",
3361 "if set to true, rlt is also used in sub-scips",
3365 "separating/" SEPA_NAME "/useprojection",
3366 "if set to true, projected rows are checked first",
3370 "separating/" SEPA_NAME "/detecthidden",
3371 "if set to true, hidden products are detected and separated by McCormick cuts",
3376 "whether RLT cuts (TRUE) or only McCormick inequalities (FALSE) should be added for hidden products",
3381 "if set to true, globally valid RLT cuts are added to the global cut pool",
3386 "threshold for score of cut relative to best score to be considered good, so that less strict filtering is applied",
3391 "threshold for score of cut relative to best score to be discarded",
3395 "separating/" SEPA_NAME "/objparalweight",
3396 "weight of objective parallelism in cut score calculation",
3400 "separating/" SEPA_NAME "/efficacyweight",
3401 "weight of efficacy in cut score calculation",
3405 "separating/" SEPA_NAME "/dircutoffdistweight",
3406 "weight of directed cutoff distance in cut score calculation",
3410 "separating/" SEPA_NAME "/goodmaxparall",
3411 "maximum parallelism for good cuts",
3416 "maximum parallelism for non-good cuts",
#define DEFAULT_EFFICACYWEIGHT
#define DEFAULT_MAXROUNDSROOT
#define DEFAULT_MAXROUNDS
constraint handler for nonlinear constraints specified by algebraic expressions
#define DEFAULT_OBJPARALWEIGHT
#define DEFAULT_DIRCUTOFFDISTWEIGHT
#define SCIP_STRINGEQ(name, reference, retcode)
#define SCIP_LONGINT_FORMAT
void SCIPaddSquareLinearization(SCIP *scip, SCIP_Real sqrcoef, SCIP_Real refpoint, SCIP_Bool isint, SCIP_Real *lincoef, SCIP_Real *linconstant, SCIP_Bool *success)
void SCIPaddSquareSecant(SCIP *scip, SCIP_Real sqrcoef, SCIP_Real lb, SCIP_Real ub, SCIP_Real *lincoef, SCIP_Real *linconstant, SCIP_Bool *success)
power and signed power expression handlers
SCIP_Real SCIPevalBilinAuxExprNonlinear(SCIP *scip, SCIP_VAR *x, SCIP_VAR *y, SCIP_CONSNONLINEAR_AUXEXPR *auxexpr, SCIP_SOL *sol)
SCIP_RETCODE SCIPinsertBilinearTermImplicitNonlinear(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_VAR *x, SCIP_VAR *y, SCIP_VAR *auxvar, SCIP_Real coefx, SCIP_Real coefy, SCIP_Real coefaux, SCIP_Real cst, SCIP_Bool overestimate)
int SCIPgetBilinTermIdxNonlinear(SCIP_CONSHDLR *conshdlr, SCIP_VAR *x, SCIP_VAR *y)
SCIP_CONSNONLINEAR_BILINTERM * SCIPgetBilinTermsNonlinear(SCIP_CONSHDLR *conshdlr)
int SCIPgetNBilinTermsNonlinear(SCIP_CONSHDLR *conshdlr)
struct SCIP_ConsNonlinear_BilinTerm SCIP_CONSNONLINEAR_BILINTERM
struct SCIP_ConsNonlinear_Auxexpr SCIP_CONSNONLINEAR_AUXEXPR
SCIP_RETCODE SCIPselectCutsHybrid(SCIP *scip, SCIP_ROW **cuts, SCIP_ROW **forcedcuts, SCIP_RANDNUMGEN *randnumgen, SCIP_Real goodscorefac, SCIP_Real badscorefac, SCIP_Real goodmaxparall, SCIP_Real maxparall, SCIP_Real dircutoffdistweight, SCIP_Real efficacyweight, SCIP_Real objparalweight, SCIP_Real intsupportweight, int ncuts, int nforcedcuts, int maxselectedcuts, int *nselectedcuts)
int SCIPgetSubscipDepth(SCIP *scip)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_CONS ** SCIPgetConss(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
int SCIPgetNConss(SCIP *scip)
SCIP_VAR ** SCIPgetVars(SCIP *scip)
int SCIPgetNBinVars(SCIP *scip)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void * SCIPhashmapEntryGetImage(SCIP_HASHMAPENTRY *entry)
int SCIPhashmapGetImageInt(SCIP_HASHMAP *hashmap, void *origin)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
int SCIPhashmapGetNEntries(SCIP_HASHMAP *hashmap)
SCIP_HASHMAPENTRY * SCIPhashmapGetEntry(SCIP_HASHMAP *hashmap, int entryidx)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapInsertInt(SCIP_HASHMAP *hashmap, void *origin, int image)
SCIP_RETCODE SCIPhashmapSetImageInt(SCIP_HASHMAP *hashmap, void *origin, int image)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
int SCIPhashtableGetNEntries(SCIP_HASHTABLE *hashtable)
#define SCIPhashFour(a, b, c, d)
void * SCIPhashtableGetEntry(SCIP_HASHTABLE *hashtable, int entryidx)
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)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPaddBilinMcCormick(SCIP *scip, SCIP_Real bilincoef, SCIP_Real lbx, SCIP_Real ubx, SCIP_Real refpointx, SCIP_Real lby, SCIP_Real uby, SCIP_Real refpointy, SCIP_Bool overestimate, SCIP_Real *lincoefx, SCIP_Real *lincoefy, SCIP_Real *linconstant, SCIP_Bool *success)
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)
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)
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)
void SCIPswapReals(SCIP_Real *value1, SCIP_Real *value2)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
SCIP_Bool SCIPcolIsIntegral(SCIP_COL *col)
int SCIPcolGetNNonz(SCIP_COL *col)
SCIP_Real * SCIPcolGetVals(SCIP_COL *col)
SCIP_ROW ** SCIPcolGetRows(SCIP_COL *col)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_RETCODE SCIPaddPoolCut(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
struct SCIP_Interval SCIP_INTERVAL
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
#define SCIPfreeCleanBufferArray(scip, ptr)
#define SCIPfreeBuffer(scip, ptr)
#define SCIPallocCleanBufferArray(scip, ptr, num)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
#define SCIPallocClearBlockMemory(scip, ptr)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIPensureBlockMemoryArray(scip, ptr, arraysizeptr, minsize)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPallocBuffer(scip, ptr)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBufferArrayNull(scip, ptr)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
SCIP_Bool SCIPinProbing(SCIP *scip)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
SCIP_RETCODE SCIPcacheRowExtensions(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPchgRowLhs(SCIP *scip, SCIP_ROW *row, SCIP_Real lhs)
SCIP_Real SCIPgetRowFeasibility(SCIP *scip, SCIP_ROW *row)
int SCIProwGetNNonz(SCIP_ROW *row)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
SCIP_RETCODE SCIPflushRowExtensions(SCIP *scip, SCIP_ROW *row)
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
const char * SCIProwGetName(SCIP_ROW *row)
SCIP_SEPA * SCIProwGetOriginSepa(SCIP_ROW *row)
SCIP_RETCODE SCIPreleaseRow(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)
int SCIProwGetIndex(SCIP_ROW *row)
SCIP_RETCODE SCIPchgRowRhs(SCIP *scip, SCIP_ROW *row, SCIP_Real rhs)
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
SCIP_Real * SCIProwGetVals(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)
SCIP_RETCODE SCIPsetSepaFree(SCIP *scip, SCIP_SEPA *sepa,)
const char * SCIPsepaGetName(SCIP_SEPA *sepa)
int SCIPsepaGetNCallsAtNode(SCIP_SEPA *sepa)
SCIP_RETCODE SCIPsetSepaExitsol(SCIP *scip, SCIP_SEPA *sepa,)
SCIP_SEPADATA * SCIPsepaGetData(SCIP_SEPA *sepa)
void SCIPsepaSetData(SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata)
SCIP_RETCODE SCIPsetSepaCopy(SCIP *scip, SCIP_SEPA *sepa,)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_Longint SCIPgetNLPs(SCIP *scip)
SCIP_Bool SCIPisRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGT(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 SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
int SCIPgetDepth(SCIP *scip)
int SCIPvarGetNVlbs(SCIP_VAR *var)
SCIP_COL * SCIPvarGetCol(SCIP_VAR *var)
SCIP_Real * SCIPvarGetVlbCoefs(SCIP_VAR *var)
int SCIPvarGetNImpls(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
void SCIPvarGetImplicVarBounds(SCIP_VAR *var, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_Real *lb, SCIP_Real *ub)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetImplVars(SCIP_VAR *var, SCIP_Bool varfixing)
int SCIPvarGetIndex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_Real * SCIPvarGetVlbConstants(SCIP_VAR *var)
int SCIPvarGetNVubs(SCIP_VAR *var)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIP_Real * SCIPvarGetImplBounds(SCIP_VAR *var, SCIP_Bool varfixing)
int SCIPvarGetNCliques(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Bool SCIPvarIsRelaxationOnly(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetVlbVars(SCIP_VAR *var)
SCIP_CLIQUE ** SCIPvarGetCliques(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
int SCIPvarCompare(SCIP_VAR *var1, SCIP_VAR *var2)
SCIP_Real * SCIPvarGetVubConstants(SCIP_VAR *var)
SCIP_VAR ** SCIPvarGetVubVars(SCIP_VAR *var)
SCIP_Bool SCIPvarsHaveCommonClique(SCIP_VAR *var1, SCIP_Bool value1, SCIP_VAR *var2, SCIP_Bool value2, SCIP_Bool regardimplics)
SCIP_Real * SCIPvarGetVubCoefs(SCIP_VAR *var)
SCIP_BOUNDTYPE * SCIPvarGetImplTypes(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
void SCIPselectDownIntPtr(int *intarray, void **ptrarray, int k, int len)
SCIP_RETCODE SCIPincludeSepaRlt(SCIP *scip)
SCIP_Bool SCIPsortedvecFindPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), void *val, int len, int *pos)
SCIP_Bool SCIPsortedvecFindInt(int *intarray, int val, int len, int *pos)
int SCIPsnprintf(char *t, int len, const char *s,...)
assert(minobj< SCIPgetCutoffbound(scip))
SCIP_Bool SCIPcliqueHasVar(SCIP_CLIQUE *clique, SCIP_VAR *var, SCIP_Bool value)
SCIP_ROW * SCIPconsGetRow(SCIP *scip, SCIP_CONS *cons)
bilinear nonlinear handler
public methods for LP management
#define SCIPstatisticMessage
#define SEPA_MAXBOUNDDIST
static SCIP_RETCODE extractProducts(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_VAR **vars_xwy, SCIP_Real *coefs1, SCIP_Real *coefs2, SCIP_Real d1, SCIP_Real d2, SCIP_SIDETYPE sidetype1, SCIP_SIDETYPE sidetype2, SCIP_HASHMAP *varmap, SCIP_Bool f)
static SCIP_RETCODE isAcceptableRow(SCIP_SEPADATA *sepadata, SCIP_ROW *row, SCIP_VAR *var, int *currentnunknown, SCIP_Bool *acceptable)
static SCIP_RETCODE separateMcCormickImplicit(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, SCIP_SOL *sol, int *bestunderestimators, int *bestoverestimators, SCIP_RESULT *result)
struct AdjacentVarData ADJACENTVARDATA
#define DEFAULT_GOODSCORE
#define DEFAULT_MAXUSEDVARS
static SCIP_VAR ** getAdjacentVars(SCIP_HASHMAP *adjvarmap, SCIP_VAR *var, int *nadjacentvars)
#define DEFAULT_USEPROJECTION
#define DEFAULT_DETECTHIDDEN
static SCIP_RETCODE detectProductsClique(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_Real *coefs1, SCIP_VAR **vars_xwy, SCIP_Real side1, SCIP_SIDETYPE sidetype1, int varpos1, int varpos2, SCIP_HASHMAP *varmap, SCIP_Bool f)
static void implBndToBigM(SCIP *scip, SCIP_VAR **vars_xwy, int binvarpos, int implvarpos, SCIP_BOUNDTYPE bndtype, SCIP_Bool binval, SCIP_Real implbnd, SCIP_Real *coefs, SCIP_Real *side)
#define DEFAULT_HIDDENRLT
static SCIP_RETCODE separateRltCuts(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, SCIP_CONSHDLR *conshdlr, SCIP_SOL *sol, SCIP_HASHMAP *row_to_pos, RLT_SIMPLEROW *projrows, SCIP_ROW **rows, int nrows, SCIP_Bool allowlocal, int *bestunderestimators, int *bestoverestimators, SCIP_RESULT *result)
#define DEFAULT_MAXPARALL
static void freeProjRow(SCIP *scip, RLT_SIMPLEROW *simplerow)
static SCIP_RETCODE addRltTerm(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_SOL *sol, int *bestunderest, int *bestoverest, SCIP_ROW *cut, SCIP_VAR *var, SCIP_VAR *colvar, SCIP_Real coef, SCIP_Bool uselb, SCIP_Bool uselhs, SCIP_Bool local, SCIP_Bool computeEqCut, SCIP_Real *coefvar, SCIP_Real *cst, SCIP_Bool *success)
static SCIP_RETCODE detectProductsImplbnd(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_Real *coefs1, SCIP_VAR **vars_xwy, SCIP_Real side1, SCIP_SIDETYPE sidetype1, int binvarpos, int implvarpos, SCIP_HASHMAP *varmap, SCIP_Bool f)
static SCIP_RETCODE getOriginalRows(SCIP *scip, SCIP_ROW ***rows, int *nrows)
#define DEFAULT_ONLYORIGINAL
struct RLT_SimpleRow RLT_SIMPLEROW
static SCIP_RETCODE fillRelationTables(SCIP *scip, SCIP_ROW **prob_rows, int nrows, SCIP_HASHTABLE *hashtable2, SCIP_HASHTABLE *hashtable3, SCIP_HASHMAP *vars_in_2rels, int *row_list)
static SCIP_RETCODE createProjRow(SCIP *scip, RLT_SIMPLEROW *simplerow, SCIP_ROW *row, SCIP_SOL *sol, SCIP_Bool local)
static SCIP_RETCODE createProjRows(SCIP *scip, SCIP_ROW **rows, int nrows, SCIP_SOL *sol, RLT_SIMPLEROW **projrows, SCIP_Bool local, SCIP_Bool *allcst)
static SCIP_RETCODE detectHiddenProducts(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_HASHMAP *varmap)
static SCIP_RETCODE markRowsXj(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_CONSHDLR *conshdlr, SCIP_SOL *sol, int j, SCIP_Bool local, SCIP_HASHMAP *row_to_pos, int *bestunderest, int *bestoverest, unsigned int *row_marks, int *row_idcs, int *nmarked)
static void addAuxexprCoefs(SCIP_VAR *var1, SCIP_VAR *var2, SCIP_CONSNONLINEAR_AUXEXPR *auxexpr, SCIP_Real coef, SCIP_Real *coefaux, SCIP_Real *coef1, SCIP_Real *coef2, SCIP_Real *cst)
#define DEFAULT_USEINSUBSCIP
static SCIP_RETCODE computeRltCut(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, SCIP_ROW **cut, SCIP_ROW *row, RLT_SIMPLEROW *projrow, SCIP_SOL *sol, int *bestunderest, int *bestoverest, SCIP_VAR *var, SCIP_Bool *success, SCIP_Bool uselb, SCIP_Bool uselhs, SCIP_Bool local, SCIP_Bool computeEqCut, SCIP_Bool useprojrow)
#define DEFAULT_ADDTOPOOL
static SCIP_RETCODE createSepaData(SCIP *scip, SCIP_SEPADATA *sepadata)
#define DEFAULT_GOODMAXPARALL
static void clearVarAdjacency(SCIP *scip, SCIP_HASHMAP *adjvarmap)
static SCIP_RETCODE freeSepaData(SCIP *scip, SCIP_SEPADATA *sepadata)
static SCIP_RETCODE storeSuitableRows(SCIP *scip, SCIP_SEPA *sepa, SCIP_SEPADATA *sepadata, SCIP_ROW **prob_rows, SCIP_ROW **rows, int *nrows, SCIP_HASHMAP *row_to_pos, SCIP_Bool allowlocal)
static SCIP_RETCODE addProductVars(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_VAR *x, SCIP_VAR *y, SCIP_HASHMAP *varmap, int nlocks)
#define DEFAULT_MAXUNKNOWNTERMS
static SCIP_RETCODE addAdjacentVars(SCIP *scip, SCIP_HASHMAP *adjvarmap, SCIP_VAR **vars)
static SCIP_RETCODE detectProductsUnconditional(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_ROW **rows, int *row_list, SCIP_HASHTABLE *hashtable, SCIP_Real *coefs1, SCIP_VAR **vars_xwy, SCIP_Real side1, SCIP_SIDETYPE sidetype1, int varpos1, int varpos2, SCIP_HASHMAP *varmap, SCIP_Bool f)
static void addRowMark(int ridx, SCIP_Real a, SCIP_Bool violatedbelow, SCIP_Bool violatedabove, int *row_idcs, unsigned int *row_marks, int *nmarked)
static void freeProjRows(SCIP *scip, RLT_SIMPLEROW **projrows, int nrows)
static SCIP_RETCODE ensureVarsSize(SCIP *scip, SCIP_SEPADATA *sepadata, int n)
#define DEFAULT_ONLYEQROWS
static void getBestEstimators(SCIP *scip, SCIP_SEPADATA *sepadata, SCIP_SOL *sol, int *bestunderestimators, int *bestoverestimators)
#define DEFAULT_ONLYCONTROWS
reformulation-linearization technique separator
SCIP_CONSNONLINEAR_AUXEXPR ** exprs
union SCIP_ConsNonlinear_BilinTerm::@055261256347130033265073212045155110332303333345 aux
struct SCIP_Cons SCIP_CONS
struct SCIP_Conshdlr SCIP_CONSHDLR
struct SCIP_Clique SCIP_CLIQUE
enum SCIP_BoundType SCIP_BOUNDTYPE
enum SCIP_SideType SCIP_SIDETYPE
struct SCIP_HashMap SCIP_HASHMAP
#define SCIP_DECL_HASHKEYEQ(x)
struct SCIP_HashMapEntry SCIP_HASHMAPENTRY
#define SCIP_DECL_HASHKEYVAL(x)
struct SCIP_HashTable SCIP_HASHTABLE
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE
struct SCIP_SepaData SCIP_SEPADATA
#define SCIP_DECL_SEPAEXECLP(x)
#define SCIP_DECL_SEPAFREE(x)
#define SCIP_DECL_SEPAEXITSOL(x)
struct SCIP_Sepa SCIP_SEPA
#define SCIP_DECL_SEPACOPY(x)