48#define POWEXPRHDLR_NAME "pow"
49#define POWEXPRHDLR_DESC "power expression"
50#define POWEXPRHDLR_PRECEDENCE 55000
51#define POWEXPRHDLR_HASHKEY SCIPcalcFibHash(21163.0)
53#define SIGNPOWEXPRHDLR_NAME "signpower"
54#define SIGNPOWEXPRHDLR_DESC "signed power expression"
55#define SIGNPOWEXPRHDLR_PRECEDENCE 56000
56#define SIGNPOWEXPRHDLR_HASHKEY SCIPcalcFibHash(21163.1)
58#define INITLPMAXPOWVAL 1e+06
69#define SIGN(x) ((x) >= 0.0 ? 1.0 : -1.0)
71#define SIGNPOW_ROOTS_KNOWN 10
80 0.41421356237309504880,
82 0.56042566045031785945,
83 0.60582958618826802099,
84 0.64146546982884663257,
85 0.67033204760309682774,
86 0.69428385661425826738,
87 0.71453772716733489700,
88 0.73192937842370733350
92struct SCIP_ExprhdlrData
95 int expandmaxexponent;
139 *root = 0.39821689389382575186;
148 else if( exponent <= 2.0 )
153 for( iter = 0; iter < 1000; ++iter )
155 polyval = (exponent - 1.0) * pow(*root, exponent) + exponent * pow(*root, exponent - 1.0) - 1.0;
160 gradval = (exponent - 1.0) * exponent * (pow(*root, exponent - 1.0) + pow(*root, exponent - 2.0));
165 *root -= polyval / gradval;
175 SCIPdebugMsg(
scip,
"root for %g is %.20g, certainty = %g\n", exponent, *root, polyval);
199 for( iter = 0; iter < 1000; ++iter )
201 polyval = (exponent - 1.0) * pow(*root, exponent) - exponent * pow(*root, exponent - 1.0) + 1.0;
206 gradval = (exponent - 1.0) * exponent * (pow(*root, exponent - 1.0) - pow(*root, exponent - 2.0));
211 *root -= polyval / gradval;
221 SCIPdebugMsg(
scip,
"root for %g is %.20g, certainty = %g\n", exponent, *root, polyval);
239 (*exprdata)->exponent = exponent;
271 assert(xref != 0.0 || exponent > 0.0);
280 if( !
EPSISINT(exponent, 0.0) && !signpower && xref < 0.0 )
283 xrefpow = pow(signpower ?
REALABS(xref) : xref, exponent - 1.0);
292 *constant = (1.0 - exponent) * xrefpow * xref;
293 *slope = exponent * xrefpow;
336 *constant = pow(xlb, exponent);
348 *constant = pow(xlb, exponent);
355 else if( xlb == 0.0 && exponent > 0.0 )
358 *slope = pow(xub, exponent-1.0);
361 else if( xub == 0.0 && exponent > 0.0 )
368 *slope = pow(-xlb, exponent-1.0);
370 *slope = pow(xlb, exponent-1.0);
373 else if(
SCIPisEQ(
scip, xlb, xub) && (!signpower || xlb >= 0.0 || xub <= 0.0) )
402 if( signpower && xub <= 0.0 )
408 xlb_n = pow(xlb, exponent);
409 xlb_n1 = pow(xlb, exponent - 1.0);
410 xlb_n2 = pow(xlb, exponent - 2.0);
412 *slope = 0.5*exponent * ((3.0-exponent) * xlb_n1 + (exponent-1.0) * xlb_n2 * xub);
413 *constant = (1.0 - 0.5*exponent*(3.0-exponent)) * xlb_n - 0.5*exponent*(exponent-1.0) * xlb_n1 * xub;
415 if( signpower && xub <= 0.0 )
426 lbval = pow(xlb, exponent);
433 ubval = pow(xub, exponent);
443 *slope = (ubval - lbval) / (xub - xlb);
444 *constant = lbval - *slope * xlb;
503 assert((exponent >= 0.0 &&
EPSISINT(exponent/2.0, 0.0)) || (exponent > 1.0 && xlb >= 0.0));
579 assert(xubglobal <= 0.0 || (root > 0.0 && root < 1.0));
634 *islocal = xref < -root * xlbglobal;
653 *islocal = xref > -root * xubglobal;
732 if( xlb >= 0.0 || xub <= 0.0 )
737 if( xref < 0.0 && xlb >= 0.0 )
739 else if( xref > 0.0 && xub <= 0.0 )
751 xref = 0.9 * xlb + 0.1 * xub;
759 xref = 0.1 * xlb + 0.9 * xub;
782 if( xref > 0.0 && xlbglobal < 0.0 )
787 *islocal = xref < xlbglobal * root;
789 else if( xref < 0.0 && xubglobal > 0.0 )
794 *islocal = xref > xubglobal * root;
802 *islocal = xlbglobal * xubglobal < 0.0;
822 constant, slope, islocal, branchcand, success);
847 if( xref <= xlb * root )
863 *islocal = xref < xlbglobal * root;
872 if( xlb < 0.0 && xub > 0.0 )
964 xref = 0.1*xlb + 0.9*xub;
974 *islocal = xlbglobal * xubglobal < 0.0;
1019 isinteger =
EPSISINT(exponent, 0.0);
1020 iseven = isinteger &&
EPSISINT(exponent / 2.0, 0.0);
1022 if( exponent == 2.0 )
1039 *branchcand =
FALSE;
1042 else if( exponent > 0.0 && iseven )
1044 estimateParabola(
scip, exponent, overestimate, childlb, childub, refpoint, constant, coef, islocal, success);
1046 *branchcand = *islocal;
1048 else if( exponent > 1.0 && childlb >= 0.0 )
1051 if( refpoint < 0.0 )
1054 estimateParabola(
scip, exponent, overestimate, childlb, childub, refpoint, constant, coef, islocal, success);
1057 *branchcand = *islocal;
1062 if( !*islocal && !iseven && childglb < 0.0 )
1072 *islocal = refpoint < exprdata->root * (-childglb);
1076 else if( exponent > 1.0 )
1084 -childglb, childgub, constant, coef, islocal, branchcand, success);
1086 else if( exponent < 0.0 && (iseven || childlb >= 0.0) )
1094 childglb, childgub, constant, coef, islocal, branchcand, success);
1096 else if( exponent < 0.0 )
1103 constant, coef, islocal, branchcand, success);
1110 SCIPestimateRoot(
scip, exponent, overestimate, childlb, childub, refpoint, constant, coef, islocal, success);
1113 *branchcand = *islocal;
1136 if( ub > -maxabsbnd )
1137 lb =
MAX(lb, -maxabsbnd);
1138 if( lb < maxabsbnd )
1139 ub =
MIN(ub, maxabsbnd);
1147 refpoints[0] = (7.0 * lb + ub) / 8.0;
1148 refpoints[1] = (lb + ub) / 2.0;
1149 refpoints[2] = (lb + 7.0 * ub) / 8.0;
1181 lb = -ub * exprdata->root - 1.0;
1183 ub = -lb * exprdata->root + 1.0;
1191 if( -lb * exprdata->root < ub - 2.0 )
1193 if( -lb * exprdata->root < ub - 4.0 )
1194 refpoints[1] = (-lb * exprdata->root + ub) / 2.0;
1197 if( !underestimate )
1203 if( -ub * exprdata->root > lb + 2.0 )
1205 if( -ub * exprdata->root > lb + 4.0 )
1206 refpoints[1] = (lb - ub * exprdata->root) / 2.0;
1235 exponent = exprdata->exponent;
1240 mixedsign = lb < 0.0 && ub > 0.0;
1247 if( (exponent > 1.0 && (lb >= 0 || even)) || (exponent < 0.0 && lb >= 0) || (exponent < 0.0 && even && ub <= 0.0) )
1253 else if( ub <= 0 || (exponent > 0.0 && exponent < 1.0) )
1261 (exponent < 0.0 && even && mixedsign) )
1264 refpointsunder[0] = (lb + ub) / 2.0;
1266 else if( exponent > 1.0 && !even && mixedsign )
1277 refpointsover[0] = (lb + ub) / 2.0;
1280 else if( exponent > 1.0 && !even && mixedsign )
1310 if( compareresult != 0 )
1311 return compareresult;
1316 return expo1 == expo2 ? 0 : expo1 < expo2 ? -1 : 1;
1348 SCIPdebugPrintf(
"[simplifyPow] simplifying power with expo %g\n", exponent);
1351 if( exponent == 0.0 )
1361 if( exponent == 1.0 )
1364 *simplifiedexpr = base;
1382 if( baseval < 0.0 && fmod(exponent, 1.0) != 0.0 && baseval > -
SCIPepsilon(
scip) )
1386 assert(baseval >= 0.0 || fmod(exponent, 1.0) == 0.0);
1387 assert(baseval != 0.0 || exponent != 0.0);
1389 if( baseval != 0.0 || exponent > 0.0 )
1411 SCIP_CALL( SCIPcallExprSimplify(
scip, prod, &simplifiedprod, ownercreate, ownercreatedata) );
1419 SCIP_CALL( SCIPcallExprSimplify(
scip, exponential, simplifiedexpr, ownercreate, ownercreatedata) );
1440 *simplifiedexpr = base;
1459 SCIP_CALL( simplifyPow(
scip, newpow, simplifiedexpr, ownercreate, ownercreatedata) );
1483 SCIP_CALL( simplifyPow(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1493 SCIP_CALL( SCIPcallExprSimplify(
scip, auxproduct, simplifiedexpr, ownercreate, ownercreatedata) );
1508 SCIPdebugPrintf(
"[simplifyPow] seeing a sum with one term, exponent %g\n", exponent);
1517 SCIP_CALL( simplifyPow(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1523 SCIP_CALL( SCIPcallExprSimplify(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
1535 if(
SCIPisExprSum(
scip, base) && exponent == 2.0 && exprhdlrdata->expandmaxexponent >= 2 )
1539 int nexpandedchildren;
1548 nexpandedchildren = nchildren * (nchildren + 1) / 2 + nchildren;
1552 for(
i = 0;
i < nchildren; ++
i )
1560 for( j = 0; j <
i; ++j )
1567 SCIP_CALL( SCIPcallExprSimplify(
scip, expansionchild, &expandedchildren[
i*(
i+1)/2 + j],
1568 ownercreate, ownercreatedata) );
1577 SCIP_CALL( SCIPcallExprSimplify(
scip, expansionchild, &expandedchildren[
i*(
i+1)/2 +
i], ownercreate,
1582 for(
i = 0;
i < nchildren; ++
i )
1589 constant *= constant;
1592 ownercreate, ownercreatedata) );
1593 SCIP_CALL( SCIPcallExprSimplify(
scip, expansion, simplifiedexpr, ownercreate,
1599 for(
i = 0;
i < nexpandedchildren - nchildren; ++
i )
1610 if(
SCIPisExprSum(
scip, base) && exponent > 2.0 && exponent <= exprhdlrdata->expandmaxexponent )
1634 SCIPdebugPrintf(
"[simplifyPow] seeing a sum with one term, exponent %g\n", exponent);
1642 SCIP_CALL( simplifyPow(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1650 SCIP_CALL( SCIPcallExprSimplify(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
1677 SCIP_CALL( simplifyPow(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1687 SCIP_CALL( SCIPcallExprSimplify(
scip, auxproduct, simplifiedexpr, ownercreate, ownercreatedata) );
1704 newexponent = baseexponent * exponent;
1716 (
EPSISINT(baseexponent, 0.0) && ((
int)baseexponent) % 2 == 0) )
1720 if(
EPSISINT(baseexponent, 0.0) && ((
int)baseexponent) % 2 == 0 &&
1721 (!
EPSISINT(newexponent, 0.0) || ((
int)newexponent) % 2 == 1) )
1731 SCIP_CALL( SCIPcallExprSimplify(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1742 SCIP_CALL( simplifyPow(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
1750 *simplifiedexpr = expr;
1772 (*symdata)->nconstants = 1;
1773 (*symdata)->ncoefficients = 0;
1776 (*symdata)->constants[0] = exprdata->exponent;
1814 *targetexprdata =
NULL;
1857 assert(currentchild == 0);
1866 if( exponent >= 0.0 )
1897 *val = pow(base, exponent);
1902 if( !
SCIPisFinite(*val) || *val == HUGE_VAL || *val == -HUGE_VAL )
1967 if( exponent > 0.0 && exponent < 2.0 &&
SCIPexprGetEvalValue(child) == 0.0 && exponent != 1.0 )
1998 if( exponent > 0.0 && exponent < 1.0 && childval == 0.0 )
2001 *val = exponent * pow(childval, exponent - 1.0);
2020 if( exponent < 0.0 )
2026 if( exprhdlrdata->minzerodistance > 0.0 )
2029 if( childinterval.
inf > -exprhdlrdata->minzerodistance && childinterval.
inf < exprhdlrdata->minzerodistance )
2034 "Check your model formulation or use option expr/" POWEXPRHDLR_NAME "/minzerodistance to avoid this warning.\n",
2035 exponent, childinterval.
inf, exprhdlrdata->minzerodistance);
2039 exprhdlrdata->warnedonpole =
TRUE;
2041 childinterval.
inf = exprhdlrdata->minzerodistance;
2043 else if( childinterval.
sup < exprhdlrdata->minzerodistance
2044 && childinterval.
sup > -exprhdlrdata->minzerodistance )
2049 "Check your model formulation or use option expr/" POWEXPRHDLR_NAME "/minzerodistance to avoid this warning.\n",
2050 exponent, childinterval.
sup, -exprhdlrdata->minzerodistance);
2054 exprhdlrdata->warnedonpole =
TRUE;
2056 childinterval.
sup = -exprhdlrdata->minzerodistance;
2072 if( exponent < 0.0 && childinterval.
inf == 0.0 && childinterval.
sup == 0.0 )
2115 childlb = localbounds[0].inf;
2116 childub = localbounds[0].sup;
2119 exponent = exprdata->exponent;
2120 assert(exponent != 1.0 && exponent != 0.0);
2125 if( childlb == childub )
2128 *constant = pow(childlb, exponent);
2130 *islocal = globalbounds[0].inf != globalbounds[0].sup;
2131 *branchcand =
FALSE;
2135 isinteger =
EPSISINT(exponent, 0.0);
2138 if( !isinteger && childlb < 0.0 )
2146 assert(isinteger || childlb >= 0.0);
2150 constant, success, islocal, branchcand) );
2168 child = childrenbounds[0];
2170 SCIPdebugMsg(
scip,
"reverseprop x^%g in [%.15g,%.15g], x = [%.15g,%.15g]", exponent, bounds.inf, bounds.sup,
2198 if( exponent < 0.0 )
2205 if( exprhdlrdata->minzerodistance > 0.0 )
2211 if( interval.
inf > -exprhdlrdata->minzerodistance && interval.
inf < exprhdlrdata->minzerodistance )
2216 "Check your model formulation or use option expr/" POWEXPRHDLR_NAME "/minzerodistance to avoid this warning.\n",
2217 exponent, interval.
inf, exprhdlrdata->minzerodistance);
2221 exprhdlrdata->warnedonpole =
TRUE;
2223 interval.
inf = exprhdlrdata->minzerodistance;
2225 else if( interval.
sup < exprhdlrdata->minzerodistance && interval.
sup > -exprhdlrdata->minzerodistance )
2230 "Check your model formulation or use option expr/" POWEXPRHDLR_NAME "/minzerodistance to avoid this warning.\n",
2231 exponent, interval.
sup, -exprhdlrdata->minzerodistance);
2235 exprhdlrdata->warnedonpole =
TRUE;
2237 interval.
sup = -exprhdlrdata->minzerodistance;
2244 childrenbounds[0] = interval;
2273 childlb = bounds[0].inf;
2274 childub = bounds[0].sup;
2279 SCIPdebugMsg(
scip,
"skip initestimates as child seems essentially fixed [%.15g,%.15g]\n", childlb, childub);
2284 exponent = exprdata->exponent;
2285 assert(exponent != 1.0 && exponent != 0.0);
2287 isinteger =
EPSISINT(exponent, 0.0);
2290 if( !isinteger && childlb < 0.0 )
2298 assert(isinteger || childlb >= 0.0);
2308 if( (overest[
i] && !overestimate) || (!overest[
i] && overestimate) )
2312 refpoint = overest[
i] ? refpointsover[
i % 3] : refpointsunder[
i % 3];
2321 SCIPexprIsIntegral(child), refpoint, exponent, coefs[*nreturned], &constant[*nreturned],
2322 &success, &islocal, &branchcand) );
2326 SCIPdebugMsg(
scip,
"initestimate x^%g for base in [%g,%g] at ref=%g, over:%u -> %g*x+%g\n", exponent,
2327 childlb, childub, refpoint, overest[
i], coefs[*nreturned][0], constant[*nreturned]);
2347 *hashkey ^= childrenhashes[0];
2405 expisint =
EPSISINT(exponent, 0.0);
2409 SCIP_Bool expisodd = ceil(exponent/2) != exponent/2;
2414 if( exponent >= 0.0 )
2418 else if( inf >= 0.0 || sup <= 0.0 )
2427 else if( sup <= 0.0 )
2462 expisint =
EPSISINT(exponent, 0.0);
2487 SCIPdebugPrintf(
"[simplifySignpower] simplifying power with expo %g\n", exponent);
2491 if( exponent == 1.0 )
2494 *simplifiedexpr = base;
2508 ownercreate, ownercreatedata) );
2530 SCIP_CALL( SCIPcallExprSimplify(
scip, prod, &simplifiedprod, ownercreate, ownercreatedata) );
2538 SCIP_CALL( SCIPcallExprSimplify(
scip, exponential, simplifiedexpr, ownercreate, ownercreatedata) );
2545 if(
EPSISINT(exponent, 0.0) && ((
int)exponent) % 2 == 1 )
2555 SCIP_CALL( simplifyPow(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
2573 *simplifiedexpr = base;
2596 assert(((
int)exponent) % 2 == 0 );
2600 ownercreate, ownercreatedata) );
2601 SCIP_CALL( simplifySignpower(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
2617 SCIPdebugPrintf(
"[simplifySignpower] seeing a sum with one term, exponent %g\n", exponent);
2624 ownercreate, ownercreatedata) );
2626 SCIP_CALL( simplifySignpower(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
2632 SCIP_CALL( SCIPcallExprSimplify(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
2639 *simplifiedexpr = expr;
2672 assert(currentchild == 0);
2704 string = *endstring;
2705 while( *
string ==
' ' )
2708 if( *
string !=
',' )
2717 SCIPerrorMessage(
"Expected numeric exponent for second argument of signpower().\n");
2759 if( !
SCIPisFinite(*val) || *val == HUGE_VAL || *val == -HUGE_VAL )
2787 *val = exponent * pow(
REALABS(childval), exponent - 1.0);
2839 SCIPdebugMsg(
scip,
"%sestimation of signed x^%g at x=%g\n", overestimate ?
"over" :
"under",
2846 childlb = localbounds[0].inf;
2847 childub = localbounds[0].sup;
2849 childglb = globalbounds[0].inf;
2850 childgub = globalbounds[0].sup;
2853 exponent = exprdata->exponent;
2859 if( childlb == childub )
2862 *constant =
SIGN(childlb)*pow(
REALABS(childlb), exponent);
2864 *islocal = childglb != childgub;
2865 *branchcand =
FALSE;
2869 if( childlb >= 0.0 )
2874 *branchcand = *islocal;
2879 if( !*islocal && childglb < 0.0 )
2889 *islocal = *refpoint < exprdata->root * (-childglb);
2901 childglb, childgub, constant, coefs, islocal, branchcand, success);
2930 childlb = bounds[0].inf;
2931 childub = bounds[0].sup;
2936 SCIPdebugMsg(
scip,
"skip initestimates as child seems essentially fixed [%.15g,%.15g]\n", childlb, childub);
2941 exponent = exprdata->exponent;
2944 if( childlb >= 0.0 )
2949 refpointsover[0] = (childlb + childub) / 2.0;
2951 else if( childub <= 0.0 )
2954 refpointsunder[0] = (childlb + childub) / 2.0;
2966 if( (overest[
i] && !overestimate) || (!overest[
i] && overestimate) )
2970 refpoint = overest[
i] ? refpointsover[
i % 3] : refpointsunder[
i % 3];
2977 estimateParabola(
scip, exponent, overest[
i], childlb, childub, refpoint, &constant[*nreturned], coefs[*nreturned],
2978 &islocal, &success);
2989 childlb, childub, &constant[*nreturned], coefs[*nreturned], &islocal,
2990 &branchcand, &success);
3014 SCIPdebugMsg(
scip,
"reverseprop signpow(x,%g) in [%.15g,%.15g]", exponent, bounds.inf, bounds.sup);
3025 if( exprecip.
inf == exprecip.
sup )
3039 childrenbounds[0] = interval;
3056 *hashkey ^= childrenhashes[0];
3085 *success = childinterval.
inf >= 0.0;
3091 *success = childinterval.
sup <= 0.0;
3122 evalPow, exprhdlrdata) );
3141 "minimal distance from zero to enforce for child in bound tightening",
3145 "maximal exponent when to expand power of sum in simplify",
3146 &exprhdlrdata->expandmaxexponent,
FALSE, 2, 1, INT_MAX,
NULL,
NULL) );
3149 "whether a fractional exponent is distributed onto factors on power of product",
3192 void* ownercreatedata
3216 void* ownercreatedata
3229 ownercreate, ownercreatedata) );
3261 if( sqrcoef == 0.0 )
3276 tmp = sqrcoef * refpoint;
3284 *lincoef += 2.0 * tmp;
3286 *linconstant -= tmp;
3299 coef = sqrcoef * (2.0 * f + 1.0);
3300 constant = -sqrcoef * f * (f + 1.0);
3309 *linconstant += constant;
3335 if( sqrcoef == 0.0 )
3348 coef = sqrcoef * (lb + ub);
3349 constant = -sqrcoef * lb * ub;
3357 *linconstant += constant;
3436 xref = 0.5 * xlb + 0.5 * xub;
3460 return exprdata->exponent;
#define SCIP_INTERVAL_INFINITY
#define SCIP_STRINGEQ(name, reference, retcode)
absolute expression handler
exponential expression handler
#define SIGNPOWEXPRHDLR_PRECEDENCE
#define POWEXPRHDLR_PRECEDENCE
void SCIPaddSquareLinearization(SCIP *scip, SCIP_Real sqrcoef, SCIP_Real refpoint, SCIP_Bool isint, SCIP_Real *lincoef, SCIP_Real *linconstant, SCIP_Bool *success)
static SCIP_RETCODE chooseRefpointsPow(SCIP *scip, SCIP_EXPRDATA *exprdata, SCIP_Real lb, SCIP_Real ub, SCIP_Real *refpointsunder, SCIP_Real *refpointsover, SCIP_Bool underestimate, SCIP_Bool overestimate)
static void estimateSignedpower(SCIP *scip, SCIP_Real exponent, SCIP_Real root, SCIP_Bool overestimate, SCIP_Real xlb, SCIP_Real xub, SCIP_Real xref, SCIP_Real xlbglobal, SCIP_Real xubglobal, SCIP_Real *constant, SCIP_Real *slope, SCIP_Bool *islocal, SCIP_Bool *branchcand, SCIP_Bool *success)
static void computeTangent(SCIP *scip, SCIP_Bool signpower, SCIP_Real exponent, SCIP_Real xref, SCIP_Real *constant, SCIP_Real *slope, SCIP_Bool *success)
#define SIGNPOWEXPRHDLR_NAME
void SCIPestimateRoot(SCIP *scip, SCIP_Real exponent, SCIP_Bool overestimate, SCIP_Real xlb, SCIP_Real xub, SCIP_Real xref, SCIP_Real *constant, SCIP_Real *slope, SCIP_Bool *islocal, SCIP_Bool *success)
#define SIGNPOWEXPRHDLR_HASHKEY
static SCIP_RETCODE buildPowEstimator(SCIP *scip, SCIP_EXPRDATA *exprdata, SCIP_Bool overestimate, SCIP_Real childlb, SCIP_Real childub, SCIP_Real childglb, SCIP_Real childgub, SCIP_Bool childintegral, SCIP_Real refpoint, SCIP_Real exponent, SCIP_Real *coef, SCIP_Real *constant, SCIP_Bool *success, SCIP_Bool *islocal, SCIP_Bool *branchcand)
static void estimateParabola(SCIP *scip, SCIP_Real exponent, SCIP_Bool overestimate, SCIP_Real xlb, SCIP_Real xub, SCIP_Real xref, SCIP_Real *constant, SCIP_Real *slope, SCIP_Bool *islocal, SCIP_Bool *success)
static SCIP_RETCODE createData(SCIP *scip, SCIP_EXPRDATA **exprdata, SCIP_Real exponent)
void SCIPaddSquareSecant(SCIP *scip, SCIP_Real sqrcoef, SCIP_Real lb, SCIP_Real ub, SCIP_Real *lincoef, SCIP_Real *linconstant, SCIP_Bool *success)
static SCIP_RETCODE addSignpowerRefpoints(SCIP *scip, SCIP_EXPRDATA *exprdata, SCIP_Real lb, SCIP_Real ub, SCIP_Real exponent, SCIP_Bool underestimate, SCIP_Real *refpoints)
#define SIGNPOW_ROOTS_KNOWN
static void estimateHyperbolaPositive(SCIP *scip, SCIP_Real exponent, SCIP_Real root, SCIP_Bool overestimate, SCIP_Real xlb, SCIP_Real xub, SCIP_Real xref, SCIP_Real xlbglobal, SCIP_Real xubglobal, SCIP_Real *constant, SCIP_Real *slope, SCIP_Bool *islocal, SCIP_Bool *branchcand, SCIP_Bool *success)
#define POWEXPRHDLR_HASHKEY
static SCIP_RETCODE computeSignpowerRoot(SCIP *scip, SCIP_Real *root, SCIP_Real exponent)
static void estimateHyperbolaMixed(SCIP *scip, SCIP_Real exponent, SCIP_Bool overestimate, SCIP_Real xlb, SCIP_Real xub, SCIP_Real xref, SCIP_Real xlbglobal, SCIP_Real xubglobal, SCIP_Real *constant, SCIP_Real *slope, SCIP_Bool *islocal, SCIP_Bool *branchcand, SCIP_Bool *success)
#define SIGNPOWEXPRHDLR_DESC
static void addTangentRefpoints(SCIP *scip, SCIP_Real exponent, SCIP_Real lb, SCIP_Real ub, SCIP_Real *refpoints)
static SCIP_RETCODE computeHyperbolaRoot(SCIP *scip, SCIP_Real *root, SCIP_Real exponent)
static SCIP_Real signpow_roots[SIGNPOW_ROOTS_KNOWN+1]
static void computeSecant(SCIP *scip, SCIP_Bool signpower, SCIP_Real exponent, SCIP_Real xlb, SCIP_Real xub, SCIP_Real *constant, SCIP_Real *slope, SCIP_Bool *success)
power and signed power expression handlers
product expression handler
constant value expression handler
SCIP_RETCODE SCIPcreateExprProduct(SCIP *scip, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_Real coefficient, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPpowerExprSum(SCIP *scip, SCIP_EXPR **result, SCIP_EXPR *base, int exponent, SCIP_Bool simplify, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_Bool SCIPisExprAbs(SCIP *scip, SCIP_EXPR *expr)
SCIP_RETCODE SCIPcreateExprAbs(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprSignpower(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_Real exponent, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_Bool SCIPisExprExp(SCIP *scip, SCIP_EXPR *expr)
SCIP_RETCODE SCIPcreateExprExp(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_Bool SCIPisExprSignpower(SCIP *scip, SCIP_EXPR *expr)
SCIP_RETCODE SCIPcreateExprSum(SCIP *scip, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_Real *coefficients, SCIP_Real constant, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprValue(SCIP *scip, SCIP_EXPR **expr, SCIP_Real value, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPcreateExprPow(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPR *child, SCIP_Real exponent, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPincludeExprhdlrSignpower(SCIP *scip)
SCIP_RETCODE SCIPincludeExprhdlrPow(SCIP *scip)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_VERBLEVEL SCIPgetVerbLevel(SCIP *scip)
#define SCIPdebugMsgPrint
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)
const char * SCIPexprhdlrGetName(SCIP_EXPRHDLR *exprhdlr)
void SCIPexprhdlrSetCompare(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetIntegrality(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetCurvature(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetParse(SCIP_EXPRHDLR *exprhdlr,)
SCIP_EXPRHDLRDATA * SCIPexprhdlrGetData(SCIP_EXPRHDLR *exprhdlr)
void SCIPexprhdlrSetIntEval(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetMonotonicity(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetReverseProp(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetHash(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetGetSymdata(SCIP_EXPRHDLR *exprhdlr,)
SCIP_RETCODE SCIPincludeExprhdlr(SCIP *scip, SCIP_EXPRHDLR **exprhdlr, const char *name, const char *desc, unsigned int precedence, SCIP_DECL_EXPREVAL((*eval)), SCIP_EXPRHDLRDATA *data)
void SCIPexprhdlrSetSimplify(SCIP_EXPRHDLR *exprhdlr,)
void SCIPexprhdlrSetDiff(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRBWDIFF((*bwdiff)), SCIP_DECL_EXPRFWDIFF((*fwdiff)),)
void SCIPexprhdlrSetCopyFreeHdlr(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRCOPYHDLR((*copyhdlr)),)
SCIP_EXPRHDLR * SCIPgetExprhdlrPower(SCIP *scip)
void SCIPexprhdlrSetPrint(SCIP_EXPRHDLR *exprhdlr,)
SCIP_EXPRHDLR * SCIPfindExprhdlr(SCIP *scip, const char *name)
void SCIPexprhdlrSetCopyFreeData(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRCOPYDATA((*copydata)),)
void SCIPexprhdlrSetEstimate(SCIP_EXPRHDLR *exprhdlr, SCIP_DECL_EXPRINITESTIMATES((*initestimates)),)
SCIP_IMPLINTTYPE SCIPexprGetIntegrality(SCIP_EXPR *expr)
SCIP_RETCODE SCIPcreateExpr(SCIP *scip, SCIP_EXPR **expr, SCIP_EXPRHDLR *exprhdlr, SCIP_EXPRDATA *exprdata, int nchildren, SCIP_EXPR **children, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPappendExprChild(SCIP *scip, SCIP_EXPR *expr, SCIP_EXPR *child)
void SCIPexprSetData(SCIP_EXPR *expr, SCIP_EXPRDATA *exprdata)
int SCIPexprGetNChildren(SCIP_EXPR *expr)
SCIP_Real SCIPgetExponentExprPow(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprProduct(SCIP *scip, SCIP_EXPR *expr)
SCIP_EXPRCURV SCIPexprcurvPowerInv(SCIP_INTERVAL basebounds, SCIP_Real exponent, SCIP_EXPRCURV powercurv)
SCIP_Bool SCIPisExprSum(SCIP *scip, SCIP_EXPR *expr)
SCIP_Bool SCIPexprIsIntegral(SCIP_EXPR *expr)
SCIP_Real * SCIPgetCoefsExprSum(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprValue(SCIP *scip, SCIP_EXPR *expr)
int SCIPcompareExpr(SCIP *scip, SCIP_EXPR *expr1, SCIP_EXPR *expr2)
SCIP_RETCODE SCIPreleaseExpr(SCIP *scip, SCIP_EXPR **expr)
SCIP_Real SCIPexprGetDot(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprVar(SCIP *scip, SCIP_EXPR *expr)
SCIP_EXPRDATA * SCIPexprGetData(SCIP_EXPR *expr)
SCIP_RETCODE SCIPparseExpr(SCIP *scip, SCIP_EXPR **expr, const char *exprstr, const char **finalpos, SCIP_DECL_EXPR_OWNERCREATE((*ownercreate)), void *ownercreatedata)
SCIP_RETCODE SCIPprintExpr(SCIP *scip, SCIP_EXPR *expr, FILE *file)
SCIP_Real SCIPgetValueExprValue(SCIP_EXPR *expr)
SCIP_Bool SCIPisExprPower(SCIP *scip, SCIP_EXPR *expr)
SCIP_Real SCIPexprGetEvalValue(SCIP_EXPR *expr)
SCIP_EXPR ** SCIPexprGetChildren(SCIP_EXPR *expr)
SCIP_Real SCIPgetConstantExprSum(SCIP_EXPR *expr)
SCIP_VAR * SCIPgetVarExprVar(SCIP_EXPR *expr)
SCIP_INTERVAL SCIPexprGetActivity(SCIP_EXPR *expr)
void SCIPcaptureExpr(SCIP_EXPR *expr)
SCIP_RETCODE SCIPevalExprActivity(SCIP *scip, SCIP_EXPR *expr)
SCIP_EXPRHDLR * SCIPexprGetHdlr(SCIP_EXPR *expr)
SCIP_Real SCIPintervalGetInf(SCIP_INTERVAL interval)
SCIP_Bool SCIPintervalIsEntire(SCIP_Real infinity, SCIP_INTERVAL operand)
void SCIPintervalSignPowerScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
void SCIPintervalUnify(SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPintervalSet(SCIP_INTERVAL *resultant, SCIP_Real value)
SCIP_Bool SCIPintervalIsEmpty(SCIP_Real infinity, SCIP_INTERVAL operand)
void SCIPintervalPowerScalarInverse(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL basedomain, SCIP_Real exponent, SCIP_INTERVAL image)
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
struct SCIP_Interval SCIP_INTERVAL
void SCIPintervalReciprocal(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand)
void SCIPintervalPowerScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
SCIP_Real SCIPintervalGetSup(SCIP_INTERVAL interval)
void SCIPintervalSetEmpty(SCIP_INTERVAL *resultant)
#define SCIPallocClearBlockMemory(scip, ptr)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPepsilon(SCIP *scip)
SCIP_Bool SCIPparseReal(SCIP *scip, const char *str, SCIP_Real *value, char **endptr)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
assert(minobj< SCIPgetCutoffbound(scip))
public functions to work with algebraic expressions
structs for symmetry computations
struct SCIP_Expr SCIP_EXPR
#define SCIP_DECL_EXPR_OWNERCREATE(x)
#define SCIP_DECL_EXPRREVERSEPROP(x)
#define SCIP_DECL_EXPRINITESTIMATES(x)
#define SCIP_DECL_EXPRBWFWDIFF(x)
#define SCIP_DECL_EXPRCURVATURE(x)
struct SCIP_ExprhdlrData SCIP_EXPRHDLRDATA
struct SCIP_ExprData SCIP_EXPRDATA
#define SCIP_DECL_EXPRFREEDATA(x)
#define SCIP_EXPR_MAXINITESTIMATES
#define SCIP_DECL_EXPRPARSE(x)
#define SCIP_DECL_EXPRBWDIFF(x)
#define SCIP_DECL_EXPRINTEVAL(x)
#define SCIP_DECL_EXPRMONOTONICITY(x)
#define SCIP_EXPRITER_VISITINGCHILD
struct SCIP_Exprhdlr SCIP_EXPRHDLR
#define SCIP_DECL_EXPRCOMPARE(x)
#define SCIP_DECL_EXPRSIMPLIFY(x)
#define SCIP_DECL_EXPREVAL(x)
#define SCIP_DECL_EXPRFWDIFF(x)
#define SCIP_DECL_EXPRHASH(x)
#define SCIP_DECL_EXPRCOPYHDLR(x)
#define SCIP_DECL_EXPRPRINT(x)
#define SCIP_DECL_EXPRFREEHDLR(x)
#define SCIP_DECL_EXPRINTEGRALITY(x)
#define SCIP_EXPRITER_VISITEDCHILD
#define SCIP_DECL_EXPRGETSYMDATA(x)
#define SCIP_DECL_EXPRCOPYDATA(x)
#define SCIP_EXPRITER_LEAVEEXPR
#define SCIP_DECL_EXPRESTIMATE(x)
#define SCIP_EXPRITER_ENTEREXPR
enum SCIP_Retcode SCIP_RETCODE