51#define SEPA_NAME "rlt"
52#define SEPA_DESC "reformulation-linearization-technique separator"
53#define SEPA_PRIORITY 10
55#define SEPA_MAXBOUNDDIST 1.0
57#define SEPA_USESSUBSCIP FALSE
58#define SEPA_DELAY FALSE
60#define DEFAULT_MAXUNKNOWNTERMS 0
61#define DEFAULT_MAXUSEDVARS 100
62#define DEFAULT_MAXNCUTS -1
63#define DEFAULT_MAXROUNDS 1
64#define DEFAULT_MAXROUNDSROOT 10
65#define DEFAULT_ONLYEQROWS FALSE
66#define DEFAULT_ONLYCONTROWS FALSE
67#define DEFAULT_ONLYORIGINAL TRUE
68#define DEFAULT_USEINSUBSCIP FALSE
69#define DEFAULT_USEPROJECTION FALSE
70#define DEFAULT_DETECTHIDDEN FALSE
71#define DEFAULT_HIDDENRLT FALSE
72#define DEFAULT_ADDTOPOOL TRUE
74#define DEFAULT_GOODSCORE 1.0
76#define DEFAULT_BADSCORE 0.5
77#define DEFAULT_OBJPARALWEIGHT 0.0
78#define DEFAULT_EFFICACYWEIGHT 1.0
79#define DEFAULT_DIRCUTOFFDISTWEIGHT 0.0
80#define DEFAULT_GOODMAXPARALL 0.1
81#define DEFAULT_MAXPARALL 0.1
83#define MAXVARBOUND 1e+5
115 SCIP_Bool isinitialround;
135 SCIP_Bool onlyeqrows;
136 SCIP_Bool onlycontrows;
137 SCIP_Bool onlyoriginal;
138 SCIP_Bool useinsubscip;
139 SCIP_Bool useprojection;
140 SCIP_Bool detecthidden;
148 SCIP_Real objparalweight;
149 SCIP_Real efficacyweight;
150 SCIP_Real dircutoffdistweight;
151 SCIP_Real goodmaxparall;
191 for( v = hashdata1->
nvars-1; v >= 0; --v )
194 if( hashdata1->
vars[v] != hashdata2->
vars[v] )
226 minidx =
MIN3(idx[0], idx[1], idx[2]);
227 maxidx =
MAX3(idx[0], idx[1], idx[2]);
228 if( idx[0] == maxidx )
229 mididx =
MAX(idx[1], idx[2]);
231 mididx =
MAX(idx[0],
MIN(idx[1], idx[2]));
234 assert(minidx <= mididx && mididx <= maxidx);
255 for( v1 = 0; v1 < 2; ++v1 )
263 if( adjacentvardata ==
NULL )
328 if( adjacentvardata ==
NULL )
431 for(
i = 0;
i < nconss; ++
i )
439 (*rows)[*nrows] = row;
469 for(
r = 0;
r < *nrows; ++
r )
474 if(
sepadata->onlyeqrows && !iseqrow )
506 rows[new_nrows] = prob_rows[
r];
527 if( n <= sepadata->sbilinvars )
582 if( xpos == INT_MAX )
593 assert(xpos >= 0 && xpos < sepadata->nbilinvars );
597 sepadata->varpriorities[xpos] += nlocks;
603 if( ypos == INT_MAX )
614 assert(ypos >= 0 && ypos < sepadata->nbilinvars);
618 sepadata->varpriorities[ypos] += nlocks;
692 SCIP_Bool overestimate;
695 SCIP_Real a1 = coefs1[0];
696 SCIP_Real b1 = coefs1[1];
697 SCIP_Real c1 = coefs1[2];
698 SCIP_Real a2 = coefs2[0];
699 SCIP_Real b2 = coefs2[1];
700 SCIP_Real c2 = coefs2[2];
710 assert(b1 != 0.0 || b2 != 0.0);
721 if( (b1 == 0.0 && c1 == 0.0) || (b2 == 0.0 && c2 == 0.0) )
725 if( a2 == 0.0 && b2 == 0.0 )
758 if( sidetype1 != sidetype2 )
764 SCIPdebugMsg(
scip,
"Ignoring a pair of linear relations because b1c2 = b2c1\n");
784 mult = 1/(b1*c2 - c1*b2);
789 SCIPdebugMsg(
scip,
"found suitable implied rels (w,x,y): %g<%s> + %g<%s> + %g<%s> <= %g\n", a1,
795 A = (b2*a1 - d1*b2 + d2*b1)*mult;
829 assert(binvarpos != implvarpos);
831 implvar = vars_xwy[implvarpos];
844 coefs[binvarpos] = binval ? globbnd - implbnd : implbnd - globbnd;
845 coefs[implvarpos] = 1.0;
846 *side = binval ? globbnd : implbnd;
848 SCIPdebugMsg(
scip,
"Got an implied relation with binpos = %d, implpos = %d, implbnd = %g, "
849 "bnd type = %s, binval = %u, glbbnd = %g\n", binvarpos, implvarpos, implbnd,
872 SCIP_Real coefs2[3] = { 0., 0., 0. };
879 SCIP_Bool binvals[2] = {!f, f};
881 assert(binvarpos != implvarpos);
884 binvar = vars_xwy[binvarpos];
885 implvar = vars_xwy[implvarpos];
894 for(
i = 0;
i < (binvarpos == 0 ? 1 : 2); ++
i )
938 SCIP_Real coefs2[3] = { 0., 0., 0. };
944 SCIP_Bool binvals[2] = {!f, f};
946 var1 = vars_xwy[varpos1];
947 var2 = vars_xwy[varpos2];
954 imax = (varpos1 == 0 || varpos2 == 0) ? 1 : 2;
959 for(
i = 0;
i < imax; ++
i )
967 coefs2[varpos1] = binvals[
i] ? 1.0 : -1.0;
968 coefs2[varpos2] = 1.0;
969 side2 = binvals[
i] ? 1.0 : 0.0;
981 coefs2[varpos1] = binvals[
i] ? 1.0 : -1.0;
982 coefs2[varpos2] = -1.0;
983 side2 = binvals[
i] ? 0.0 : -1.0;
1020 SCIP_Real coefs2[3] = { 0., 0., 0. };
1028 var1 = vars_xwy[varpos1];
1029 var2 = vars_xwy[varpos2];
1044 hashdata.
vars[pos1] = var1;
1045 hashdata.
vars[pos2] = var2;
1049 if( foundhashdata !=
NULL )
1124 for(
r = 0;
r < nrows; ++
r )
1147 searchhashdata.
nvars = 2;
1155 if( elementhashdata !=
NULL )
1158 row_list[
r] = elementhashdata->
firstrow;
1160 ++elementhashdata->
nrows;
1167 elementhashdata->
nvars = 2;
1168 elementhashdata->
nrows = 1;
1169 elementhashdata->
vars[0] = searchhashdata.
vars[0];
1170 elementhashdata->
vars[1] = searchhashdata.
vars[1];
1192 searchhashdata.
nvars = 3;
1201 if( elementhashdata !=
NULL )
1204 row_list[
r] = elementhashdata->
firstrow;
1206 ++elementhashdata->
nrows;
1213 elementhashdata->
nvars = 3;
1214 elementhashdata->
nrows = 1;
1215 elementhashdata->
vars[0] = searchhashdata.
vars[0];
1216 elementhashdata->
vars[1] = searchhashdata.
vars[1];
1217 elementhashdata->
vars[2] = searchhashdata.
vars[2];
1246 SCIP_Real coefs1[3];
1247 SCIP_Real coefs2[3];
1276 hashdataKeyEqConss, hashdataKeyValConss,
NULL) );
1278 hashdataKeyEqConss, hashdataKeyValConss,
NULL) );
1295 if( foundhashdata ==
NULL )
1305 for( xpos = 0; xpos < 3; ++xpos )
1308 vars_xwy[0] = foundhashdata->
vars[xpos];
1315 for( f = 0; f <= 1; ++f )
1320 for( r1 = foundhashdata->
firstrow; r1 != -1; r1 = row_list[r1] )
1323 row1 = prob_rows[r1];
1334 if( (!xfixing && coefs1[0] > 0.0) || (xfixing && coefs1[0] < 0.0) )
1351 for( permwy = 1; permwy <= 2; ++permwy )
1353 wpos = (xpos + permwy) % 3;
1354 ypos = (xpos - permwy + 3) % 3;
1355 vars_xwy[1] = foundhashdata->
vars[wpos];
1356 vars_xwy[2] = foundhashdata->
vars[ypos];
1370 for( r2 = row_list[r1]; r2 != -1; r2 = row_list[r2] )
1373 row2 = prob_rows[r2];
1385 if( (!xfixing && coefs2[0] > 0.0) || (xfixing && coefs2[0] < 0.0) )
1403 sidetype2, varmap, xfixing) );
1467 vars_xwy, side1, sidetype1, 1, 2, varmap, xfixing) );
1485 for( f = 0; f <= 1; ++f )
1523 if( vars_xwy[2] == vars_xwy[0] )
1539 if( vars_xwy[2] == vars_xwy[0] )
1550 relatedvars =
getAdjacentVars(vars_in_2rels, vars_xwy[1], &nrelatedvars);
1551 if( relatedvars ==
NULL )
1554 for( r2 = 0; r2 < nrelatedvars; ++r2 )
1556 vars_xwy[2] = relatedvars[r2];
1559 vars_xwy, side1, sidetype1, 1, 2, varmap, xfixing) );
1573 if( foundhashdata ==
NULL )
1639 assert(bilinterms[
i].nlockspos + bilinterms[
i].nlocksneg > 0);
1642 if( bilinterms[
i].aux.
var ==
NULL )
1652 bilinterms[
i].nlockspos + bilinterms[
i].nlocksneg) );
1657 int oldnterms =
sepadata->nbilinterms;
1666 if(
sepadata->nbilinterms > oldnterms )
1687 for( j = 0; j < bilinterms[
i].
nauxexprs; ++j )
1733 int* bestunderestimators,
1734 int* bestoverestimators
1740 SCIP_Real viol_below;
1741 SCIP_Real viol_above;
1759 bestunderestimators[j] = -1;
1760 bestoverestimators[j] = -1;
1766 prodviol = auxval - prodval;
1770 viol_below = prodviol;
1771 bestunderestimators[j] =
i;
1775 viol_above = -prodviol;
1776 bestoverestimators[j] =
i;
1790 int* currentnunknown,
1791 SCIP_Bool* acceptable
1801 *currentnunknown = 0;
1811 ++(*currentnunknown);
1818 ++(*currentnunknown);
1822 *acceptable =
sepadata->maxunknownterms < 0 || *currentnunknown <=
sepadata->maxunknownterms;
1850 *coefaux += auxexpr->
coefs[0] * coef;
1857 *coef1 += auxexpr->
coefs[1] * coef;
1858 *coef2 += auxexpr->
coefs[2] * coef;
1862 *coef1 += auxexpr->
coefs[2] * coef;
1863 *coef2 += auxexpr->
coefs[1] * coef;
1865 *
cst += coef * auxexpr->
cst;
1886 SCIP_Bool computeEqCut,
1894 SCIP_Real refpointvar;
1895 SCIP_Real signfactor;
1896 SCIP_Real boundfactor;
1897 SCIP_Real coefauxvar;
1898 SCIP_Real coefcolvar;
1920 signfactor = (uselb ? 1.0 : -1.0);
1921 boundfactor = (uselb ? -lbvar : ubvar);
1923 coefterm = coef * signfactor;
1924 coefcolvar = coef * boundfactor;
1936 if( idx >= 0 && terms[idx].nauxexprs > 0 )
1944 else if( (uselhs && coefterm > 0.0) || (!uselhs && coefterm < 0.0) )
1947 auxpos = bestoverest[idx];
1952 auxpos = bestunderest[idx];
1961 SCIPdebugMsg(
scip,
"auxiliary expression for <%s> and <%s> found, will be added to cut:\n",
1967 else if( idx >= 0 && terms[idx].nauxexprs == 0 && terms[idx].aux.
var !=
NULL )
1969 SCIPdebugMsg(
scip,
"auxvar for <%s> and <%s> found, will be added to cut:\n",
1971 coefauxvar += coefterm;
1972 auxvar = terms[idx].
aux.
var;
1976 else if( colvar !=
var )
1978 SCIP_Bool found_clique =
FALSE;
2007 found_clique =
TRUE;
2013 *coefvar += coefterm;
2014 found_clique =
TRUE;
2028 coefcolvar += coefterm;
2029 found_clique =
TRUE;
2035 *coefvar += coefterm;
2036 coefcolvar += coefterm;
2038 found_clique =
TRUE;
2049 ubcolvar, refpointcolvar, uselhs, coefvar, &coefcolvar,
cst, success);
2065 *coefvar += coefterm;
2070 if( (uselhs && coefterm > 0.0) || (!uselhs && coefterm < 0.0) )
2098 *coefvar += coefcolvar;
2128 SCIP_Bool computeEqCut,
2129 SCIP_Bool useprojrow
2132 SCIP_Real signfactor;
2133 SCIP_Real boundfactor;
2138 SCIP_Real finalside;
2144 const char* rowname;
2176 consside = uselhs ?
lhs :
rhs;
2182 SCIPdebugMsg(
scip,
"cut generation for %srow <%s>, %s, and variable <%s> with its %s %g not possible\n",
2183 useprojrow ?
"projected " :
"", rowname, uselhs ?
"lhs" :
"rhs",
SCIPvarGetName(
var),
2184 uselb ?
"lower bound" :
"upper bound", uselb ? lbvar : ubvar);
2200 signfactor = (uselb ? 1.0 : -1.0);
2201 boundfactor = (uselb ? -lbvar : ubvar);
2220 &coefvar, &cstterm, success) );
2230 coefvar += signfactor * (rowcst - consside);
2231 finalside = boundfactor * (consside - rowcst) - cstterm;
2239 if( uselhs || computeEqCut )
2243 if( !uselhs || computeEqCut )
2248 SCIPdebugMsg(
scip,
"%scut was generated successfully:\n", useprojrow ?
"projected " :
"");
2276 simplerow->
nnonz = 0;
2277 simplerow->
size = 0;
2300 if( simplerow->
nnonz + 1 > simplerow->
size )
2307 simplerow->
size = newsize;
2313 ++(simplerow->
nnonz);
2329 if( simplerow->
size > 0 )
2366 for(
i = 0;
i < nrows; ++
i )
2370 if( (*projrows)[
i].
nnonz > 0 )
2392 for(
i = 0;
i < nrows; ++
i )
2397 for( j = 0; j < projrows[
i].
nnonz; ++j )
2401 if( projrows[
i].
coefs[j] < 0 )
2406 if( projrows[
i].
coefs[j] < 0 )
2412 if( projrows[
i].
coefs[j] != 1.0 )
2416 if( projrows[
i].
cst > 0 )
2418 else if( projrows[
i].
cst < 0 )
2438 for(
i = 0;
i < nrows; ++
i )
2455 SCIP_Bool violatedbelow,
2456 SCIP_Bool violatedabove,
2458 unsigned int* row_marks,
2462 unsigned int newmark;
2468 if( (
a > 0.0 && violatedbelow) || (
a < 0.0 && violatedabove) )
2479 row_marks[pos] |= newmark;
2486 for(
i = *nmarked;
i > pos; --
i )
2488 row_idcs[
i] = row_idcs[
i-1];
2489 row_marks[
i] = row_marks[
i-1];
2491 row_idcs[pos] = ridx;
2492 row_marks[pos] = newmark;
2509 unsigned int* row_marks,
2530 SCIP_Bool violatedbelow;
2531 SCIP_Bool violatedabove;
2556 for(
i = 0;
i < nbilinadjvars; ++
i )
2558 xi = bilinadjvars[
i];
2583 if( bestunderest ==
NULL || bestunderest[idx] == -1 )
2585 if( terms[idx].nauxexprs == 0 && terms[idx].aux.
var !=
NULL )
2587 assert(terms[idx].existing);
2593 violatedbelow =
FALSE;
2598 assert(bestunderest[idx] >= 0 && bestunderest[idx] < terms[idx].nauxexprs);
2602 terms[idx].aux.
exprs[bestunderest[idx]],
sol) - valj * vali));
2603 violatedbelow =
TRUE;
2606 if( bestoverest ==
NULL || bestoverest[idx] == -1 )
2608 if( terms[idx].nauxexprs == 0 && terms[idx].aux.
var !=
NULL )
2610 assert(terms[idx].existing);
2616 violatedabove =
FALSE;
2621 assert(bestoverest[idx] >= 0 && bestoverest[idx] < terms[idx].nauxexprs);
2625 terms[idx].aux.
exprs[bestoverest[idx]],
sol)));
2626 violatedabove =
TRUE;
2630 if( !violatedbelow && !violatedabove )
2645 for(
r = 0;
r < ncolrows; ++
r )
2657 addRowMark(ridx,
a, violatedbelow, violatedabove, row_idcs, row_marks, nmarked);
2671 int* bestunderestimators,
2672 int* bestoverestimators,
2681 SCIP_Bool underestimate;
2689 SCIP_Real refpointx;
2690 SCIP_Real refpointy;
2694 SCIP_Real productval;
2699 assert(bestunderestimators !=
NULL && bestoverestimators !=
NULL);
2706 if( terms[
i].existing )
2709 assert(terms[
i].nauxexprs > 0);
2723 for( j = 0; j < 2; ++j )
2730 underestimate = j == 0;
2731 if( underestimate && bestoverestimators[
i] != -1 )
2732 auxexpr = terms[
i].
aux.
exprs[bestoverestimators[
i]];
2733 else if( !underestimate && bestunderestimators[
i] != -1 )
2734 auxexpr = terms[
i].
aux.
exprs[bestunderestimators[
i]];
2765 addAuxexprCoefs(terms[
i].
x, terms[
i].
y, auxexpr, -1.0, &auxcoef, &xcoef, &ycoef, &constant);
2769 &xcoef, &ycoef, &constant, &success);
2798 SCIPdebugMsg(
scip,
"\nMcCormick cut for hidden product <%s>*<%s> was created successfully, but is not violated",
2833 SCIP_Bool allowlocal,
2834 int* bestunderestimators,
2835 int* bestoverestimators,
2846 unsigned int* row_marks;
2853 SCIP_Bool infeasible;
2855 SCIP_Bool buildeqcut;
2876 bestoverestimators, row_marks, row_idcs, &nmarked) );
2878 assert(nmarked <= nrows);
2881 for(
r = 0;
r < nmarked; ++
r )
2884 int currentnunknown;
2912 buildeqcut = (currentnunknown == 0 && iseqrow);
2915 for( k = 0; k < 4; ++k )
2926 if( row_marks[
r] == 1 && uselb[k] == uselhs[k] )
2929 if( row_marks[
r] == 2 && uselb[k] != uselhs[k] )
2941 if( projrows[pos].
nnonz == 0 )
2946 bestoverestimators, xj, &success, uselb[k], uselhs[k], allowlocal, buildeqcut,
TRUE) );
2969 bestoverestimators, xj, &success, uselb[k], uselhs[k], allowlocal, buildeqcut,
FALSE) );
2982 if( ncuts + 1 > cutssize )
2995 SCIPdebugMsg(
scip,
"the generation of the cut failed or cut not violated and not added to cutpool\n");
3019 0.0, ncuts, 0,
sepadata->maxncuts == -1 ? ncuts :
sepadata->maxncuts, &nselectedcuts) );
3021 for(
i = 0;
i < ncuts; ++
i )
3025 if(
i < nselectedcuts )
3054 SCIPdebugMsg(
scip,
"exit separator because cut calculation is finished\n");
3161 SCIPdebugMsg(
scip,
"exit separator because round limit for this node is reached\n");
3177 SCIPdebugMsg(
scip,
"exit separator because there are no known bilinear terms\n");
3184 SCIPdebugMsg(
scip,
"exit separator because we are too close to terminating\n");
3191 SCIPdebugMsg(
scip,
"exit separator because there is no LP solution at hand\n");
3235 printProjRows(
scip, projrows, nrows,
NULL);
3246 int* bestunderestimators;
3247 int* bestoverestimators;
3263 allowlocal, bestunderestimators, bestoverestimators,
result) );
3323 "maximal number of rlt-cuts that are added per round (-1: unlimited)",
3327 "separating/" SEPA_NAME "/maxunknownterms",
3328 "maximal number of unknown bilinear terms a row is still used with (-1: unlimited)",
3333 "maximal number of variables used to compute rlt cuts (-1: unlimited)",
3338 "maximal number of separation rounds per node (-1: unlimited)",
3342 "separating/" SEPA_NAME "/maxroundsroot",
3343 "maximal number of separation rounds in the root node (-1: unlimited)",
3348 "if set to true, only equality rows are used for rlt cuts",
3352 "separating/" SEPA_NAME "/onlycontrows",
3353 "if set to true, only continuous rows are used for rlt cuts",
3357 "separating/" SEPA_NAME "/onlyoriginal",
3358 "if set to true, only original rows and variables are used",
3362 "separating/" SEPA_NAME "/useinsubscip",
3363 "if set to true, rlt is also used in sub-scips",
3367 "separating/" SEPA_NAME "/useprojection",
3368 "if set to true, projected rows are checked first",
3372 "separating/" SEPA_NAME "/detecthidden",
3373 "if set to true, hidden products are detected and separated by McCormick cuts",
3378 "whether RLT cuts (TRUE) or only McCormick inequalities (FALSE) should be added for hidden products",
3383 "if set to true, globally valid RLT cuts are added to the global cut pool",
3388 "threshold for score of cut relative to best score to be considered good, so that less strict filtering is applied",
3393 "threshold for score of cut relative to best score to be discarded",
3397 "separating/" SEPA_NAME "/objparalweight",
3398 "weight of objective parallelism in cut score calculation",
3402 "separating/" SEPA_NAME "/efficacyweight",
3403 "weight of efficacy in cut score calculation",
3407 "separating/" SEPA_NAME "/dircutoffdistweight",
3408 "weight of directed cutoff distance in cut score calculation",
3412 "separating/" SEPA_NAME "/goodmaxparall",
3413 "maximum parallelism for good cuts",
3418 "maximum parallelism for non-good cuts",
constraint handler for nonlinear constraints specified by algebraic expressions
#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)
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)
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)
#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
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
public methods for LP management
#define SCIPstatisticMessage
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)
#define DEFAULT_GOODSCORE
#define DEFAULT_MAXUSEDVARS
#define DEFAULT_EFFICACYWEIGHT
#define DEFAULT_OBJPARALWEIGHT
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)
#define DEFAULT_MAXROUNDSROOT
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
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
#define SEPA_MAXBOUNDDIST
static void clearVarAdjacency(SCIP *scip, SCIP_HASHMAP *adjvarmap)
#define DEFAULT_DIRCUTOFFDISTWEIGHT
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)
#define DEFAULT_MAXROUNDS
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
enum SCIP_BoundType SCIP_BOUNDTYPE
enum SCIP_SideType SCIP_SIDETYPE
#define SCIP_DECL_HASHKEYEQ(x)
#define SCIP_DECL_HASHKEYVAL(x)
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)
#define SCIP_DECL_SEPACOPY(x)