39 #define CONSHDLR_NAME "abspower" 40 #define CONSHDLR_DESC "constraint handler for absolute power constraints lhs <= sign(x+offset)abs(x+offset)^n + c*z <= rhs" 41 #define CONSHDLR_SEPAPRIORITY 0 42 #define CONSHDLR_ENFOPRIORITY -30 43 #define CONSHDLR_CHECKPRIORITY -3500000 44 #define CONSHDLR_SEPAFREQ 1 45 #define CONSHDLR_PROPFREQ 1 46 #define CONSHDLR_EAGERFREQ 100 48 #define CONSHDLR_MAXPREROUNDS -1 49 #define CONSHDLR_DELAYSEPA FALSE 50 #define CONSHDLR_DELAYPROP FALSE 51 #define CONSHDLR_NEEDSCONS TRUE 53 #define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_FAST | SCIP_PRESOLTIMING_MEDIUM 54 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_ALWAYS 56 #define QUADCONSUPGD_PRIORITY 50000 57 #define NONLINCONSUPGD_PRIORITY 50000 63 #define PROPVARTOL SCIPepsilon(scip) 64 #define PROPSIDETOL SCIPepsilon(scip) 65 #define INITLPMAXVARVAL 1000.0 68 #define DECL_MYPOW(x) SCIP_Real x (SCIP_Real base, SCIP_Real exponent) 74 #define SIGN(x) ((x) >= 0.0 ? 1.0 : -1.0) 81 #define ROOTS_KNOWN 10 90 0.41421356237309504880,
92 0.56042566045031785945,
93 0.60582958618826802099,
94 0.64146546982884663257,
95 0.67033204760309682774,
96 0.69428385661425826738,
97 0.71453772716733489700,
98 0.73192937842370733350
120 unsigned int propvarbounds:1;
126 struct SCIP_ConshdlrData
133 int preferzerobranch;
146 int newsoleventfilterpos;
151 unsigned int nsecantcuts;
177 assert(exponent == 2.0);
188 assert(event !=
NULL);
192 assert(cons !=
NULL);
213 assert(scip !=
NULL);
214 assert(cons !=
NULL);
215 assert(eventhdlr !=
NULL);
218 assert(consdata !=
NULL);
238 if( consdata->zcoef > 0.0 )
272 assert(scip !=
NULL);
273 assert(cons !=
NULL);
274 assert(eventhdlr !=
NULL);
277 assert(consdata !=
NULL);
288 consdata->xeventfilterpos = -1;
294 if( consdata->zcoef > 0.0 )
310 consdata->zeventfilterpos = -1;
313 assert(consdata->xeventfilterpos == -1);
314 assert(consdata->zeventfilterpos == -1);
335 assert(consdata1 !=
NULL);
336 assert(consdata2 !=
NULL);
338 if( consdata1->x != consdata2->x )
341 if( consdata1->exponent != consdata2->exponent )
344 if( consdata1->xoffset != consdata2->xoffset && consdata1->z != consdata2->z )
357 assert(consdata !=
NULL);
372 assert(consdata1 !=
NULL);
373 assert(consdata2 !=
NULL);
375 if( consdata1->z != consdata2->z )
378 if( consdata1->exponent != consdata2->exponent )
391 assert(consdata !=
NULL);
417 assert(scip !=
NULL);
418 assert(cons1 !=
NULL);
419 assert(cons2 !=
NULL);
420 assert(infeas !=
NULL);
421 assert(nupgdconss !=
NULL);
422 assert(ndelconss !=
NULL);
423 assert(naggrvars !=
NULL);
427 assert(consdata1 !=
NULL);
428 assert(consdata2 !=
NULL);
430 assert(
SCIPisEQ(scip, consdata2->lhs, consdata2->rhs));
432 assert(consdata1->x == consdata2->x);
433 assert(consdata1->exponent == consdata2->exponent);
434 assert(consdata1->xoffset == consdata2->xoffset);
436 lhs = consdata1->lhs;
438 lhs -= consdata2->lhs;
439 rhs = consdata1->rhs;
441 rhs -= consdata2->lhs;
443 vars[0] = consdata1->z;
444 vars[1] = consdata2->z;
446 coefs[0] = consdata1->zcoef;
447 coefs[1] = -consdata2->zcoef;
455 SCIP_CALL(
SCIPaggregateVars(scip, consdata1->z, consdata2->z, consdata1->zcoef, -consdata2->zcoef, rhs, infeas, &redundant, &aggregated) );
477 vars[0] = consdata1->z;
478 vars[1] = consdata2->z;
479 coefs[0] = consdata1->zcoef;
480 coefs[1] = -consdata2->zcoef;
530 assert(scip !=
NULL);
531 assert(infeas !=
NULL);
532 assert(xval !=
NULL);
533 assert(zval !=
NULL);
534 assert(exponent == 2.0);
535 assert(!
SCIPisEQ(scip, xoffset1, xoffset2));
536 assert(
SCIPisEQ(scip, zcoef1 * rhs2, zcoef2 * rhs1));
537 assert(zcoef1 != 0.0);
538 assert(zcoef2 != 0.0);
540 if( xoffset2 < xoffset1 )
542 presolveFindDuplicatesSolveEquations(scip, infeas, xval, zval, exponent, xoffset2, zcoef2, rhs2, xoffset1, zcoef1, rhs1);
546 if(
SCIPisEQ(scip, zcoef1, zcoef2) )
554 if(
SCIPisEQ(scip, zcoef1, -zcoef2) )
556 *xval = - (xoffset1 + xoffset2) / 2.0;
558 else if( zcoef2 * zcoef1 > 0.0 )
560 *xval = (xoffset2 - xoffset1) / (
sqrt(zcoef2 / zcoef1) - 1.0) - xoffset1;
564 assert(zcoef2 * zcoef1 < 0.0);
565 *xval = (xoffset2 - xoffset1) / (-
sqrt(-zcoef2 / zcoef1) - 1.0) - xoffset1;
568 *zval = rhs1 - (*xval + xoffset1) *
REALABS(*xval + xoffset1);
571 assert(
SCIPisFeasEQ(scip, (*xval + xoffset1) *
REALABS(*xval + xoffset1) + zcoef1 * *zval, rhs1));
572 assert(
SCIPisFeasEQ(scip, (*xval + xoffset2) *
REALABS(*xval + xoffset2) + zcoef2 * *zval, rhs2));
596 assert(scip !=
NULL);
597 assert(conshdlr !=
NULL);
598 assert(conss !=
NULL || nconss == 0);
599 assert(nupgdconss !=
NULL);
600 assert(ndelconss !=
NULL);
601 assert(naddconss !=
NULL);
602 assert(nfixedvars !=
NULL);
603 assert(naggrvars !=
NULL);
604 assert(success !=
NULL);
605 assert(infeas !=
NULL);
614 assert(conshdlrdata !=
NULL);
619 presolveFindDuplicatesGetKey, presolveFindDuplicatesKeyEQ, presolveFindDuplicatesKeyVal, (
void*)scip) );
621 for( c = 0; c < nconss && !*infeas; ++c )
632 multihashlist =
NULL;
648 assert(cons0 != cons1);
652 assert(consdata0 !=
NULL);
653 assert(consdata1 !=
NULL);
658 assert(consdata0->x == consdata1->x);
659 assert(consdata0->exponent == consdata1->exponent);
661 if(
SCIPisEQ(scip, consdata0->xoffset, consdata1->xoffset) )
666 if( consdata0->z == consdata1->z &&
SCIPisEQ(scip, consdata0->zcoef, consdata1->zcoef) )
669 if(
SCIPisGT(scip, consdata0->lhs, consdata1->rhs) ||
SCIPisGT(scip, consdata1->lhs, consdata0->rhs) )
684 if( consdata1->zcoef > 0.0 )
689 consdata1->lhs =
MAX(consdata0->lhs, consdata1->lhs);
690 consdata1->rhs =
MIN(consdata0->rhs, consdata1->rhs);
694 if( consdata1->zcoef > 0.0 )
701 consdata1->lhs =
MAX(consdata0->lhs, consdata1->lhs);
702 consdata1->rhs =
MIN(consdata0->rhs, consdata1->rhs);
713 if(
SCIPisEQ(scip, consdata1->lhs, consdata1->rhs) )
723 if(
SCIPisEQ(scip, consdata0->lhs, consdata0->rhs) )
756 SCIP_CALL(
SCIPcreateConsAbspower(scip, &auxcons, name, consdata0->x, auxvar, consdata0->exponent, consdata0->xoffset, -1.0, 0.0, 0.0,
772 #ifdef SCIP_DEBUG_SOLUTION 773 if( SCIPdebugIsMainscip(scip) )
784 vars[1] = consdata0->z;
786 coefs[1] = consdata0->zcoef;
797 vars[1] = consdata1->z;
798 coefs[1] = consdata1->zcoef;
818 else if( consdata0->z == consdata1->z &&
819 consdata0->exponent == 2.0 &&
822 SCIPisEQ(scip, consdata0->lhs, consdata0->rhs) &&
823 SCIPisEQ(scip, consdata1->lhs, consdata1->rhs) &&
824 SCIPisEQ(scip, consdata0->lhs * consdata1->zcoef, consdata1->lhs * consdata0->zcoef) )
835 assert(consdata0->x == consdata1->x);
836 assert(consdata0->exponent == consdata1->exponent);
837 assert(!
SCIPisEQ(scip, consdata0->xoffset, consdata1->xoffset));
841 consdata0->xoffset, consdata0->zcoef, consdata0->lhs,
842 consdata1->xoffset, consdata1->zcoef, consdata1->lhs);
846 SCIPdebugMsg(scip,
"infeasibility detected while solving the equations, no solution exists\n");
852 SCIPdebugMsg(scip,
"fixing variables <%s>[%g, %g] to %g and <%s>[%g, %g] to %g due to equations\n",
924 if( multihashlist ==
NULL )
944 presolveFindDuplicatesGetKey, presolveFindDuplicatesKeyEQ2, presolveFindDuplicatesKeyVal2, (
void*) scip) );
946 for( c = 0; c < nconss && !*infeas; ++c )
963 assert(consdata0 !=
NULL);
968 if( !
SCIPisEQ(scip, consdata0->lhs, consdata0->rhs) )
971 multihashlist =
NULL;
986 assert(cons0 != cons1);
990 assert(consdata1 !=
NULL);
995 assert(consdata0->z == consdata1->z);
996 assert(consdata0->exponent == consdata1->exponent);
997 assert(
SCIPisEQ(scip, consdata1->lhs, consdata1->rhs));
1000 if(
SCIPisEQ(scip, consdata0->lhs*consdata1->zcoef, consdata1->lhs*consdata0->zcoef) )
1017 if( consdata0->exponent == 2.0 )
1018 coef =
SIGN(consdata0->zcoef / consdata1->zcoef) *
sqrt(
REALABS(consdata0->zcoef / consdata1->zcoef));
1020 coef =
SIGN(consdata0->zcoef / consdata1->zcoef) *
pow(
REALABS(consdata0->zcoef / consdata1->zcoef), 1.0/consdata0->exponent);
1021 rhs = coef * consdata1->xoffset - consdata0->xoffset;
1030 else if( redundant )
1047 vars[0] = consdata0->x;
1048 vars[1] = consdata1->x;
1070 if( multihashlist ==
NULL )
1105 assert(scip !=
NULL);
1106 assert(cons !=
NULL);
1107 assert(cutoff !=
NULL);
1108 assert(nfixedvars !=
NULL);
1109 assert(ndelconss !=
NULL);
1119 assert(consdata !=
NULL);
1135 assert(consdata->zcoef != 0.0);
1151 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
1180 xfix = 0.5 * (xlb + xub);
1188 else if( consdata->exponent == 2.0 )
1200 if(
SCIPisLT(scip, xlb, -consdata->xoffset) )
1210 c = consdata->xoffset * consdata->xoffset *
SCIPvarGetObj(consdata->z) / consdata->zcoef;
1222 xfixobjval = a * xlb * xlb + b * xlb + c;
1225 cand =
MIN(-consdata->xoffset, xub);
1226 if( xfixobjval > a * cand * cand + b * cand + c )
1229 xfixobjval = a * cand * cand + b * cand + c;
1234 if( cand > xlb && cand < -consdata->xoffset && cand < xub && xfixobjval > -b*b/(4.0*a) + c )
1237 xfixobjval = -b*b/(4.0*a) + c;
1242 if(
SCIPisGT(scip, xub, -consdata->xoffset) )
1252 c = -consdata->xoffset * consdata->xoffset *
SCIPvarGetObj(consdata->z) / consdata->zcoef;
1266 xfixobjval = a * xub * xub + b * xub + c;
1272 if( xfixobjval > a * cand * cand + b * cand + c )
1275 xfixobjval = a * cand * cand + b * cand + c;
1280 cand =
MAX(xlb, -consdata->xoffset);
1281 if( xfixobjval > a * cand * cand + b * cand + c )
1284 xfixobjval = a * cand * cand + b * cand + c;
1289 if( cand > xlb && cand > -consdata->xoffset && cand < xub && xfixobjval > -b*b/(4.0*a) + c )
1309 if( consdata->zcoef > 0.0 )
1322 if( consdata->zcoef > 0.0 )
1340 zfix = consdata->rhs -
SIGN(xfix + consdata->xoffset) * consdata->power(ABS(xfix + consdata->xoffset), consdata->exponent);
1341 zfix /= consdata->zcoef;
1346 zfix =
MAX(zlb,
MIN(zub, zfix));
1350 SCIPdebugMsg(scip,
"dual presolve fixes x=<%s>[%g,%g] to %g and z=<%s>[%g,%g] to %g in cons <%s>\n",
1396 assert(scip !=
NULL);
1397 assert(var !=
NULL);
1398 assert(cons !=
NULL);
1399 assert(result !=
NULL);
1400 assert(nchgbds !=
NULL);
1401 assert(nfixedvars !=
NULL);
1426 if( bounds.
inf != bounds.
sup )
1427 fixval = (bounds.
inf + bounds.
sup) / 2.0;
1429 fixval = bounds.
inf;
1450 SCIPdebugMsg(scip,
"found <%s> infeasible due to fixing fixed variable <%s>[%.20g,%.20g] to [%.20g,%.20g]\n",
1505 assert(naddconss !=
NULL);
1546 assert(scip !=
NULL);
1547 assert(cons !=
NULL);
1548 assert(zbnds !=
NULL);
1552 assert(consdata !=
NULL);
1562 if( consdata->zcoef > 0.0 )
1563 zbnds->
sup = bnd / consdata->zcoef;
1565 zbnds->
inf = bnd / consdata->zcoef;
1574 if( consdata->zcoef > 0.0 )
1575 zbnds->
inf = bnd / consdata->zcoef;
1577 zbnds->
sup = bnd / consdata->zcoef;
1580 SCIPdebugMsg(scip,
"given x = [%.20g, %.20g], computed z = [%.20g, %.20g] via", xbnds.
inf, xbnds.
sup, zbnds->
inf, zbnds->
sup);
1599 assert(scip !=
NULL);
1600 assert(cons !=
NULL);
1601 assert(xbnds !=
NULL);
1605 assert(consdata !=
NULL);
1610 z = (consdata->zcoef > 0.0 ? zbnds.
inf : zbnds.
sup);
1614 if( consdata->exponent == 2.0 )
1618 xbnds->
sup = bnd - consdata->xoffset;
1622 z = (consdata->zcoef > 0.0 ? zbnds.
sup : zbnds.
inf);
1626 if( consdata->exponent == 2.0 )
1630 xbnds->
inf = bnd - consdata->xoffset;
1633 SCIPdebugMsg(scip,
"given z = [%.20g, %.20g], computed x = [%.20g, %.20g] via", zbnds.
inf, zbnds.
sup, xbnds->
inf, xbnds->
sup);
1659 assert(scip !=
NULL);
1660 assert(cons !=
NULL);
1661 assert(ndelconss !=
NULL);
1662 assert(nupgdconss !=
NULL);
1663 assert(nchgbds !=
NULL);
1664 assert(nfixedvars !=
NULL);
1667 assert(conshdlrdata !=
NULL);
1670 assert(consdata !=
NULL);
1702 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
1716 zfix = consdata->rhs -
SIGN(constant + consdata->xoffset) * consdata->power(
REALABS(constant + consdata->xoffset), consdata->exponent);
1717 zfix /= consdata->zcoef;
1750 else if( scalar > 0.0 )
1751 factor = consdata->power( scalar, consdata->exponent);
1753 factor = -consdata->power(-scalar, consdata->exponent);
1769 consdata->xoffset += constant;
1772 if( scalar == 1.0 ) ;
1773 else if( scalar > 0.0 )
1776 consdata->lhs /= factor;
1778 consdata->rhs /= factor;
1779 consdata->zcoef /= factor;
1780 consdata->xoffset /= scalar;
1786 assert(scalar < 0.0);
1787 assert(factor < 0.0);
1789 oldlhs = consdata->lhs;
1792 consdata->lhs = consdata->rhs / factor;
1796 consdata->rhs = oldlhs / factor;
1799 consdata->zcoef /= factor;
1800 consdata->xoffset /= scalar;
1810 conshdlrdata->comparedpairwise =
FALSE;
1814 SCIPwarningMessage(scip,
"Skip resolving aggregation of variable <%s> in abspower constraint <%s> to avoid zcoef = %g\n",
1847 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
1861 xfix = consdata->rhs - consdata->zcoef * constant;
1862 if( consdata->exponent == 2.0 )
1865 xfix =
SIGN(xfix) *
pow(
REALABS(xfix), 1.0/consdata->exponent) - consdata->xoffset;
1897 if( consdata->zcoef > 0.0 )
1910 consdata->lhs -= consdata->zcoef * constant;
1912 consdata->rhs -= consdata->zcoef * constant;
1915 consdata->zcoef *= scalar;
1917 if( consdata->zcoef > 0.0 )
1924 conshdlrdata->comparedpairwise =
FALSE;
1946 assert(scip !=
NULL);
1947 assert(cons !=
NULL);
1950 assert(consdata !=
NULL);
1955 if( consdata->exponent == 2.0 )
1956 val = consdata->exponent *
REALABS(xval + consdata->xoffset);
1958 val = consdata->exponent *
pow(
REALABS(xval + consdata->xoffset), consdata->exponent - 1.0);
1980 assert(scip !=
NULL);
1981 assert(conshdlr !=
NULL);
1982 assert(cons !=
NULL);
1983 assert(viol !=
NULL);
1984 assert(solviolbounds !=
NULL);
1987 assert(conshdlrdata !=
NULL);
1990 assert(consdata !=
NULL);
1992 *solviolbounds =
FALSE;
2014 *solviolbounds =
TRUE;
2016 xval =
MAX(lb,
MIN(ub, xval));
2019 xval += consdata->xoffset;
2021 val =
SIGN(xval) * consdata->power(
REALABS(xval), consdata->exponent);
2022 val += consdata->zcoef * zval;
2024 if( val < consdata->lhs && !
SCIPisInfinity(scip, -consdata->lhs) )
2025 consdata->lhsviol = *viol = consdata->lhs - val;
2027 consdata->lhsviol = 0.0;
2029 if( val > consdata->rhs && !
SCIPisInfinity(scip, consdata->rhs) )
2030 consdata->rhsviol = *viol = val - consdata->rhs;
2032 consdata->rhsviol = 0.0;
2034 switch( conshdlrdata->scaling )
2042 if( consdata->lhsviol > 0.0 || consdata->rhsviol > 0.0 )
2048 consdata->lhsviol /= norm;
2049 consdata->rhsviol /= norm;
2059 if( consdata->lhsviol > 0.0 )
2061 absval =
REALABS(consdata->lhs);
2062 consdata->lhsviol /=
MAX(1.0, absval);
2065 if( consdata->rhsviol > 0.0 )
2067 absval =
REALABS(consdata->rhs);
2068 consdata->rhsviol /=
MAX(1.0, absval);
2101 assert(scip !=
NULL);
2102 assert(conss !=
NULL || nconss == 0);
2103 assert(solviolbounds !=
NULL);
2104 assert(maxviolcon !=
NULL);
2106 *solviolbounds =
FALSE;
2111 for( c = 0; c < nconss; ++c )
2113 assert(conss !=
NULL);
2114 assert(conss[c] !=
NULL);
2117 *solviolbounds |= solviolbounds1;
2120 assert(consdata !=
NULL);
2122 viol =
MAX(consdata->lhsviol, consdata->rhsviol);
2126 *maxviolcon = conss[c];
2150 assert(scip !=
NULL);
2151 assert(cons !=
NULL);
2154 assert(consdata !=
NULL);
2161 if(
SCIPisLT(scip, xlb, -consdata->xoffset) &&
SCIPisGT(scip, xub, -consdata->xoffset) )
2167 assert(preferzero >= 0);
2169 if( preferzero == 0 )
2173 return -consdata->xoffset;
2175 xlb += consdata->xoffset;
2176 xub += consdata->xoffset;
2187 return -consdata->xoffset;
2197 return -consdata->xoffset;
2201 if( branchminconverror )
2206 if(
SCIPisGE(scip, xlb, -consdata->xoffset) )
2209 xlb =
MAX(0.0, xlb + consdata->xoffset);
2210 xub =
MAX(0.0, xub + consdata->xoffset);
2212 ref = (consdata->power(xub, consdata->exponent) - consdata->power(xlb, consdata->exponent)) / (consdata->exponent * (xub - xlb));
2213 ref =
pow(ref, 1.0/(consdata->exponent-1.0));
2214 ref -= consdata->xoffset;
2224 assert(
SCIPisLE(scip, xub, -consdata->xoffset));
2226 xlb =
MIN(0.0, xlb + consdata->xoffset);
2227 xub =
MIN(0.0, xub + consdata->xoffset);
2229 ref = (consdata->power(-xlb, consdata->exponent) - consdata->power(-xub, consdata->exponent)) / (consdata->exponent * (-xlb + xub));
2230 ref = -
pow(ref, 1.0/(consdata->exponent-1.0));
2231 ref -= consdata->xoffset;
2260 assert(scip !=
NULL);
2261 assert(conshdlr !=
NULL);
2262 assert(conss !=
NULL || nconss == 0);
2265 assert(conshdlrdata !=
NULL);
2269 onlynonfixedsign = conshdlrdata->preferzerobranch == 3;
2273 for( c = 0; c < nconss; ++c )
2275 assert(conss[c] !=
NULL);
2278 assert(consdata !=
NULL);
2283 if( onlynonfixedsign &&
2301 if( onlynonfixedsign && *nnotify == 0 )
2304 onlynonfixedsign =
FALSE;
2329 assert(scip !=
NULL);
2330 assert(conss !=
NULL || nconss == 0);
2335 for( c = 0; c < nconss; ++c )
2337 assert(conss !=
NULL);
2339 assert(consdata !=
NULL);
2344 val =
SCIPgetSolVal(scip, sol, consdata->x) + consdata->xoffset;
2347 brvarval = ABS(val);
2348 *brvar = consdata->x;
2352 if( *brvar !=
NULL )
2376 assert(scip !=
NULL);
2377 assert(cons !=
NULL);
2378 assert(infervar !=
NULL);
2381 assert(consdata !=
NULL);
2382 assert(consdata->zcoef != 0.0);
2388 assert(infervar == consdata->x);
2391 if( consdata->zcoef > 0.0 )
2403 assert(infervar == consdata->z);
2410 assert(infervar == consdata->x);
2413 if( consdata->zcoef > 0.0 )
2425 assert(infervar == consdata->z);
2502 assert(conshdlr !=
NULL);
2503 assert(cutoff !=
NULL);
2504 assert(nchgbds !=
NULL);
2505 assert(naddconss !=
NULL);
2508 assert(consdata !=
NULL);
2522 while( tightenedround )
2524 tightenedround =
FALSE;
2545 newlb = consdata->lhs - consdata->zcoef * (consdata->zcoef > 0.0 ? zub : zlb);
2548 if( consdata->exponent == 2.0 )
2549 newlb =
SIGN(newlb) *
sqrt(ABS(newlb));
2551 newlb =
SIGN(newlb) *
pow(ABS(newlb), 1.0/consdata->exponent);
2552 newlb -= consdata->xoffset;
2560 if( consdata->exponent == 2.0 )
2561 newlb =
SIGN(newlb) *
sqrt(ABS(newlb));
2563 newlb =
SIGN(newlb) *
pow(ABS(newlb), 1.0/consdata->exponent);
2564 newlb -= consdata->xoffset;
2569 newlb =
MIN(newlb, xub);
2574 if( consdata->zcoef > 0.0 )
2592 if( consdata->exponent == 2.0 )
2593 newlb =
SIGN(newlb) *
sqrt(ABS(newlb));
2595 newlb =
SIGN(newlb) *
pow(ABS(newlb), 1.0/consdata->exponent);
2596 newlb -= consdata->xoffset;
2603 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g] -> cutoff\n",
SCIPvarGetName(consdata->x), xlb, xub, newlb, xub);
2616 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n",
2631 tightenedround =
TRUE;
2654 newbd = xub + consdata->xoffset;
2655 newbd = consdata->lhs -
SIGN(newbd) * consdata->power(
REALABS(newbd), consdata->exponent);
2656 newbd /= consdata->zcoef;
2663 if( (consdata->zcoef > 0.0 &&
SCIPisFeasGT(scip, newbd, zub)) || (consdata->zcoef < 0.0 &&
SCIPisFeasLT(scip, newbd, zlb)) )
2666 newbd = xub +
PROPVARTOL + consdata->xoffset;
2668 newbd /= consdata->zcoef;
2673 newbd =
MIN(zub,
MAX(zlb, newbd) );
2678 newbd = xub +
PROPVARTOL + consdata->xoffset;
2680 newbd /= consdata->zcoef;
2683 if( consdata->zcoef > 0.0 )
2690 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g] -> cutoff\n",
SCIPvarGetName(consdata->z), zlb, zub, newlb, zub);
2701 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n",
2716 tightenedround =
TRUE;
2729 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g] -> cutoff\n",
SCIPvarGetName(consdata->z), zlb, zub, zlb, newub);
2740 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n",
2755 tightenedround =
TRUE;
2783 newub = consdata->rhs - consdata->zcoef * (consdata->zcoef > 0.0 ? zlb : zub);
2786 if( consdata->exponent == 2.0 )
2787 newub =
SIGN(newub) *
sqrt(ABS(newub));
2789 newub =
SIGN(newub) *
pow(ABS(newub), 1.0/consdata->exponent);
2790 newub -= consdata->xoffset;
2798 if( consdata->exponent == 2.0 )
2799 newub =
SIGN(newub) *
sqrt(ABS(newub));
2801 newub =
SIGN(newub) *
pow(ABS(newub), 1.0/consdata->exponent);
2802 newub -= consdata->xoffset;
2807 newub =
MAX(newub, xlb);
2812 if( consdata->zcoef > 0.0 )
2829 if( consdata->exponent == 2.0 )
2830 newub =
SIGN(newub) *
sqrt(ABS(newub));
2832 newub =
SIGN(newub) *
pow(ABS(newub), 1.0/consdata->exponent);
2833 newub -= consdata->xoffset;
2840 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g] -> cutoff\n",
SCIPvarGetName(consdata->x), xlb, xub, xlb, newub);
2853 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n",
2868 tightenedround =
TRUE;
2891 newbd = xlb + consdata->xoffset;
2892 newbd = consdata->rhs -
SIGN(newbd) * consdata->power(
REALABS(newbd), consdata->exponent);
2893 newbd /= consdata->zcoef;
2900 if( (consdata->zcoef > 0.0 &&
SCIPisFeasLT(scip, newbd, zlb)) || (consdata->zcoef < 0.0 &&
SCIPisFeasGT(scip, newbd, zub)) )
2903 newbd = xlb -
PROPVARTOL + consdata->xoffset;
2905 newbd /= consdata->zcoef;
2910 newbd =
MIN(zub,
MAX(zlb, newbd) );
2915 newbd = xlb -
PROPVARTOL + consdata->xoffset;
2917 newbd /= consdata->zcoef;
2920 if( consdata->zcoef > 0.0 )
2927 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g] -> cutoff\n",
SCIPvarGetName(consdata->z), zlb, zub, zlb, newub);
2938 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n",
2953 tightenedround =
TRUE;
2966 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g] -> cutoff\n",
SCIPvarGetName(consdata->z), zlb, zub, newlb, zub);
2977 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n",
2992 tightenedround =
TRUE;
3012 minact =
SIGN(xlb + consdata->xoffset) * consdata->power(
REALABS(xlb + consdata->xoffset), consdata->exponent) + consdata->zcoef * (consdata->zcoef > 0.0 ? zlb : zub);
3017 maxact =
SIGN(xub + consdata->xoffset) * consdata->power(
REALABS(xub + consdata->xoffset), consdata->exponent) + consdata->zcoef * (consdata->zcoef > 0.0 ? zub : zlb);
3023 SCIPdebugMsg(scip,
"absolute power constraint <%s> is redundant: <%s>[%.15g,%.15g], <%s>[%.15g,%.15g]\n",
3040 SCIPdebugMsg(scip,
"x-variable in constraint <%s> is fixed: x = <%s>[%.15g,%.15g], z = <%s>[%.15g,%.15g]\n",
3063 SCIPdebugMsg(scip,
"z-variable in constraint <%s> is fixed: x = <%s>[%.15g,%.15g], z = <%s>[%.15g,%.15g]\n",
3100 assert(scip !=
NULL);
3101 assert(cons !=
NULL);
3102 assert(var !=
NULL);
3103 assert(vbdvar !=
NULL);
3106 assert(infeas !=
NULL);
3156 *nbdchgs += nbdchgs_local;
3164 *nbdchgs += nbdchgs_local;
3211 assert(scip !=
NULL);
3212 assert(conshdlr !=
NULL);
3213 assert(cons !=
NULL);
3214 assert(infeas !=
NULL);
3215 assert(nbdchgs !=
NULL);
3216 assert(naddconss !=
NULL);
3221 assert(conshdlrdata !=
NULL);
3224 assert(consdata !=
NULL);
3225 assert(consdata->z !=
NULL);
3250 if(
SCIPisFeasZero(scip, consdata->power(a, consdata->exponent)) )
3255 fb =
SIGN( b + consdata->xoffset) * consdata->power( b + consdata->xoffset, consdata->exponent);
3256 fab =
SIGN(a+b + consdata->xoffset) * consdata->power(a+b + consdata->xoffset, consdata->exponent);
3258 vbcoef = (fb - fab) / consdata->zcoef;
3259 vbconst = (consdata->lhs - fb) / consdata->zcoef;
3261 if( consdata->zcoef > 0.0 )
3264 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->z, y, -vbcoef, vbconst,
SCIPinfinity(scip), infeas, nbdchgs, naddconss) );
3269 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->z, y, -vbcoef, -
SCIPinfinity(scip), vbconst, infeas, nbdchgs, naddconss) );
3295 if(
SCIPisFeasZero(scip, consdata->power(a, consdata->exponent)) )
3300 fb =
SIGN( b + consdata->xoffset) * consdata->power( b + consdata->xoffset, consdata->exponent);
3301 fab =
SIGN(a+b + consdata->xoffset) * consdata->power(a+b + consdata->xoffset, consdata->exponent);
3303 vbcoef = (fb - fab) / consdata->zcoef;
3304 vbconst = (consdata->rhs - fb) / consdata->zcoef;
3306 if( consdata->zcoef > 0.0 )
3309 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->z, y, -vbcoef, -
SCIPinfinity(scip), vbconst, infeas, nbdchgs, naddconss) );
3314 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->z, y, -vbcoef, vbconst,
SCIPinfinity(scip), infeas, nbdchgs, naddconss) );
3325 if( (consdata->zcoef > 0.0 && !
SCIPisInfinity(scip, -consdata->lhs)) ||
3326 ( consdata->zcoef < 0.0 && !
SCIPisInfinity(scip, consdata->rhs)) )
3341 if( consdata->zcoef > 0.0 )
3343 fb = consdata->lhs - b;
3344 fb =
SIGN(fb) *
pow(ABS(fb), 1.0/consdata->exponent);
3345 fab = consdata->lhs - (a+b);
3346 fab =
SIGN(fab) *
pow(ABS(fab), 1.0/consdata->exponent);
3347 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->x, y, fb - fab, fb - consdata->xoffset,
SCIPinfinity(scip), infeas, nbdchgs, naddconss) );
3351 fb = consdata->rhs - b;
3352 fb =
SIGN(fb) *
pow(ABS(fb), 1.0/consdata->exponent);
3353 fab = consdata->rhs - (a+b);
3354 fab =
SIGN(fab) *
pow(ABS(fab), 1.0/consdata->exponent);
3355 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->x, y, fb - fab, -
SCIPinfinity(scip), fb - consdata->xoffset, infeas, nbdchgs, naddconss) );
3365 if( (consdata->zcoef < 0.0 && !
SCIPisInfinity(scip, -consdata->lhs)) ||
3366 ( consdata->zcoef > 0.0 && !
SCIPisInfinity(scip, consdata->rhs)) )
3381 if( consdata->zcoef > 0.0 )
3383 fb = consdata->rhs - b;
3384 fb =
SIGN(fb) *
pow(ABS(fb), 1.0/consdata->exponent);
3385 fab = consdata->rhs - (a+b);
3386 fab =
SIGN(fab) *
pow(ABS(fab), 1.0/consdata->exponent);
3387 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->x, y, fb - fab, -
SCIPinfinity(scip), fb - consdata->xoffset, infeas, nbdchgs, naddconss) );
3391 fb = consdata->lhs - b;
3392 fb =
SIGN(fb) *
pow(ABS(fb), 1.0/consdata->exponent);
3393 fab = consdata->lhs - (a+b);
3394 fab =
SIGN(fab) *
pow(ABS(fab), 1.0/consdata->exponent);
3395 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->x, y, fb - fab, fb - consdata->xoffset,
SCIPinfinity(scip), infeas, nbdchgs, naddconss) );
3428 assert(scip !=
NULL);
3433 assert(conshdlrdata !=
NULL);
3435 if( refpoint < -xoffset )
3436 refpoint = -xoffset;
3438 tmp = exponent == 2.0 ? refpoint+xoffset :
pow(refpoint+xoffset, exponent-1);
3441 SCIPdebugMsg(scip,
"skip linearization cut because (refpoint+offset)^(exponent-1) > infinity\n");
3446 rhs += ((exponent-1)*refpoint-xoffset)*tmp;
3450 SCIPdebugMsg(scip,
"skip linearization cut because its rhs would be > infinity\n");
3501 assert(scip !=
NULL);
3510 if( exponent == 2.0 )
3513 tmp = (xproj+xoffset) * (xproj+xoffset);
3514 gval = xproj - xref + 2*(xproj+xoffset) / zcoef * ((tmp-rhs)/zcoef + zref);
3518 gderiv = 1 + 6 * tmp / (zcoef*zcoef) + 2 / zcoef * (zref - rhs/zcoef);
3519 xproj -= gval / gderiv;
3522 while( ++iter <= 5 );
3526 tmp =
pow(xproj + xoffset, exponent-1);
3527 gval = xproj - xref + exponent / zcoef * (
pow(xproj+xoffset, 2*exponent-1)/zcoef + tmp * (zref-rhs/zcoef));
3531 gderiv = 1 + exponent / zcoef * ( (2*exponent-1)*tmp*tmp/zcoef + (exponent-1)*
pow(xproj+xoffset, exponent-2) * (zref-rhs/zcoef) );
3532 xproj -= gval / gderiv;
3535 while( ++iter <= 5 );
3540 SCIP_CALL(
generateLinearizationCut(scip, row, conshdlr, xproj, exponent, xoffset, xmult, zcoef, rhs, x, z, islocal) );
3574 assert(scip !=
NULL);
3579 assert(conshdlrdata !=
NULL);
3585 if( xlb > -xoffset )
3588 tmp = mypow(-xlb-xoffset, exponent);
3589 slope =
SIGN(xub+xoffset) * mypow(ABS(xub+xoffset), exponent) + tmp;
3635 assert(scip !=
NULL);
3643 if( xlb > -xoffset )
3646 tmp = mypow(-xlb-xoffset, exponent);
3647 slope =
SIGN(xub+xoffset) * mypow(ABS(xub+xoffset), exponent) + tmp;
3687 assert(scip !=
NULL);
3688 assert(cons !=
NULL);
3689 assert(row !=
NULL);
3692 assert(conshdlrdata !=
NULL);
3695 assert(consdata !=
NULL);
3712 xoffset = consdata->xoffset;
3714 zcoef = consdata->zcoef;
3715 rhs = consdata->rhs;
3723 xoffset = -consdata->xoffset;
3725 zcoef = -consdata->zcoef;
3726 rhs = -consdata->lhs;
3731 SCIPdebugMsg(scip,
"skip separation since x is at infinity\n");
3741 if( conshdlrdata->projectrefpoint && !onlyinbounds )
3744 xoffset, xmult, zcoef, rhs, consdata->x, consdata->z, islocal) );
3746 else if( !onlyinbounds )
3749 consdata->x, consdata->z, islocal) );
3754 consdata->x, consdata->z, islocal) );
3762 SCIP_CALL(
generateSecantCut(scip, row,
SCIPconsGetHdlr(cons), sol, xlb, xub, consdata->exponent, xoffset, consdata->power, xmult, zcoef, rhs, consdata->x, consdata->z) );
3764 else if( (c = - consdata->root * (xlb+xoffset) - xoffset) > xub )
3769 SCIP_CALL(
generateSecantCut(scip, row,
SCIPconsGetHdlr(cons), sol, xlb, xub, consdata->exponent, xoffset, consdata->power, xmult, zcoef, rhs, consdata->x, consdata->z) );
3771 else if( xval >= c )
3774 if( conshdlrdata->projectrefpoint && !onlyinbounds )
3777 else if( !onlyinbounds )
3789 SCIP_CALL(
generateSecantCut(scip, row,
SCIPconsGetHdlr(cons), sol, xlb, c, consdata->exponent, xoffset, consdata->power, xmult, zcoef, rhs, consdata->x, consdata->z) );
3798 SCIPdebugMsg(scip,
" -> found cut rhs=%f, min=%f, max=%f range=%g\n",
3849 assert(scip !=
NULL);
3850 assert(conshdlr !=
NULL);
3851 assert(conss !=
NULL || nconss == 0);
3852 assert(success !=
NULL);
3853 assert(cutoff !=
NULL);
3859 assert(conshdlrdata !=
NULL);
3861 if( bestefficacy !=
NULL )
3862 *bestefficacy = 0.0;
3864 for( c = 0; c < nconss && ! (*cutoff); ++c )
3866 assert(conss[c] !=
NULL);
3869 assert(consdata !=
NULL);
3894 switch( conshdlrdata->scaling )
3897 efficacy = -feasibility;
3906 efficacy = -feasibility /
MAX(1.0, norm);
3915 efficacy = -feasibility /
MAX(1.0, minval);
3938 if( bestefficacy !=
NULL && efficacy > *bestefficacy )
3939 *bestefficacy = efficacy;
3948 if( inenforcement && !conshdlrdata->enfocutsremovable )
3958 if( c >= nusefulconss && *success )
3986 assert(scip !=
NULL);
3987 assert(conshdlr !=
NULL);
3988 assert(conss !=
NULL || nconss == 0);
3990 if( separatedlpsol !=
NULL )
3991 *separatedlpsol =
FALSE;
3993 for( c = 0; c < nconss; ++c )
3995 assert(conss[c] !=
NULL);
4001 assert(consdata !=
NULL);
4006 consdata->lhsviol = 1.0;
4007 consdata->rhsviol = 0.0;
4013 consdata->lhsviol = 0.0;
4014 consdata->rhsviol = 1.0;
4031 if( separatedlpsol !=
NULL )
4038 assert(conshdlrdata !=
NULL);
4041 switch( conshdlrdata->scaling )
4052 efficacy /=
MAX(1.0, norm);
4061 efficacy /=
MAX(1.0, minval);
4071 if( efficacy >= minefficacy )
4075 *separatedlpsol =
TRUE;
4078 assert( ! infeasible );
4103 assert(scip !=
NULL);
4104 assert(event !=
NULL);
4105 assert(eventdata !=
NULL);
4106 assert(eventhdlr !=
NULL);
4118 assert(sol !=
NULL);
4121 assert(conshdlrdata !=
NULL);
4131 assert(conss !=
NULL);
4158 assert(scip !=
NULL);
4159 assert(conshdlr !=
NULL);
4160 assert(conss !=
NULL || nconss == 0);
4176 for( c = 0; c < nconss; ++c )
4179 assert(consdata !=
NULL);
4180 assert(consdata->z !=
NULL);
4181 assert(consdata->zcoef != 0.0);
4185 assert(!solviolbounds);
4203 xtermval += consdata->xoffset;
4204 xtermval =
SIGN(xtermval) * consdata->power(ABS(xtermval), consdata->exponent);
4211 zval = (consdata->lhs - xtermval)/consdata->zcoef;
4221 zval = (consdata->rhs - xtermval)/consdata->zcoef;
4237 assert(conshdlrdata !=
NULL);
4238 assert(conshdlrdata->trysolheur !=
NULL);
4269 assert(scip !=
NULL);
4270 assert(cons !=
NULL);
4273 assert(consdata !=
NULL);
4275 if( consdata->nlrow !=
NULL )
4296 n = (int)
SCIPround(scip, consdata->exponent);
4299 if(
sign != 0 || (expisint && (n % 2 == 1)) )
4302 if( expisint && n == 2 )
4311 quadvar = consdata->x;
4313 if( consdata->xoffset != 0.0 )
4315 linvars[0] = consdata->x;
4316 lincoefs[0] =
sign * 2.0 * consdata->xoffset;
4318 constant =
sign * consdata->xoffset * consdata->xoffset;
4328 if( consdata->xoffset != 0.0 )
4333 if(
sign == -1 && !expisint )
4350 if(
sign == -1 && !(expisint && n % 2 == 1) )
4365 if( consdata->xoffset != 0.0 )
4374 assert(exprtree !=
NULL || nquadelems > 0);
4377 if( exprtree !=
NULL )
4382 assert(nlinvars < 2);
4383 linvars[nlinvars] = consdata->z;
4384 lincoefs[nlinvars] = consdata->zcoef;
4389 nlinvars, linvars, lincoefs,
4390 nquadvars, &quadvar, nquadelems, &quadelem,
4391 exprtree, consdata->lhs, consdata->rhs,
4395 if( exprtree !=
NULL )
4431 x = quadvarterm.
var;
4443 if( -*nupgdconss > upgdconsssize )
4482 #ifdef SCIP_DEBUG_SOLUTION 4483 if( SCIPdebugIsMainscip(scip) )
4513 lhs += quadvarterm.
sqrcoef * xoffset * xoffset;
4515 rhs += quadvarterm.
sqrcoef * xoffset * xoffset;
4518 signpowcoef = quadvarterm.
sqrcoef;
4520 signpowcoef = -signpowcoef;
4521 if( signpowcoef > 0.0 )
4533 newrhs = lhs / signpowcoef;
4537 lhs = rhs / signpowcoef;
4542 zcoef /= signpowcoef;
4546 xoffset, zcoef, lhs, rhs,
4574 assert(nupgdconss !=
NULL);
4575 assert(upgdconss !=
NULL);
4604 if( exponent <= 1.0 )
4616 if( exponent <= 1.0 )
4620 if( (
int)exponent % 2 == 0 && childbounds.
inf < 0.0 && childbounds.
sup > 0.0 )
4624 if( (
int)exponent % 2 == 0 && childbounds.
inf < 0.0 )
4636 if( childbounds.
inf < 0.0 && childbounds.
sup > 0.0 )
4640 if( childbounds.
inf < 0.0 )
4650 if( exponent <= 1.0 )
4670 if( exponent <= 1.0 )
4678 if( childbounds.
sup > 0.0 )
4698 zcoef /= signpowcoef;
4705 SCIPdebugMsg(scip,
"skip upgrade to signpower since |zcoef| = %g would be zero\n", zcoef);
4735 if( upgdconsssize < -*nupgdconss )
4762 signpowcoef *= (xcoef < 0.0 ? -1.0 : 1.0) *
pow(
REALABS(xcoef), exponent);
4788 assert(upgdconsssize > *nupgdconss);
4817 assert(upgdconsssize > *nupgdconss);
4834 #ifdef SCIP_DEBUG_SOLUTION 4835 if( SCIPdebugIsMainscip(scip) )
4861 if( constant != 0.0 )
4870 if( signpowcoef != 1.0 )
4872 zcoef /= signpowcoef;
4873 if( signpowcoef < 0.0 )
4892 assert(*nupgdconss < upgdconsssize);
4894 x, z, exponent, xoffset, zcoef, lhs, rhs,
4924 assert(scip !=
NULL);
4925 assert(exprgraph !=
NULL);
4926 assert(node !=
NULL);
4927 assert(naddcons !=
NULL);
4928 assert(reformnode !=
NULL);
4946 if( exponent <= 1.0 )
4958 if( exponent <= 1.0 )
4962 if( (
int)exponent % 2 == 0 && childbounds.
inf < 0.0 && childbounds.
sup > 0.0 )
4966 if( (
int)exponent % 2 == 0 && childbounds.
inf < 0.0 )
4978 if( childbounds.
inf < 0.0 && childbounds.
sup > 0.0 )
4982 if( childbounds.
inf < 0.0 )
4992 if( exponent <= 1.0 )
5014 if( exponent <= 1.0 )
5022 if( childbounds.
sup > 0.0 )
5043 SCIPdebugMsg(scip,
"reformulate node %p via signpower\n", (
void*)node);
5060 signpowcoef *= (xcoef < 0.0 ? -1.0 : 1.0) *
pow(
REALABS(xcoef), exponent);
5108 x, z, exponent, xoffset, -1.0/signpowcoef, -constant/signpowcoef, -constant/signpowcoef,
5115 #ifdef SCIP_DEBUG_SOLUTION 5116 if( SCIPdebugIsMainscip(scip) )
5122 zval = signpowcoef *
SIGN(xval + xoffset) *
pow(
REALABS(xval + xoffset), exponent) + constant;
5136 x, z, exponent, xoffset, -1.0, 0.0, 0.0,
5143 #ifdef SCIP_DEBUG_SOLUTION 5144 if( SCIPdebugIsMainscip(scip) )
5150 zval =
SIGN(xval + xoffset) *
pow(
REALABS(xval + xoffset), exponent);
5160 *reformnode = linnode;
5195 assert(scip !=
NULL);
5196 assert(conshdlr !=
NULL);
5197 assert(conss !=
NULL || nconss == 0);
5198 assert(result !=
NULL);
5201 assert(conshdlrdata !=
NULL);
5205 if( maxviolcons ==
NULL )
5220 assert(solinfeasible);
5233 if( conshdlrdata->nenforounds > 100 )
5246 ++conshdlrdata->nenforounds;
5251 conshdlrdata->nenforounds = 0;
5255 for( c = 0; c < nconss; ++c )
5260 assert(conss[c] !=
NULL);
5263 assert(consdata !=
NULL);
5285 assert(consdata !=
NULL);
5286 maxviol = consdata->lhsviol + consdata->rhsviol;
5294 minefficacy =
MIN(0.75*maxviol, conshdlrdata->mincutefficacyenfofac *
SCIPfeastol(scip));
5296 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, sol, minefficacy,
TRUE,
FALSE, &success,
5297 &cutoff, &sepaefficacy) );
5306 SCIPdebugMsg(scip,
"separation succeeded (bestefficacy = %g, minefficacy = %g)\n", sepaefficacy, minefficacy);
5310 SCIPdebugMsg(scip,
"separation failed (bestefficacy = %g < %g = minefficacy ); max viol: %g\n", sepaefficacy, minefficacy,
5320 if( nnotify == 0 && !solinfeasible && minefficacy > leastpossibleefficacy )
5324 &success, &cutoff, &sepaefficacy) );
5338 if( nnotify == 0 && !solinfeasible )
5346 SCIPwarningMessage(scip,
"Could not find any branching variable candidate. Cutting off node. Max viol = %g.\n",
5353 SCIPdebugMsg(scip,
"Could not find any usual branching variable candidate. Proposed variable %s with LP value %g for branching. Max. viol. cons. <%s>: %g+%g\n",
5372 assert(scip !=
NULL);
5373 assert(conshdlr !=
NULL);
5390 assert(scip !=
NULL);
5391 assert(conshdlr !=
NULL);
5394 assert(conshdlrdata !=
NULL);
5407 assert(scip !=
NULL);
5408 assert(conshdlr !=
NULL);
5411 assert(conshdlrdata !=
NULL);
5413 conshdlrdata->subnlpheur =
SCIPfindHeur(scip,
"subnlp");
5414 conshdlrdata->trysolheur =
SCIPfindHeur(scip,
"trysol");
5416 conshdlrdata->nsecantcuts = 0;
5417 conshdlrdata->ncuts = 0;
5428 assert(scip !=
NULL);
5429 assert(conshdlr !=
NULL);
5432 assert(conshdlrdata !=
NULL);
5434 conshdlrdata->subnlpheur =
NULL;
5435 conshdlrdata->trysolheur =
NULL;
5436 conshdlrdata->conshdlrindicator =
NULL;
5447 assert(conshdlr !=
NULL);
5450 assert(conshdlrdata !=
NULL);
5453 conshdlrdata->comparedpairwise = (nconss <= 1);
5464 assert(scip !=
NULL);
5465 assert(conss !=
NULL || nconss == 0);
5468 for( c = 0; c < nconss; ++c )
5470 assert(conss[c] !=
NULL);
5491 assert(conshdlrdata !=
NULL);
5493 assert(scip !=
NULL);
5494 assert(conss !=
NULL || nconss == 0);
5496 for( c = 0; c < nconss; ++c )
5498 assert(conss[c] !=
NULL);
5501 assert(consdata !=
NULL);
5503 assert(consdata->exponent > 1.0);
5508 consdata->root =
roots[(int)
SCIPfloor(scip, consdata->exponent+0.5)];
5510 else if(
SCIPisEQ(scip, consdata->exponent, 1.852) )
5512 consdata->root = 0.398217;
5525 else if( consdata->exponent <= 2.0 )
5532 polyval = (consdata->exponent - 1.0) * consdata->power(root, consdata->exponent) + consdata->exponent *
pow(root, consdata->exponent-1.0) - 1.0;
5537 gradval = (consdata->exponent - 1.0) * consdata->exponent * (
pow(root, consdata->exponent - 1.0) +
pow(root, consdata->exponent - 2.0));
5542 root -= polyval / gradval;
5546 while( ++iter < 1000 );
5550 SCIPerrorMessage(
"failed to compute root for exponent %g\n", consdata->exponent);
5553 SCIPdebugMsg(scip,
"root for %g is %.20g, certainty = %g\n", consdata->exponent, root, polyval);
5556 consdata->root = root;
5562 if( consdata->nlrow ==
NULL )
5565 assert(consdata->nlrow !=
NULL);
5571 conshdlrdata->newsoleventfilterpos = -1;
5577 assert(eventhdlr !=
NULL);
5583 conshdlrdata->sepanlp =
FALSE;
5584 conshdlrdata->lastenfonode =
NULL;
5585 conshdlrdata->nenforounds = 0;
5598 assert(scip !=
NULL);
5599 assert(conss !=
NULL || nconss == 0);
5602 assert(conshdlrdata !=
NULL);
5604 if( conshdlrdata->newsoleventfilterpos >= 0 )
5609 assert(eventhdlr !=
NULL);
5612 conshdlrdata->newsoleventfilterpos = -1;
5615 for( c = 0; c < nconss; ++c )
5617 assert(conss[c] !=
NULL);
5620 assert(consdata !=
NULL);
5623 if( consdata->nlrow !=
NULL )
5636 assert(scip !=
NULL);
5637 assert(conshdlr !=
NULL);
5638 assert(cons !=
NULL);
5639 assert(consdata !=
NULL);
5640 assert((*consdata)->x !=
NULL);
5641 assert((*consdata)->z !=
NULL);
5642 assert((*consdata)->xeventfilterpos == -1);
5643 assert((*consdata)->zeventfilterpos == -1);
5645 if( (*consdata)->nlrow !=
NULL )
5663 assert(sourcedata !=
NULL);
5666 assert(targetdata->xeventfilterpos == -1);
5667 assert(targetdata->zeventfilterpos == -1);
5704 assert(scip !=
NULL);
5705 assert(conshdlr !=
NULL);
5706 assert(conss !=
NULL || nconss == 0);
5709 assert(conshdlrdata !=
NULL);
5711 *infeasible =
FALSE;
5713 for( c = 0; c < nconss && !(*infeasible); ++c )
5715 assert(conss[c] !=
NULL);
5718 assert(consdata !=
NULL);
5734 consdata->exponent, consdata->xoffset, consdata->power, 1.0, consdata->zcoef, consdata->rhs, consdata->x, consdata->z) );
5739 assert(!(*infeasible));
5754 consdata->x, consdata->z,
FALSE) );
5755 assert(row !=
NULL);
5758 assert(!(*infeasible));
5761 if( conshdlrdata->conshdlrindicator !=
NULL )
5773 if( -consdata->root * (xlb+consdata->xoffset) - consdata->xoffset < xub && xub <=
INITLPMAXVARVAL )
5776 consdata->x, consdata->z,
FALSE) );
5777 assert(row !=
NULL);
5780 assert(!(*infeasible));
5783 if( conshdlrdata->conshdlrindicator !=
NULL )
5801 consdata->exponent, -consdata->xoffset, consdata->power, -1.0, -consdata->zcoef, -consdata->lhs, consdata->x, consdata->z) );
5806 assert(!(*infeasible));
5821 consdata->x, consdata->z,
FALSE) );
5822 assert(row !=
NULL);
5825 assert(!(*infeasible));
5828 if( conshdlrdata->conshdlrindicator !=
NULL )
5840 if( -consdata->root * (xub+consdata->xoffset) - consdata->xoffset > xlb && xlb >= -
INITLPMAXVARVAL )
5843 consdata->x, consdata->z,
FALSE) );
5844 assert(row !=
NULL);
5847 assert(!(*infeasible));
5850 if( conshdlrdata->conshdlrindicator !=
NULL )
5874 assert(scip !=
NULL);
5875 assert(conshdlr !=
NULL);
5876 assert(conss !=
NULL || nconss == 0);
5877 assert(result !=
NULL);
5882 assert(conshdlrdata !=
NULL);
5891 if( maxviolcon ==
NULL )
5897 if(
SCIPgetDepth(scip) == 0 && !conshdlrdata->sepanlp &&
5914 for( c = 0; c < nconss; ++c )
5916 assert(conss[c] !=
NULL);
5919 assert(consdata !=
NULL);
5935 if( conshdlrdata->subnlpheur !=
NULL )
5950 SCIPdebugMsg(scip,
"solved NLP relax, solution status: %d\n", solstat);
5956 conshdlrdata->sepanlp =
TRUE;
5960 SCIPdebugMsg(scip,
"NLP relaxation is globally infeasible, thus can cutoff node\n");
5972 assert(nlpsol !=
NULL);
5975 if( solvednlp && conshdlrdata->trysolheur !=
NULL )
5985 if( nfracvars == 0 )
5996 if( lpsolseparated )
5998 SCIPdebugMsg(scip,
"linearization cuts separate LP solution\n");
6010 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss,
NULL, conshdlrdata->mincutefficacysepa,
FALSE, conshdlrdata->sepainboundsonly, &success, &cutoff,
NULL) );
6029 assert(scip !=
NULL);
6030 assert(conshdlr !=
NULL);
6031 assert(conss !=
NULL || nconss == 0);
6032 assert(sol !=
NULL);
6033 assert(result !=
NULL);
6036 assert(conshdlrdata !=
NULL);
6047 if( maxviolcon ==
NULL )
6050 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, sol, conshdlrdata->mincutefficacysepa,
FALSE,
FALSE, &success, &cutoff,
NULL) );
6088 assert(scip !=
NULL);
6089 assert(conshdlr !=
NULL);
6090 assert(conss !=
NULL || nconss == 0);
6093 assert(conshdlrdata !=
NULL);
6097 assert(!solviolbounds);
6099 if( maxviolcon ==
NULL )
6108 for( c = 0; c < nconss; ++c )
6114 assert(conss[c] !=
NULL);
6117 assert(consdata !=
NULL);
6142 for( c = 0; c < nconss; ++c )
6144 assert(conss !=
NULL);
6146 assert(consdata !=
NULL);
6163 SCIPdebugMsg(scip,
"All variables in violated constraints fixed (up to epsilon). Cannot find branching candidate. Forcing solution of LP.\n");
6181 assert(scip !=
NULL);
6182 assert(conshdlr !=
NULL);
6183 assert(conss !=
NULL || nconss == 0);
6184 assert(result !=
NULL);
6188 for( c = 0; c < nmarkedconss; ++c )
6190 assert(conss !=
NULL);
6196 assert(naddconss == 0);
6227 assert(scip !=
NULL);
6228 assert(conss !=
NULL || nconss == 0);
6229 assert(result !=
NULL);
6232 assert(conshdlrdata !=
NULL);
6239 SCIP_CALL(
presolveFindDuplicates(scip, conshdlr, conss, nconss, nupgdconss, ndelconss, naddconss, nfixedvars, naggrvars, &success, &infeas) );
6248 conshdlrdata->comparedpairwise =
TRUE;
6253 for( c = 0; c < nconss; ++c )
6255 assert(conss[c] !=
NULL);
6261 assert(consdata !=
NULL);
6267 if( consdata->exponent == 1.0 )
6275 vars[0] = consdata->x;
6276 vars[1] = consdata->z;
6278 coefs[1] = consdata->zcoef;
6279 lhs = consdata->lhs;
6280 rhs = consdata->rhs;
6282 lhs -= consdata->xoffset;
6284 rhs -= consdata->xoffset;
6302 switch( replaceresult )
6342 if( consdata->xoffset != 0.0 )
6346 xcoef =
SIGN(consdata->xoffset + 1.0) * consdata->power(ABS(consdata->xoffset + 1.0), consdata->exponent)
6347 -
SIGN(consdata->xoffset) * consdata->power(ABS(consdata->xoffset), consdata->exponent);
6354 lhs = (consdata->rhs -
SIGN(consdata->xoffset) * consdata->power(ABS(consdata->xoffset), consdata->exponent)) / xcoef;
6358 rhs = (consdata->lhs -
SIGN(consdata->xoffset) * consdata->power(ABS(consdata->xoffset), consdata->exponent)) / xcoef;
6365 lhs = (consdata->lhs -
SIGN(consdata->xoffset) * consdata->power(ABS(consdata->xoffset), consdata->exponent)) / xcoef;
6369 rhs = (consdata->rhs -
SIGN(consdata->xoffset) * consdata->power(ABS(consdata->xoffset), consdata->exponent)) / xcoef;
6371 zcoef = consdata->zcoef / xcoef;
6379 lhs = consdata->lhs;
6380 rhs = consdata->rhs;
6381 zcoef = consdata->zcoef;
6397 if( infeas || !fixed )
6399 SCIPdebugMsg(scip,
"propagation on constraint <%s> says problem is infeasible in presolve\n",
6411 SCIPdebugMsg(scip,
"propagation on constraint <%s> says problem is infeasible in presolve\n",
6421 consdata->x, consdata->z, zcoef, lhs, rhs,
6430 1, &consdata->z, &zcoef, lhs, rhs,
6460 if( localnchgbds > 0 || localnaddconss > 0 )
6462 *nchgbds += localnchgbds;
6463 *naddconss += localnaddconss;
6501 consdata->propvarbounds =
TRUE;
6540 assert(result !=
NULL);
6557 assert(scip !=
NULL);
6558 assert(cons !=
NULL);
6561 assert(consdata !=
NULL);
6566 if( consdata->x !=
NULL )
6578 if( consdata->z !=
NULL )
6580 if( consdata->zcoef > 0 )
6613 assert(conshdlr !=
NULL);
6616 assert(conshdlrdata !=
NULL);
6619 conshdlrdata->comparedpairwise =
FALSE;
6630 assert(scip !=
NULL);
6631 assert(cons !=
NULL);
6632 assert(conshdlr !=
NULL);
6635 assert(conshdlrdata !=
NULL);
6636 assert(conshdlrdata->eventhdlr !=
NULL);
6649 assert(scip !=
NULL);
6650 assert(cons !=
NULL);
6651 assert(conshdlr !=
NULL);
6654 assert(conshdlrdata !=
NULL);
6655 assert(conshdlrdata->eventhdlr !=
NULL);
6668 assert(scip !=
NULL);
6669 assert(cons !=
NULL);
6672 assert(consdata !=
NULL);
6677 && !
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
6683 SCIPinfoMessage(scip, file,
" %+.15g, %.15g) ", consdata->xoffset, consdata->exponent);
6689 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
6721 assert(scip !=
NULL);
6722 assert(conss !=
NULL || nconss == 0);
6723 assert(result !=
NULL);
6726 assert(conshdlrdata !=
NULL);
6734 for( c = 0; c < nconss; ++c )
6736 assert(conss !=
NULL);
6739 assert(!solviolbounds);
6742 assert(consdata !=
NULL);
6750 SCIPinfoMessage(scip,
NULL,
"absolute power constraint <%s> violated by %g (scaled = %g)\n\t",
6752 SCIP_CALL( consPrintAbspower(scip, conshdlr, conss[c],
NULL) );
6756 if( conshdlrdata->subnlpheur ==
NULL && !dolinfeasshift && !completely )
6758 if( consdata->lhsviol > maxviol || consdata->rhsviol > maxviol )
6759 maxviol =
MAX(consdata->lhsviol, consdata->rhsviol);
6784 assert(scip !=
NULL);
6785 assert(cons !=
NULL);
6786 assert(sourcescip !=
NULL);
6787 assert(sourcecons !=
NULL);
6788 assert(varmap !=
NULL);
6789 assert(valid !=
NULL);
6792 assert(consdata !=
NULL);
6807 x, z, consdata->exponent, consdata->xoffset, consdata->zcoef, consdata->lhs, consdata->rhs,
6808 initial, separate, enforce, check, propagate, local,
FALSE, dynamic, removable, stickingatnode) );
6835 SCIPdebugMsg(scip,
"start parsing absolute power constraint expression %s\n", str);
6837 if( strncmp(str,
"signpower(", 10) != 0 )
6866 while( isspace((
int)*str) )
6887 while( isspace((
int)*str) )
6908 while( isspace((
int)*str) )
6931 while( isspace((
int)*str) )
6934 if( strncmp(str,
"[free]", 6) != 0 )
6937 if( (*str !=
'<' && *str !=
'>' && *str !=
'=') || str[1] !=
'=' )
6971 SCIP_CALL(
SCIPcreateConsAbspower(scip, cons, name, x, z, exponent, xoffset, zcoef, lhs, rhs,
6972 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
6987 assert(cons !=
NULL);
6988 assert(vars !=
NULL);
6991 assert(consdata !=
NULL);
6993 vars[0] = consdata->x;
6994 vars[1] = consdata->z;
7031 consEnfolpAbspower, consEnfopsAbspower, consCheckAbspower, consLockAbspower,
7034 assert(conshdlr !=
NULL);
7074 "minimal efficacy for a cut to be added to the LP during separation; overwrites separating/efficacy",
7078 "minimal target efficacy of a cut in order to add it to relaxation during enforcement as factor of feasibility tolerance (may be ignored)",
7082 "whether scaling of infeasibility is 'o'ff, by sup-norm of function 'g'radient, or by left/right hand 's'ide",
7083 &conshdlrdata->scaling,
TRUE,
'o',
"ogs",
NULL,
NULL) );
7086 "maximal coef range of a cut (maximal coefficient divided by minimal coefficient) in order to be added to LP relaxation",
7090 "whether to project the reference point when linearizing an absolute power constraint in a convex region",
7094 "how much to prefer branching on 0.0 when sign of variable is not fixed yet: 0 no preference, 1 prefer if LP solution will be cutoff in both child nodes, 2 prefer always, 3 ensure always",
7095 &conshdlrdata->preferzerobranch,
FALSE, 1, 0, 3,
NULL,
NULL) );
7098 "whether to compute branching point such that the convexification error is minimized (after branching on 0.0)",
7102 "should variable bound constraints be added for derived variable bounds?",
7106 "whether to try to make solutions in check function feasible by shifting the linear variable z",
7110 "should dual presolve be applied?",
7114 "whether to separate linearization cuts only in the variable bounds (does not affect enforcement)",
7118 "minimal required fraction of continuous variables in problem to use solution of NLP relaxation in root for separation",
7119 &conshdlrdata->sepanlpmincont,
FALSE, 1.0, 0.0, 2.0,
NULL,
NULL) );
7122 "are cuts added during enforcement removable from the LP in the same node?",
7126 processVarEvent,
NULL) );
7127 conshdlrdata->eventhdlr = eventhdlr;
7130 processNewSolutionEvent,
NULL) );
7180 assert(exponent > 1.0);
7183 assert(!modifiable);
7187 if( conshdlr ==
NULL )
7196 consdata->xeventfilterpos = -1;
7197 consdata->zeventfilterpos = -1;
7201 consdata->xoffset = xoffset;
7202 consdata->zcoef = zcoef;
7203 consdata->lhs = lhs;
7204 consdata->rhs = rhs;
7206 if(
SCIPisEQ(scip, exponent, 2.0) )
7208 consdata->exponent = 2.0;
7209 consdata->power =
square;
7213 consdata->exponent = exponent;
7214 consdata->power =
pow;
7226 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
7227 local, modifiable, dynamic, removable, stickingatnode) );
7253 assert(scip !=
NULL);
7255 SCIP_CALL(
SCIPcreateConsAbspower(scip, cons, name, x, z, exponent, xoffset, zcoef, lhs, rhs,
7270 assert(cons !=
NULL);
7272 assert(nlrow !=
NULL);
7275 assert(consdata !=
NULL);
7277 if( consdata->nlrow ==
NULL )
7281 assert(consdata->nlrow !=
NULL);
7282 *nlrow = consdata->nlrow;
7295 assert(cons !=
NULL);
7299 assert(consdata !=
NULL);
7312 assert(cons !=
NULL);
7316 assert(consdata !=
NULL);
7329 assert(cons !=
NULL);
7333 assert(consdata !=
NULL);
7335 return consdata->exponent;
7346 assert(cons !=
NULL);
7350 assert(consdata !=
NULL);
7352 return consdata->xoffset;
7363 assert(cons !=
NULL);
7367 assert(consdata !=
NULL);
7369 return consdata->zcoef;
7380 assert(cons !=
NULL);
7384 assert(consdata !=
NULL);
7386 return consdata->lhs;
7397 assert(cons !=
NULL);
7401 assert(consdata !=
NULL);
7403 return consdata->rhs;
7419 assert(cons !=
NULL);
7423 assert(consdata !=
NULL);
7424 assert(consdata->lhs == 0.0);
7425 assert(consdata->rhs == 0.0);
7430 rhs = -1.0 * consdata->zcoef * z_val;
7431 proj_val =
SIGN(rhs) *
pow(
REALABS(rhs), 1.0 / consdata->exponent) - consdata->xoffset;
7433 SCIPdebugMsg(scip,
"computing slack: linear: %f, power: %f, projected: %f\n", z_val, x_val, proj_val);
7435 return x_val - proj_val;
SCIP_Real SCIPgetCoefLinearAbspower(SCIP *scip, SCIP_CONS *cons)
enum SCIP_Result SCIP_RESULT
void SCIPmultihashFree(SCIP_MULTIHASH **multihash)
SCIP_VAR * SCIPgetNonlinearVarAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
enum SCIP_BoundType SCIP_BOUNDTYPE
SCIP_Real SCIPexprgraphGetNodeVal(SCIP_EXPRGRAPHNODE *node)
int SCIPgetNIntVars(SCIP *scip)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
static SCIP_DECL_HASHGETKEY(presolveFindDuplicatesGetKey)
SCIPInterval square(const SCIPInterval &x)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
SCIP_EXPRGRAPH * SCIPgetExprgraphNonlinear(SCIP *scip, SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPincludeNonlinconsUpgrade(SCIP *scip, SCIP_DECL_NONLINCONSUPGD((*nonlinconsupgd)), SCIP_DECL_EXPRGRAPHNODEREFORM((*nodereform)), int priority, SCIP_Bool active, const char *conshdlrname)
SCIP_Real * SCIPvarGetVlbCoefs(SCIP_VAR *var)
SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
void SCIPexprgraphSetVarNodeValue(SCIP_EXPRGRAPHNODE *varnode, SCIP_Real value)
SCIP_Bool SCIPintervalIsEmpty(SCIP_Real infinity, SCIP_INTERVAL operand)
SCIP_RETCODE SCIPexprgraphAddNode(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, int mindepth, int nchildren, SCIP_EXPRGRAPHNODE **children)
primal heuristic that tries a given solution
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
static SCIP_DECL_CONSPROP(consPropAbspower)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE resolvePropagation(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, PROPRULE proprule, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx)
SCIP_RETCODE SCIPexprgraphAddVars(SCIP_EXPRGRAPH *exprgraph, int nvars, void **vars, SCIP_EXPRGRAPHNODE **varnodes)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
static SCIP_RETCODE generateSecantCut(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, SCIP_SOL *sol, SCIP_Real xlb, SCIP_Real xub, SCIP_Real exponent, SCIP_Real xoffset, DECL_MYPOW((*mypow)), SCIP_Real xmult, SCIP_Real zcoef, SCIP_Real rhs, SCIP_VAR *x, SCIP_VAR *z)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
Constraint handler for variable bound constraints .
SCIP_Bool SCIPisRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE dropVarEvents(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_CONS *cons)
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_Real SCIPgetOffsetAbspower(SCIP *scip, SCIP_CONS *cons)
int SCIPexprgraphGetNodeNChildren(SCIP_EXPRGRAPHNODE *node)
int SCIPvarGetNVlbs(SCIP_VAR *var)
SCIP_Bool SCIPisUbBetter(SCIP *scip, SCIP_Real newub, SCIP_Real oldlb, SCIP_Real oldub)
static SCIP_DECL_CONSDISABLE(consDisableAbspower)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPincludeQuadconsUpgrade(SCIP *scip, SCIP_DECL_QUADCONSUPGD((*quadconsupgd)), int priority, SCIP_Bool active, const char *conshdlrname)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
SCIP_VAR * SCIPgetLinearVarAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
SCIPInterval pow(const SCIPInterval &x, const SCIPInterval &y)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
static SCIP_DECL_CONSINITPRE(consInitpreAbspower)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
static SCIP_RETCODE addLinearizationCuts(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *ref, SCIP_Bool *separatedlpsol, SCIP_Real minefficacy)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_CONSPARSE(consParseAbspower)
SCIP_Bool SCIPconsIsAdded(SCIP_CONS *cons)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
SCIP_NLPSOLSTAT SCIPgetNLPSolstat(SCIP *scip)
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_RETCODE SCIPmultihashCreate(SCIP_MULTIHASH **multihash, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
constraint handler for indicator constraints
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPgetRelaxFeastolFactor(SCIP *scip)
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
static SCIP_DECL_CONSINITSOL(consInitsolAbspower)
SCIP_RETCODE SCIPincludeConshdlrBasic(SCIP *scip, SCIP_CONSHDLR **conshdlrptr, const char *name, const char *desc, int enfopriority, int chckpriority, int eagerfreq, SCIP_Bool needscons, SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_CONSHDLRDATA *conshdlrdata)
SCIP_Real * SCIPgetLinearCoefsNonlinear(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSINITLP(consInitlpAbspower)
static SCIP_DECL_CONSEXITPRE(consExitpreAbspower)
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPexprgraphGetNodeSignPowerExponent(SCIP_EXPRGRAPHNODE *node)
static SCIP_RETCODE generateLinearizationCutProject(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, SCIP_Real xref, SCIP_Real zref, SCIP_Real xmin, SCIP_Real exponent, SCIP_Real xoffset, SCIP_Real xmult, SCIP_Real zcoef, SCIP_Real rhs, SCIP_VAR *x, SCIP_VAR *z, SCIP_Bool islocal)
SCIP_RETCODE SCIPunmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
SCIP_RETCODE SCIPsolveNLP(SCIP *scip)
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
int SCIPvarGetNVubs(SCIP_VAR *var)
static SCIP_RETCODE tightenBounds(SCIP *scip, SCIP_VAR *var, SCIP_INTERVAL bounds, SCIP_Bool force, SCIP_CONS *cons, SCIP_RESULT *result, int *nchgbds, int *nfixedvars, int *naddconss)
SCIP_INTERVAL SCIPexprgraphGetNodeBounds(SCIP_EXPRGRAPHNODE *node)
static SCIP_RETCODE enforceConstraint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int nusefulconss, SCIP_SOL *sol, SCIP_Bool solinfeasible, SCIP_RESULT *result)
static SCIP_DECL_CONSENFOPS(consEnfopsAbspower)
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
SCIP_Real SCIPgetRhsNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPexprtreeSetVars(SCIP_EXPRTREE *tree, int nvars, SCIP_VAR **vars)
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
#define CONSHDLR_CHECKPRIORITY
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
static SCIP_RETCODE checkFixedVariables(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, int *ndelconss, int *nupgdconss, int *nchgbds, int *nfixedvars, SCIP_RESULT *result)
#define SCIPfreeBlockMemory(scip, ptr)
static SCIP_DECL_HASHKEYVAL(presolveFindDuplicatesKeyVal)
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
SCIP_VAR ** SCIPvarGetVlbVars(SCIP_VAR *var)
SCIP_EVENTHDLR * SCIPfindEventhdlr(SCIP *scip, const char *name)
static SCIP_RETCODE generateCut(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_ROW **row, SCIP_Bool onlyinbounds)
static SCIP_DECL_HASHKEYEQ(presolveFindDuplicatesKeyEQ)
static SCIP_DECL_CONSTRANS(consTransAbspower)
static SCIP_RETCODE separatePoint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int nusefulconss, SCIP_SOL *sol, SCIP_Real minefficacy, SCIP_Bool inenforcement, SCIP_Bool onlyinbounds, SCIP_Bool *success, SCIP_Bool *cutoff, SCIP_Real *bestefficacy)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPaddVarVlb(SCIP *scip, SCIP_VAR *var, SCIP_VAR *vlbvar, SCIP_Real vlbcoef, SCIP_Real vlbconstant, SCIP_Bool *infeasible, int *nbdchgs)
int SCIPnodeGetDepth(SCIP_NODE *node)
static SCIP_DECL_CONSGETVARS(consGetVarsAbspower)
SCIP_RETCODE SCIPcreateLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
SCIP_RETCODE SCIPexprtreeCreate(BMS_BLKMEM *blkmem, SCIP_EXPRTREE **tree, SCIP_EXPR *root, int nvars, int nparams, SCIP_Real *params)
static SCIP_DECL_NONLINCONSUPGD(nonlinconsUpgdAbspower)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPdebugPrintCons(x, y, z)
SCIP_RETCODE SCIPaddVarVub(SCIP *scip, SCIP_VAR *var, SCIP_VAR *vubvar, SCIP_Real vubcoef, SCIP_Real vubconstant, SCIP_Bool *infeasible, int *nbdchgs)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
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)
#define NONLINCONSUPGD_PRIORITY
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
SCIP_Real SCIPgetLhsQuadratic(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSENABLE(consEnableAbspower)
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
int SCIPgetNContVars(SCIP *scip)
SCIP_RETCODE SCIPcreateCons(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA *consdata, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
static SCIP_DECL_CONSEXIT(consExitAbspower)
SCIP_RETCODE SCIPcreateConsBasicAbspower(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *x, SCIP_VAR *z, SCIP_Real exponent, SCIP_Real xoffset, SCIP_Real zcoef, SCIP_Real lhs, SCIP_Real rhs)
SCIP_Real SCIPepsilon(SCIP *scip)
#define CONSHDLR_DELAYSEPA
int SCIPexprgraphGetNodePolynomialNMonomials(SCIP_EXPRGRAPHNODE *node)
static SCIP_Real proposeBranchingPoint(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, int preferzero, SCIP_Bool branchminconverror)
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
static SCIP_DECL_QUADCONSUPGD(quadconsUpgdAbspower)
SCIP_Real SCIPgetRowMaxCoef(SCIP *scip, SCIP_ROW *row)
int SCIPgetNQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsGlobal(SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsVarbound(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *var, SCIP_VAR *vbdvar, SCIP_Real vbdcoef, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
int SCIPexprGetMonomialNFactors(SCIP_EXPRDATA_MONOMIAL *monomial)
int SCIPgetNBilinTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
SCIP_RETCODE SCIPheurPassSolTrySol(SCIP *scip, SCIP_HEUR *heur, SCIP_SOL *sol)
SCIP_EXPROP SCIPexprgraphGetNodeOperator(SCIP_EXPRGRAPHNODE *node)
SCIP_Bool SCIPisLbBetter(SCIP *scip, SCIP_Real newlb, SCIP_Real oldlb, SCIP_Real oldub)
SCIP_EXPRDATA_MONOMIAL ** SCIPexprgraphGetNodePolynomialMonomials(SCIP_EXPRGRAPHNODE *node)
SCIP_RETCODE SCIPchgVarType(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_VAR * SCIPvarGetProbvar(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrInitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITSOL((*consinitsol)))
#define SCIP_EVENTTYPE_SOLFOUND
#define CONSHDLR_ENFOPRIORITY
static SCIP_RETCODE createNlRow(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
SCIP_Real SCIPexprgraphGetNodeLinearConstant(SCIP_EXPRGRAPHNODE *node)
#define SCIP_PRESOLTIMING_MEDIUM
SCIP_Real SCIPexprgraphGetNodePolynomialConstant(SCIP_EXPRGRAPHNODE *node)
void SCIPmarkRowNotRemovableLocal(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
SCIP_RETCODE SCIPaddLinearConsToNlpHeurSubNlp(SCIP *scip, SCIP_HEUR *heur, SCIP_Bool addcombconss, SCIP_Bool addcontconss)
SCIP_Bool SCIPexprgraphHasNodeNonlinearAncestor(SCIP_EXPRGRAPHNODE *node)
SCIP_EXPRCURV SCIPexprgraphGetNodeCurvature(SCIP_EXPRGRAPHNODE *node)
static void computeBoundsX(SCIP *scip, SCIP_CONS *cons, SCIP_INTERVAL zbnds, SCIP_INTERVAL *xbnds)
const char * SCIPheurGetName(SCIP_HEUR *heur)
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
SCIP_Real SCIPvarGetBestBoundGlobal(SCIP_VAR *var)
#define CONSHDLR_EAGERFREQ
SCIP_Real SCIPgetRowMinCoef(SCIP *scip, SCIP_ROW *row)
static void computeBoundsZ(SCIP *scip, SCIP_CONS *cons, SCIP_INTERVAL xbnds, SCIP_INTERVAL *zbnds)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
interval arithmetics for provable bounds
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE computeViolations(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_Bool *solviolbounds, SCIP_CONS **maxviolcon)
SCIP_RETCODE SCIPaddConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_NODE *validnode)
#define QUADCONSUPGD_PRIORITY
SCIP_RETCODE SCIPaddNlRow(SCIP *scip, SCIP_NLROW *nlrow)
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPintervalGetInf(SCIP_INTERVAL interval)
static void presolveFindDuplicatesSolveEquations(SCIP *scip, SCIP_Bool *infeas, SCIP_Real *xval, SCIP_Real *zval, SCIP_Real exponent, SCIP_Real xoffset1, SCIP_Real zcoef1, SCIP_Real rhs1, SCIP_Real xoffset2, SCIP_Real zcoef2, SCIP_Real rhs2)
SCIP_RETCODE SCIPreleaseNlRow(SCIP *scip, SCIP_NLROW **nlrow)
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
#define SCIPpositiveRealHashCode(x, n)
SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_Real * SCIPgetCoefsLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIPInterval sqrt(const SCIPInterval &x)
static SCIP_RETCODE proposeFeasibleSolution(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
#define CONSHDLR_NEEDSCONS
static SCIP_RETCODE catchVarEvents(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_Real * SCIPvarGetVubConstants(SCIP_VAR *var)
SCIPInterval sign(const SCIPInterval &x)
static SCIP_DECL_CONSACTIVE(consActiveAbspower)
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
struct SCIP_EventData SCIP_EVENTDATA
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
static SCIP_RETCODE presolveFindDuplicates(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int *nupgdconss, int *ndelconss, int *naddconss, int *nfixedvars, int *naggrvars, SCIP_Bool *success, SCIP_Bool *infeas)
constraint handler for quadratic constraints
static SCIP_DECL_CONSFREE(consFreeAbspower)
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
SCIP_HEUR * SCIPsolGetHeur(SCIP_SOL *sol)
SCIP_Real SCIPgetSolTransObj(SCIP *scip, SCIP_SOL *sol)
int SCIPgetNNlpis(SCIP *scip)
static SCIP_RETCODE presolveDual(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *ndelconss, int *nfixedvars)
SCIP_RETCODE SCIPsetNLPInitialGuessSol(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
static SCIP_Real getGradientMaxElement(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
static SCIP_RETCODE registerLargeRelaxValueVariableForBranching(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_VAR **brvar)
static SCIP_DECL_EVENTEXEC(processVarEvent)
SCIP_RETCODE SCIPexprgraphCreateNodeLinear(BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node, int ncoefs, SCIP_Real *coefs, SCIP_Real constant)
#define SCIPhashTwo(a, b)
#define SCIP_EVENTTYPE_LBTIGHTENED
SCIP_Real * SCIPvarGetVlbConstants(SCIP_VAR *var)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define CONSHDLR_SEPAPRIORITY
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
void SCIPintervalSet(SCIP_INTERVAL *resultant, SCIP_Real value)
SCIP_Real SCIProwGetRhs(SCIP_ROW *row)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_Real * SCIPvarGetVubCoefs(SCIP_VAR *var)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
static SCIP_DECL_CONSDELETE(consDeleteAbspower)
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
static SCIP_RETCODE generateSecantCutNoCheck(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, SCIP_Real xlb, SCIP_Real xub, SCIP_Real exponent, SCIP_Real xoffset, DECL_MYPOW((*mypow)), SCIP_Real xmult, SCIP_Real zcoef, SCIP_Real rhs, SCIP_VAR *x, SCIP_VAR *z)
#define SCIPdebugGetSolVal(scip, var, val)
SCIP_RETCODE SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible)
SCIP_Real SCIPgetViolationAbspower(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
struct SCIP_ConsData SCIP_CONSDATA
#define CONSHDLR_PROP_TIMING
#define SCIP_EVENTTYPE_BOUNDTIGHTENED
SCIP_Bool SCIPexprgraphHasNodeSibling(SCIP_EXPRGRAPHNODE *node)
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
static SCIP_DECL_CONSGETNVARS(consGetNVarsAbspower)
SCIP_Real SCIPgetRhsQuadratic(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSPRINT(consPrintAbspower)
SCIP_RETCODE SCIPsetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real val)
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
static SCIP_RETCODE presolveFindDuplicatesUpgradeCons(SCIP *scip, SCIP_CONS *cons1, SCIP_CONS *cons2, SCIP_Bool *infeas, int *nupgdconss, int *ndelconss, int *naggrvars)
SCIP_RETCODE SCIPchgRowRhs(SCIP *scip, SCIP_ROW *row, SCIP_Real rhs)
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
SCIP_RETCODE SCIPcreateEmptyRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
SCIP_RETCODE SCIPmultihashInsert(SCIP_MULTIHASH *multihash, void *element)
SCIP_Real SCIPgetLhsNonlinear(SCIP *scip, SCIP_CONS *cons)
int SCIPgetDepth(SCIP *scip)
constraint handler for nonlinear constraints
SCIP_RETCODE SCIPgetNlRowAbspower(SCIP *scip, SCIP_CONS *cons, SCIP_NLROW **nlrow)
static SCIP_DECL_CONSSEPALP(consSepalpAbspower)
int SCIPvarGetNLocksUp(SCIP_VAR *var)
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
static SCIP_RETCODE propagateVarbounds(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_Bool *infeas, int *nbdchgs, int *naddconss)
SCIP_RETCODE SCIPaddPoolCut(SCIP *scip, SCIP_ROW *row)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
static SCIP_DECL_CONSSEPASOL(consSepasolAbspower)
static SCIP_DECL_CONSCHECK(consCheckAbspower)
static SCIP_DECL_EXPRGRAPHNODEREFORM(exprgraphnodeReformAbspower)
SCIP_RETCODE SCIPsetConshdlrDisable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDISABLE((*consdisable)))
SCIP_RETCODE SCIPdropEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_RETCODE SCIPexprCreate(BMS_BLKMEM *blkmem, SCIP_EXPR **expr, SCIP_EXPROP op,...)
SCIP_RETCODE SCIPfreeSol(SCIP *scip, SCIP_SOL **sol)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPexprtreeFree(SCIP_EXPRTREE **tree)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_RETCODE SCIPcreateVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
SCIP_RETCODE SCIPaddExternBranchCand(SCIP *scip, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
static SCIP_RETCODE computeViolation(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Real *viol, SCIP_Bool *solviolbounds)
SCIP_RETCODE SCIPcreateConsAbspower(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *x, SCIP_VAR *z, SCIP_Real exponent, SCIP_Real xoffset, SCIP_Real zcoef, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
static SCIP_DECL_CONSRESPROP(consRespropAbspower)
void * SCIPmultihashRetrieveNext(SCIP_MULTIHASH *multihash, SCIP_MULTIHASHLIST **multihashlist, void *key)
SCIP_Real SCIPintervalGetSup(SCIP_INTERVAL interval)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
static SCIP_RETCODE addVarbound(SCIP *scip, SCIP_CONS *cons, SCIP_Bool addcons, SCIP_VAR *var, SCIP_VAR *vbdvar, SCIP_Real vbdcoef, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool *infeas, int *nbdchgs, int *naddconss)
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
static SCIP_DECL_CONSINIT(consInitAbspower)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
#define SCIP_EVENTTYPE_UBTIGHTENED
Constraint handler for linear constraints in their most general form, .
SCIP_Bool SCIPisCutApplicable(SCIP *scip, SCIP_ROW *cut)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
#define BMSclearMemory(ptr)
SCIP_Real SCIPexprGetMonomialCoef(SCIP_EXPRDATA_MONOMIAL *monomial)
Constraint handler for absolute power constraints .
SCIP_RETCODE SCIPinferVarLbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPsetConshdlrEnable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENABLE((*consenable)))
void * SCIPexprgraphGetNodeVar(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node)
int SCIPgetNBinVars(SCIP *scip)
SCIP_RETCODE SCIPincludeConshdlrAbspower(SCIP *scip)
SCIP_Bool SCIPinProbing(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
#define SCIP_EVENTTYPE_DISABLED
int SCIPexprgraphGetNodeIntPowerExponent(SCIP_EXPRGRAPHNODE *node)
SCIP_Real SCIPnodeGetEstimate(SCIP_NODE *node)
static SCIP_RETCODE propagateCons(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_Bool canaddcons, SCIP_Bool *cutoff, int *nchgbds, int *naddconss)
void SCIPenableNLP(SCIP *scip)
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
static SCIP_RETCODE registerBranchingCandidates(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, int *nnotify)
int SCIPgetNLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateNLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
int SCIPvarGetNLocksDown(SCIP_VAR *var)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real * SCIPexprgraphGetNodeLinearCoefs(SCIP_EXPRGRAPHNODE *node)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPaddCharParam(SCIP *scip, const char *name, const char *desc, char *valueptr, SCIP_Bool isadvanced, char defaultvalue, const char *allowedvalues, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
int SCIPgetNLinearVarsNonlinear(SCIP *scip, SCIP_CONS *cons)
#define CONSHDLR_SEPAFREQ
SCIP_Real SCIPgetRhsAbspower(SCIP *scip, SCIP_CONS *cons)
void SCIPintervalSetEntire(SCIP_Real infinity, SCIP_INTERVAL *resultant)
SCIP_RETCODE SCIPgetVarCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR *sourcevar, SCIP_VAR **targetvar, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *success)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
SCIP_RETCODE SCIPinferVarUbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
int SCIPexprgraphGetNodePosition(SCIP_EXPRGRAPHNODE *node)
static SCIP_DECL_CONSENFORELAX(consEnforelaxAbspower)
SCIP_RETCODE SCIPsetConshdlrExit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit)))
static SCIP_DECL_CONSLOCK(consLockAbspower)
#define SCIP_EVENTTYPE_FORMAT
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
static SCIP_DECL_CONSPRESOL(consPresolAbspower)
#define CONSHDLR_MAXPREROUNDS
static SCIP_DECL_CONSENFOLP(consEnfolpAbspower)
SCIP_Bool SCIPallowDualReds(SCIP *scip)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
NLP local search primal heuristic using sub-SCIPs.
SCIP_Real SCIPgetRowLPFeasibility(SCIP *scip, SCIP_ROW *row)
static SCIP_Real roots[ROOTS_KNOWN+1]
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPcreateConsNonlinear2(SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, SCIP_EXPRGRAPHNODE *exprgraphnode, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPgetNLPFracVars(SCIP *scip, SCIP_VAR ***fracvars, SCIP_Real **fracvarssol, SCIP_Real **fracvarsfrac, int *nfracvars, int *npriofracvars)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_RETCODE SCIPaggregateVars(SCIP *scip, SCIP_VAR *varx, SCIP_VAR *vary, SCIP_Real scalarx, SCIP_Real scalary, SCIP_Real rhs, SCIP_Bool *infeasible, SCIP_Bool *redundant, SCIP_Bool *aggregated)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
static SCIP_RETCODE analyzeConflict(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, PROPRULE proprule, SCIP_BOUNDTYPE boundtype)
SCIP_VAR ** SCIPgetLinearVarsNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_RETCODE SCIPaddRowIndicator(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_ROW *row)
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_EXPRGRAPHNODE ** SCIPexprgraphGetNodeChildren(SCIP_EXPRGRAPHNODE *node)
static SCIP_DECL_CONSCOPY(consCopyAbspower)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
SCIP_Real SCIPgetExponentAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPvarGetVubVars(SCIP_VAR *var)
SCIP_Real * SCIPexprGetMonomialExponents(SCIP_EXPRDATA_MONOMIAL *monomial)
#define CONSHDLR_PROPFREQ
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
SCIP_RETCODE SCIPunlinkSol(SCIP *scip, SCIP_SOL *sol)
#define SCIPdebugAddSolVal(scip, var, val)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPmultihashRemove(SCIP_MULTIHASH *multihash, void *element)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
#define CONSHDLR_PRESOLTIMING
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
int SCIPcalcMultihashSize(int minsize)
SCIP_RETCODE SCIPupdateStartpointHeurSubNlp(SCIP *scip, SCIP_HEUR *heur, SCIP_SOL *solcand, SCIP_Real violation)
SCIP_Bool SCIPconsIsMarkedPropagate(SCIP_CONS *cons)
SCIP_Real SCIPexprgraphGetNodeRealPowerExponent(SCIP_EXPRGRAPHNODE *node)
static SCIP_DECL_CONSEXITSOL(consExitsolAbspower)
SCIP_RETCODE SCIPsetConshdlrActive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSACTIVE((*consactive)))
SCIP_Real SCIPgetLhsAbspower(SCIP *scip, SCIP_CONS *cons)
SCIP_QUADVARTERM * SCIPgetQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateNlRow(SCIP *scip, SCIP_NLROW **nlrow, const char *name, SCIP_Real constant, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadvars, SCIP_VAR **quadvars, int nquadelems, SCIP_QUADELEM *quadelems, SCIP_EXPRTREE *expression, SCIP_Real lhs, SCIP_Real rhs, SCIP_EXPRCURV curvature)
SCIP_EXPRGRAPHNODE * SCIPgetExprgraphNodeNonlinear(SCIP *scip, SCIP_CONS *cons)
#define CONSHDLR_DELAYPROP
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
static SCIP_RETCODE generateLinearizationCut(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, SCIP_Real refpoint, SCIP_Real exponent, SCIP_Real xoffset, SCIP_Real xmult, SCIP_Real zcoef, SCIP_Real rhs, SCIP_VAR *x, SCIP_VAR *z, SCIP_Bool islocal)
SCIP_RETCODE SCIPwriteVarName(SCIP *scip, FILE *file, SCIP_VAR *var, SCIP_Bool type)
SCIP_Real SCIPround(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_SOL * SCIPeventGetSol(SCIP_EVENT *event)
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)
#define SCIPduplicateBlockMemory(scip, ptr, source)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
int SCIPexprgraphGetNodeDepth(SCIP_EXPRGRAPHNODE *node)
SCIP_Bool SCIPallowObjProp(SCIP *scip)
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)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyAbspower)
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
enum SCIP_SideType SCIP_SIDETYPE