27 #define SCIP_PRIVATE_ROWPREP 41 #define CONSHDLR_NAME "abspower" 42 #define CONSHDLR_DESC "constraint handler for absolute power constraints lhs <= sign(x+offset)abs(x+offset)^n + c*z <= rhs" 43 #define CONSHDLR_SEPAPRIORITY 0 44 #define CONSHDLR_ENFOPRIORITY -30 45 #define CONSHDLR_CHECKPRIORITY -3500000 46 #define CONSHDLR_SEPAFREQ 1 47 #define CONSHDLR_PROPFREQ 1 48 #define CONSHDLR_EAGERFREQ 100 50 #define CONSHDLR_MAXPREROUNDS -1 51 #define CONSHDLR_DELAYSEPA FALSE 52 #define CONSHDLR_DELAYPROP FALSE 53 #define CONSHDLR_NEEDSCONS TRUE 55 #define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_FAST | SCIP_PRESOLTIMING_MEDIUM 56 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_ALWAYS 58 #define QUADCONSUPGD_PRIORITY 50000 59 #define NONLINCONSUPGD_PRIORITY 50000 65 #define PROPVARTOL SCIPepsilon(scip) 66 #define PROPSIDETOL SCIPepsilon(scip) 67 #define INITLPMAXVARVAL 1000.0 70 #define DECL_MYPOW(x) SCIP_Real x (SCIP_Real base, SCIP_Real exponent) 76 #define SIGN(x) ((x) >= 0.0 ? 1.0 : -1.0) 83 #define ROOTS_KNOWN 10 92 0.41421356237309504880,
94 0.56042566045031785945,
95 0.60582958618826802099,
96 0.64146546982884663257,
97 0.67033204760309682774,
98 0.69428385661425826738,
99 0.71453772716733489700,
100 0.73192937842370733350
122 unsigned int propvarbounds:1;
128 struct SCIP_ConshdlrData
132 int preferzerobranch;
145 int newsoleventfilterpos;
150 unsigned int nsecantcuts;
185 assert(exponent == 2.0);
195 assert(
scip != NULL);
196 assert(event != NULL);
200 assert(cons != NULL);
221 assert(scip != NULL);
222 assert(cons != NULL);
223 assert(eventhdlr != NULL);
226 assert(consdata != NULL);
246 if( consdata->zcoef > 0.0 )
280 assert(scip != NULL);
281 assert(cons != NULL);
282 assert(eventhdlr != NULL);
285 assert(consdata != NULL);
296 consdata->xeventfilterpos = -1;
302 if( consdata->zcoef > 0.0 )
318 consdata->zeventfilterpos = -1;
321 assert(consdata->xeventfilterpos == -1);
322 assert(consdata->zeventfilterpos == -1);
343 assert(consdata1 != NULL);
344 assert(consdata2 != NULL);
346 if( consdata1->x != consdata2->x )
349 if( consdata1->exponent != consdata2->exponent )
352 if( consdata1->xoffset != consdata2->xoffset && consdata1->z != consdata2->z )
365 assert(consdata != NULL);
380 assert(consdata1 != NULL);
381 assert(consdata2 != NULL);
383 if( consdata1->z != consdata2->z )
386 if( consdata1->exponent != consdata2->exponent )
399 assert(consdata != NULL);
425 assert(scip != NULL);
426 assert(cons1 != NULL);
427 assert(cons2 != NULL);
428 assert(infeas != NULL);
429 assert(nupgdconss != NULL);
430 assert(ndelconss != NULL);
431 assert(naggrvars != NULL);
435 assert(consdata1 != NULL);
436 assert(consdata2 != NULL);
438 assert(
SCIPisEQ(scip, consdata2->lhs, consdata2->rhs));
440 assert(consdata1->x == consdata2->x);
441 assert(consdata1->exponent == consdata2->exponent);
442 assert(consdata1->xoffset == consdata2->xoffset);
444 lhs = consdata1->lhs;
446 lhs -= consdata2->lhs;
447 rhs = consdata1->rhs;
449 rhs -= consdata2->lhs;
451 vars[0] = consdata1->z;
452 vars[1] = consdata2->z;
454 coefs[0] = consdata1->zcoef;
455 coefs[1] = -consdata2->zcoef;
463 SCIP_CALL(
SCIPaggregateVars(scip, consdata1->z, consdata2->z, consdata1->zcoef, -consdata2->zcoef, rhs, infeas, &redundant, &aggregated) );
485 vars[0] = consdata1->z;
486 vars[1] = consdata2->z;
487 coefs[0] = consdata1->zcoef;
488 coefs[1] = -consdata2->zcoef;
538 assert(scip != NULL);
539 assert(infeas != NULL);
540 assert(xval != NULL);
541 assert(zval != NULL);
542 assert(exponent == 2.0);
543 assert(!
SCIPisEQ(scip, xoffset1, xoffset2));
544 assert(
SCIPisEQ(scip, zcoef1 * rhs2, zcoef2 * rhs1));
545 assert(zcoef1 != 0.0);
546 assert(zcoef2 != 0.0);
548 if( xoffset2 < xoffset1 )
550 presolveFindDuplicatesSolveEquations(scip, infeas, xval, zval, exponent, xoffset2, zcoef2, rhs2, xoffset1, zcoef1, rhs1);
554 if(
SCIPisEQ(scip, zcoef1, zcoef2) )
562 if(
SCIPisEQ(scip, zcoef1, -zcoef2) )
564 *xval = - (xoffset1 + xoffset2) / 2.0;
566 else if( zcoef2 * zcoef1 > 0.0 )
568 *xval = (xoffset2 - xoffset1) / (
sqrt(zcoef2 / zcoef1) - 1.0) - xoffset1;
572 assert(zcoef2 * zcoef1 < 0.0);
573 *xval = (xoffset2 - xoffset1) / (-
sqrt(-zcoef2 / zcoef1) - 1.0) - xoffset1;
576 *zval = rhs1 - (*xval + xoffset1) *
REALABS(*xval + xoffset1);
579 assert(
SCIPisFeasEQ(scip, (*xval + xoffset1) *
REALABS(*xval + xoffset1) + zcoef1 * *zval, rhs1));
580 assert(
SCIPisFeasEQ(scip, (*xval + xoffset2) *
REALABS(*xval + xoffset2) + zcoef2 * *zval, rhs2));
604 assert(scip != NULL);
605 assert(conshdlr != NULL);
606 assert(conss != NULL || nconss == 0);
607 assert(nupgdconss != NULL);
608 assert(ndelconss != NULL);
609 assert(naddconss != NULL);
610 assert(nfixedvars != NULL);
611 assert(naggrvars != NULL);
612 assert(success != NULL);
613 assert(infeas != NULL);
622 assert(conshdlrdata != NULL);
627 presolveFindDuplicatesGetKey, presolveFindDuplicatesKeyEQ, presolveFindDuplicatesKeyVal, (
void*)scip) );
629 for( c = 0; c < nconss && !*infeas; ++c )
640 multihashlist = NULL;
656 assert(cons0 != cons1);
660 assert(consdata0 != NULL);
661 assert(consdata1 != NULL);
666 assert(consdata0->x == consdata1->x);
667 assert(consdata0->exponent == consdata1->exponent);
669 if(
SCIPisEQ(scip, consdata0->xoffset, consdata1->xoffset) )
674 if( consdata0->z == consdata1->z &&
SCIPisEQ(scip, consdata0->zcoef, consdata1->zcoef) )
677 if(
SCIPisGT(scip, consdata0->lhs, consdata1->rhs) ||
SCIPisGT(scip, consdata1->lhs, consdata0->rhs) )
692 if( consdata1->zcoef > 0.0 )
697 consdata1->lhs =
MAX(consdata0->lhs, consdata1->lhs);
698 consdata1->rhs = MIN(consdata0->rhs, consdata1->rhs);
702 if( consdata1->zcoef > 0.0 )
709 consdata1->lhs =
MAX(consdata0->lhs, consdata1->lhs);
710 consdata1->rhs = MIN(consdata0->rhs, consdata1->rhs);
721 if(
SCIPisEQ(scip, consdata1->lhs, consdata1->rhs) )
731 if(
SCIPisEQ(scip, consdata0->lhs, consdata0->rhs) )
757 TRUE,
TRUE, NULL, NULL, NULL, NULL, NULL) );
764 SCIP_CALL(
SCIPcreateConsAbspower(scip, &auxcons, name, consdata0->x, auxvar, consdata0->exponent, consdata0->xoffset, -1.0, 0.0, 0.0,
780 #ifdef WITH_DEBUG_SOLUTION 781 if( SCIPdebugIsMainscip(scip) )
792 vars[1] = consdata0->z;
794 coefs[1] = consdata0->zcoef;
805 vars[1] = consdata1->z;
806 coefs[1] = consdata1->zcoef;
826 else if( consdata0->z == consdata1->z &&
827 consdata0->exponent == 2.0 &&
830 SCIPisEQ(scip, consdata0->lhs, consdata0->rhs) &&
831 SCIPisEQ(scip, consdata1->lhs, consdata1->rhs) &&
832 SCIPisEQ(scip, consdata0->lhs * consdata1->zcoef, consdata1->lhs * consdata0->zcoef) )
843 assert(consdata0->x == consdata1->x);
844 assert(consdata0->exponent == consdata1->exponent);
845 assert(!
SCIPisEQ(scip, consdata0->xoffset, consdata1->xoffset));
849 consdata0->xoffset, consdata0->zcoef, consdata0->lhs,
850 consdata1->xoffset, consdata1->zcoef, consdata1->lhs);
854 SCIPdebugMsg(scip,
"infeasibility detected while solving the equations, no solution exists\n");
860 SCIPdebugMsg(scip,
"fixing variables <%s>[%g, %g] to %g and <%s>[%g, %g] to %g due to equations\n",
932 if( multihashlist == NULL )
952 presolveFindDuplicatesGetKey, presolveFindDuplicatesKeyEQ2, presolveFindDuplicatesKeyVal2, (
void*) scip) );
954 for( c = 0; c < nconss && !*infeas; ++c )
971 assert(consdata0 != NULL);
976 if( !
SCIPisEQ(scip, consdata0->lhs, consdata0->rhs) )
979 multihashlist = NULL;
994 assert(cons0 != cons1);
998 assert(consdata1 != NULL);
1003 assert(consdata0->z == consdata1->z);
1004 assert(consdata0->exponent == consdata1->exponent);
1005 assert(
SCIPisEQ(scip, consdata1->lhs, consdata1->rhs));
1008 if(
SCIPisEQ(scip, consdata0->lhs*consdata1->zcoef, consdata1->lhs*consdata0->zcoef) )
1025 if( consdata0->exponent == 2.0 )
1026 coef =
SIGN(consdata0->zcoef / consdata1->zcoef) *
sqrt(
REALABS(consdata0->zcoef / consdata1->zcoef));
1028 coef =
SIGN(consdata0->zcoef / consdata1->zcoef) *
pow(
REALABS(consdata0->zcoef / consdata1->zcoef), 1.0/consdata0->exponent);
1029 rhs = coef * consdata1->xoffset - consdata0->xoffset;
1038 else if( redundant )
1055 vars[0] = consdata0->x;
1056 vars[1] = consdata1->x;
1078 if( multihashlist == NULL )
1113 assert(scip != NULL);
1114 assert(cons != NULL);
1115 assert(cutoff != NULL);
1116 assert(nfixedvars != NULL);
1117 assert(ndelconss != NULL);
1127 assert(consdata != NULL);
1143 assert(consdata->zcoef != 0.0);
1159 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
1193 xfix = 0.5 * (xlb + xub);
1201 else if( consdata->exponent == 2.0 )
1213 if(
SCIPisLT(scip, xlb, -consdata->xoffset) )
1223 c = consdata->xoffset * consdata->xoffset *
SCIPvarGetObj(consdata->z) / consdata->zcoef;
1235 xfixobjval = a * xlb * xlb + b * xlb + c;
1238 cand = MIN(-consdata->xoffset, xub);
1239 if( xfixobjval > a * cand * cand + b * cand + c )
1242 xfixobjval = a * cand * cand + b * cand + c;
1247 if( cand > xlb && cand < -consdata->xoffset && cand < xub && xfixobjval > -b*b/(4.0*a) + c )
1250 xfixobjval = -b*b/(4.0*a) + c;
1255 if(
SCIPisGT(scip, xub, -consdata->xoffset) )
1265 c = -consdata->xoffset * consdata->xoffset *
SCIPvarGetObj(consdata->z) / consdata->zcoef;
1279 xfixobjval = a * xub * xub + b * xub + c;
1285 if( xfixobjval > a * cand * cand + b * cand + c )
1288 xfixobjval = a * cand * cand + b * cand + c;
1293 cand =
MAX(xlb, -consdata->xoffset);
1294 if( xfixobjval > a * cand * cand + b * cand + c )
1297 xfixobjval = a * cand * cand + b * cand + c;
1302 if( cand > xlb && cand > -consdata->xoffset && cand < xub && xfixobjval > -b*b/(4.0*a) + c )
1322 if( consdata->zcoef > 0.0 )
1335 if( consdata->zcoef > 0.0 )
1353 zfix = consdata->rhs -
SIGN(xfix + consdata->xoffset) * consdata->power(ABS(xfix + consdata->xoffset), consdata->exponent);
1354 zfix /= consdata->zcoef;
1359 zfix =
MAX(zlb, MIN(zub, zfix));
1363 SCIPdebugMsg(scip,
"dual presolve fixes x=<%s>[%g,%g] to %g and z=<%s>[%g,%g] to %g in cons <%s>\n",
1409 assert(scip != NULL);
1410 assert(var != NULL);
1411 assert(cons != NULL);
1412 assert(result != NULL);
1413 assert(nchgbds != NULL);
1414 assert(nfixedvars != NULL);
1439 if( bounds.
inf != bounds.
sup )
1440 fixval = (bounds.
inf + bounds.
sup) / 2.0;
1442 fixval = bounds.
inf;
1463 SCIPdebugMsg(scip,
"found <%s> infeasible due to fixing fixed variable <%s>[%.20g,%.20g] to [%.20g,%.20g]\n",
1518 assert(naddconss != NULL);
1559 assert(scip != NULL);
1560 assert(cons != NULL);
1561 assert(zbnds != NULL);
1565 assert(consdata != NULL);
1575 if( consdata->zcoef > 0.0 )
1576 zbnds->
sup = bnd / consdata->zcoef;
1578 zbnds->
inf = bnd / consdata->zcoef;
1587 if( consdata->zcoef > 0.0 )
1588 zbnds->
inf = bnd / consdata->zcoef;
1590 zbnds->
sup = bnd / consdata->zcoef;
1593 SCIPdebugMsg(scip,
"given x = [%.20g, %.20g], computed z = [%.20g, %.20g] via", xbnds.
inf, xbnds.
sup, zbnds->
inf, zbnds->
sup);
1612 assert(scip != NULL);
1613 assert(cons != NULL);
1614 assert(xbnds != NULL);
1618 assert(consdata != NULL);
1623 z = (consdata->zcoef > 0.0 ? zbnds.
inf : zbnds.
sup);
1627 if( consdata->exponent == 2.0 )
1631 xbnds->
sup = bnd - consdata->xoffset;
1635 z = (consdata->zcoef > 0.0 ? zbnds.
sup : zbnds.
inf);
1639 if( consdata->exponent == 2.0 )
1643 xbnds->
inf = bnd - consdata->xoffset;
1646 SCIPdebugMsg(scip,
"given z = [%.20g, %.20g], computed x = [%.20g, %.20g] via", zbnds.
inf, zbnds.
sup, xbnds->
inf, xbnds->
sup);
1672 assert(scip != NULL);
1673 assert(cons != NULL);
1674 assert(ndelconss != NULL);
1675 assert(nupgdconss != NULL);
1676 assert(nchgbds != NULL);
1677 assert(nfixedvars != NULL);
1680 assert(conshdlrdata != NULL);
1683 assert(consdata != NULL);
1715 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
1729 zfix = consdata->rhs -
SIGN(constant + consdata->xoffset) * consdata->power(
REALABS(constant + consdata->xoffset), consdata->exponent);
1730 zfix /= consdata->zcoef;
1763 else if( scalar > 0.0 )
1764 factor = consdata->power( scalar, consdata->exponent);
1766 factor = -consdata->power(-scalar, consdata->exponent);
1782 consdata->xoffset += constant;
1785 if( scalar == 1.0 ) ;
1786 else if( scalar > 0.0 )
1789 consdata->lhs /= factor;
1791 consdata->rhs /= factor;
1792 consdata->zcoef /= factor;
1793 consdata->xoffset /= scalar;
1799 assert(scalar < 0.0);
1800 assert(factor < 0.0);
1802 oldlhs = consdata->lhs;
1805 consdata->lhs = consdata->rhs / factor;
1809 consdata->rhs = oldlhs / factor;
1812 consdata->zcoef /= factor;
1813 consdata->xoffset /= scalar;
1823 conshdlrdata->comparedpairwise =
FALSE;
1827 SCIPwarningMessage(scip,
"Skip resolving aggregation of variable <%s> in abspower constraint <%s> to avoid zcoef = %g\n",
1860 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
1874 xfix = consdata->rhs - consdata->zcoef * constant;
1875 if( consdata->exponent == 2.0 )
1878 xfix =
SIGN(xfix) *
pow(
REALABS(xfix), 1.0/consdata->exponent) - consdata->xoffset;
1910 if( consdata->zcoef > 0.0 )
1923 consdata->lhs -= consdata->zcoef * constant;
1925 consdata->rhs -= consdata->zcoef * constant;
1928 consdata->zcoef *= scalar;
1930 if( consdata->zcoef > 0.0 )
1937 conshdlrdata->comparedpairwise =
FALSE;
1962 assert(scip != NULL);
1963 assert(conshdlr != NULL);
1964 assert(cons != NULL);
1965 assert(viol != NULL);
1966 assert(solviolbounds != NULL);
1969 assert(consdata != NULL);
1971 *solviolbounds =
FALSE;
1993 *solviolbounds =
TRUE;
1995 xval =
MAX(lb, MIN(ub, xval));
1998 xval += consdata->xoffset;
2000 val =
SIGN(xval) * consdata->power(
REALABS(xval), consdata->exponent);
2001 val += consdata->zcoef * zval;
2005 if( val < consdata->lhs && !
SCIPisInfinity(scip, -consdata->lhs) )
2007 consdata->lhsviol = *viol = consdata->lhs - val;
2011 consdata->lhsviol = 0.0;
2013 if( val > consdata->rhs && !
SCIPisInfinity(scip, consdata->rhs) )
2015 consdata->rhsviol = *viol = val - consdata->rhs;
2019 consdata->rhsviol = 0.0;
2045 assert(scip != NULL);
2046 assert(conss != NULL || nconss == 0);
2047 assert(solviolbounds != NULL);
2048 assert(maxviolcon != NULL);
2050 *solviolbounds =
FALSE;
2055 for( c = 0; c < nconss; ++c )
2057 assert(conss != NULL);
2058 assert(conss[c] != NULL);
2061 *solviolbounds |= solviolbounds1;
2064 assert(consdata != NULL);
2066 viol =
MAX(consdata->lhsviol, consdata->rhsviol);
2070 *maxviolcon = conss[c];
2094 assert(scip != NULL);
2095 assert(cons != NULL);
2098 assert(consdata != NULL);
2105 if(
SCIPisLT(scip, xlb, -consdata->xoffset) &&
SCIPisGT(scip, xub, -consdata->xoffset) )
2111 assert(preferzero >= 0);
2113 if( preferzero == 0 )
2117 return -consdata->xoffset;
2119 xlb += consdata->xoffset;
2120 xub += consdata->xoffset;
2131 return -consdata->xoffset;
2141 return -consdata->xoffset;
2145 if( branchminconverror )
2150 if(
SCIPisGE(scip, xlb, -consdata->xoffset) )
2153 xlb =
MAX(0.0, xlb + consdata->xoffset);
2154 xub =
MAX(0.0, xub + consdata->xoffset);
2156 ref = (consdata->power(xub, consdata->exponent) - consdata->power(xlb, consdata->exponent)) / (consdata->exponent * (xub - xlb));
2157 ref =
pow(ref, 1.0/(consdata->exponent-1.0));
2158 ref -= consdata->xoffset;
2168 assert(
SCIPisLE(scip, xub, -consdata->xoffset));
2170 xlb = MIN(0.0, xlb + consdata->xoffset);
2171 xub = MIN(0.0, xub + consdata->xoffset);
2173 ref = (consdata->power(-xlb, consdata->exponent) - consdata->power(-xub, consdata->exponent)) / (consdata->exponent * (-xlb + xub));
2174 ref = -
pow(ref, 1.0/(consdata->exponent-1.0));
2175 ref -= consdata->xoffset;
2204 assert(scip != NULL);
2205 assert(conshdlr != NULL);
2206 assert(conss != NULL || nconss == 0);
2209 assert(conshdlrdata != NULL);
2213 onlynonfixedsign = conshdlrdata->preferzerobranch == 3;
2217 for( c = 0; c < nconss; ++c )
2219 assert(conss[c] != NULL);
2226 assert(consdata != NULL);
2231 if( onlynonfixedsign &&
2249 if( onlynonfixedsign && *nnotify == 0 )
2252 onlynonfixedsign =
FALSE;
2277 assert(scip != NULL);
2278 assert(conss != NULL || nconss == 0);
2283 for( c = 0; c < nconss; ++c )
2285 assert(conss != NULL);
2287 assert(consdata != NULL);
2296 val =
SCIPgetSolVal(scip, sol, consdata->x) + consdata->xoffset;
2299 brvarval = ABS(val);
2300 *brvar = consdata->x;
2304 if( *brvar != NULL )
2328 assert(scip != NULL);
2329 assert(conss != NULL);
2330 assert(infeasible != NULL);
2331 assert(reduceddom != NULL);
2333 *infeasible =
FALSE;
2334 *reduceddom =
FALSE;
2336 for( c = 0; c < nconss; ++c )
2339 assert(consdata != NULL);
2408 assert(scip != NULL);
2409 assert(cons != NULL);
2410 assert(infervar != NULL);
2413 assert(consdata != NULL);
2414 assert(consdata->zcoef != 0.0);
2420 assert(infervar == consdata->x);
2423 if( consdata->zcoef > 0.0 )
2435 assert(infervar == consdata->z);
2442 assert(infervar == consdata->x);
2445 if( consdata->zcoef > 0.0 )
2457 assert(infervar == consdata->z);
2534 assert(conshdlr != NULL);
2535 assert(cutoff != NULL);
2536 assert(nchgbds != NULL);
2537 assert(naddconss != NULL);
2540 assert(consdata != NULL);
2554 while( tightenedround )
2556 tightenedround =
FALSE;
2577 newlb = consdata->lhs - consdata->zcoef * (consdata->zcoef > 0.0 ? zub : zlb);
2580 if( consdata->exponent == 2.0 )
2581 newlb =
SIGN(newlb) *
sqrt(ABS(newlb));
2583 newlb =
SIGN(newlb) *
pow(ABS(newlb), 1.0/consdata->exponent);
2584 newlb -= consdata->xoffset;
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;
2601 newlb = MIN(newlb, xub);
2606 if( consdata->zcoef > 0.0 )
2624 if( consdata->exponent == 2.0 )
2625 newlb =
SIGN(newlb) *
sqrt(ABS(newlb));
2627 newlb =
SIGN(newlb) *
pow(ABS(newlb), 1.0/consdata->exponent);
2628 newlb -= consdata->xoffset;
2635 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g] -> cutoff\n",
SCIPvarGetName(consdata->x), xlb, xub, newlb, xub);
2648 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n",
2663 tightenedround =
TRUE;
2686 newbd = xub + consdata->xoffset;
2687 newbd = consdata->lhs -
SIGN(newbd) * consdata->power(
REALABS(newbd), consdata->exponent);
2688 newbd /= consdata->zcoef;
2695 if( (consdata->zcoef > 0.0 &&
SCIPisFeasGT(scip, newbd, zub)) || (consdata->zcoef < 0.0 &&
SCIPisFeasLT(scip, newbd, zlb)) )
2698 newbd = xub +
PROPVARTOL + consdata->xoffset;
2700 newbd /= consdata->zcoef;
2705 newbd = MIN(zub,
MAX(zlb, newbd) );
2710 newbd = xub +
PROPVARTOL + consdata->xoffset;
2712 newbd /= consdata->zcoef;
2715 if( consdata->zcoef > 0.0 )
2722 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g] -> cutoff\n",
SCIPvarGetName(consdata->z), zlb, zub, newlb, zub);
2733 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n",
2748 tightenedround =
TRUE;
2761 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g] -> cutoff\n",
SCIPvarGetName(consdata->z), zlb, zub, zlb, newub);
2772 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n",
2787 tightenedround =
TRUE;
2815 newub = consdata->rhs - consdata->zcoef * (consdata->zcoef > 0.0 ? zlb : zub);
2818 if( consdata->exponent == 2.0 )
2819 newub =
SIGN(newub) *
sqrt(ABS(newub));
2821 newub =
SIGN(newub) *
pow(ABS(newub), 1.0/consdata->exponent);
2822 newub -= consdata->xoffset;
2830 if( consdata->exponent == 2.0 )
2831 newub =
SIGN(newub) *
sqrt(ABS(newub));
2833 newub =
SIGN(newub) *
pow(ABS(newub), 1.0/consdata->exponent);
2834 newub -= consdata->xoffset;
2839 newub =
MAX(newub, xlb);
2844 if( consdata->zcoef > 0.0 )
2861 if( consdata->exponent == 2.0 )
2862 newub =
SIGN(newub) *
sqrt(ABS(newub));
2864 newub =
SIGN(newub) *
pow(ABS(newub), 1.0/consdata->exponent);
2865 newub -= consdata->xoffset;
2872 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g] -> cutoff\n",
SCIPvarGetName(consdata->x), xlb, xub, xlb, newub);
2885 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n",
2900 tightenedround =
TRUE;
2923 newbd = xlb + consdata->xoffset;
2924 newbd = consdata->rhs -
SIGN(newbd) * consdata->power(
REALABS(newbd), consdata->exponent);
2925 newbd /= consdata->zcoef;
2932 if( (consdata->zcoef > 0.0 &&
SCIPisFeasLT(scip, newbd, zlb)) || (consdata->zcoef < 0.0 &&
SCIPisFeasGT(scip, newbd, zub)) )
2935 newbd = xlb -
PROPVARTOL + consdata->xoffset;
2937 newbd /= consdata->zcoef;
2942 newbd = MIN(zub,
MAX(zlb, newbd) );
2947 newbd = xlb -
PROPVARTOL + consdata->xoffset;
2949 newbd /= consdata->zcoef;
2952 if( consdata->zcoef > 0.0 )
2959 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g] -> cutoff\n",
SCIPvarGetName(consdata->z), zlb, zub, zlb, newub);
2970 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n",
2985 tightenedround =
TRUE;
2998 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g] -> cutoff\n",
SCIPvarGetName(consdata->z), zlb, zub, newlb, zub);
3009 SCIPdebugMsg(scip,
" -> tighten <%s>[%.15g,%.15g] -> [%.15g,%.15g]\n",
3024 tightenedround =
TRUE;
3044 minact =
SIGN(xlb + consdata->xoffset) * consdata->power(
REALABS(xlb + consdata->xoffset), consdata->exponent) + consdata->zcoef * (consdata->zcoef > 0.0 ? zlb : zub);
3049 maxact =
SIGN(xub + consdata->xoffset) * consdata->power(
REALABS(xub + consdata->xoffset), consdata->exponent) + consdata->zcoef * (consdata->zcoef > 0.0 ? zub : zlb);
3056 SCIPdebugMsg(scip,
"absolute power constraint <%s> is redundant: <%s>[%.15g,%.15g], <%s>[%.15g,%.15g]\n",
3073 SCIPdebugMsg(scip,
"x-variable in constraint <%s> is fixed: x = <%s>[%.15g,%.15g], z = <%s>[%.15g,%.15g]\n",
3096 SCIPdebugMsg(scip,
"z-variable in constraint <%s> is fixed: x = <%s>[%.15g,%.15g], z = <%s>[%.15g,%.15g]\n",
3133 assert(scip != NULL);
3134 assert(cons != NULL);
3135 assert(var != NULL);
3136 assert(vbdvar != NULL);
3139 assert(infeas != NULL);
3189 *nbdchgs += nbdchgs_local;
3197 *nbdchgs += nbdchgs_local;
3244 assert(scip != NULL);
3245 assert(conshdlr != NULL);
3246 assert(cons != NULL);
3247 assert(infeas != NULL);
3248 assert(nbdchgs != NULL);
3249 assert(naddconss != NULL);
3254 assert(conshdlrdata != NULL);
3257 assert(consdata != NULL);
3258 assert(consdata->z != NULL);
3283 if(
SCIPisFeasZero(scip, consdata->power(a, consdata->exponent)) )
3288 fb =
SIGN( b + consdata->xoffset) * consdata->power( b + consdata->xoffset, consdata->exponent);
3289 fab =
SIGN(a+b + consdata->xoffset) * consdata->power(a+b + consdata->xoffset, consdata->exponent);
3291 vbcoef = (fb - fab) / consdata->zcoef;
3292 vbconst = (consdata->lhs - fb) / consdata->zcoef;
3294 if( consdata->zcoef > 0.0 )
3297 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->z, y, -vbcoef, vbconst,
SCIPinfinity(scip), infeas, nbdchgs, naddconss) );
3302 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->z, y, -vbcoef, -
SCIPinfinity(scip), vbconst, infeas, nbdchgs, naddconss) );
3328 if(
SCIPisFeasZero(scip, consdata->power(a, consdata->exponent)) )
3333 fb =
SIGN( b + consdata->xoffset) * consdata->power( b + consdata->xoffset, consdata->exponent);
3334 fab =
SIGN(a+b + consdata->xoffset) * consdata->power(a+b + consdata->xoffset, consdata->exponent);
3336 vbcoef = (fb - fab) / consdata->zcoef;
3337 vbconst = (consdata->rhs - fb) / consdata->zcoef;
3339 if( consdata->zcoef > 0.0 )
3342 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->z, y, -vbcoef, -
SCIPinfinity(scip), vbconst, infeas, nbdchgs, naddconss) );
3347 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->z, y, -vbcoef, vbconst,
SCIPinfinity(scip), infeas, nbdchgs, naddconss) );
3358 if( (consdata->zcoef > 0.0 && !
SCIPisInfinity(scip, -consdata->lhs)) ||
3359 ( consdata->zcoef < 0.0 && !
SCIPisInfinity(scip, consdata->rhs)) )
3374 if( consdata->zcoef > 0.0 )
3376 fb = consdata->lhs - b;
3377 fb =
SIGN(fb) *
pow(ABS(fb), 1.0/consdata->exponent);
3378 fab = consdata->lhs - (a+b);
3379 fab =
SIGN(fab) *
pow(ABS(fab), 1.0/consdata->exponent);
3380 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->x, y, fb - fab, fb - consdata->xoffset,
SCIPinfinity(scip), infeas, nbdchgs, naddconss) );
3384 fb = consdata->rhs - b;
3385 fb =
SIGN(fb) *
pow(ABS(fb), 1.0/consdata->exponent);
3386 fab = consdata->rhs - (a+b);
3387 fab =
SIGN(fab) *
pow(ABS(fab), 1.0/consdata->exponent);
3388 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->x, y, fb - fab, -
SCIPinfinity(scip), fb - consdata->xoffset, infeas, nbdchgs, naddconss) );
3398 if( (consdata->zcoef < 0.0 && !
SCIPisInfinity(scip, -consdata->lhs)) ||
3399 ( consdata->zcoef > 0.0 && !
SCIPisInfinity(scip, consdata->rhs)) )
3414 if( consdata->zcoef > 0.0 )
3416 fb = consdata->rhs - b;
3417 fb =
SIGN(fb) *
pow(ABS(fb), 1.0/consdata->exponent);
3418 fab = consdata->rhs - (a+b);
3419 fab =
SIGN(fab) *
pow(ABS(fab), 1.0/consdata->exponent);
3420 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->x, y, fb - fab, -
SCIPinfinity(scip), fb - consdata->xoffset, infeas, nbdchgs, naddconss) );
3424 fb = consdata->lhs - b;
3425 fb =
SIGN(fb) *
pow(ABS(fb), 1.0/consdata->exponent);
3426 fab = consdata->lhs - (a+b);
3427 fab =
SIGN(fab) *
pow(ABS(fab), 1.0/consdata->exponent);
3428 SCIP_CALL(
addVarbound(scip, cons, conshdlrdata->addvarboundcons, consdata->x, y, fb - fab, fb - consdata->xoffset,
SCIPinfinity(scip), infeas, nbdchgs, naddconss) );
3460 assert(scip != NULL);
3461 assert(rowprep != NULL);
3466 assert(conshdlrdata != NULL);
3468 if( refpoint < -xoffset )
3469 refpoint = -xoffset;
3471 tmp = exponent == 2.0 ? refpoint+xoffset :
pow(refpoint+xoffset, exponent-1);
3474 SCIPdebugMsg(scip,
"skip linearization cut because (refpoint+offset)^(exponent-1) > infinity\n");
3479 rhs += ((exponent-1)*refpoint-xoffset)*tmp;
3483 SCIPdebugMsg(scip,
"skip linearization cut because its rhs would be > infinity\n");
3489 (void)
SCIPsnprintf((*rowprep)->name, (
int)
sizeof((*rowprep)->name),
"signpowlinearizecut_%u", ++(conshdlrdata->ncuts));
3532 assert(scip != NULL);
3541 if( exponent == 2.0 )
3544 tmp = (xproj+xoffset) * (xproj+xoffset);
3545 gval = xproj - xref + 2*(xproj+xoffset) / zcoef * ((tmp-rhs)/zcoef + zref);
3549 gderiv = 1 + 6 * tmp / (zcoef*zcoef) + 2 / zcoef * (zref - rhs/zcoef);
3550 xproj -= gval / gderiv;
3553 while( ++iter <= 5 );
3557 tmp =
pow(xproj + xoffset, exponent-1);
3558 gval = xproj - xref + exponent / zcoef * (
pow(xproj+xoffset, 2*exponent-1)/zcoef + tmp * (zref-rhs/zcoef));
3562 gderiv = 1 + exponent / zcoef * ( (2*exponent-1)*tmp*tmp/zcoef + (exponent-1)*
pow(xproj+xoffset, exponent-2) * (zref-rhs/zcoef) );
3563 xproj -= gval / gderiv;
3566 while( ++iter <= 5 );
3571 SCIP_CALL(
generateLinearizationCut(scip, rowprep, conshdlr, xproj, exponent, xoffset, xmult, zcoef, rhs, x, z, islocal) );
3604 assert(scip != NULL);
3609 assert(conshdlrdata != NULL);
3618 if( xlb > -xoffset )
3621 tmp = mypow(-xlb-xoffset, exponent);
3622 slope =
SIGN(xub+xoffset) * mypow(ABS(xub+xoffset), exponent) + tmp;
3666 assert(scip != NULL);
3667 assert(rowprep != NULL);
3675 if( xlb > -xoffset )
3678 tmp = mypow(-xlb-xoffset, exponent);
3679 slope =
SIGN(xub+xoffset) * mypow(ABS(xub+xoffset), exponent) + tmp;
3686 (void)
SCIPmemccpy((*rowprep)->name,
"signpowcut",
'\0', 11);
3721 assert(scip != NULL);
3722 assert(cons != NULL);
3723 assert(row != NULL);
3726 assert(conshdlrdata != NULL);
3729 assert(consdata != NULL);
3745 xoffset = consdata->xoffset;
3747 zcoef = consdata->zcoef;
3748 rhs = consdata->rhs;
3756 xoffset = -consdata->xoffset;
3758 zcoef = -consdata->zcoef;
3759 rhs = -consdata->lhs;
3764 else if(
SCIPisGT(scip, xval, xub) )
3769 SCIPdebugMsg(scip,
"skip separation since x is at infinity\n");
3779 if( conshdlrdata->projectrefpoint && !onlyinbounds )
3782 xoffset, xmult, zcoef, rhs, consdata->x, consdata->z, islocal) );
3784 else if( !onlyinbounds )
3787 consdata->x, consdata->z, islocal) );
3792 consdata->x, consdata->z, islocal) );
3800 SCIP_CALL(
generateSecantCut(scip, &rowprep,
SCIPconsGetHdlr(cons), sol, xlb, xub, consdata->exponent, xoffset, consdata->power, xmult, zcoef, rhs, consdata->x, consdata->z) );
3802 else if( (c = - consdata->root * (xlb+xoffset) - xoffset) > xub )
3807 SCIP_CALL(
generateSecantCut(scip, &rowprep,
SCIPconsGetHdlr(cons), sol, xlb, xub, consdata->exponent, xoffset, consdata->power, xmult, zcoef, rhs, consdata->x, consdata->z) );
3809 else if( xval >= c )
3812 if( conshdlrdata->projectrefpoint && !onlyinbounds )
3815 else if( !onlyinbounds )
3827 SCIP_CALL(
generateSecantCut(scip, &rowprep,
SCIPconsGetHdlr(cons), sol, xlb, c, consdata->exponent, xoffset, consdata->power, xmult, zcoef, rhs, consdata->x, consdata->z) );
3831 if( rowprep != NULL )
3838 assert(rowprep->
nvars <= 2);
3842 if( coefrange >= conshdlrdata->cutmaxrange )
3891 assert(scip != NULL);
3892 assert(conshdlr != NULL);
3893 assert(conss != NULL || nconss == 0);
3894 assert(success != NULL);
3895 assert(cutoff != NULL);
3901 assert(conshdlrdata != NULL);
3903 if( bestefficacy != NULL )
3904 *bestefficacy = 0.0;
3908 assert(conss[c] != NULL);
3915 assert(consdata != NULL);
3917 if(
SCIPisGT(scip, side == SCIP_SIDETYPE_LEFT ? consdata->lhsviol : consdata->rhsviol,
SCIPfeastol(scip)) )
3937 if( bestefficacy != NULL && efficacy > *bestefficacy )
3938 *bestefficacy = efficacy;
3941 if( conshdlrdata->conshdlrindicator != NULL && !
SCIProwIsLocal(row) )
3947 if( inenforcement && !conshdlrdata->enfocutsremovable )
3957 if( c >= nusefulconss && *success )
3985 assert(scip != NULL);
3986 assert(conshdlr != NULL);
3987 assert(conss != NULL || nconss == 0);
3989 if( separatedlpsol != NULL )
3990 *separatedlpsol =
FALSE;
3992 for( c = 0; c < nconss; ++c )
3994 assert(conss[c] != NULL);
4000 assert(consdata != NULL);
4005 consdata->lhsviol = 1.0;
4006 consdata->rhsviol = 0.0;
4012 consdata->lhsviol = 0.0;
4013 consdata->rhsviol = 1.0;
4028 if( separatedlpsol != NULL )
4034 *separatedlpsol =
TRUE;
4037 assert( ! infeasible );
4062 assert(scip != NULL);
4063 assert(event != NULL);
4064 assert(eventdata != NULL);
4065 assert(eventhdlr != NULL);
4077 assert(sol != NULL);
4080 assert(conshdlrdata != NULL);
4090 assert(conss != NULL);
4117 assert(scip != NULL);
4118 assert(conshdlr != NULL);
4119 assert(conss != NULL || nconss == 0);
4135 for( c = 0; c < nconss; ++c )
4138 assert(consdata != NULL);
4139 assert(consdata->z != NULL);
4140 assert(consdata->zcoef != 0.0);
4144 assert(!solviolbounds);
4162 xtermval += consdata->xoffset;
4163 xtermval =
SIGN(xtermval) * consdata->power(ABS(xtermval), consdata->exponent);
4170 zval = (consdata->lhs - xtermval)/consdata->zcoef;
4180 zval = (consdata->rhs - xtermval)/consdata->zcoef;
4196 assert(conshdlrdata != NULL);
4197 assert(conshdlrdata->trysolheur != NULL);
4228 assert(scip != NULL);
4229 assert(cons != NULL);
4232 assert(consdata != NULL);
4234 if( consdata->nlrow != NULL )
4255 n = (int)
SCIPround(scip, consdata->exponent);
4258 if(
sign != 0 || (expisint && (n % 2 == 1)) )
4261 if( expisint && n == 2 )
4270 quadvar = consdata->x;
4272 if( consdata->xoffset != 0.0 )
4274 linvars[0] = consdata->x;
4275 lincoefs[0] =
sign * 2.0 * consdata->xoffset;
4277 constant =
sign * consdata->xoffset * consdata->xoffset;
4287 if( consdata->xoffset != 0.0 )
4292 if(
sign == -1 && !expisint )
4309 if(
sign == -1 && !(expisint && n % 2 == 1) )
4324 if( consdata->xoffset != 0.0 )
4333 assert(exprtree != NULL || nquadelems > 0);
4336 if( exprtree != NULL )
4341 assert(nlinvars < 2);
4342 linvars[nlinvars] = consdata->z;
4343 lincoefs[nlinvars] = consdata->zcoef;
4348 nlinvars, linvars, lincoefs,
4349 nquadvars, &quadvar, nquadelems, &quadelem,
4350 exprtree, consdata->lhs, consdata->rhs,
4354 if( exprtree != NULL )
4396 x = quadvarterm.
var;
4408 if( -*nupgdconss > upgdconsssize )
4447 #ifdef WITH_DEBUG_SOLUTION 4448 if( SCIPdebugIsMainscip(scip) )
4478 lhs += quadvarterm.
sqrcoef * xoffset * xoffset;
4480 rhs += quadvarterm.
sqrcoef * xoffset * xoffset;
4483 signpowcoef = quadvarterm.
sqrcoef;
4485 signpowcoef = -signpowcoef;
4486 if( signpowcoef > 0.0 )
4498 newrhs = lhs / signpowcoef;
4502 lhs = rhs / signpowcoef;
4507 zcoef /= signpowcoef;
4511 xoffset, zcoef, lhs, rhs,
4539 assert(nupgdconss != NULL);
4540 assert(upgdconss != NULL);
4569 if( exponent <= 1.0 )
4581 if( exponent <= 1.0 )
4585 if( (
int)exponent % 2 == 0 && childbounds.
inf < 0.0 && childbounds.
sup > 0.0 )
4589 if( (
int)exponent % 2 == 0 && childbounds.
inf < 0.0 )
4601 if( childbounds.
inf < 0.0 && childbounds.
sup > 0.0 )
4605 if( childbounds.
inf < 0.0 )
4615 if( exponent <= 1.0 )
4635 if( exponent <= 1.0 )
4643 if( childbounds.
sup > 0.0 )
4663 zcoef /= signpowcoef;
4670 SCIPdebugMsg(scip,
"skip upgrade to signpower since |zcoef| = %g would be zero\n", zcoef);
4700 if( upgdconsssize < -*nupgdconss )
4727 signpowcoef *= (xcoef < 0.0 ? -1.0 : 1.0) *
pow(
REALABS(xcoef), exponent);
4753 assert(upgdconsssize > *nupgdconss);
4782 assert(upgdconsssize > *nupgdconss);
4799 #ifdef WITH_DEBUG_SOLUTION 4800 if( SCIPdebugIsMainscip(scip) )
4826 if( constant != 0.0 )
4835 if( signpowcoef != 1.0 )
4837 zcoef /= signpowcoef;
4838 if( signpowcoef < 0.0 )
4857 assert(*nupgdconss < upgdconsssize);
4859 x, z, exponent, xoffset, zcoef, lhs, rhs,
4889 assert(scip != NULL);
4890 assert(exprgraph != NULL);
4891 assert(node != NULL);
4892 assert(naddcons != NULL);
4893 assert(reformnode != NULL);
4911 if( exponent <= 1.0 )
4923 if( exponent <= 1.0 )
4927 if( (
int)exponent % 2 == 0 && childbounds.
inf < 0.0 && childbounds.
sup > 0.0 )
4931 if( (
int)exponent % 2 == 0 && childbounds.
inf < 0.0 )
4943 if( childbounds.
inf < 0.0 && childbounds.
sup > 0.0 )
4947 if( childbounds.
inf < 0.0 )
4957 if( exponent <= 1.0 )
4979 if( exponent <= 1.0 )
4987 if( childbounds.
sup > 0.0 )
5008 SCIPdebugMsg(scip,
"reformulate node %p via signpower\n", (
void*)node);
5025 signpowcoef *= (xcoef < 0.0 ? -1.0 : 1.0) *
pow(
REALABS(xcoef), exponent);
5041 TRUE,
TRUE, NULL, NULL, NULL, NULL, NULL) );
5064 TRUE,
TRUE, NULL, NULL, NULL, NULL, NULL) );
5073 x, z, exponent, xoffset, -1.0/signpowcoef, -constant/signpowcoef, -constant/signpowcoef,
5080 #ifdef WITH_DEBUG_SOLUTION 5081 if( SCIPdebugIsMainscip(scip) )
5087 zval = signpowcoef *
SIGN(xval + xoffset) *
pow(
REALABS(xval + xoffset), exponent) + constant;
5101 x, z, exponent, xoffset, -1.0, 0.0, 0.0,
5108 #ifdef WITH_DEBUG_SOLUTION 5109 if( SCIPdebugIsMainscip(scip) )
5115 zval =
SIGN(xval + xoffset) *
pow(
REALABS(xval + xoffset), exponent);
5125 *reformnode = linnode;
5158 assert(scip != NULL);
5159 assert(conshdlr != NULL);
5160 assert(conss != NULL || nconss == 0);
5161 assert(result != NULL);
5164 assert(conshdlrdata != NULL);
5168 if( maxviolcons == NULL )
5183 assert(solinfeasible);
5187 if( !solinfeasible )
5201 if( conshdlrdata->nenforounds > 100 )
5214 ++conshdlrdata->nenforounds;
5219 conshdlrdata->nenforounds = 0;
5223 for( c = 0; c < nconss; ++c )
5228 assert(conss[c] != NULL);
5231 assert(consdata != NULL);
5253 assert(consdata != NULL);
5254 maxviol = consdata->lhsviol + consdata->rhsviol;
5260 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, sol,
SCIPfeastol(scip),
TRUE,
FALSE, &success,
5261 &cutoff, &sepaefficacy) );
5270 SCIPdebugMsg(scip,
"separation succeeded (bestefficacy = %g, minefficacy = %g)\n", sepaefficacy,
SCIPfeastol(scip));
5274 SCIPdebugMsg(scip,
"separation failed (bestefficacy = %g < %g = minefficacy ); max viol: %g\n", sepaefficacy,
SCIPfeastol(scip),
5286 &success, &cutoff, &sepaefficacy) );
5300 if( nnotify == 0 && !solinfeasible )
5309 SCIPdebugMsg(scip,
"fixing almost fixed var lead to infeasibility.\n");
5324 SCIPwarningMessage(scip,
"Could not find any branching variable candidate. Cutting off node. Max viol = %g.\n",
5331 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",
5350 assert(scip != NULL);
5351 assert(conshdlr != NULL);
5368 assert(scip != NULL);
5369 assert(conshdlr != NULL);
5372 assert(conshdlrdata != NULL);
5385 assert(scip != NULL);
5386 assert(conshdlr != NULL);
5389 assert(conshdlrdata != NULL);
5391 conshdlrdata->subnlpheur =
SCIPfindHeur(scip,
"subnlp");
5392 conshdlrdata->trysolheur =
SCIPfindHeur(scip,
"trysol");
5394 conshdlrdata->nsecantcuts = 0;
5395 conshdlrdata->ncuts = 0;
5406 assert(scip != NULL);
5407 assert(conshdlr != NULL);
5410 assert(conshdlrdata != NULL);
5412 conshdlrdata->subnlpheur = NULL;
5413 conshdlrdata->trysolheur = NULL;
5414 conshdlrdata->conshdlrindicator = NULL;
5425 assert(conshdlr != NULL);
5428 assert(conshdlrdata != NULL);
5431 conshdlrdata->comparedpairwise = (nconss <= 1);
5442 assert(scip != NULL);
5443 assert(conss != NULL || nconss == 0);
5446 for( c = 0; c < nconss; ++c )
5448 assert(conss[c] != NULL);
5469 assert(conshdlrdata != NULL);
5471 assert(scip != NULL);
5472 assert(conss != NULL || nconss == 0);
5474 for( c = 0; c < nconss; ++c )
5476 assert(conss[c] != NULL);
5479 assert(consdata != NULL);
5481 assert(consdata->exponent > 1.0);
5486 consdata->root =
roots[(int)
SCIPfloor(scip, consdata->exponent+0.5)];
5488 else if(
SCIPisEQ(scip, consdata->exponent, 1.852) )
5490 consdata->root = 0.398217;
5503 else if( consdata->exponent <= 2.0 )
5510 polyval = (consdata->exponent - 1.0) * consdata->power(root, consdata->exponent) + consdata->exponent *
pow(root, consdata->exponent-1.0) - 1.0;
5515 gradval = (consdata->exponent - 1.0) * consdata->exponent * (
pow(root, consdata->exponent - 1.0) +
pow(root, consdata->exponent - 2.0));
5520 root -= polyval / gradval;
5524 while( ++iter < 1000 );
5528 SCIPerrorMessage(
"failed to compute root for exponent %g\n", consdata->exponent);
5531 SCIPdebugMsg(scip,
"root for %g is %.20g, certainty = %g\n", consdata->exponent, root, polyval);
5534 consdata->root = root;
5540 if( consdata->nlrow == NULL )
5543 assert(consdata->nlrow != NULL);
5549 conshdlrdata->newsoleventfilterpos = -1;
5555 assert(eventhdlr != NULL);
5561 conshdlrdata->sepanlp =
FALSE;
5562 conshdlrdata->lastenfonode = NULL;
5563 conshdlrdata->nenforounds = 0;
5576 assert(scip != NULL);
5577 assert(conss != NULL || nconss == 0);
5580 assert(conshdlrdata != NULL);
5582 if( conshdlrdata->newsoleventfilterpos >= 0 )
5587 assert(eventhdlr != NULL);
5590 conshdlrdata->newsoleventfilterpos = -1;
5593 for( c = 0; c < nconss; ++c )
5595 assert(conss[c] != NULL);
5598 assert(consdata != NULL);
5601 if( consdata->nlrow != NULL )
5614 assert(scip != NULL);
5615 assert(conshdlr != NULL);
5616 assert(cons != NULL);
5617 assert(consdata != NULL);
5618 assert((*consdata)->x != NULL);
5619 assert((*consdata)->z != NULL);
5620 assert((*consdata)->xeventfilterpos == -1);
5621 assert((*consdata)->zeventfilterpos == -1);
5623 if( (*consdata)->nlrow != NULL )
5641 assert(sourcedata != NULL);
5644 assert(targetdata->xeventfilterpos == -1);
5645 assert(targetdata->zeventfilterpos == -1);
5684 assert(scip != NULL);
5685 assert(conshdlr != NULL);
5686 assert(conss != NULL || nconss == 0);
5689 assert(conshdlrdata != NULL);
5691 *infeasible =
FALSE;
5693 for( c = 0; c < nconss && !(*infeasible); ++c )
5695 assert(conss[c] != NULL);
5698 assert(consdata != NULL);
5714 consdata->exponent, consdata->xoffset, consdata->power, 1.0, consdata->zcoef, consdata->rhs, consdata->x, consdata->z) );
5715 if( rowprep != NULL )
5722 assert(!(*infeasible));
5725 if( conshdlrdata->conshdlrindicator != NULL && !
SCIProwIsLocal(row) )
5738 consdata->x, consdata->z,
FALSE) );
5739 assert(rowprep != NULL);
5746 assert(!(*infeasible));
5749 if( conshdlrdata->conshdlrindicator != NULL )
5762 if( -consdata->root * (xlb+consdata->xoffset) - consdata->xoffset < xub && xub <=
INITLPMAXVARVAL )
5765 consdata->x, consdata->z,
FALSE) );
5766 assert(rowprep != NULL);
5773 assert(!(*infeasible));
5776 if( conshdlrdata->conshdlrindicator != NULL )
5795 consdata->exponent, -consdata->xoffset, consdata->power, -1.0, -consdata->zcoef, -consdata->lhs, consdata->x, consdata->z) );
5796 if( rowprep != NULL )
5803 assert(!(*infeasible));
5806 if( conshdlrdata->conshdlrindicator != NULL && !
SCIProwIsLocal(row) )
5819 consdata->x, consdata->z,
FALSE) );
5820 assert(rowprep != NULL);
5827 assert(!(*infeasible));
5830 if( conshdlrdata->conshdlrindicator != NULL )
5843 if( -consdata->root * (xub+consdata->xoffset) - consdata->xoffset > xlb && xlb >= -
INITLPMAXVARVAL )
5846 consdata->x, consdata->z,
FALSE) );
5847 assert(rowprep != NULL);
5854 assert(!(*infeasible));
5857 if( conshdlrdata->conshdlrindicator != NULL )
5882 assert(scip != NULL);
5883 assert(conshdlr != NULL);
5884 assert(conss != NULL || nconss == 0);
5885 assert(result != NULL);
5890 assert(conshdlrdata != NULL);
5899 if( maxviolcon == NULL )
5905 if(
SCIPgetDepth(scip) == 0 && !conshdlrdata->sepanlp &&
5922 for( c = 0; c < nconss; ++c )
5924 assert(conss[c] != NULL);
5927 assert(consdata != NULL);
5943 if( conshdlrdata->subnlpheur != NULL )
5958 SCIPdebugMsg(scip,
"solved NLP relax, solution status: %d\n", solstat);
5964 conshdlrdata->sepanlp =
TRUE;
5968 SCIPdebugMsg(scip,
"NLP relaxation is globally infeasible, thus can cutoff node\n");
5980 assert(nlpsol != NULL);
5983 if( solvednlp && conshdlrdata->trysolheur != NULL )
5993 if( nfracvars == 0 )
6004 if( lpsolseparated )
6006 SCIPdebugMsg(scip,
"linearization cuts separate LP solution\n");
6018 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, NULL,
SCIPgetSepaMinEfficacy(scip),
FALSE, conshdlrdata->sepainboundsonly, &success, &cutoff, NULL) );
6036 assert(scip != NULL);
6037 assert(conshdlr != NULL);
6038 assert(conss != NULL || nconss == 0);
6039 assert(sol != NULL);
6040 assert(result != NULL);
6051 if( maxviolcon == NULL )
6054 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, sol,
SCIPgetSepaMinEfficacy(scip),
FALSE,
FALSE, &success, &cutoff, NULL) );
6092 assert(scip != NULL);
6093 assert(conshdlr != NULL);
6094 assert(conss != NULL || nconss == 0);
6097 assert(conshdlrdata != NULL);
6101 assert(!solviolbounds);
6103 if( maxviolcon == NULL )
6112 for( c = 0; c < nconss; ++c )
6118 assert(conss[c] != NULL);
6121 assert(consdata != NULL);
6146 for( c = 0; c < nconss; ++c )
6148 assert(conss != NULL);
6150 assert(consdata != NULL);
6167 SCIPdebugMsg(scip,
"All variables in violated constraints fixed (up to epsilon). Cannot find branching candidate. Forcing solution of LP.\n");
6185 assert(scip != NULL);
6186 assert(conshdlr != NULL);
6187 assert(conss != NULL || nconss == 0);
6188 assert(result != NULL);
6192 for( c = 0; c < nmarkedconss; ++c )
6194 assert(conss != NULL);
6200 assert(naddconss == 0);
6231 assert(scip != NULL);
6232 assert(conss != NULL || nconss == 0);
6233 assert(result != NULL);
6236 assert(conshdlrdata != NULL);
6243 SCIP_CALL(
presolveFindDuplicates(scip, conshdlr, conss, nconss, nupgdconss, ndelconss, naddconss, nfixedvars, naggrvars, &success, &infeas) );
6252 conshdlrdata->comparedpairwise =
TRUE;
6257 for( c = 0; c < nconss; ++c )
6259 assert(conss[c] != NULL);
6265 assert(consdata != NULL);
6271 if( consdata->exponent == 1.0 )
6279 vars[0] = consdata->x;
6280 vars[1] = consdata->z;
6282 coefs[1] = consdata->zcoef;
6283 lhs = consdata->lhs;
6284 rhs = consdata->rhs;
6286 lhs -= consdata->xoffset;
6288 rhs -= consdata->xoffset;
6306 switch( replaceresult )
6346 if( consdata->xoffset != 0.0 )
6350 xcoef =
SIGN(consdata->xoffset + 1.0) * consdata->power(ABS(consdata->xoffset + 1.0), consdata->exponent)
6351 -
SIGN(consdata->xoffset) * consdata->power(ABS(consdata->xoffset), consdata->exponent);
6358 lhs = (consdata->rhs -
SIGN(consdata->xoffset) * consdata->power(ABS(consdata->xoffset), consdata->exponent)) / xcoef;
6362 rhs = (consdata->lhs -
SIGN(consdata->xoffset) * consdata->power(ABS(consdata->xoffset), consdata->exponent)) / xcoef;
6369 lhs = (consdata->lhs -
SIGN(consdata->xoffset) * consdata->power(ABS(consdata->xoffset), consdata->exponent)) / xcoef;
6373 rhs = (consdata->rhs -
SIGN(consdata->xoffset) * consdata->power(ABS(consdata->xoffset), consdata->exponent)) / xcoef;
6375 zcoef = consdata->zcoef / xcoef;
6383 lhs = consdata->lhs;
6384 rhs = consdata->rhs;
6385 zcoef = consdata->zcoef;
6401 if( infeas || !fixed )
6403 SCIPdebugMsg(scip,
"propagation on constraint <%s> says problem is infeasible in presolve\n",
6415 SCIPdebugMsg(scip,
"propagation on constraint <%s> says problem is infeasible in presolve\n",
6426 consdata->x, consdata->z, zcoef, lhs, rhs,
6435 1, &consdata->z, &zcoef, lhs, rhs,
6465 if( localnchgbds > 0 || localnaddconss > 0 )
6467 *nchgbds += localnchgbds;
6468 *naddconss += localnaddconss;
6506 consdata->propvarbounds =
TRUE;
6545 assert(result != NULL);
6562 assert(scip != NULL);
6563 assert(cons != NULL);
6566 assert(consdata != NULL);
6571 if( consdata->x != NULL )
6583 if( consdata->z != NULL )
6585 if( consdata->zcoef > 0 )
6618 assert(conshdlr != NULL);
6621 assert(conshdlrdata != NULL);
6624 conshdlrdata->comparedpairwise =
FALSE;
6635 assert(scip != NULL);
6636 assert(cons != NULL);
6637 assert(conshdlr != NULL);
6640 assert(conshdlrdata != NULL);
6641 assert(conshdlrdata->eventhdlr != NULL);
6654 assert(scip != NULL);
6655 assert(cons != NULL);
6656 assert(conshdlr != NULL);
6659 assert(conshdlrdata != NULL);
6660 assert(conshdlrdata->eventhdlr != NULL);
6673 assert(scip != NULL);
6674 assert(cons != NULL);
6677 assert(consdata != NULL);
6682 && !
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
6688 SCIPinfoMessage(scip, file,
" %+.15g, %.15g) ", consdata->xoffset, consdata->exponent);
6694 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
6726 assert(scip != NULL);
6727 assert(conss != NULL || nconss == 0);
6728 assert(result != NULL);
6731 assert(conshdlrdata != NULL);
6739 for( c = 0; c < nconss; ++c )
6741 assert(conss != NULL);
6744 assert(!solviolbounds);
6747 assert(consdata != NULL);
6755 SCIPinfoMessage(scip, NULL,
"absolute power constraint <%s> violated by %g (scaled = %g)\n\t",
6757 SCIP_CALL( consPrintAbspower(scip, conshdlr, conss[c], NULL) );
6761 if( conshdlrdata->subnlpheur == NULL && !dolinfeasshift && !completely )
6763 if( consdata->lhsviol > maxviol || consdata->rhsviol > maxviol )
6764 maxviol =
MAX(consdata->lhsviol, consdata->rhsviol);
6789 assert(scip != NULL);
6790 assert(cons != NULL);
6791 assert(sourcescip != NULL);
6792 assert(sourcecons != NULL);
6793 assert(varmap != NULL);
6794 assert(valid != NULL);
6797 assert(consdata != NULL);
6812 x, z, consdata->exponent, consdata->xoffset, consdata->zcoef, consdata->lhs, consdata->rhs,
6813 initial, separate, enforce, check, propagate, local,
FALSE, dynamic, removable, stickingatnode) );
6840 SCIPdebugMsg(scip,
"start parsing absolute power constraint expression %s\n", str);
6842 if( strncmp(str,
"signpower(", 10) != 0 )
6871 while( isspace((
int)*str) )
6892 while( isspace((
int)*str) )
6913 while( isspace((
int)*str) )
6936 while( isspace((
int)*str) )
6939 if( strncmp(str,
"[free]", 6) != 0 )
6942 if( (*str !=
'<' && *str !=
'>' && *str !=
'=') || str[1] !=
'=' )
6976 SCIP_CALL(
SCIPcreateConsAbspower(scip, cons, name, x, z, exponent, xoffset, zcoef, lhs, rhs,
6977 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
6992 assert(cons != NULL);
6993 assert(vars != NULL);
6996 assert(consdata != NULL);
6998 vars[0] = consdata->x;
6999 vars[1] = consdata->z;
7036 consEnfolpAbspower, consEnfopsAbspower, consCheckAbspower, consLockAbspower,
7039 assert(conshdlr != NULL);
7079 "maximal coef range of a cut (maximal coefficient divided by minimal coefficient) in order to be added to LP relaxation",
7080 &conshdlrdata->cutmaxrange,
FALSE, 1e+7, 0.0,
SCIPinfinity(scip), NULL, NULL) );
7083 "whether to project the reference point when linearizing an absolute power constraint in a convex region",
7084 &conshdlrdata->projectrefpoint,
FALSE,
TRUE, NULL, NULL) );
7087 "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",
7088 &conshdlrdata->preferzerobranch,
FALSE, 1, 0, 3, NULL, NULL) );
7091 "whether to compute branching point such that the convexification error is minimized (after branching on 0.0)",
7092 &conshdlrdata->branchminconverror,
FALSE,
FALSE, NULL, NULL) );
7095 "should variable bound constraints be added for derived variable bounds?",
7096 &conshdlrdata->addvarboundcons,
TRUE,
TRUE, NULL, NULL) );
7099 "whether to try to make solutions in check function feasible by shifting the linear variable z",
7100 &conshdlrdata->linfeasshift,
FALSE,
TRUE, NULL, NULL) );
7103 "should dual presolve be applied?",
7104 &conshdlrdata->dualpresolve,
FALSE,
TRUE, NULL, NULL) );
7107 "whether to separate linearization cuts only in the variable bounds (does not affect enforcement)",
7108 &conshdlrdata->sepainboundsonly,
FALSE,
FALSE, NULL, NULL) );
7111 "minimal required fraction of continuous variables in problem to use solution of NLP relaxation in root for separation",
7112 &conshdlrdata->sepanlpmincont,
FALSE, 1.0, 0.0, 2.0, NULL, NULL) );
7115 "are cuts added during enforcement removable from the LP in the same node?",
7116 &conshdlrdata->enfocutsremovable,
TRUE,
FALSE, NULL, NULL) );
7119 processVarEvent, NULL) );
7120 conshdlrdata->eventhdlr = eventhdlr;
7123 processNewSolutionEvent, NULL) );
7173 assert(exponent > 1.0);
7176 assert(!modifiable);
7180 if( conshdlr == NULL )
7189 consdata->xeventfilterpos = -1;
7190 consdata->zeventfilterpos = -1;
7194 consdata->xoffset = xoffset;
7195 consdata->zcoef = zcoef;
7196 consdata->lhs = lhs;
7197 consdata->rhs = rhs;
7199 if(
SCIPisEQ(scip, exponent, 2.0) )
7201 consdata->exponent = 2.0;
7202 consdata->power =
square;
7206 consdata->exponent = exponent;
7207 consdata->power =
pow;
7219 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
7220 local, modifiable, dynamic, removable, stickingatnode) );
7246 assert(scip != NULL);
7248 SCIP_CALL(
SCIPcreateConsAbspower(scip, cons, name, x, z, exponent, xoffset, zcoef, lhs, rhs,
7263 assert(cons != NULL);
7265 assert(nlrow != NULL);
7268 assert(consdata != NULL);
7270 if( consdata->nlrow == NULL )
7274 assert(consdata->nlrow != NULL);
7275 *nlrow = consdata->nlrow;
7288 assert(cons != NULL);
7292 assert(consdata != NULL);
7305 assert(cons != NULL);
7309 assert(consdata != NULL);
7322 assert(cons != NULL);
7326 assert(consdata != NULL);
7328 return consdata->exponent;
7339 assert(cons != NULL);
7343 assert(consdata != NULL);
7345 return consdata->xoffset;
7356 assert(cons != NULL);
7360 assert(consdata != NULL);
7362 return consdata->zcoef;
7373 assert(cons != NULL);
7377 assert(consdata != NULL);
7379 return consdata->lhs;
7390 assert(cons != NULL);
7394 assert(consdata != NULL);
7396 return consdata->rhs;
7412 assert(cons != NULL);
7416 assert(consdata != NULL);
7417 assert(consdata->lhs == 0.0);
7418 assert(consdata->rhs == 0.0);
7423 rhs = -1.0 * consdata->zcoef * z_val;
7424 proj_val =
SIGN(rhs) *
pow(
REALABS(rhs), 1.0 / consdata->exponent) - consdata->xoffset;
7426 SCIPdebugMsg(scip,
"computing slack: linear: %f, power: %f, projected: %f\n", z_val, x_val, proj_val);
7428 return x_val - proj_val;
SCIP_Real SCIPgetCoefLinearAbspower(SCIP *scip, SCIP_CONS *cons)
enum SCIP_Result SCIP_RESULT
static SCIP_RETCODE generateLinearizationCut(SCIP *scip, SCIP_ROWPREP **rowprep, 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)
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)
void SCIPexprgraphSetVarNodeValue(SCIP_EXPRGRAPHNODE *varnode, SCIP_Real value)
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
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)
int SCIPmemccpy(char *dest, const char *src, char stop, unsigned int cnt)
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)))
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 SCIPcleanupRowprep(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Real maxcoefrange, SCIP_Real minviol, SCIP_Real *coefrange, SCIP_Real *viol)
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)
SCIP_RETCODE SCIPaddRowprepTerm(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_VAR *var, SCIP_Real coef)
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_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
static SCIP_DECL_CONSINITSOL(consInitsolAbspower)
SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
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)
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_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)
#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)
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
void SCIPfreeRowprep(SCIP *scip, SCIP_ROWPREP **rowprep)
#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)
#define CONSHDLR_EAGERFREQ
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)
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 INLINE uint32_t SCIPrealHashCode(double 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)
void SCIPaddRowprepSide(SCIP_ROWPREP *rowprep, SCIP_Real side)
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 SCIPcreateRowprep(SCIP *scip, SCIP_ROWPREP **rowprep, SCIP_SIDETYPE sidetype, SCIP_Bool local)
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)
static SCIP_RETCODE fixAlmostFixedX(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool *infeasible, SCIP_Bool *reduceddom)
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
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)
SCIP_Real SCIPgetSepaMinEfficacy(SCIP *scip)
#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)
static SCIP_RETCODE generateSecantCutNoCheck(SCIP *scip, SCIP_ROWPREP **rowprep, 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 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)
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 SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
#define SCIPdebugGetSolVal(scip, var, val)
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 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 SCIPmultihashInsert(SCIP_MULTIHASH *multihash, void *element)
SCIP_Real SCIPgetLhsNonlinear(SCIP *scip, SCIP_CONS *cons)
int SCIPgetDepth(SCIP *scip)
SCIP_Real SCIPlpfeastol(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_RETCODE generateLinearizationCutProject(SCIP *scip, SCIP_ROWPREP **rowprep, 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)
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 SCIPgetRowprepRowCons(SCIP *scip, SCIP_ROW **row, SCIP_ROWPREP *rowprep, SCIP_CONSHDLR *conshdlr)
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)
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.
void SCIPupdateSolConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
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_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)
static SCIP_RETCODE generateSecantCut(SCIP *scip, SCIP_ROWPREP **rowprep, 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 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)
static SCIP_RETCODE generateCut(SCIP *scip, SCIP_CONS *cons, SCIP_SIDETYPE violside, SCIP_SOL *sol, SCIP_ROW **row, SCIP_Bool onlyinbounds, SCIP_Real minviol)
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)
void SCIPprintRowprep(SCIP *scip, SCIP_ROWPREP *rowprep, FILE *file)
#define CONSHDLR_DELAYPROP
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
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