45#ifdef INTERCUTS_VERBOSE
50#define INTERLOG(x) if( SCIPgetSubscipDepth(scip) == 0 && SCIPgetVerbLevel(scip) >= SCIP_VERBLEVEL_NORMAL ) { x }
65#define NLHDLR_NAME "quadratic"
66#define NLHDLR_DESC "handler for quadratic expressions"
67#define NLHDLR_DETECTPRIORITY 1
68#define NLHDLR_ENFOPRIORITY 100
71#define TABLE_NAME_QUADRATIC "nlhdlr_quadratic"
72#define TABLE_DESC_QUADRATIC "quadratic nlhdlr statistics table"
73#define TABLE_POSITION_QUADRATIC 14700
74#define TABLE_EARLIEST_STAGE_QUADRATIC SCIP_STAGE_TRANSFORMED
77#define INTERCUTS_MINVIOL 1e-4
78#define DEFAULT_USEINTERCUTS FALSE
79#define DEFAULT_USESTRENGTH FALSE
80#define DEFAULT_USEMONOIDAL TRUE
81#define DEFAULT_USEMINREP TRUE
82#define DEFAULT_USEBOUNDS FALSE
83#define BINSEARCH_MAXITERS 120
84#define DEFAULT_NCUTSROOT 20
85#define DEFAULT_NCUTS 2
92struct SCIP_NlhdlrExprData
101 SCIP_Real minquadfiniteact;
103 SCIP_Real maxquadfiniteact;
105 int nneginfinityquadact;
106 int nposinfinityquadact;
109 SCIP_Longint activitiestag;
112 SCIP_Bool separating;
119struct SCIP_NlhdlrData
123 SCIP_Longint lastnodenumber;
127 SCIP_Bool useintersectioncuts;
128 SCIP_Bool usestrengthening;
129 SCIP_Bool usemonoidal;
131 SCIP_Bool useboundsasrays;
135 SCIP_Real mincutviolation;
136 SCIP_Real minviolation;
140 SCIP_Bool sparsifycuts;
141 SCIP_Bool ignorebadrayrestriction;
142 SCIP_Bool ignorehighre;
146 int ncouldimprovedcoef;
147 int nbadrayrestriction;
155 SCIP_Real densitysum;
156 SCIP_Real cutcoefsum;
157 SCIP_Real monoidalimprovementsum;
158 SCIP_Real efficacysum;
159 SCIP_Real currentavecutcoef;
160 SCIP_Real currentavemonoidalimprovement;
198 SCIPinfoMessage(
scip, file,
"Quadratic Nlhdlr : %10s %10s %10s %10s %10s %10s %10s %10s %10s %10s %20s %10s %10s %10s \n",
"GenCuts",
"AddCuts",
"CouldImpr",
"NLargeRE",
199 "AbrtBadRay",
"AbrtPosPhi",
"AbrtNonBas",
"NStrength",
"NMonoidal",
"AveCutcoef",
"AveMonoidalImprov",
"AveDensity",
"AveEfficacy",
"AveBCutsFrac");
210 SCIPinfoMessage(
scip, file,
" %10g", nlhdlrdata->ncutsgenerated > 0 ? nlhdlrdata->cutcoefsum / nlhdlrdata->ncutsgenerated : 0.0);
211 SCIPinfoMessage(
scip, file,
" %20g", (nlhdlrdata->nmonoidal > 0 && nlhdlrdata->trackmore) ? nlhdlrdata->monoidalimprovementsum / nlhdlrdata->nmonoidal : -1.0);
212 SCIPinfoMessage(
scip, file,
" %10g", nlhdlrdata->ncutsgenerated > 0 ? nlhdlrdata->densitysum / nlhdlrdata->ncutsgenerated : 0.0);
213 SCIPinfoMessage(
scip, file,
" %10g", nlhdlrdata->ncutsgenerated > 0 ? nlhdlrdata->efficacysum / nlhdlrdata->ncutsgenerated : 0.0);
214 SCIPinfoMessage(
scip, file,
" %10g", nlhdlrdata->ncalls > 0 ? nlhdlrdata->nboundcuts / nlhdlrdata->ncalls : 0.0);
237#ifdef DEBUG_INTERCUTS_NUMERICS
281#ifdef DEBUG_INTERCUTS_NUMERICS
311 for(
i = 0;
i < nnonz;
i++ )
336 for(
i = 0;
i < nrows; ++
i )
338 if( basisind[
i] >= 0 )
339 map[basisind[
i]] =
i;
352 SCIP_Bool* nozerostat
365 qexpr = nlhdlrexprdata->qexpr;
369 for(
i = 0;
i < nquadexprs; ++
i )
386 for(
i = 0;
i < nlinexprs; ++
i )
431 int* basicvarpos2tableaurow,
436 SCIP_Real* tableaurows
447 assert(nbasiccol < raylength);
460 assert(basicvarpos2tableaurow[lppos] >= 0);
466 for(
i = 0;
i < ncols; ++
i )
469 tableaurows[nbasiccol + nray * raylength] = binvarow[
i];
472 for( ;
i < ncols + nrows; ++
i )
475 tableaurows[nbasiccol + nray * raylength] = binvrow[
i - ncols];
500 SCIP_Real* tableaurows,
501 int* rayentry2conspos
509 int* basicvarpos2tableaurow;
524 for(
i = 0;
i < ncols; ++
i )
525 basicvarpos2tableaurow[
i] = -1;
528 qexpr = nlhdlrexprdata->qexpr;
533 for(
i = 0;
i < nquadexprs; ++
i )
544 rayentry2conspos[nrayentries] =
i;
549 for(
i = 0;
i < nlinexprs; ++
i )
557 rayentry2conspos[nrayentries] = nquadexprs +
i;
570 rayentry2conspos[nrayentries] = nquadexprs + nlinexprs;
574 assert(nrayentries == raylength);
576#ifdef DEBUG_INTERSECTIONCUT
577 for(
i = 0;
i < ncols; ++
i )
580 for(
int j = 0; j < raylength; ++j )
609 (*rays)->raysbegin[0] = 0;
633 (*rays)->raysbegin[0] = 0;
635 (*rays)->rayssize = size;
669 if(
rays->rayssize <= coefpos + 1 )
676 rays->rayssize = newsize;
680 rays->rays[coefpos] = coef;
681 rays->raysidx[coefpos] = coefidx;
705 qexpr = nlhdlrexprdata->qexpr;
709 for(
i = 0;
i < nquadexprs; ++
i )
718 for(
i = 0;
i < nlinexprs; ++
i )
721 map[lppos] = nquadexprs +
i;
727 map[lppos] = nquadexprs + nlinexprs;
738 SCIP_Real* densetableaucols,
739 int* rayentry2conspos,
752 for(
i = 0;
i < raylength; ++
i )
757 if( factor == 0.0 && !
SCIPisZero(
scip, densetableaucols[nray * raylength +
i]) )
763 coef = factor * densetableaucols[nray * raylength +
i];
775 if( conspos > -1 && conspos < rayentry2conspos[
i] )
780#ifdef DEBUG_INTERSECTIONCUT
801#ifdef DEBUG_INTERSECTIONCUT
810 rays->raysbegin[
rays->nrays + 1] = *nnonz;
812#ifdef DEBUG_INTERSECTIONCUT
814 for(
i =
rays->raysbegin[
rays->nrays];
i < *nnonz; ++
i )
867 SCIP_Real* densetableaucols;
871 int* rayentry2conspos;
888 SCIPdebugMsg(
scip,
"failed to store sparse rays: there is a var with base status zero\n");
897 densetableaucols, rayentry2conspos) );
901 for(
i = 0;
i < ncols; ++
i )
902 lppos2conspos[
i] = -1;
915 for(
i = 0;
i < ncols; ++
i )
917 int oldnnonz = nnonz;
936#ifdef DEBUG_INTERSECTIONCUT
937 SCIPinfoMessage(
scip,
NULL,
"looked at ray of var %s with basestat %d, it has %d nonzeros\n-----------------\n",
942#ifdef DEBUG_INTERSECTIONCUT
943 SCIPdebugMsg(
scip,
"nonzero ray associated with variable <%s> has base status zero -> abort storing rays\n",
950 assert(oldnnonz <= nnonz);
951 if( oldnnonz < nnonz )
961 for(
i = 0;
i < nrows; ++
i )
963 int oldnnonz = nnonz;
983#ifdef DEBUG_INTERSECTIONCUT
984 SCIPinfoMessage(
scip,
NULL,
"looked at ray of row %d, it has %d nonzeros\n-----------------\n",
i, nnonz - oldnnonz);
986 assert(oldnnonz <= nnonz);
987 if( oldnnonz < nnonz )
1062 SCIP_Real sidefactor,
1073 SCIP_Real* eigenvectors;
1074 SCIP_Real* eigenvalues;
1075 SCIP_Real* lincoefs;
1082 assert(sidefactor == 1.0 || sidefactor == -1.0);
1085 qexpr = nlhdlrexprdata->qexpr;
1092 if( nlhdlrexprdata->cons !=
NULL )
1096 constant = (sidefactor * constant);
1102 for(
i = 0;
i < nquadexprs; ++
i )
1108 offset =
i * nquadexprs;
1113 for( j = 0; j < nquadexprs; ++j )
1120 vdotb += (sidefactor * lincoef) * eigenvectors[offset + j];
1122#ifdef INTERCUT_MOREDEBUG
1123 printf(
"vdotb: offset %d, eigenvector %d = %g, lincoef quad %g\n", offset, j,
1124 eigenvectors[offset + j], lincoef);
1134 *kappa +=
SQR(vdotb) / (sidefactor * eigenvalues[
i]);
1139 for( j = 0; j < nquadexprs; ++j )
1140 wcoefs[j] += vdotb * eigenvectors[offset + j];
1142 *wzlp += vdotb * vdotzlp;
1154 for(
i = 0;
i < nlinexprs; ++
i )
1158 if( auxvar !=
NULL )
1163#ifdef DEBUG_INTERSECTIONCUT
1166 for(
i = 0;
i < nquadexprs; ++
i )
1178 SCIP_Real* eigenvec,
1180 SCIP_Real* raycoefs,
1189 for(
i = 0;
i < raynnonz; ++
i )
1192 if( rayidx[
i] >= nquadvars )
1195 retval += eigenvec[rayidx[
i]] * raycoefs[
i];
1208 SCIP_Real sidefactor,
1209 SCIP_Real* raycoefs,
1215 SCIP_Real* lincoefs;
1223#ifdef INTERCUT_MOREDEBUG
1224 printf(
"Computing w(ray) \n");
1227 start = raynnonz - 1;
1229 qexpr = nlhdlrexprdata->qexpr;
1233 if( rayidx[raynnonz - 1] == nquadexprs + nlinexprs )
1235#ifdef INTERCUT_MOREDEBUG
1236 printf(
"wray auxvar term %g \n", (sidefactor * -1.0) * raycoefs[raynnonz - 1]);
1238 retval += (sidefactor * -1.0) * raycoefs[raynnonz - 1];
1243 for(
i = start;
i >= 0; --
i )
1246 if( rayidx[
i] < nquadexprs )
1249#ifdef INTERCUT_MOREDEBUG
1250 printf(
"wray var in pos %d term %g:: lincoef %g raycoef %g\n", rayidx[
i], (sidefactor *
1251 lincoefs[rayidx[
i] - nquadexprs]) * raycoefs[
i], lincoefs[rayidx[
i] - nquadexprs] ,raycoefs[
i]);
1253 retval += (sidefactor * lincoefs[rayidx[
i] - nquadexprs]) * raycoefs[
i] ;
1266 SCIP_Real* raycoefs,
1275 SCIP_Real* eigenvectors;
1276 SCIP_Real* eigenvalues;
1279 qexpr = nlhdlrexprdata->qexpr;
1282 for(
i = 0;
i < nquadexprs; ++
i )
1290 offset =
i * nquadexprs;
1296 for( j = 0; j < nquadexprs; ++j )
1301 if( k < raynnonz && j == rayidx[k] )
1303 rayentry = raycoefs[k];
1309 vdotray += rayentry * eigenvectors[offset + j];
1310 vdotapex += apex[j] * eigenvectors[offset + j];
1314 vapex[
i] = vdotapex;
1334 SCIP_Real sidefactor,
1335 SCIP_Real* raycoefs,
1348 SCIP_Real* eigenvectors;
1349 SCIP_Real* eigenvalues;
1362 qexpr = nlhdlrexprdata->qexpr;
1365#ifdef DEBUG_INTERSECTIONCUT
1387 for(
i = 0;
i < nquadexprs; ++
i )
1392 eigval = sidefactor * eigenvalues[
i];
1397 dot = vzlp[
i] + vb[
i] / (2.0 * eigval);
1401 *d += eigval * dot * (vzlp[
i] - vapex[
i]);
1402 *e += eigval * dot * (vray[
i] + vapex[
i] + vb[
i] / (2.0 * eigval));
1403 norm += eigval *
SQR(dot);
1407 *
a -= eigval *
SQR(vzlp[
i] - vapex[
i]);
1408 *
b -= eigval * (vzlp[
i] - vapex[
i]) * (vray[
i] + vapex[
i] + vb[
i] / (2.0 * eigval));
1409 *
c -= eigval *
SQR(vray[
i] + vapex[
i] + vb[
i] / (2.0 * eigval));
1413 norm = sqrt(norm / kappa + 1.0);
1417 *d /= (kappa * norm);
1418 *e /= (kappa * norm);
1424 if( sqrt(*
c) - *e >= 0 )
1427 assert(sqrt(*
c) > 10e+15 || *e > 10e+15 || sqrt(*
c) - *e < 10e+9);
1429 INTERLOG(printf(
"Bad numerics: phi(0) >= 0\n"); )
1434#ifdef DEBUG_INTERSECTIONCUT
1435 SCIPinfoMessage(
scip,
NULL,
"Restriction yields case 2: a,b,c,d,e %g %g %g %g %g\n", coefs1234a[0], coefs1234a[1], coefs1234a[2],
1436 coefs1234a[3], coefs1234a[4]);
1467 SCIP_Real sidefactor,
1469 SCIP_Real* raycoefs,
1477 SCIP_Real* coefs1234a,
1479 SCIP_Real* coefscondition,
1485 SCIP_Real* eigenvectors;
1486 SCIP_Real* eigenvalues;
1497 qexpr = nlhdlrexprdata->qexpr;
1500#ifdef DEBUG_INTERSECTIONCUT
1503 for(
i = 0;
i < raynnonz; ++
i )
1531 for(
i = 0;
i < nquadexprs; ++
i )
1533 SCIP_Real dot = 0.0;
1538 if( wcoefs ==
NULL )
1543 dot = vzlp[
i] + vb[
i] / (2.0 * (sidefactor * eigenvalues[
i]));
1551 wray += vb[
i] * vdotray;
1552#ifdef INTERCUT_MOREDEBUG
1553 printf(
" wray += %g, vb[i] %g and vdotray %g\n", vb[
i] * vdotray,vb[
i],vdotray);
1556 else if( sidefactor * eigenvalues[
i] > 0 )
1559 *d += (sidefactor * eigenvalues[
i]) * dot * vdotray;
1560 *e += (sidefactor * eigenvalues[
i]) *
SQR( dot );
1562#ifdef INTERCUT_MOREDEBUG
1563 printf(
"Positive eigenvalue: computing D: v^T ray %g, v^T( zlp + b/theta ) %g and theta %g \n", vdotray, dot, (sidefactor * eigenvalues[
i]));
1569 *
a -= (sidefactor * eigenvalues[
i]) *
SQR( vdotray );
1570 *
b -= 2.0 * (sidefactor * eigenvalues[
i]) * dot * vdotray;
1571 *
c -= (sidefactor * eigenvalues[
i]) *
SQR( dot );
1573#ifdef INTERCUT_MOREDEBUG
1574 printf(
"Negative eigenvalue: computing A: v^T ray %g, and theta %g \n", vdotray, (sidefactor * eigenvalues[
i]));
1582 *e +=
MAX(kappa, 0.0);
1583 *
c -=
MIN(kappa, 0.0);
1596 if( sqrt(*
c) - *e >= 0 )
1599 assert(sqrt(*
c) > 10e+15 || *e > 10e+15 || sqrt(*
c) - *e < 10e+9);
1601 INTERLOG(printf(
"Bad numerics: phi(0) >= 0\n"); )
1612 norm = sqrt(1.0 +
SQR( kappa ));
1613 xextra = wzlp + kappa + norm;
1614 yextra = wzlp + kappa - norm;
1617 wray +=
computeWRayLinear(nlhdlrexprdata, sidefactor, raycoefs, rayidx, raynnonz);
1623 coefs4b[0] = (*a) * (*e);
1624 coefs4b[1] = (*b) * (*e);
1625 coefs4b[2] = (*c) * (*e);
1629 coefs4b[4] = (*e) + xextra / 2.0;
1639 coefs4b[3] = *d / sqrt(*e);
1640 coefs4b[4] = sqrt(*e) + (xextra / (2.0 * sqrt(*e)));
1647 *
a +=
SQR( wray ) / (4.0 * norm);
1648 *
b += 2.0 * yextra * (wray) / (4.0 * norm);
1649 *
c +=
SQR( yextra ) / (4.0 * norm);
1652 *e +=
SQR( xextra ) / (4.0 * norm);
1655 *d += xextra * (wray) / (4.0 * norm);
1663 coefscondition[0] = - xextra / (*e);
1664 coefscondition[1] = wray;
1665 coefscondition[2] = yextra;
1668#ifdef DEBUG_INTERSECTIONCUT
1671 SCIPinfoMessage(
scip,
NULL,
"Restriction yields case 1,2 or 3: a,b,c,d,e %g %g %g %g %g\n", coefs1234a[0], coefs1234a[1], coefs1234a[2],
1672 coefs1234a[3], coefs1234a[4]);
1677 coefs1234a[1], coefs1234a[2], coefs1234a[3], coefs1234a[4]);
1678 SCIPinfoMessage(
scip,
NULL,
" Case 4b: a,b,c,d,e %g %g %g %g %g\n", coefs4b[0], coefs4b[1], coefs4b[2],
1679 coefs4b[3], coefs4b[4]);
1681 coefscondition[1], coefscondition[2]);
1710#ifdef INTERCUTS_DBLDBL
1711 SCIP_Real
QUAD(lin);
1712 SCIP_Real
QUAD(disc);
1713 SCIP_Real
QUAD(tmp);
1714 SCIP_Real
QUAD(root);
1751 return sqrt(
a * t * t +
b * t +
c) - ( d * t + e );
1768 SCIP_Real* coefscondition
1772 return (coefscondition[0] * sqrt(coefs4a[0] *
SQR( tsol ) + coefs4a[1] * tsol + coefs4a[2]) + coefscondition[1] *
1773 tsol + coefscondition[2]) <= 0.0;
1789 SCIP_Real ub = *
sol;
1797 curr = (lb + ub) / 2.0;
1799#ifdef INTERCUT_MOREDEBUG
1800 printf(
"%d: lb,ub %.10f, %.10f. curr = %g -> phi at curr %g -> phi at lb %g \n",
i, lb, ub, curr, phival,
evalPhiAtRay(lb,
a,
b,
c, d, e));
1831 SCIP_Real
a = coefs[0];
1832 SCIP_Real
b = coefs[1];
1833 SCIP_Real
c = coefs[2];
1834 SCIP_Real d = coefs[3];
1835 SCIP_Real e = coefs[4];
1853 e, -(
c - e * e), bounds);
1858#ifdef INTERCUT_MOREDEBUG
1863 printf(
"got root %g: with binsearch get %g\n",
sol, binsol);
1874#ifdef INTERCUT_MOREDEBUG
1875 printf(
"interval solution returned %g -> phival = %g, believe it\n",
sol,
evalPhiAtRay(
sol,
a,
b,
c, d, e));
1876 printf(
"don't do bin search\n");
1883#ifdef INTERCUT_MOREDEBUG
1927 SCIP_Real* coefs1234a,
1929 SCIP_Real* coefscondition
1937#ifdef DEBUG_INTERSECTIONCUT
1947#ifdef DEBUG_INTERSECTIONCUT
1964 if(
isCase4a(sol1234a, coefs1234a, coefscondition) )
1967#ifdef DEBUG_INTERSECTIONCUT
1981 if( sol4b < sol1234a &&
evalPhiAtRay(1.1 * sol1234a, coefs4b[0], coefs4b[1], coefs4b[2], coefs4b[3], coefs4b[4]) <=
1983 nlhdlrdata->ncouldimprovedcoef++;
1985 return MAX(sol1234a, sol4b);
1993 SCIP_Real* coefs1234a,
2005 if( sqrt(coefs1234a[2]) - coefs1234a[4] >= 0.0 )
2007 INTERLOG(printf(
"Bad numerics: phi(0) >= 0\n"); )
2008 nlhdlrdata->nphinonneg++;
2013 if( nlhdlrdata->ignorebadrayrestriction )
2017 for( j = 0; j < 3; ++j )
2021 absval =
REALABS(coefs1234a[j]);
2024 if( absval != 0.0 && absval < min )
2030 INTERLOG(printf(
"Bad numerics 1 2 3 or 4a: max(A,B,C)/min(A,B,C) is too large (%g)\n", max / min); )
2031 nlhdlrdata->nbadrayrestriction++;
2040 for( j = 0; j < 3; ++j )
2044 absval =
ABS(coefs4b[j]);
2047 if( absval != 0.0 && absval < min )
2053 INTERLOG(printf(
"Bad numeric 4b: max(A,B,C)/min(A,B,C) is too large (%g)\n", max / min); )
2054 nlhdlrdata->nbadrayrestriction++;
2079 SCIP_Real sidefactor,
2087 SCIP_Real* eigenvectors;
2088 SCIP_Real* eigenvalues;
2091 qexpr = nlhdlrexprdata->qexpr;
2097 for(
i = 0;
i < nquadexprs; ++
i )
2104 dot = vray[
i] + vapex[
i] + vb[
i] / (2.0 * sidefactor * eigenvalues[
i]);
2106 *
a += sidefactor * eigenvalues[
i] *
SQR(vzlp[
i] - vapex[
i]);
2107 *
b += sidefactor * eigenvalues[
i] * (vzlp[
i] - vapex[
i]) * dot;
2108 *
c += sidefactor * eigenvalues[
i] *
SQR(dot);
2128 SCIP_Real sidefactor,
2134 SCIP_Real* eigenvectors;
2135 SCIP_Real* eigenvalues;
2140 qexpr = nlhdlrexprdata->qexpr;
2145 for(
i = 0;
i < nquadexprs; ++
i )
2149 if( sidefactor * eigenvalues[
i] <= 0.0 )
2152 dot = vzlp[
i] + vb[
i] / (2.0 * sidefactor * eigenvalues[
i]);
2154 num += sidefactor * eigenvalues[
i] * dot * (cutcoef * (vzlp[
i] - vapex[
i]) + vray[
i] + vapex[
i]);
2155 denom += sidefactor * eigenvalues[
i] *
SQR(dot);
2165 return num / denom < 1;
2215 SCIP_Real lastposval;
2216 SCIP_Real lastpossol;
2219 lb = -
b / (2.0 *
a);
2227 sol = (ub + lb) / 2.0;
2236 if( val > 0.0 && val < 1e-6 )
2239 if( val > 0.0 && lastposval > val )
2266 SCIP_Real sidefactor,
2273 SCIP_Real* eigenvectors;
2274 SCIP_Real* eigenvalues;
2277 qexpr = nlhdlrexprdata->qexpr;
2282 for(
i = 0;
i < nquadexprs; ++
i )
2292 for( j = 0; j < nquadexprs; ++j )
2294 if( sidefactor * eigenvalues[j] == 0.0 )
2297 entry -= eigenvectors[j * nquadexprs +
i] * vb[j] / (2.0 * sidefactor * eigenvalues[j]);
2299 if( sidefactor * eigenvalues[j] > 0.0 )
2303 dot = vzlp[j] + vb[j] / (2.0 * sidefactor * eigenvalues[j]);
2305 num += eigenvectors[j * nquadexprs +
i] * dot;
2306 denom += sidefactor * eigenvalues[j] *
SQR(dot);
2319 entry += num / denom;
2331 SCIP_Real* raycoefs,
2339 SCIP_Real sidefactor,
2375 sidefactor, &
a, &
b, &
c) );
2378 if(
SQR(
b) - (4 *
a *
c) >= 0.0 )
2384 *cutcoef =
MAX(*cutcoef, 0.0);
2387 if( !
isRayInStrip(nlhdlrexprdata, vb, vzlp, vapex, vray, kappa, sidefactor, *cutcoef) )
2460 SCIP_Real sidefactor,
2468 SCIP_Real* interpoints,
2477 SCIP_Real avecutcoefsum;
2478 SCIP_Real avemonoidalimprovsum;
2479 int monoidalcounter;
2482 SCIP_Bool usemonoidal;
2483 SCIP_Bool monoidalwasused;
2489 case2 = wcoefs ==
NULL && kappa > 0.0;
2490 monoidalwasused =
FALSE;
2493 monoidalcounter = 0;
2494 avecutcoefsum = 0.0;
2495 avemonoidalimprovsum = 0.0;
2507 computeApex(nlhdlrexprdata, vb, vzlp, kappa, sidefactor, apex, success);
2518 usemonoidal = nlhdlrdata->usemonoidal && case2;
2521 for(
i = 0;
i <
rays->nrays; ++
i )
2523 SCIP_Real interpoint;
2526 SCIP_Real coefs1234a[5];
2527 SCIP_Real coefs4b[5];
2528 SCIP_Real coefscondition[3];
2529 SCIP_Bool monoidalsuccess;
2531 monoidalsuccess =
FALSE;
2538 &
rays->raysidx[
rays->raysbegin[
i]],
rays->raysbegin[
i + 1] -
rays->raysbegin[
i], vb, vzlp, wcoefs, kappa,
2539 apex, sidefactor, &cutcoef, &monoidalsuccess) );
2543 if( usemonoidal && ! monoidalwasused && monoidalsuccess )
2544 monoidalwasused =
TRUE;
2547 if( ! usemonoidal || ! monoidalsuccess || nlhdlrdata->trackmore )
2552 rays->raysbegin[
i], vb, vzlp, wcoefs, wzlp, kappa, coefs1234a, coefs4b, coefscondition, success) );
2566#ifdef DEBUG_INTERSECTIONCUT
2571 if( interpoints !=
NULL )
2572 interpoints[
i] = interpoint;
2576 if( nlhdlrdata->trackmore && monoidalsuccess )
2578 SCIP_Real normalcutcoef;
2583 avemonoidalimprovsum += cutcoef / normalcutcoef;
2592 if( cutcoef == 0.0 && case2 && nlhdlrdata->useminrep )
2597 rays->raysbegin[
i], vb, vzlp, kappa, apex, coefs1234a, success) );
2608 coefs1234a[1] *= -1.0;
2609 coefs1234a[3] *= -1.0;
2620 avecutcoefsum += cutcoef;
2624 lppos =
rays->lpposray[
i];
2639 INTERLOG(printf(
"Bad numeric: now not nonbasic enough\n");)
2640 nlhdlrdata->nbadnonbasic++;
2646 if( ! nlhdlrdata->useboundsasrays )
2659 cutcoef =
rays->rays[
i] == -1 ? -cutcoef : cutcoef;
2668 nlhdlrdata->currentavecutcoef = avecutcoefsum / counter;
2669 if( monoidalwasused )
2670 nlhdlrdata->nmonoidal += 1;
2671 if( monoidalcounter > 0 )
2672 nlhdlrdata->currentavemonoidalimprovement = avemonoidalimprovsum / monoidalcounter;
2683 SCIP_Real* raycoefs1,
2686 SCIP_Real* raycoefs2,
2689 SCIP_Real* newraycoefs,
2703 while( idx1 < raynnonz1 || idx2 < raynnonz2 )
2708 if( idx1 >= raynnonz1 || (idx2 < raynnonz2 && rayidx1[idx1] > rayidx2[idx2]) )
2711 newraycoefs[*newraynnonz] = - coef2 * raycoefs2[idx2];
2712 newrayidx[*newraynnonz] = rayidx2[idx2];
2716 else if( idx2 >= raynnonz2 || rayidx1[idx1] < rayidx2[idx2] )
2719 newraycoefs[*newraynnonz] = coef1 * raycoefs1[idx1];
2720 newrayidx[*newraynnonz] = rayidx1[idx1];
2725 else if( rayidx1[idx1] == rayidx2[idx2] )
2728 newraycoefs[*newraynnonz] = coef1 * raycoefs1[idx1] - coef2 * raycoefs2[idx2];
2729 newrayidx[*newraynnonz] = rayidx1[idx1];
2741 SCIP_Real* raycoefs1,
2744 SCIP_Real* raycoefs2,
2754 if( raynnonz1 != raynnonz2 )
2759 for(
i = 0;
i < raynnonz1; ++
i )
2762 if( rayidx1[
i] != rayidx2[
i] ||
2778 *coef = raycoefs1[
i] / raycoefs2[
i];
2795 SCIP_Real sidefactor,
2803 SCIP_Bool* inreccone,
2807 SCIP_Real coefs1234a[5];
2808 SCIP_Real coefs4b[5];
2809 SCIP_Real coefscondition[3];
2810 SCIP_Real interpoint;
2811 SCIP_Real* newraycoefs;
2818 newraynnonz = (
rays->raysbegin[
i + 1] -
rays->raysbegin[
i]) + (
rays->raysbegin[j + 1] -
rays->raysbegin[j]);
2825 rays->raysbegin[j + 1] -
rays->raysbegin[j], newraycoefs, newrayidx, &newraynnonz,
alpha,
2830 newraynnonz, vb, vzlp, wcoefs, wzlp, kappa, coefs1234a, coefs4b, coefscondition, success) );
2863 SCIP_Real sidefactor,
2870 SCIP_Real* interpoints,
2881 for(
i = 0;
i <
rays->nrays; ++
i )
2883 SCIP_Real currentrho;
2899 &
rays->raysidx[
rays->raysbegin[idx]],
rays->raysbegin[idx + 1] -
rays->raysbegin[idx], &coef) )
2901 currentrho = coef * interpoints[
i];
2912 SCIP_Bool inreccone;
2922 alpha = (lb + ub) / 2.0;
2931 vzlp, wcoefs, wzlp, kappa,
alpha, &inreccone, success) );
2955 currentrho = (
alpha - 1) * interpoints[
i] /
alpha;
2958 if( currentrho < *rho )
2961 if( *rho < -10e+06 )
2981 SCIP_Real sidefactor,
2991 SCIP_Bool* strengthsuccess
2996 SCIP_Real* interpoints;
2997 SCIP_Real avecutcoef;
3002 *strengthsuccess =
FALSE;
3011 SCIP_CALL(
computeIntercut(
scip, nlhdlrdata, nlhdlrexprdata,
rays, sidefactor, iscase4, vb, vzlp, wcoefs, wzlp, kappa,
3012 rowprep, interpoints,
sol, success) );
3023 for(
i = 0;
i <
rays->nrays; ++
i )
3033 if( counter >= nlhdlrdata->nstrengthlimit )
3037 SCIP_CALL(
findRho(
scip, nlhdlrdata, nlhdlrexprdata,
rays,
i, sidefactor, iscase4, vb, vzlp, wcoefs, wzlp, kappa,
3038 interpoints, &rho, success));
3044 cutcoef = 1.0 / rho;
3048 avecutcoef += cutcoef;
3051 *strengthsuccess =
TRUE;
3054 lppos =
rays->lpposray[
i];
3063 -cutcoef, rows[lppos], success) );
3067 INTERLOG(printf(
"Bad numeric: row not nonbasic enough\n");)
3068 nlhdlrdata->nbadnonbasic++;
3077 cutcoef, cols[lppos]) );
3082 nlhdlrdata->cutcoefsum += avecutcoef / counter;
3157 qexpr = nlhdlrexprdata->qexpr;
3160 raylength = (auxvar ==
NULL) ? nquadexprs + nlinexprs : nquadexprs + nlinexprs + 1;
3166 rays->rayssize = raylength;
3167 rays->nrays = raylength;
3170 for(
i = 0;
i < nquadexprs; ++
i )
3180 &
rays->rays[
i], success) );
3187 for(
i = 0;
i < nlinexprs; ++
i )
3189 rays->raysbegin[
i + nquadexprs] =
i + nquadexprs;
3190 rays->raysidx[
i + nquadexprs] =
i + nquadexprs;
3194 &
rays->rays[
i + nquadexprs], success) );
3201 if( auxvar !=
NULL )
3203 rays->raysbegin[nquadexprs + nlinexprs] = nquadexprs + nlinexprs;
3204 rays->raysidx[nquadexprs + nlinexprs] = nquadexprs + nlinexprs;
3213 rays->raysbegin[raylength] = raylength;
3225 SCIP_Real sidefactor
3230 SCIP_Real* lincoefs;
3238 qexpr = nlhdlrexprdata->qexpr;
3245 for(
i = 0;
i < nquadexprs;
i++ )
3248 SCIP_Real quadlincoef;
3257 val += sqrcoef *
SQR(solval);
3260 val += quadlincoef * solval;
3264 for(
i = 0;
i < nbilinexprs;
i++ )
3268 SCIP_Real bilincoef;
3277 for(
i = 0;
i < nlinexprs;
i++ )
3283 if( auxvar !=
NULL )
3291 constant = (sidefactor * constant);
3293 val = (sidefactor * val);
3296 if( val <= constant )
3312 SCIP_Bool overestimate,
3319 SCIP_Real sidefactor;
3333 (nlhdlrdata->ncalls++);
3335 qexpr = nlhdlrexprdata->qexpr;
3338#ifdef DEBUG_INTERSECTIONCUT
3354 sidefactor = overestimate ? -1.0 : 1.0;
3359 if( ! nlhdlrdata->useboundsasrays )
3365 INTERLOG(printf(
"Failed to get rays: there is a var with base status ZERO!\n"); )
3369 soltoseparate =
sol;
3375 if( auxvar !=
NULL )
3389 INTERLOG(printf(
"Failed to use bounds as rays: variable is unbounded!\n"); )
3400 INTERLOG(printf(
"Failed to use bounds as rays: nearest vertex is not violated!\n"); )
3407 soltoseparate = vertex;
3415 vb, vzlp, wcoefs, &wzlp, &kappa) );
3418 if( nlinexprs == 0 && auxvar ==
NULL )
3420 for(
i = 0;
i < nquadexprs; ++
i )
3421 if( wcoefs[
i] != 0.0 )
3424 if(
i == nquadexprs )
3433 if( nlhdlrdata->usestrengthening )
3435 SCIP_Bool strengthsuccess;
3438 wzlp, kappa, rowprep, soltoseparate, success, &strengthsuccess) );
3440 if( *success && strengthsuccess )
3441 nlhdlrdata->nstrengthenings++;
3445 SCIP_CALL(
computeIntercut(
scip, nlhdlrdata, nlhdlrexprdata,
rays, sidefactor, iscase4, vb, vzlp, wcoefs, wzlp, kappa,
3446 rowprep,
NULL, soltoseparate, success) );
3454 if( nlhdlrdata->useboundsasrays )
3480 for(
i = 0;
i < nquadexprs; ++
i )
3488 if( (lincoef != 0.0) + (sqrcoef != 0.0) + nadjbilin >= 2 )
3515 return (lincoef != 0.0) + (sqrcoef != 0.0) + nadjbilin >= 2;
3528 SCIP_Bool* infeasible,
3578 SCIP_Bool* infeasible,
3628 cand1 =
a/x1 + cneg*x1;
3629 cand2 =
a/x2 + cneg*x2;
3632 return MAX(cand1, cand2);
3645 SCIP_Real negunresmax;
3646 SCIP_Real boundarymax;
3657 if(
a >= 0.0 ||
c <= 0.0 )
3682 return -negunresmax;
3689 return MAX(boundarymax, -negunresmax);
3714 if( exprdom.
inf <= 0.0 && 0.0 <= exprdom.
sup )
3721 if( exprdom.
sup < 0 )
3743 SCIP_Real* lincoefs,
3746 SCIP_Bool* infeasible,
3754 if( nlinexprs == 0 )
3760 for(
i = 0;
i < nlinexprs; ++
i )
3764 oldboundslin, lincoefs, constant, rhs, newboundslin, infeasible);
3766 if( *nreductions > 0 && !*infeasible )
3770 for(
i = 0;
i < nlinexprs && ! (*infeasible); ++
i )
3794 if( (*nlhdlrexprdata)->quadactivities !=
NULL )
3858 SCIP_Real* eigenvalues;
3859 SCIP_Bool isquadratic;
3860 SCIP_Bool propagable;
3883 nlhdlrdata->useintersectioncuts =
FALSE;
3898 SCIPdebugMsg(
scip,
"expr %p is not quadratic -> abort detect\n", (
void*)expr);
3907 SCIPdebugMsg(
scip,
"expr %p is not propagable and in presolving -> abort detect\n", (
void*)expr);
3914 if( !propagable && !nlhdlrdata->useintersectioncuts )
3916 SCIPdebugMsg(
scip,
"expr %p is not propagable -> abort detect\n", (
void*)expr);
3922 nlexprdata = *nlhdlrexprdata;
3923 nlexprdata->qexpr = expr;
3924 nlexprdata->cons = cons;
3947 for(
i = 0;
i < nlinexprs; ++
i )
3950 for(
i = 0;
i < nquadexprs; ++
i )
3974 if( sqrexpr !=
NULL )
3998 if( expr1 == argexpr )
4014 for( j = 0; j < nquadexprs; ++j )
4018 if( expr1 == exprj )
4045 SCIP_CALL( nlhdlrFreeexprdataQuadratic(
scip, nlhdlr, expr, nlhdlrexprdata) );
4049 SCIPdebugMsg(
scip,
"expr %p is quadratic and propagable -> propagate\n", (
void*)expr);
4081 SCIP_CALL( nlhdlrFreeexprdataQuadratic(
scip, nlhdlr, expr, nlhdlrexprdata) );
4095 for(
i = 0;
i < nlinexprs; ++
i )
4099 for(
i = 0;
i < nquadexprs; ++
i )
4106 SCIPdebugMsg(
scip,
"expr %p is quadratic and propagable -> propagate and separate\n", (
void*)expr);
4108 nlexprdata->separating =
TRUE;
4112 SCIPdebugMsg(
scip,
"expr %p is quadratic and propagable -> propagate only\n", (
void*)expr);
4119 nlexprdata->origvars =
TRUE;
4134 SCIP_Real* lincoefs;
4140 assert(nlhdlrexprdata->separating);
4141 assert(nlhdlrexprdata->qexpr == expr);
4144 if( nlhdlrexprdata->origvars )
4157 *auxvalue = constant;
4159 for(
i = 0;
i < nlinexprs; ++
i )
4162 for(
i = 0;
i < nquadexprs; ++
i )
4172 *auxvalue += (lincoef + sqrcoef * solval) * solval;
4175 for(
i = 0;
i < nbilinexprs; ++
i )
4196 SCIP_Bool success =
FALSE;
4199 SCIP_Longint nodenumber;
4200 SCIP_Real* eigenvalues;
4201 SCIP_Real violation;
4204 assert(nlhdlrexprdata->qexpr == expr);
4206 INTERLOG(printf(
"Starting interesection cuts!\n");)
4214 if( branchcandonly )
4221 INTERLOG(printf(
"Convex or concave, no need of interesection cuts!\n");)
4226 if( ! nlhdlrdata->useintersectioncuts )
4228 INTERLOG(printf(
"We don't use intersection cuts!\n");)
4237 INTERLOG(printf(
"LP solutoin not good!\n");)
4244 if( (nlhdlrdata->atwhichnodes == -1 &&
depth != 0) || (nlhdlrdata->atwhichnodes != -1 &&
depth % nlhdlrdata->atwhichnodes != 0) )
4246 INTERLOG(printf(
"Don't separate at this node\n");)
4252 if( nlhdlrdata->lastnodenumber != nodenumber )
4254 nlhdlrdata->lastnodenumber = nodenumber;
4255 nlhdlrdata->lastncuts = nlhdlrdata->ncutsadded;
4260 if( (
depth > 0 && nlhdlrexprdata->ncutsadded >= nlhdlrdata->ncutslimit) || (
depth == 0 &&
4261 nlhdlrexprdata->ncutsadded >= nlhdlrdata->ncutslimitroot) )
4263 INTERLOG(printf(
"Too many cuts added already\n");)
4269 if( eigenvalues ==
NULL )
4271 INTERLOG(printf(
"No known eigenvalues!\n");)
4276 if( cons != nlhdlrexprdata->cons )
4280 violation =
ABS( violation );
4287 if( violation < nlhdlrdata->minviolation )
4289 INTERLOG(printf(
"Violation %g is just too small\n", violation); )
4295 if( nlhdlrexprdata->cons !=
NULL && cons != nlhdlrexprdata->cons )
4297 INTERLOG(printf(
"WARNING!! expr is root of one constraint and subexpr of another!\n"); )
4307 INTERLOG(printf(
"We are actually feasible for the sides of the constraint\n"); )
4311#ifdef DEBUG_INTERSECTIONCUT
4313 if( cons == nlhdlrexprdata->cons )
4331 INTERLOG(printf(
"Generating inter cut\n"); )
4334 INTERLOG(
if( !success) printf(
"Generation failed\n"); )
4340 nlhdlrdata->ncutsgenerated += 1;
4341 nlhdlrexprdata->ncutsadded += 1;
4347 if( nlhdlrdata->sparsifycuts )
4351 INTERLOG(
if( !success) printf(
"Clean up failed\n"); )
4358 SCIP_Bool infeasible;
4361 if( nlhdlrdata->useboundsasrays )
4362 nlhdlrdata->nboundcuts += 1;
4365 overestimate ?
"over" :
"under",
4400 nlhdlrdata->cutcoefsum += nlhdlrdata->currentavecutcoef;
4401 nlhdlrdata->monoidalimprovementsum += nlhdlrdata->currentavemonoidalimprovement;
4402 nlhdlrdata->ncutsadded += 1;
4409 nlhdlrdata->nhighre++;
4451 SCIP_Real* lincoefs;
4460 assert(nlhdlrexprdata->quadactivities !=
NULL);
4461 assert(nlhdlrexprdata->qexpr == expr);
4476 for(
i = 0;
i < nlinexprs; ++
i )
4491 SCIPdebugMsg(
scip,
"Activity of linear part is [%g, %g]\n", nlhdlrexprdata->linactivity.inf,
4492 nlhdlrexprdata->linactivity.sup);
4503 nlhdlrexprdata->nneginfinityquadact = 0;
4504 nlhdlrexprdata->nposinfinityquadact = 0;
4505 nlhdlrexprdata->minquadfiniteact = 0.0;
4506 nlhdlrexprdata->maxquadfiniteact = 0.0;
4509 for(
i = 0;
i < nquadexprs; ++
i )
4532 if( sqrcoef != 0.0 )
4562 if( expr1 == qexpr )
4609 for( j = 0; j < nadjbilin; ++j )
4614 SCIP_Real bilincoef;
4618 if( expr1 != qexpr )
4653 SCIPinfoMessage(
scip,
NULL,
"Computing activity for quadratic term %g <expr>^2 + [%g,%g] <expr>, where <expr> is: ", sqrcoef,
b.inf,
b.sup);
4666 nlhdlrexprdata->nneginfinityquadact++;
4674 nlhdlrexprdata->minquadfiniteact += quadlb;
4679 nlhdlrexprdata->nposinfinityquadact++;
4687 nlhdlrexprdata->maxquadfiniteact += quadub;
4693 SCIPdebugMsg(
scip,
"Activity of quadratic part is [%g, %g]\n", nlhdlrexprdata->quadactivity.inf, nlhdlrexprdata->quadactivity.sup);
4714 SCIP_Real* bilincoefs;
4715 SCIP_Real* lincoefs;
4724 SCIPdebugMsg(
scip,
"Reverse propagation of quadratic expr given bounds = [%g,%g]\n", bounds.inf, bounds.sup);
4731 assert(nlhdlrexprdata->quadactivities !=
NULL);
4732 assert(nlhdlrexprdata->qexpr == expr);
4815 for(
i = 0;
i < nquadexprs; ++
i )
4840 nlhdlrexprdata->nposinfinityquadact == 0 )
4851 nlhdlrexprdata->nposinfinityquadact == 1 )
4852 rest_i.
sup = nlhdlrexprdata->maxquadfiniteact;
4858 nlhdlrexprdata->nneginfinityquadact == 0 )
4869 nlhdlrexprdata->nneginfinityquadact == 1 )
4870 rest_i.
inf = nlhdlrexprdata->minquadfiniteact;
4874#ifdef SCIP_DISABLED_CODE
4902 if( sqrcoef != 0.0 )
4926 if( expr1 == qexpr )
4938 SCIP_Real bilincoef = 0.0;
4947 for( j = 0; j < nadjbilin; ++j )
4954 if( expr1 != qexpr )
4969 bilinexprs[nbilin] = expr2;
4970 bilincoefs[nbilin] = bilincoef;
4980 if( nbilin > 0 && !*infeasible )
5002 infeasible, &nreds) );
5005 *nreductions += nreds;
5071 "whether to use intersection cuts for quadratic constraints to separate",
5075 "whether the strengthening should be used",
5079 "whether monoidal strengthening should be used",
5083 "whether the minimal representation of the S-free set should be used (instead of the gauge)",
5087 "use bounds of variables in quadratic as rays for intersection cuts",
5091 "limit for number of cuts generated consecutively",
5095 "limit for number of cuts generated at root node",
5099 "maximal rank a slackvar can have",
5100 &nlhdlrdata->maxrank,
FALSE, INT_MAX, 0, INT_MAX,
NULL,
NULL) );
5103 "minimal cut violation the generated cuts must fulfill to be added to the LP",
5107 "minimal violation the constraint must fulfill such that a cut is generated",
5111 "determines at which nodes cut is used (if it's -1, it's used only at the root node, if it's n >= 0, it's used at every multiple of n",
5112 &nlhdlrdata->atwhichnodes,
FALSE, 1, -1, INT_MAX,
NULL,
NULL) );
5115 "limit for number of rays we do the strengthening for",
5116 &nlhdlrdata->nstrengthlimit,
FALSE, INT_MAX, 0, INT_MAX,
NULL,
NULL) );
5119 "should we try to sparisfy the intersection cut?",
5123 "should cut be generated even with bad numerics when restricting to ray?",
5127 "should cut be added even when range / efficacy is large?",
5131 "for monoidal strengthening, should we track more statistics (more expensive)?",
constraint handler for nonlinear constraints specified by algebraic expressions
#define SCIPquadprecSqrtQ(r, a)
#define SCIPquadprecProdDD(r, a, b)
#define SCIPquadprecProdQD(r, a, b)
#define SCIPquadprecSumQD(r, a, b)
#define QUAD_ASSIGN(a, constant)
#define SCIPquadprecSquareD(r, a)
#define SCIPquadprecSumQQ(r, a, b)
#define SCIP_INTERVAL_INFINITY
#define SCIP_LONGINT_FORMAT
power and signed power expression handlers
product expression handler
variable expression handler
SCIP_Longint SCIPgetCurBoundsTagNonlinear(SCIP_CONSHDLR *conshdlr)
SCIP_VAR * SCIPgetExprAuxVarNonlinear(SCIP_EXPR *expr)
SCIP_Real SCIPgetRhsNonlinear(SCIP_CONS *cons)
SCIP_RETCODE SCIPtightenExprIntervalNonlinear(SCIP *scip, SCIP_EXPR *expr, SCIP_INTERVAL newbounds, SCIP_Bool *cutoff, int *ntightenings)
SCIP_RETCODE SCIPregisterExprUsageNonlinear(SCIP *scip, SCIP_EXPR *expr, SCIP_Bool useauxvar, SCIP_Bool useactivityforprop, SCIP_Bool useactivityforsepabelow, SCIP_Bool useactivityforsepaabove)
SCIP_INTERVAL SCIPgetExprBoundsNonlinear(SCIP *scip, SCIP_EXPR *expr)
SCIP_Real SCIPgetLhsNonlinear(SCIP_CONS *cons)
int SCIPgetSubscipDepth(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPincludeNlhdlrQuadratic(SCIP *scip)
SCIP_Real SCIPnextafter(SCIP_Real from, SCIP_Real to)
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)
int SCIPcolGetLPPos(SCIP_COL *col)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
SCIP_Real SCIPcolGetPrimsol(SCIP_COL *col)
SCIP_BASESTAT SCIPcolGetBasisStatus(SCIP_COL *col)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_Real SCIPgetCutEfficacy(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
int SCIPexprGetNChildren(SCIP_EXPR *expr)
SCIP_RETCODE SCIPprintExprQuadratic(SCIP *scip, SCIP_EXPR *expr)
void SCIPexprGetQuadraticBilinTerm(SCIP_EXPR *expr, int termidx, SCIP_EXPR **expr1, SCIP_EXPR **expr2, SCIP_Real *coef, int *pos2, SCIP_EXPR **prodexpr)
void SCIPexprSetCurvature(SCIP_EXPR *expr, SCIP_EXPRCURV curvature)
SCIP_Bool SCIPisExprSum(SCIP *scip, SCIP_EXPR *expr)
SCIP_Bool SCIPexprAreQuadraticExprsVariables(SCIP_EXPR *expr)
void SCIPexprGetQuadraticData(SCIP_EXPR *expr, SCIP_Real *constant, int *nlinexprs, SCIP_EXPR ***linexprs, SCIP_Real **lincoefs, int *nquadexprs, int *nbilinexprs, SCIP_Real **eigenvalues, SCIP_Real **eigenvectors)
SCIP_RETCODE SCIPcomputeExprQuadraticCurvature(SCIP *scip, SCIP_EXPR *expr, SCIP_EXPRCURV *curv, SCIP_HASHMAP *assumevarfixed, SCIP_Bool storeeigeninfo)
SCIP_RETCODE SCIPprintExpr(SCIP *scip, SCIP_EXPR *expr, FILE *file)
SCIP_Real SCIPexprGetEvalValue(SCIP_EXPR *expr)
SCIP_Longint SCIPexprGetActivityTag(SCIP_EXPR *expr)
SCIP_RETCODE SCIPcheckExprQuadratic(SCIP *scip, SCIP_EXPR *expr, SCIP_Bool *isquadratic)
SCIP_INTERVAL SCIPexprGetActivity(SCIP_EXPR *expr)
void SCIPexprGetQuadraticQuadTerm(SCIP_EXPR *quadexpr, int termidx, SCIP_EXPR **expr, SCIP_Real *lincoef, SCIP_Real *sqrcoef, int *nadjbilin, int **adjbilin, SCIP_EXPR **sqrexpr)
void SCIPintervalSetRoundingModeUpwards(void)
void SCIPintervalSetRoundingModeDownwards(void)
SCIP_Real SCIPintervalGetInf(SCIP_INTERVAL interval)
SCIP_Real SCIPintervalQuadUpperBound(SCIP_Real infinity, SCIP_Real a, SCIP_INTERVAL b_, SCIP_INTERVAL x)
SCIP_Bool SCIPintervalIsEntire(SCIP_Real infinity, SCIP_INTERVAL operand)
void SCIPintervalSub(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalSetEntire(SCIP_Real infinity, SCIP_INTERVAL *resultant)
void SCIPintervalSquareRoot(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
SCIP_ROUNDMODE SCIPintervalGetRoundingMode(void)
void SCIPintervalSolveUnivariateQuadExpression(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL sqrcoeff, SCIP_INTERVAL lincoeff, SCIP_INTERVAL rhs, SCIP_INTERVAL xbnds)
void SCIPintervalSetRoundingMode(SCIP_ROUNDMODE roundmode)
void SCIPintervalSet(SCIP_INTERVAL *resultant, SCIP_Real value)
SCIP_Bool SCIPintervalIsEmpty(SCIP_Real infinity, SCIP_INTERVAL operand)
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
void SCIPintervalMulScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
void SCIPintervalDivScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
SCIP_Real SCIPintervalGetSup(SCIP_INTERVAL interval)
void SCIPintervalSolveUnivariateQuadExpressionPositiveAllScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_Real sqrcoeff, SCIP_Real lincoeff, SCIP_Real rhs, SCIP_INTERVAL xbnds)
SCIP_Real SCIPintervalNegateReal(SCIP_Real x)
int SCIPintervalPropagateWeightedSum(SCIP_Real infinity, int noperands, SCIP_INTERVAL *operands, SCIP_Real *weights, SCIP_Real constant, SCIP_INTERVAL rhs, SCIP_INTERVAL *resultants, SCIP_Bool *infeasible)
void SCIPintervalAdd(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalSetEmpty(SCIP_INTERVAL *resultant)
SCIP_RETCODE SCIPgetLPBasisInd(SCIP *scip, int *basisind)
SCIP_RETCODE SCIPgetLPColsData(SCIP *scip, SCIP_COL ***cols, int *ncols)
SCIP_RETCODE SCIPgetLPRowsData(SCIP *scip, SCIP_ROW ***rows, int *nrows)
SCIP_ROW ** SCIPgetLPRows(SCIP *scip)
int SCIPgetNLPRows(SCIP *scip)
SCIP_RETCODE SCIPgetLPBInvARow(SCIP *scip, int r, SCIP_Real *binvrow, SCIP_Real *coefs, int *inds, int *ninds)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_COL ** SCIPgetLPCols(SCIP *scip)
int SCIPgetNLPCols(SCIP *scip)
SCIP_Bool SCIPisLPSolBasic(SCIP *scip)
SCIP_RETCODE SCIPgetLPBInvRow(SCIP *scip, int r, SCIP_Real *coefs, int *inds, int *ninds)
#define SCIPfreeBuffer(scip, ptr)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
#define SCIPallocClearBlockMemory(scip, ptr)
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 SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBufferArrayNull(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_NLHDLRDATA * SCIPnlhdlrGetData(SCIP_NLHDLR *nlhdlr)
void SCIPnlhdlrSetFreeExprData(SCIP_NLHDLR *nlhdlr,)
const char * SCIPnlhdlrGetName(SCIP_NLHDLR *nlhdlr)
SCIP_NLHDLR * SCIPfindNlhdlrNonlinear(SCIP_CONSHDLR *conshdlr, const char *name)
void SCIPnlhdlrSetSepa(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINITSEPA((*initsepa)), SCIP_DECL_NLHDLRENFO((*enfo)), SCIP_DECL_NLHDLRESTIMATE((*estimate)),)
void SCIPnlhdlrSetFreeHdlrData(SCIP_NLHDLR *nlhdlr,)
void SCIPnlhdlrSetCopyHdlr(SCIP_NLHDLR *nlhdlr,)
SCIP_RETCODE SCIPincludeNlhdlrNonlinear(SCIP *scip, SCIP_NLHDLR **nlhdlr, const char *name, const char *desc, int detectpriority, int enfopriority, SCIP_DECL_NLHDLRDETECT((*detect)), SCIP_DECL_NLHDLREVALAUX((*evalaux)), SCIP_NLHDLRDATA *nlhdlrdata)
void SCIPnlhdlrSetProp(SCIP_NLHDLR *nlhdlr, SCIP_DECL_NLHDLRINTEVAL((*inteval)),)
SCIP_Longint SCIPnodeGetNumber(SCIP_NODE *node)
int SCIPnodeGetDepth(SCIP_NODE *node)
SCIP_Bool SCIProwIsIntegral(SCIP_ROW *row)
SCIP_Real SCIPgetRowMaxCoef(SCIP *scip, SCIP_ROW *row)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
SCIP_Real SCIPgetRowMinCoef(SCIP *scip, SCIP_ROW *row)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
int SCIProwGetNLPNonz(SCIP_ROW *row)
int SCIProwGetLPPos(SCIP_ROW *row)
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
SCIP_Real SCIPgetRowActivity(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
SCIP_Real SCIProwGetConstant(SCIP_ROW *row)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
SCIP_BASESTAT SCIProwGetBasisStatus(SCIP_ROW *row)
SCIP_RETCODE SCIPprintTransSol(SCIP *scip, SCIP_SOL *sol, FILE *file, SCIP_Bool printzeros)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_Longint SCIPgetNLPs(SCIP *scip)
SCIP_TABLE * SCIPfindTable(SCIP *scip, const char *name)
SCIP_RETCODE SCIPincludeTable(SCIP *scip, const char *name, const char *desc, SCIP_Bool active, SCIP_DECL_TABLECOPY((*tablecopy)), SCIP_DECL_TABLEFREE((*tablefree)), SCIP_DECL_TABLEINIT((*tableinit)), SCIP_DECL_TABLEEXIT((*tableexit)), SCIP_DECL_TABLEINITSOL((*tableinitsol)), SCIP_DECL_TABLEEXITSOL((*tableexitsol)), SCIP_DECL_TABLEOUTPUT((*tableoutput)), SCIP_TABLEDATA *tabledata, int position, SCIP_STAGE earlieststage)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisSumRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisHugeValue(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_COL * SCIPvarGetCol(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_VAR ** SCIProwprepGetVars(SCIP_ROWPREP *rowprep)
SCIP_Real SCIProwprepGetSide(SCIP_ROWPREP *rowprep)
void SCIPmergeRowprepTerms(SCIP *scip, SCIP_ROWPREP *rowprep)
void SCIProwprepSetCoef(SCIP_ROWPREP *rowprep, int idx, SCIP_Real newcoef)
SCIP_Real * SCIProwprepGetCoefs(SCIP_ROWPREP *rowprep)
char * SCIProwprepGetName(SCIP_ROWPREP *rowprep)
void SCIProwprepSetSidetype(SCIP_ROWPREP *rowprep, SCIP_SIDETYPE sidetype)
void SCIProwprepAddConstant(SCIP_ROWPREP *rowprep, SCIP_Real constant)
SCIP_RETCODE SCIPaddRowprepTerm(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_VAR *var, SCIP_Real coef)
SCIP_RETCODE SCIPgetRowprepRowCons(SCIP *scip, SCIP_ROW **row, SCIP_ROWPREP *rowprep, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateRowprep(SCIP *scip, SCIP_ROWPREP **rowprep, SCIP_SIDETYPE sidetype, SCIP_Bool local)
int SCIProwprepGetNVars(SCIP_ROWPREP *rowprep)
void SCIProwprepAddSide(SCIP_ROWPREP *rowprep, SCIP_Real side)
SCIP_RETCODE SCIPcleanupRowprep(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Real minviol, SCIP_Real *viol, SCIP_Bool *success)
void SCIPfreeRowprep(SCIP *scip, SCIP_ROWPREP **rowprep)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIPfreeSol(scip, &heurdata->sol))
SCIPcreateSol(scip, &heurdata->sol, heur))
assert(minobj< SCIPgetCutoffbound(scip))
#define BMSclearMemory(ptr)
#define BMSclearMemoryArray(ptr, num)
static SCIP_Bool raysAreDependent(SCIP *scip, SCIP_Real *raycoefs1, int *rayidx1, int raynnonz1, SCIP_Real *raycoefs2, int *rayidx2, int raynnonz2, SCIP_Real *coef)
#define NLHDLR_DETECTPRIORITY
static SCIP_RETCODE computeRestrictionToLine(SCIP *scip, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_Real sidefactor, SCIP_Real *raycoefs, int *rayidx, int raynnonz, SCIP_Real *vb, SCIP_Real *vzlp, SCIP_Real kappa, SCIP_Real *apex, SCIP_Real *coefs2, SCIP_Bool *success)
#define DEFAULT_USEBOUNDS
#define DEFAULT_USESTRENGTH
static SCIP_Real computeMaxBoundaryForBilinearProp(SCIP_Real a, SCIP_Real c, SCIP_Real x1, SCIP_Real x2)
static SCIP_RETCODE setVarToNearestBound(SCIP *scip, SCIP_SOL *sol, SCIP_SOL *vertex, SCIP_VAR *var, SCIP_Real *factor, SCIP_Bool *success)
static void computeVApexAndVRay(SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_Real *apex, SCIP_Real *raycoefs, int *rayidx, int raynnonz, SCIP_Real *vapex, SCIP_Real *vray)
static void computeRangeForBilinearProp(SCIP_INTERVAL exprdom, SCIP_Real coef, SCIP_INTERVAL rhs, SCIP_INTERVAL *range)
static SCIP_RETCODE computeIntercut(SCIP *scip, SCIP_NLHDLRDATA *nlhdlrdata, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, RAYS *rays, SCIP_Real sidefactor, SCIP_Bool iscase4, SCIP_Real *vb, SCIP_Real *vzlp, SCIP_Real *wcoefs, SCIP_Real wzlp, SCIP_Real kappa, SCIP_ROWPREP *rowprep, SCIP_Real *interpoints, SCIP_SOL *sol, SCIP_Bool *success)
#define NLHDLR_ENFOPRIORITY
static SCIP_RETCODE computeRestrictionToRay(SCIP *scip, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_Real sidefactor, SCIP_Bool iscase4, SCIP_Real *raycoefs, int *rayidx, int raynnonz, SCIP_Real *vb, SCIP_Real *vzlp, SCIP_Real *wcoefs, SCIP_Real wzlp, SCIP_Real kappa, SCIP_Real *coefs1234a, SCIP_Real *coefs4b, SCIP_Real *coefscondition, SCIP_Bool *success)
static SCIP_RETCODE findRho(SCIP *scip, SCIP_NLHDLRDATA *nlhdlrdata, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, RAYS *rays, int idx, SCIP_Real sidefactor, SCIP_Bool iscase4, SCIP_Real *vb, SCIP_Real *vzlp, SCIP_Real *wcoefs, SCIP_Real wzlp, SCIP_Real kappa, SCIP_Real *interpoints, SCIP_Real *rho, SCIP_Bool *success)
static SCIP_RETCODE createAndStoreSparseRays(SCIP *scip, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_VAR *auxvar, RAYS **raysptr, SCIP_Bool *success)
static SCIP_RETCODE insertRayEntry(SCIP *scip, RAYS *rays, SCIP_Real coef, int coefidx, int coefpos)
static void sparsifyIntercut(SCIP *scip, SCIP_ROWPREP *rowprep)
static SCIP_RETCODE computeMonoidalStrengthCoef(SCIP *scip, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, int lppos, SCIP_Real *raycoefs, int *rayidx, int raynnonz, SCIP_Real *vb, SCIP_Real *vzlp, SCIP_Real *wcoefs, SCIP_Real kappa, SCIP_Real *apex, SCIP_Real sidefactor, SCIP_Real *cutcoef, SCIP_Bool *success)
static SCIP_Real findMonoidalQuadRoot(SCIP *scip, SCIP_Real a, SCIP_Real b, SCIP_Real c)
static SCIP_RETCODE propagateBoundsQuadExpr(SCIP *scip, SCIP_EXPR *expr, SCIP_Real sqrcoef, SCIP_INTERVAL b, SCIP_INTERVAL rhs, SCIP_Bool *infeasible, int *nreductions)
static SCIP_RETCODE createBoundRays(SCIP *scip, RAYS **rays, int size)
#define TABLE_DESC_QUADRATIC
static void freeRays(SCIP *scip, RAYS **rays)
static void combineRays(SCIP_Real *raycoefs1, int *rayidx1, int raynnonz1, SCIP_Real *raycoefs2, int *rayidx2, int raynnonz2, SCIP_Real *newraycoefs, int *newrayidx, int *newraynnonz, SCIP_Real coef1, SCIP_Real coef2)
static SCIP_Real computeEigenvecDotRay(SCIP_Real *eigenvec, int nquadvars, SCIP_Real *raycoefs, int *rayidx, int raynnonz)
static SCIP_Bool isPropagableTerm(SCIP_EXPR *qexpr, int idx)
static SCIP_Real computeWRayLinear(SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_Real sidefactor, SCIP_Real *raycoefs, int *rayidx, int raynnonz)
#define DEFAULT_NCUTSROOT
#define DEFAULT_USEMONOIDAL
static SCIP_RETCODE storeDenseTableauRow(SCIP *scip, SCIP_COL *col, int *basicvarpos2tableaurow, int nbasiccol, int raylength, SCIP_Real *binvrow, SCIP_Real *binvarow, SCIP_Real *tableaurows)
static SCIP_RETCODE addRowToCut(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_Real cutcoef, SCIP_ROW *row, SCIP_Bool *success)
static SCIP_Real computeIntersectionPoint(SCIP *scip, SCIP_NLHDLRDATA *nlhdlrdata, SCIP_Bool iscase4, SCIP_Real *coefs1234a, SCIP_Real *coefs4b, SCIP_Real *coefscondition)
static SCIP_Real isCase4a(SCIP_Real tsol, SCIP_Real *coefs4a, SCIP_Real *coefscondition)
#define DEFAULT_USEMINREP
static SCIP_Real computeMaxForBilinearProp(SCIP_Real a, SCIP_Real c, SCIP_INTERVAL dom)
#define DEFAULT_USEINTERCUTS
static void constructLPPos2ConsPosMap(SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_VAR *auxvar, int *map)
static SCIP_Real computeRoot(SCIP *scip, SCIP_Real *coefs)
static SCIP_Bool isQuadConsViolated(SCIP *scip, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_VAR *auxvar, SCIP_SOL *sol, SCIP_Real sidefactor)
static SCIP_Bool areCoefsNumericsGood(SCIP *scip, SCIP_NLHDLRDATA *nlhdlrdata, SCIP_Real *coefs1234a, SCIP_Real *coefs4b, SCIP_Bool iscase4)
static SCIP_RETCODE intercutsComputeCommonQuantities(SCIP *scip, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_VAR *auxvar, SCIP_Real sidefactor, SCIP_SOL *sol, SCIP_Real *vb, SCIP_Real *vzlp, SCIP_Real *wcoefs, SCIP_Real *wzlp, SCIP_Real *kappa)
static SCIP_Real evalPhiAtRay(SCIP_Real t, SCIP_Real a, SCIP_Real b, SCIP_Real c, SCIP_Real d, SCIP_Real e)
#define TABLE_POSITION_QUADRATIC
static SCIP_RETCODE insertRayEntries(SCIP *scip, RAYS *rays, SCIP_Real *densetableaucols, int *rayentry2conspos, int raylength, int nray, int conspos, SCIP_Real factor, int *nnonz, SCIP_Bool *success)
static SCIP_RETCODE computeStrengthenedIntercut(SCIP *scip, SCIP_NLHDLRDATA *nlhdlrdata, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, RAYS *rays, SCIP_Real sidefactor, SCIP_Bool iscase4, SCIP_Real *vb, SCIP_Real *vzlp, SCIP_Real *wcoefs, SCIP_Real wzlp, SCIP_Real kappa, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Bool *success, SCIP_Bool *strengthsuccess)
#define TABLE_NAME_QUADRATIC
#define INTERCUTS_MINVIOL
static void computeApex(SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_Real *vb, SCIP_Real *vzlp, SCIP_Real kappa, SCIP_Real sidefactor, SCIP_Real *apex, SCIP_Bool *success)
static SCIP_RETCODE propagateBoundsLinExpr(SCIP *scip, SCIP_EXPR *expr, SCIP_Real b, SCIP_INTERVAL rhs, SCIP_Bool *infeasible, int *nreductions)
static SCIP_RETCODE createRays(SCIP *scip, RAYS **rays)
#define BINSEARCH_MAXITERS
static int countBasicVars(SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_VAR *auxvar, SCIP_Bool *nozerostat)
static SCIP_RETCODE findVertexAndGetRays(SCIP *scip, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_SOL *sol, SCIP_SOL *vertex, SCIP_VAR *auxvar, RAYS **raysptr, SCIP_Bool *success)
static SCIP_RETCODE reversePropagateLinearExpr(SCIP *scip, SCIP_EXPR **linexprs, int nlinexprs, SCIP_Real *lincoefs, SCIP_Real constant, SCIP_INTERVAL rhs, SCIP_Bool *infeasible, int *nreductions)
static SCIP_Bool isPropagable(SCIP_EXPR *qexpr)
static SCIP_Bool isRayInStrip(SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_Real *vb, SCIP_Real *vzlp, SCIP_Real *vapex, SCIP_Real *vray, SCIP_Real kappa, SCIP_Real sidefactor, SCIP_Real cutcoef)
static void doBinarySearch(SCIP *scip, SCIP_Real a, SCIP_Real b, SCIP_Real c, SCIP_Real d, SCIP_Real e, SCIP_Real *sol)
static SCIP_RETCODE storeDenseTableauRowsByColumns(SCIP *scip, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, int raylength, SCIP_VAR *auxvar, SCIP_Real *tableaurows, int *rayentry2conspos)
static SCIP_RETCODE computeMonoidalQuadCoefs(SCIP *scip, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_Real *vb, SCIP_Real *vzlp, SCIP_Real *vapex, SCIP_Real *vray, SCIP_Real kappa, SCIP_Real sidefactor, SCIP_Real *a, SCIP_Real *b, SCIP_Real *c)
#define TABLE_EARLIEST_STAGE_QUADRATIC
static SCIP_RETCODE constructBasicVars2TableauRowMap(SCIP *scip, int *map)
static SCIP_RETCODE rayInRecessionCone(SCIP *scip, SCIP_NLHDLRDATA *nlhdlrdata, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, RAYS *rays, int j, int i, SCIP_Real sidefactor, SCIP_Bool iscase4, SCIP_Real *vb, SCIP_Real *vzlp, SCIP_Real *wcoefs, SCIP_Real wzlp, SCIP_Real kappa, SCIP_Real alpha, SCIP_Bool *inreccone, SCIP_Bool *success)
static SCIP_RETCODE generateIntercut(SCIP *scip, SCIP_EXPR *expr, SCIP_NLHDLRDATA *nlhdlrdata, SCIP_NLHDLREXPRDATA *nlhdlrexprdata, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_ROWPREP *rowprep, SCIP_Bool overestimate, SCIP_Bool *success)
static SCIP_RETCODE addColToCut(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Real cutcoef, SCIP_COL *col)
nonlinear handler to handle quadratic expressions
preparation of a linear inequality to become a SCIP_ROW
public functions of nonlinear handlers of nonlinear constraints
#define SCIP_NLHDLR_METHOD_SEPAABOVE
#define SCIP_DECL_NLHDLREVALAUX(x)
struct SCIP_NlhdlrData SCIP_NLHDLRDATA
#define SCIP_NLHDLR_METHOD_SEPABOTH
#define SCIP_DECL_NLHDLRCOPYHDLR(x)
#define SCIP_NLHDLR_METHOD_ACTIVITY
#define SCIP_DECL_NLHDLRFREEEXPRDATA(x)
#define SCIP_DECL_NLHDLRDETECT(x)
#define SCIP_NLHDLR_METHOD_NONE
#define SCIP_DECL_NLHDLRFREEHDLRDATA(x)
struct SCIP_NlhdlrExprData SCIP_NLHDLREXPRDATA
#define SCIP_DECL_NLHDLRREVERSEPROP(x)
#define SCIP_NLHDLR_METHOD_ALL
#define SCIP_DECL_NLHDLRENFO(x)
#define SCIP_DECL_NLHDLRINTEVAL(x)
#define SCIP_NLHDLR_METHOD_SEPABELOW
enum SCIP_Retcode SCIP_RETCODE
#define SCIP_DECL_TABLEOUTPUT(x)
@ SCIP_VARTYPE_CONTINUOUS