50#define POWEXPRHDLR_NAME "pow"
51#define POWEXPRHDLR_DESC "power expression"
52#define POWEXPRHDLR_PRECEDENCE 55000
53#define POWEXPRHDLR_HASHKEY SCIPcalcFibHash(21163.0)
55#define SIGNPOWEXPRHDLR_NAME "signpower"
56#define SIGNPOWEXPRHDLR_DESC "signed power expression"
57#define SIGNPOWEXPRHDLR_PRECEDENCE 56000
58#define SIGNPOWEXPRHDLR_HASHKEY SCIPcalcFibHash(21163.1)
60#define INITLPMAXPOWVAL 1e+06
71#define SIGN(x) ((x) >= 0.0 ? 1.0 : -1.0)
73#define SIGNPOW_ROOTS_KNOWN 10
82 0.41421356237309504880,
84 0.56042566045031785945,
85 0.60582958618826802099,
86 0.64146546982884663257,
87 0.67033204760309682774,
88 0.69428385661425826738,
89 0.71453772716733489700,
90 0.73192937842370733350
94struct SCIP_ExprhdlrData
97 int expandmaxexponent;
141 *root = 0.39821689389382575186;
150 else if( exponent <= 2.0 )
155 for( iter = 0; iter < 1000; ++iter )
157 polyval = (exponent - 1.0) * pow(*root, exponent) + exponent * pow(*root, exponent - 1.0) - 1.0;
162 gradval = (exponent - 1.0) * exponent * (pow(*root, exponent - 1.0) + pow(*root, exponent - 2.0));
167 *root -= polyval / gradval;
177 SCIPdebugMsg(
scip,
"root for %g is %.20g, certainty = %g\n", exponent, *root, polyval);
201 for( iter = 0; iter < 1000; ++iter )
203 polyval = (exponent - 1.0) * pow(*root, exponent) - exponent * pow(*root, exponent - 1.0) + 1.0;
208 gradval = (exponent - 1.0) * exponent * (pow(*root, exponent - 1.0) - pow(*root, exponent - 2.0));
213 *root -= polyval / gradval;
223 SCIPdebugMsg(
scip,
"root for %g is %.20g, certainty = %g\n", exponent, *root, polyval);
241 (*exprdata)->exponent = exponent;
273 assert(xref != 0.0 || exponent > 0.0);
282 if( !
EPSISINT(exponent, 0.0) && !signpower && xref < 0.0 )
285 xrefpow = pow(signpower ?
REALABS(xref) : xref, exponent - 1.0);
294 *constant = (1.0 - exponent) * xrefpow * xref;
295 *slope = exponent * xrefpow;
338 *constant = pow(xlb, exponent);
350 *constant = pow(xlb, exponent);
357 else if( xlb == 0.0 && exponent > 0.0 )
360 *slope = pow(xub, exponent-1.0);
363 else if( xub == 0.0 && exponent > 0.0 )
370 *slope = pow(-xlb, exponent-1.0);
372 *slope = pow(xlb, exponent-1.0);
375 else if(
SCIPisEQ(
scip, xlb, xub) && (!signpower || xlb >= 0.0 || xub <= 0.0) )
404 if( signpower && xub <= 0.0 )
410 xlb_n = pow(xlb, exponent);
411 xlb_n1 = pow(xlb, exponent - 1.0);
412 xlb_n2 = pow(xlb, exponent - 2.0);
414 *slope = 0.5*exponent * ((3.0-exponent) * xlb_n1 + (exponent-1.0) * xlb_n2 * xub);
415 *constant = (1.0 - 0.5*exponent*(3.0-exponent)) * xlb_n - 0.5*exponent*(exponent-1.0) * xlb_n1 * xub;
417 if( signpower && xub <= 0.0 )
428 lbval = pow(xlb, exponent);
435 ubval = pow(xub, exponent);
445 *slope = (ubval - lbval) / (xub - xlb);
446 *constant = lbval - *slope * xlb;
505 assert((exponent >= 0.0 &&
EPSISINT(exponent/2.0, 0.0)) || (exponent > 1.0 && xlb >= 0.0));
581 assert(xubglobal <= 0.0 || (root > 0.0 && root < 1.0));
636 *islocal = xref < -root * xlbglobal;
655 *islocal = xref > -root * xubglobal;
734 if( xlb >= 0.0 || xub <= 0.0 )
739 if( xref < 0.0 && xlb >= 0.0 )
741 else if( xref > 0.0 && xub <= 0.0 )
753 xref = 0.9 * xlb + 0.1 * xub;
761 xref = 0.1 * xlb + 0.9 * xub;
784 if( xref > 0.0 && xlbglobal < 0.0 )
789 *islocal = xref < xlbglobal * root;
791 else if( xref < 0.0 && xubglobal > 0.0 )
796 *islocal = xref > xubglobal * root;
804 *islocal = xlbglobal * xubglobal < 0.0;
824 constant, slope, islocal, branchcand, success);
849 if( xref <= xlb * root )
865 *islocal = xref < xlbglobal * root;
874 if( xlb < 0.0 && xub > 0.0 )
966 xref = 0.1*xlb + 0.9*xub;
976 *islocal = xlbglobal * xubglobal < 0.0;
1021 isinteger =
EPSISINT(exponent, 0.0);
1022 iseven = isinteger &&
EPSISINT(exponent / 2.0, 0.0);
1024 if( exponent == 2.0 )
1041 *branchcand =
FALSE;
1044 else if( exponent > 0.0 && iseven )
1046 estimateParabola(
scip, exponent, overestimate, childlb, childub, refpoint, constant, coef, islocal, success);
1048 *branchcand = *islocal;
1050 else if( exponent > 1.0 && childlb >= 0.0 )
1053 if( refpoint < 0.0 )
1056 estimateParabola(
scip, exponent, overestimate, childlb, childub, refpoint, constant, coef, islocal, success);
1059 *branchcand = *islocal;
1064 if( !*islocal && !iseven && childglb < 0.0 )
1074 *islocal = refpoint < exprdata->root * (-childglb);
1078 else if( exponent > 1.0 )
1086 -childglb, childgub, constant, coef, islocal, branchcand, success);
1088 else if( exponent < 0.0 && (iseven || childlb >= 0.0) )
1096 childglb, childgub, constant, coef, islocal, branchcand, success);
1098 else if( exponent < 0.0 )
1105 constant, coef, islocal, branchcand, success);
1112 SCIPestimateRoot(
scip, exponent, overestimate, childlb, childub, refpoint, constant, coef, islocal, success);
1115 *branchcand = *islocal;
1138 if( ub > -maxabsbnd )
1139 lb =
MAX(lb, -maxabsbnd);
1140 if( lb < maxabsbnd )
1141 ub =
MIN(ub, maxabsbnd);
1149 refpoints[0] = (7.0 * lb + ub) / 8.0;
1150 refpoints[1] = (lb + ub) / 2.0;
1151 refpoints[2] = (lb + 7.0 * ub) / 8.0;
1183 lb = -ub * exprdata->root - 1.0;
1185 ub = -lb * exprdata->root + 1.0;
1193 if( -lb * exprdata->root < ub - 2.0 )
1195 if( -lb * exprdata->root < ub - 4.0 )
1196 refpoints[1] = (-lb * exprdata->root + ub) / 2.0;
1199 if( !underestimate )
1205 if( -ub * exprdata->root > lb + 2.0 )
1207 if( -ub * exprdata->root > lb + 4.0 )
1208 refpoints[1] = (lb - ub * exprdata->root) / 2.0;
1237 exponent = exprdata->exponent;
1242 mixedsign = lb < 0.0 && ub > 0.0;
1249 if( (exponent > 1.0 && (lb >= 0 || even)) || (exponent < 0.0 && lb >= 0) || (exponent < 0.0 && even && ub <= 0.0) )
1255 else if( ub <= 0 || (exponent > 0.0 && exponent < 1.0) )
1263 (exponent < 0.0 && even && mixedsign) )
1266 refpointsunder[0] = (lb + ub) / 2.0;
1268 else if( exponent > 1.0 && !even && mixedsign )
1279 refpointsover[0] = (lb + ub) / 2.0;
1282 else if( exponent > 1.0 && !even && mixedsign )
1312 if( compareresult != 0 )
1313 return compareresult;
1318 return expo1 == expo2 ? 0 : expo1 < expo2 ? -1 : 1;
1350 SCIPdebugPrintf(
"[simplifyPow] simplifying power with expo %g\n", exponent);
1353 if( exponent == 0.0 )
1363 if( exponent == 1.0 )
1366 *simplifiedexpr = base;
1384 if( baseval < 0.0 && fmod(exponent, 1.0) != 0.0 && baseval > -
SCIPepsilon(
scip) )
1388 assert(baseval >= 0.0 || fmod(exponent, 1.0) == 0.0);
1389 assert(baseval != 0.0 || exponent != 0.0);
1391 if( baseval != 0.0 || exponent > 0.0 )
1413 SCIP_CALL( SCIPcallExprSimplify(
scip, prod, &simplifiedprod, ownercreate, ownercreatedata) );
1421 SCIP_CALL( SCIPcallExprSimplify(
scip, exponential, simplifiedexpr, ownercreate, ownercreatedata) );
1442 *simplifiedexpr = base;
1461 SCIP_CALL( simplifyPow(
scip, newpow, simplifiedexpr, ownercreate, ownercreatedata) );
1485 SCIP_CALL( simplifyPow(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1495 SCIP_CALL( SCIPcallExprSimplify(
scip, auxproduct, simplifiedexpr, ownercreate, ownercreatedata) );
1510 SCIPdebugPrintf(
"[simplifyPow] seeing a sum with one term, exponent %g\n", exponent);
1519 SCIP_CALL( simplifyPow(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1525 SCIP_CALL( SCIPcallExprSimplify(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
1537 if(
SCIPisExprSum(
scip, base) && exponent == 2.0 && exprhdlrdata->expandmaxexponent >= 2 )
1541 int nexpandedchildren;
1550 nexpandedchildren = nchildren * (nchildren + 1) / 2 + nchildren;
1554 for(
i = 0;
i < nchildren; ++
i )
1562 for( j = 0; j <
i; ++j )
1569 SCIP_CALL( SCIPcallExprSimplify(
scip, expansionchild, &expandedchildren[
i*(
i+1)/2 + j],
1570 ownercreate, ownercreatedata) );
1579 SCIP_CALL( SCIPcallExprSimplify(
scip, expansionchild, &expandedchildren[
i*(
i+1)/2 +
i], ownercreate,
1584 for(
i = 0;
i < nchildren; ++
i )
1591 constant *= constant;
1594 ownercreate, ownercreatedata) );
1595 SCIP_CALL( SCIPcallExprSimplify(
scip, expansion, simplifiedexpr, ownercreate,
1601 for(
i = 0;
i < nexpandedchildren - nchildren; ++
i )
1612 if(
SCIPisExprSum(
scip, base) && exponent > 2.0 && exponent <= exprhdlrdata->expandmaxexponent )
1636 SCIPdebugPrintf(
"[simplifyPow] seeing a sum with one term, exponent %g\n", exponent);
1644 SCIP_CALL( simplifyPow(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1652 SCIP_CALL( SCIPcallExprSimplify(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
1679 SCIP_CALL( simplifyPow(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1689 SCIP_CALL( SCIPcallExprSimplify(
scip, auxproduct, simplifiedexpr, ownercreate, ownercreatedata) );
1706 newexponent = baseexponent * exponent;
1718 (
EPSISINT(baseexponent, 0.0) && ((
int)baseexponent) % 2 == 0) )
1722 if(
EPSISINT(baseexponent, 0.0) && ((
int)baseexponent) % 2 == 0 &&
1723 (!
EPSISINT(newexponent, 0.0) || ((
int)newexponent) % 2 == 1) )
1733 SCIP_CALL( SCIPcallExprSimplify(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1744 SCIP_CALL( simplifyPow(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
1752 *simplifiedexpr = expr;
1774 (*symdata)->nconstants = 1;
1775 (*symdata)->ncoefficients = 0;
1778 (*symdata)->constants[0] = exprdata->exponent;
1816 *targetexprdata =
NULL;
1859 assert(currentchild == 0);
1868 if( exponent >= 0.0 )
1899 *val = pow(base, exponent);
1904 if( !
SCIPisFinite(*val) || *val == HUGE_VAL || *val == -HUGE_VAL )
1969 if( exponent > 0.0 && exponent < 2.0 &&
SCIPexprGetEvalValue(child) == 0.0 && exponent != 1.0 )
2000 if( exponent > 0.0 && exponent < 1.0 && childval == 0.0 )
2003 *val = exponent * pow(childval, exponent - 1.0);
2022 if( exponent < 0.0 )
2028 if( exprhdlrdata->minzerodistance > 0.0 )
2031 if( childinterval.
inf > -exprhdlrdata->minzerodistance && childinterval.
inf < exprhdlrdata->minzerodistance )
2036 "Check your model formulation or use option expr/" POWEXPRHDLR_NAME "/minzerodistance to avoid this warning.\n",
2037 exponent, childinterval.
inf, exprhdlrdata->minzerodistance);
2041 exprhdlrdata->warnedonpole =
TRUE;
2043 childinterval.
inf = exprhdlrdata->minzerodistance;
2045 else if( childinterval.
sup < exprhdlrdata->minzerodistance
2046 && childinterval.
sup > -exprhdlrdata->minzerodistance )
2051 "Check your model formulation or use option expr/" POWEXPRHDLR_NAME "/minzerodistance to avoid this warning.\n",
2052 exponent, childinterval.
sup, -exprhdlrdata->minzerodistance);
2056 exprhdlrdata->warnedonpole =
TRUE;
2058 childinterval.
sup = -exprhdlrdata->minzerodistance;
2074 if( exponent < 0.0 && childinterval.
inf == 0.0 && childinterval.
sup == 0.0 )
2116 childlb = localbounds[0].inf;
2117 childub = localbounds[0].sup;
2120 exponent = exprdata->exponent;
2121 assert(exponent != 1.0 && exponent != 0.0);
2126 if( childlb == childub )
2129 *constant = pow(childlb, exponent);
2131 *islocal = globalbounds[0].inf != globalbounds[0].sup;
2132 *branchcand =
FALSE;
2136 isinteger =
EPSISINT(exponent, 0.0);
2139 if( !isinteger && childlb < 0.0 )
2147 assert(isinteger || childlb >= 0.0);
2151 constant, success, islocal, branchcand) );
2169 child = childrenbounds[0];
2171 SCIPdebugMsg(
scip,
"reverseprop x^%g in [%.15g,%.15g], x = [%.15g,%.15g]", exponent, bounds.inf, bounds.sup,
2199 if( exponent < 0.0 )
2206 if( exprhdlrdata->minzerodistance > 0.0 )
2212 if( interval.
inf > -exprhdlrdata->minzerodistance && interval.
inf < exprhdlrdata->minzerodistance )
2217 "Check your model formulation or use option expr/" POWEXPRHDLR_NAME "/minzerodistance to avoid this warning.\n",
2218 exponent, interval.
inf, exprhdlrdata->minzerodistance);
2222 exprhdlrdata->warnedonpole =
TRUE;
2224 interval.
inf = exprhdlrdata->minzerodistance;
2226 else if( interval.
sup < exprhdlrdata->minzerodistance && interval.
sup > -exprhdlrdata->minzerodistance )
2231 "Check your model formulation or use option expr/" POWEXPRHDLR_NAME "/minzerodistance to avoid this warning.\n",
2232 exponent, interval.
sup, -exprhdlrdata->minzerodistance);
2236 exprhdlrdata->warnedonpole =
TRUE;
2238 interval.
sup = -exprhdlrdata->minzerodistance;
2245 childrenbounds[0] = interval;
2274 childlb = bounds[0].inf;
2275 childub = bounds[0].sup;
2280 SCIPdebugMsg(
scip,
"skip initestimates as child seems essentially fixed [%.15g,%.15g]\n", childlb, childub);
2285 exponent = exprdata->exponent;
2286 assert(exponent != 1.0 && exponent != 0.0);
2288 isinteger =
EPSISINT(exponent, 0.0);
2291 if( !isinteger && childlb < 0.0 )
2299 assert(isinteger || childlb >= 0.0);
2309 if( (overest[
i] && !overestimate) || (!overest[
i] && overestimate) )
2313 refpoint = overest[
i] ? refpointsover[
i % 3] : refpointsunder[
i % 3];
2322 SCIPexprIsIntegral(child), refpoint, exponent, coefs[*nreturned], &constant[*nreturned],
2323 &success, &islocal, &branchcand) );
2327 SCIPdebugMsg(
scip,
"initestimate x^%g for base in [%g,%g] at ref=%g, over:%u -> %g*x+%g\n", exponent,
2328 childlb, childub, refpoint, overest[
i], coefs[*nreturned][0], constant[*nreturned]);
2348 *hashkey ^= childrenhashes[0];
2406 expisint =
EPSISINT(exponent, 0.0);
2410 SCIP_Bool expisodd = ceil(exponent/2) != exponent/2;
2415 if( exponent >= 0.0 )
2419 else if( inf >= 0.0 || sup <= 0.0 )
2428 else if( sup <= 0.0 )
2463 expisint =
EPSISINT(exponent, 0.0);
2488 SCIPdebugPrintf(
"[simplifySignpower] simplifying power with expo %g\n", exponent);
2492 if( exponent == 1.0 )
2495 *simplifiedexpr = base;
2509 ownercreate, ownercreatedata) );
2531 SCIP_CALL( SCIPcallExprSimplify(
scip, prod, &simplifiedprod, ownercreate, ownercreatedata) );
2539 SCIP_CALL( SCIPcallExprSimplify(
scip, exponential, simplifiedexpr, ownercreate, ownercreatedata) );
2546 if(
EPSISINT(exponent, 0.0) && ((
int)exponent) % 2 == 1 )
2556 SCIP_CALL( simplifyPow(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
2574 *simplifiedexpr = base;
2597 assert(((
int)exponent) % 2 == 0 );
2601 ownercreate, ownercreatedata) );
2602 SCIP_CALL( simplifySignpower(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
2618 SCIPdebugPrintf(
"[simplifySignpower] seeing a sum with one term, exponent %g\n", exponent);
2625 ownercreate, ownercreatedata) );
2627 SCIP_CALL( simplifySignpower(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
2633 SCIP_CALL( SCIPcallExprSimplify(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
2640 *simplifiedexpr = expr;
2673 assert(currentchild == 0);
2705 string = *endstring;
2706 while( *
string ==
' ' )
2709 if( *
string !=
',' )
2718 SCIPerrorMessage(
"Expected numeric exponent for second argument of signpower().\n");
2760 if( !
SCIPisFinite(*val) || *val == HUGE_VAL || *val == -HUGE_VAL )
2788 *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);
2929 childlb = bounds[0].inf;
2930 childub = bounds[0].sup;
2935 SCIPdebugMsg(
scip,
"skip initestimates as child seems essentially fixed [%.15g,%.15g]\n", childlb, childub);
2940 exponent = exprdata->exponent;
2943 if( childlb >= 0.0 )
2948 refpointsover[0] = (childlb + childub) / 2.0;
2950 else if( childub <= 0.0 )
2953 refpointsunder[0] = (childlb + childub) / 2.0;
2965 if( (overest[
i] && !overestimate) || (!overest[
i] && overestimate) )
2969 refpoint = overest[
i] ? refpointsover[
i % 3] : refpointsunder[
i % 3];
2976 estimateParabola(
scip, exponent, overest[
i], childlb, childub, refpoint, &constant[*nreturned], coefs[*nreturned],
2977 &islocal, &success);
2988 childlb, childub, &constant[*nreturned], coefs[*nreturned], &islocal,
2989 &branchcand, &success);
3013 SCIPdebugMsg(
scip,
"reverseprop signpow(x,%g) in [%.15g,%.15g]", exponent, bounds.inf, bounds.sup);
3024 if( exprecip.
inf == exprecip.
sup )
3038 childrenbounds[0] = interval;
3055 *hashkey ^= childrenhashes[0];
3084 *success = childinterval.
inf >= 0.0;
3090 *success = childinterval.
sup <= 0.0;
3121 evalPow, exprhdlrdata) );
3140 "minimal distance from zero to enforce for child in bound tightening",
3144 "maximal exponent when to expand power of sum in simplify",
3145 &exprhdlrdata->expandmaxexponent,
FALSE, 2, 1, INT_MAX,
NULL,
NULL) );
3148 "whether a fractional exponent is distributed onto factors on power of product",
3191 void* ownercreatedata
3215 void* ownercreatedata
3228 ownercreate, ownercreatedata) );
3260 if( sqrcoef == 0.0 )
3275 tmp = sqrcoef * refpoint;
3283 *lincoef += 2.0 * tmp;
3285 *linconstant -= tmp;
3298 coef = sqrcoef * (2.0 * f + 1.0);
3299 constant = -sqrcoef * f * (f + 1.0);
3308 *linconstant += constant;
3334 if( sqrcoef == 0.0 )
3347 coef = sqrcoef * (lb + ub);
3348 constant = -sqrcoef * lb * ub;
3356 *linconstant += constant;
3435 xref = 0.5 * xlb + 0.5 * xub;
3459 return exprdata->exponent;
#define SCIP_INTERVAL_INFINITY
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