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
96 SCIP_Real minzerodistance;
97 int expandmaxexponent;
98 SCIP_Bool distribfracexponent;
100 SCIP_Bool warnedonpole;
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;
489 SCIP_Bool overestimate,
505 assert((exponent >= 0.0 &&
EPSISINT(exponent/2.0, 0.0)) || (exponent > 1.0 && xlb >= 0.0));
557 SCIP_Bool overestimate,
567 SCIP_Bool* branchcand,
581 assert(xubglobal <= 0.0 || (root > 0.0 && root < 1.0));
636 *islocal = xref < -root * xlbglobal;
655 *islocal = xref > -root * xubglobal;
705 SCIP_Bool overestimate,
715 SCIP_Bool* branchcand,
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 )
916 SCIP_Bool overestimate,
926 SCIP_Bool* branchcand,
967 xref = 0.1*xlb + 0.9*xub;
977 *islocal = xlbglobal * xubglobal < 0.0;
994 SCIP_Bool overestimate,
999 SCIP_Bool childintegral,
1003 SCIP_Real* constant,
1007 SCIP_Bool* branchcand
1011 SCIP_Bool isinteger;
1022 isinteger =
EPSISINT(exponent, 0.0);
1023 iseven = isinteger &&
EPSISINT(exponent / 2.0, 0.0);
1025 if( exponent == 2.0 )
1042 *branchcand =
FALSE;
1045 else if( exponent > 0.0 && iseven )
1047 estimateParabola(
scip, exponent, overestimate, childlb, childub, refpoint, constant, coef, islocal, success);
1049 *branchcand = *islocal;
1051 else if( exponent > 1.0 && childlb >= 0.0 )
1054 if( refpoint < 0.0 )
1057 estimateParabola(
scip, exponent, overestimate, childlb, childub, refpoint, constant, coef, islocal, success);
1060 *branchcand = *islocal;
1065 if( !*islocal && !iseven && childglb < 0.0 )
1075 *islocal = refpoint < exprdata->root * (-childglb);
1079 else if( exponent > 1.0 )
1087 -childglb, childgub, constant, coef, islocal, branchcand, success);
1089 else if( exponent < 0.0 && (iseven || childlb >= 0.0) )
1097 childglb, childgub, constant, coef, islocal, branchcand, success);
1099 else if( exponent < 0.0 )
1106 constant, coef, islocal, branchcand, success);
1113 SCIPestimateRoot(
scip, exponent, overestimate, childlb, childub, refpoint, constant, coef, islocal, success);
1116 *branchcand = *islocal;
1129 SCIP_Real* refpoints
1132 SCIP_Real maxabsbnd;
1139 if( ub > -maxabsbnd )
1140 lb =
MAX(lb, -maxabsbnd);
1141 if( lb < maxabsbnd )
1142 ub =
MIN(ub, maxabsbnd);
1150 refpoints[0] = (7.0 * lb + ub) / 8.0;
1151 refpoints[1] = (lb + ub) / 2.0;
1152 refpoints[2] = (lb + 7.0 * ub) / 8.0;
1168 SCIP_Bool underestimate,
1169 SCIP_Real* refpoints
1184 lb = -ub * exprdata->root - 1.0;
1186 ub = -lb * exprdata->root + 1.0;
1194 if( -lb * exprdata->root < ub - 2.0 )
1196 if( -lb * exprdata->root < ub - 4.0 )
1197 refpoints[1] = (-lb * exprdata->root + ub) / 2.0;
1200 if( !underestimate )
1206 if( -ub * exprdata->root > lb + 2.0 )
1208 if( -ub * exprdata->root > lb + 4.0 )
1209 refpoints[1] = (lb - ub * exprdata->root) / 2.0;
1222 SCIP_Real* refpointsunder,
1223 SCIP_Real* refpointsover,
1224 SCIP_Bool underestimate,
1225 SCIP_Bool overestimate
1230 SCIP_Bool mixedsign;
1238 exponent = exprdata->exponent;
1243 mixedsign = lb < 0.0 && ub > 0.0;
1250 if( (exponent > 1.0 && (lb >= 0 || even)) || (exponent < 0.0 && lb >= 0) || (exponent < 0.0 && even && ub <= 0.0) )
1256 else if( ub <= 0 || (exponent > 0.0 && exponent < 1.0) )
1264 (exponent < 0.0 && even && mixedsign) )
1267 refpointsunder[0] = (lb + ub) / 2.0;
1269 else if( exponent > 1.0 && !even && mixedsign )
1280 refpointsover[0] = (lb + ub) / 2.0;
1283 else if( exponent > 1.0 && !even && mixedsign )
1313 if( compareresult != 0 )
1314 return compareresult;
1319 return expo1 == expo2 ? 0 : expo1 < expo2 ? -1 : 1;
1351 SCIPdebugPrintf(
"[simplifyPow] simplifying power with expo %g\n", exponent);
1354 if( exponent == 0.0 )
1364 if( exponent == 1.0 )
1367 *simplifiedexpr = base;
1385 if( baseval < 0.0 && fmod(exponent, 1.0) != 0.0 && baseval > -
SCIPepsilon(
scip) )
1389 assert(baseval >= 0.0 || fmod(exponent, 1.0) == 0.0);
1390 assert(baseval != 0.0 || exponent != 0.0);
1392 if( baseval != 0.0 || exponent > 0.0 )
1414 SCIP_CALL( SCIPcallExprSimplify(
scip, prod, &simplifiedprod, ownercreate, ownercreatedata) );
1422 SCIP_CALL( SCIPcallExprSimplify(
scip, exponential, simplifiedexpr, ownercreate, ownercreatedata) );
1443 *simplifiedexpr = base;
1462 SCIP_CALL( simplifyPow(
scip, newpow, simplifiedexpr, ownercreate, ownercreatedata) );
1486 SCIP_CALL( simplifyPow(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1496 SCIP_CALL( SCIPcallExprSimplify(
scip, auxproduct, simplifiedexpr, ownercreate, ownercreatedata) );
1511 SCIPdebugPrintf(
"[simplifyPow] seeing a sum with one term, exponent %g\n", exponent);
1520 SCIP_CALL( simplifyPow(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1526 SCIP_CALL( SCIPcallExprSimplify(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
1538 if(
SCIPisExprSum(
scip, base) && exponent == 2.0 && exprhdlrdata->expandmaxexponent >= 2 )
1542 int nexpandedchildren;
1551 nexpandedchildren = nchildren * (nchildren + 1) / 2 + nchildren;
1555 for(
i = 0;
i < nchildren; ++
i )
1563 for( j = 0; j <
i; ++j )
1570 SCIP_CALL( SCIPcallExprSimplify(
scip, expansionchild, &expandedchildren[
i*(
i+1)/2 + j],
1571 ownercreate, ownercreatedata) );
1580 SCIP_CALL( SCIPcallExprSimplify(
scip, expansionchild, &expandedchildren[
i*(
i+1)/2 +
i], ownercreate,
1585 for(
i = 0;
i < nchildren; ++
i )
1592 constant *= constant;
1595 ownercreate, ownercreatedata) );
1596 SCIP_CALL( SCIPcallExprSimplify(
scip, expansion, simplifiedexpr, ownercreate,
1602 for(
i = 0;
i < nexpandedchildren - nchildren; ++
i )
1613 if(
SCIPisExprSum(
scip, base) && exponent > 2.0 && exponent <= exprhdlrdata->expandmaxexponent )
1638 SCIPdebugPrintf(
"[simplifyPow] seeing a sum with one term, exponent %g\n", exponent);
1646 SCIP_CALL( simplifyPow(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1654 SCIP_CALL( SCIPcallExprSimplify(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
1681 SCIP_CALL( simplifyPow(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1691 SCIP_CALL( SCIPcallExprSimplify(
scip, auxproduct, simplifiedexpr, ownercreate, ownercreatedata) );
1704 SCIP_Real newexponent;
1705 SCIP_Real baseexponent;
1708 newexponent = baseexponent * exponent;
1720 (
EPSISINT(baseexponent, 0.0) && ((
int)baseexponent) % 2 == 0) )
1724 if(
EPSISINT(baseexponent, 0.0) && ((
int)baseexponent) % 2 == 0 &&
1725 (!
EPSISINT(newexponent, 0.0) || ((
int)newexponent) % 2 == 1) )
1735 SCIP_CALL( SCIPcallExprSimplify(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
1746 SCIP_CALL( simplifyPow(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
1754 *simplifiedexpr = expr;
1776 (*symdata)->nconstants = 1;
1777 (*symdata)->ncoefficients = 0;
1780 (*symdata)->constants[0] = exprdata->exponent;
1818 *targetexprdata =
NULL;
1861 assert(currentchild == 0);
1870 if( exponent >= 0.0 )
1901 *val = pow(base, exponent);
1906 if( !
SCIPisFinite(*val) || *val == HUGE_VAL || *val == -HUGE_VAL )
1971 if( exponent > 0.0 && exponent < 2.0 &&
SCIPexprGetEvalValue(child) == 0.0 && exponent != 1.0 )
2002 if( exponent > 0.0 && exponent < 1.0 && childval == 0.0 )
2005 *val = exponent * pow(childval, exponent - 1.0);
2024 if( exponent < 0.0 )
2030 if( exprhdlrdata->minzerodistance > 0.0 )
2033 if( childinterval.
inf > -exprhdlrdata->minzerodistance && childinterval.
inf < exprhdlrdata->minzerodistance )
2038 "Check your model formulation or use option expr/" POWEXPRHDLR_NAME "/minzerodistance to avoid this warning.\n",
2039 exponent, childinterval.
inf, exprhdlrdata->minzerodistance);
2043 exprhdlrdata->warnedonpole =
TRUE;
2045 childinterval.
inf = exprhdlrdata->minzerodistance;
2047 else if( childinterval.
sup < exprhdlrdata->minzerodistance
2048 && childinterval.
sup > -exprhdlrdata->minzerodistance )
2053 "Check your model formulation or use option expr/" POWEXPRHDLR_NAME "/minzerodistance to avoid this warning.\n",
2054 exponent, childinterval.
sup, -exprhdlrdata->minzerodistance);
2058 exprhdlrdata->warnedonpole =
TRUE;
2060 childinterval.
sup = -exprhdlrdata->minzerodistance;
2076 if( exponent < 0.0 && childinterval.
inf == 0.0 && childinterval.
sup == 0.0 )
2091 SCIP_Bool isinteger;
2118 childlb = localbounds[0].inf;
2119 childub = localbounds[0].sup;
2122 exponent = exprdata->exponent;
2123 assert(exponent != 1.0 && exponent != 0.0);
2128 if( childlb == childub )
2131 *constant = pow(childlb, exponent);
2133 *islocal = globalbounds[0].inf != globalbounds[0].sup;
2134 *branchcand =
FALSE;
2138 isinteger =
EPSISINT(exponent, 0.0);
2141 if( !isinteger && childlb < 0.0 )
2149 assert(isinteger || childlb >= 0.0);
2153 constant, success, islocal, branchcand) );
2171 child = childrenbounds[0];
2173 SCIPdebugMsg(
scip,
"reverseprop x^%g in [%.15g,%.15g], x = [%.15g,%.15g]", exponent, bounds.inf, bounds.sup,
2201 if( exponent < 0.0 )
2208 if( exprhdlrdata->minzerodistance > 0.0 )
2214 if( interval.
inf > -exprhdlrdata->minzerodistance && interval.
inf < exprhdlrdata->minzerodistance )
2219 "Check your model formulation or use option expr/" POWEXPRHDLR_NAME "/minzerodistance to avoid this warning.\n",
2220 exponent, interval.
inf, exprhdlrdata->minzerodistance);
2224 exprhdlrdata->warnedonpole =
TRUE;
2226 interval.
inf = exprhdlrdata->minzerodistance;
2228 else if( interval.
sup < exprhdlrdata->minzerodistance && interval.
sup > -exprhdlrdata->minzerodistance )
2233 "Check your model formulation or use option expr/" POWEXPRHDLR_NAME "/minzerodistance to avoid this warning.\n",
2234 exponent, interval.
sup, -exprhdlrdata->minzerodistance);
2238 exprhdlrdata->warnedonpole =
TRUE;
2240 interval.
sup = -exprhdlrdata->minzerodistance;
2247 childrenbounds[0] = interval;
2261 SCIP_Bool isinteger;
2262 SCIP_Bool branchcand;
2276 childlb = bounds[0].inf;
2277 childub = bounds[0].sup;
2282 SCIPdebugMsg(
scip,
"skip initestimates as child seems essentially fixed [%.15g,%.15g]\n", childlb, childub);
2287 exponent = exprdata->exponent;
2288 assert(exponent != 1.0 && exponent != 0.0);
2290 isinteger =
EPSISINT(exponent, 0.0);
2293 if( !isinteger && childlb < 0.0 )
2301 assert(isinteger || childlb >= 0.0);
2311 if( (overest[
i] && !overestimate) || (!overest[
i] && overestimate) )
2315 refpoint = overest[
i] ? refpointsover[
i % 3] : refpointsunder[
i % 3];
2324 SCIPexprIsIntegral(child), refpoint, exponent, coefs[*nreturned], &constant[*nreturned],
2325 &success, &islocal, &branchcand) );
2329 SCIPdebugMsg(
scip,
"initestimate x^%g for base in [%g,%g] at ref=%g, over:%u -> %g*x+%g\n", exponent,
2330 childlb, childub, refpoint, overest[
i], coefs[*nreturned][0], constant[*nreturned]);
2350 *hashkey ^= childrenhashes[0];
2408 expisint =
EPSISINT(exponent, 0.0);
2412 SCIP_Bool expisodd = ceil(exponent/2) != exponent/2;
2417 if( exponent >= 0.0 )
2421 else if( inf >= 0.0 || sup <= 0.0 )
2430 else if( sup <= 0.0 )
2460 *isintegral =
FALSE;
2471 expisint =
EPSISINT(exponent, 0.0);
2474 *isintegral = expisint && exponent >= 0.0;
2496 SCIPdebugPrintf(
"[simplifySignpower] simplifying power with expo %g\n", exponent);
2500 if( exponent == 1.0 )
2503 *simplifiedexpr = base;
2517 ownercreate, ownercreatedata) );
2539 SCIP_CALL( SCIPcallExprSimplify(
scip, prod, &simplifiedprod, ownercreate, ownercreatedata) );
2547 SCIP_CALL( SCIPcallExprSimplify(
scip, exponential, simplifiedexpr, ownercreate, ownercreatedata) );
2554 if(
EPSISINT(exponent, 0.0) && ((
int)exponent) % 2 == 1 )
2564 SCIP_CALL( simplifyPow(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
2582 *simplifiedexpr = base;
2603 SCIP_Real newexponent;
2605 assert(((
int)exponent) % 2 == 0 );
2609 ownercreate, ownercreatedata) );
2610 SCIP_CALL( simplifySignpower(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
2626 SCIPdebugPrintf(
"[simplifySignpower] seeing a sum with one term, exponent %g\n", exponent);
2633 ownercreate, ownercreatedata) );
2635 SCIP_CALL( simplifySignpower(
scip, aux, &simplifiedaux, ownercreate, ownercreatedata) );
2641 SCIP_CALL( SCIPcallExprSimplify(
scip, aux, simplifiedexpr, ownercreate, ownercreatedata) );
2648 *simplifiedexpr = expr;
2681 assert(currentchild == 0);
2713 string = *endstring;
2714 while( *
string ==
' ' )
2717 if( *
string !=
',' )
2726 SCIPerrorMessage(
"Expected numeric exponent for second argument of signpower().\n");
2768 if( !
SCIPisFinite(*val) || *val == HUGE_VAL || *val == -HUGE_VAL )
2796 *val = exponent * pow(
REALABS(childval), exponent - 1.0);
2847 SCIPdebugMsg(
scip,
"%sestimation of signed x^%g at x=%g\n", overestimate ?
"over" :
"under",
2854 childlb = localbounds[0].inf;
2855 childub = localbounds[0].sup;
2857 childglb = globalbounds[0].inf;
2858 childgub = globalbounds[0].sup;
2861 exponent = exprdata->exponent;
2867 if( childlb == childub )
2870 *constant =
SIGN(childlb)*pow(
REALABS(childlb), exponent);
2872 *islocal = childglb != childgub;
2873 *branchcand =
FALSE;
2877 if( childlb >= 0.0 )
2882 *branchcand = *islocal;
2887 if( !*islocal && childglb < 0.0 )
2897 *islocal = *refpoint < exprdata->root * (-childglb);
2909 childglb, childgub, constant, coefs, islocal, branchcand, success);
2923 SCIP_Bool branchcand;
2937 childlb = bounds[0].inf;
2938 childub = bounds[0].sup;
2943 SCIPdebugMsg(
scip,
"skip initestimates as child seems essentially fixed [%.15g,%.15g]\n", childlb, childub);
2948 exponent = exprdata->exponent;
2951 if( childlb >= 0.0 )
2956 refpointsover[0] = (childlb + childub) / 2.0;
2958 else if( childub <= 0.0 )
2961 refpointsunder[0] = (childlb + childub) / 2.0;
2973 if( (overest[
i] && !overestimate) || (!overest[
i] && overestimate) )
2977 refpoint = overest[
i] ? refpointsover[
i % 3] : refpointsunder[
i % 3];
2984 estimateParabola(
scip, exponent, overest[
i], childlb, childub, refpoint, &constant[*nreturned], coefs[*nreturned],
2985 &islocal, &success);
2996 childlb, childub, &constant[*nreturned], coefs[*nreturned], &islocal,
2997 &branchcand, &success);
3021 SCIPdebugMsg(
scip,
"reverseprop signpow(x,%g) in [%.15g,%.15g]", exponent, bounds.inf, bounds.sup);
3032 if( exprecip.
inf == exprecip.
sup )
3046 childrenbounds[0] = interval;
3063 *hashkey ^= childrenhashes[0];
3092 *success = childinterval.
inf >= 0.0;
3098 *success = childinterval.
sup <= 0.0;
3129 evalPow, exprhdlrdata) );
3148 "minimal distance from zero to enforce for child in bound tightening",
3152 "maximal exponent when to expand power of sum in simplify",
3153 &exprhdlrdata->expandmaxexponent,
FALSE, 2, 1, INT_MAX,
NULL,
NULL) );
3156 "whether a fractional exponent is distributed onto factors on power of product",
3199 void* ownercreatedata
3223 void* ownercreatedata
3236 ownercreate, ownercreatedata) );
3259 SCIP_Real* linconstant,
3268 if( sqrcoef == 0.0 )
3283 tmp = sqrcoef * refpoint;
3291 *lincoef += 2.0 * tmp;
3293 *linconstant -= tmp;
3306 coef = sqrcoef * (2.0 * f + 1.0);
3307 constant = -sqrcoef * f * (f + 1.0);
3316 *linconstant += constant;
3327 SCIP_Real* linconstant,
3342 if( sqrcoef == 0.0 )
3355 coef = sqrcoef * (lb + ub);
3356 constant = -sqrcoef * lb * ub;
3364 *linconstant += constant;
3398 SCIP_Bool overestimate,
3402 SCIP_Real* constant,
3443 xref = 0.5 * xlb + 0.5 * xub;
3467 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_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)
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
#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
#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