39 #define CONSHDLR_NAME "bivariate" 40 #define CONSHDLR_DESC "constraint handler for constraints of the form lhs <= f(x,y) + c*z <= rhs where f(x,y) is a bivariate function" 41 #define CONSHDLR_SEPAPRIORITY 5 42 #define CONSHDLR_ENFOPRIORITY -55 43 #define CONSHDLR_CHECKPRIORITY -3600000 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 54 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP 56 #define INTERVALINFTY 1E+43 57 #define NEWTONMAXITER 1000 58 #define INITLPMAXVARVAL 1000.0 60 #define QUADCONSUPGD_PRIORITY 5000 61 #define NONLINCONSUPGD_PRIORITY 10000 71 struct SepaData_ConvexConcave
82 typedef struct SepaData_ConvexConcave SEPADATA_CONVEXCONCAVE;
98 unsigned int mayincreasez:1;
99 unsigned int maydecreasez:1;
104 SEPADATA_CONVEXCONCAVE sepaconvexconcave;
108 struct SCIP_ConshdlrData
117 int ninitlprefpoints;
125 int newsoleventfilterpos;
145 #define infty2infty(infty1, infty2, val) ((val) >= (infty1) ? (infty2) : (val)) 154 assert(event !=
NULL);
155 assert(eventdata !=
NULL);
156 assert(eventhdlr !=
NULL);
160 assert(cons !=
NULL);
178 assert(scip !=
NULL);
179 assert(cons !=
NULL);
185 assert(conshdlrdata !=
NULL);
186 assert(conshdlrdata->linvareventhdlr !=
NULL);
189 assert(consdata !=
NULL);
191 if( consdata->z ==
NULL )
193 assert(consdata->eventfilterpos == -1);
199 if( consdata->zcoef > 0.0 )
207 if( consdata->zcoef > 0.0 )
231 assert(scip !=
NULL);
232 assert(cons !=
NULL);
237 assert(conshdlrdata !=
NULL);
238 assert(conshdlrdata->linvareventhdlr !=
NULL);
241 assert(consdata !=
NULL);
243 if( consdata->z ==
NULL )
245 assert(consdata->eventfilterpos >= 0);
251 if( consdata->zcoef > 0.0 )
259 if( consdata->zcoef > 0.0 )
266 consdata->eventfilterpos = -1;
279 assert(scip !=
NULL);
280 assert(event !=
NULL);
281 assert(eventdata !=
NULL);
282 assert(eventhdlr !=
NULL);
285 assert(conshdlrdata !=
NULL);
286 assert(conshdlrdata->exprgraph !=
NULL);
293 SCIPdebugMsg(scip,
"changed %s bound on expression graph variable <%s> from %g to %g\n",
298 conshdlrdata->ispropagated =
FALSE;
303 if( eventtype & SCIP_EVENTTYPE_LBCHANGED )
313 conshdlrdata->isremovedfixings =
FALSE;
327 assert(exprgraph !=
NULL);
329 assert(varnode !=
NULL);
334 assert(conshdlrdata !=
NULL);
335 assert(conshdlrdata->exprgraph == exprgraph);
352 conshdlrdata->ispropagated =
FALSE;
364 assert(exprgraph !=
NULL);
366 assert(varnode !=
NULL);
371 assert(conshdlrdata !=
NULL);
372 assert(conshdlrdata->exprgraph == exprgraph);
394 assert(scip !=
NULL);
395 assert(cons !=
NULL);
400 assert(consdata !=
NULL);
425 assert(scip !=
NULL);
426 assert(cons !=
NULL);
431 assert(consdata !=
NULL);
466 assert(conshdlr !=
NULL);
467 assert(scip !=
NULL);
468 assert(cons !=
NULL);
469 assert(ischanged !=
NULL);
470 assert(isupgraded !=
NULL);
474 assert(conshdlrdata !=
NULL);
478 assert(consdata !=
NULL);
479 assert(consdata->f !=
NULL);
495 if( consdata->zcoef == 0.0 )
498 consdata->lhs -= constant;
500 consdata->rhs -= constant;
502 if( consdata->z !=
NULL )
536 for( i = 0; i < 2; ++i )
554 else if( coef == 1.0 && constant == 0.0 )
571 assert(substexpr[0] !=
NULL || substexpr[1] !=
NULL);
574 if( substexpr[0] !=
NULL )
576 if( substexpr[1] !=
NULL )
580 if( (vars[0] ==
NULL || vars[0] == vars[1]) && vars[1] !=
NULL )
592 assert(vars[1] ==
NULL || vars[0] !=
NULL);
596 consdata->z !=
NULL ? 1 : 0, consdata->z !=
NULL ? &consdata->z :
NULL, &consdata->zcoef,
597 1, &tree, NULL, consdata->lhs, consdata->rhs,
613 for( i = 0; i < 2; ++i )
626 if( coef == 1.0 && constant == 0.0 )
659 if( substexpr[0] !=
NULL || substexpr[1] !=
NULL )
662 if( substexpr[0] !=
NULL )
664 if( substexpr[1] !=
NULL )
690 assert(conshdlrdata !=
NULL);
691 assert(conshdlrdata->exprgraph !=
NULL);
693 if( conshdlrdata->isremovedfixings )
716 if( requsize > varssize )
722 assert(requsize <= varssize);
727 for( j = 0; j < nvars; ++j )
742 conshdlrdata->isremovedfixings =
TRUE;
767 assert(scip !=
NULL);
768 assert(conshdlr !=
NULL);
769 assert(cons !=
NULL);
772 assert(conshdlrdata !=
NULL);
773 assert(conshdlrdata->exprinterpreter !=
NULL);
776 assert(consdata !=
NULL);
777 assert(consdata->z !=
NULL);
796 consdata->lhsviol = consdata->rhsviol =
SCIPinfinity(scip);
802 consdata->lhsviol = consdata->rhsviol =
SCIPinfinity(scip);
816 xyvals[0] =
MAX(xlb,
MIN(xub, xyvals[0]));
820 xyvals[1] =
MAX(ylb,
MIN(yub, xyvals[1]));
829 xyvals[0] =
MAX(xlb,
MIN(xub, xyvals[0]));
831 xyvals[1] =
MAX(ylb,
MIN(yub, xyvals[1]));
840 consdata->lhsviol = consdata->rhsviol =
SCIPinfinity(scip);
844 consdata->activity += consdata->zcoef * zval;
847 if( consdata->activity < consdata->lhs && !
SCIPisInfinity(scip, -consdata->lhs) )
848 consdata->lhsviol = consdata->lhs - consdata->activity;
850 consdata->lhsviol = 0.0;
852 if( consdata->activity > consdata->rhs && !
SCIPisInfinity(scip, consdata->rhs) )
853 consdata->rhsviol = consdata->activity - consdata->rhs;
855 consdata->rhsviol = 0.0;
857 switch( conshdlrdata->scaling )
865 if( consdata->lhsviol > 0.0 || consdata->rhsviol > 0.0 )
878 if( consdata->z !=
NULL )
883 consdata->lhsviol /= norm;
884 consdata->rhsviol /= norm;
892 if( consdata->lhsviol > 0.0 )
893 consdata->lhsviol /=
MAX(1.0,
REALABS(consdata->lhs));
895 if( consdata->rhsviol > 0.0 )
896 consdata->rhsviol /=
MAX(1.0,
REALABS(consdata->rhs));
925 assert(scip !=
NULL);
926 assert(conshdlr !=
NULL);
927 assert(conss !=
NULL || nconss == 0);
928 assert(maxviolcon !=
NULL);
934 for( c = 0; c < nconss; ++c )
936 assert(conss !=
NULL);
937 assert(conss[c] !=
NULL);
942 assert(consdata !=
NULL);
944 viol =
MAX(consdata->lhsviol, consdata->rhsviol);
948 *maxviolcon = conss[c];
977 assert(scip !=
NULL);
978 assert(vred !=
NULL);
1067 assert(scip !=
NULL);
1068 assert(exprinterpreter !=
NULL);
1069 assert(cons !=
NULL);
1072 assert(consdata !=
NULL);
1073 assert(consdata->f !=
NULL);
1075 switch( consdata->convextype )
1097 consdata->sepaconvexconcave.linearinx = !sparsity[0];
1098 consdata->sepaconvexconcave.lineariny = !sparsity[3];
1100 if( !consdata->sepaconvexconcave.linearinx && !
SCIPisInfinity(scip, consdata->rhs) )
1135 consdata->sepaconvexconcave.f_yfixed =
NULL;
1136 consdata->sepaconvexconcave.vred =
NULL;
1139 if( !consdata->sepaconvexconcave.lineariny && !
SCIPisInfinity(scip, -consdata->lhs) )
1199 consdata->sepaconvexconcave.f_neg_swapped =
NULL;
1200 consdata->sepaconvexconcave.f_neg_swapped_yfixed =
NULL;
1201 consdata->sepaconvexconcave.vred_neg_swapped =
NULL;
1222 assert(scip !=
NULL);
1223 assert(cons !=
NULL);
1226 assert(consdata !=
NULL);
1227 assert(consdata->f !=
NULL);
1229 switch( consdata->convextype )
1233 if( consdata->sepaconvexconcave.f_yfixed !=
NULL )
1237 if( consdata->sepaconvexconcave.f_neg_swapped !=
NULL )
1241 if( consdata->sepaconvexconcave.f_neg_swapped_yfixed !=
NULL )
1245 if( consdata->sepaconvexconcave.vred !=
NULL )
1249 if( consdata->sepaconvexconcave.vred_neg_swapped !=
NULL )
1274 assert(val !=
NULL);
1277 mid = 0.5 * (lb + ub);
1280 *val +=
MIN(1.0, amount * range);
1282 *val -=
MIN(1.0, amount * range);
1308 assert(scip !=
NULL);
1309 assert(exprinterpreter !=
NULL);
1313 assert(val !=
NULL);
1314 assert(success !=
NULL);
1330 s =
MIN(
MAX(0.0, lb), ub);
1349 amount = iter <= 65 ? 0.1 / (1u<<iter) : 1e-20;
1354 }
while( s == sold );
1390 if(
SCIPisEQ(scip, s, lb) && (grad - targetvalue) * hess >= 0 )
1400 if(
SCIPisEQ(scip, s, ub) && (grad - targetvalue) * hess <= 0 )
1423 step = (grad - targetvalue) / hess;
1424 assert(step != 0.0);
1466 assert(scip !=
NULL);
1467 assert(cons !=
NULL);
1468 assert(row !=
NULL);
1471 assert(consdata !=
NULL);
1500 SCIPdebugMsg(scip,
"could not evaluate f at given reference point and perturbed one");
1506 rhs = consdata->rhs - fval + fgrad[0] * x0y0[0] + fgrad[1] * x0y0[1];
1515 if( consdata->z !=
NULL )
1560 assert(scip !=
NULL);
1561 assert(exprinterpreter !=
NULL);
1563 assert(x0y0 !=
NULL);
1564 assert(coefx !=
NULL);
1565 assert(coefy !=
NULL);
1566 assert(constant !=
NULL);
1567 assert(success !=
NULL);
1580 assert(
SCIPisLE(scip, xlb, x0y0[0]));
1581 assert(
SCIPisGE(scip, xub, x0y0[0]));
1582 assert(
SCIPisLE(scip, ylb, x0y0[1]));
1583 assert(
SCIPisGE(scip, yub, x0y0[1]));
1623 SCIPdebugMsg(scip,
"skip hyperplane since function cannot be evaluated\n");
1628 *coefy = (p4val - p1val) / (yub - ylb);
1629 *constant = p1val - *coefy * ylb;
1646 SCIPdebugMsg(scip,
"skip hyperplane since function cannot be evaluated\n");
1650 *coefx = (p2val - p1val) / (xub - xlb);
1652 *constant = p1val - *coefx * xlb;
1673 SCIPdebugMsg(scip,
"p1 = (%g, %g), f(p1) = %g\n", p1[0], p1[1], p1val);
1674 SCIPdebugMsg(scip,
"p2 = (%g, %g), f(p2) = %g\n", p2[0], p2[1], p2val);
1675 SCIPdebugMsg(scip,
"p3 = (%g, %g), f(p3) = %g\n", p3[0], p3[1], p3val);
1676 SCIPdebugMsg(scip,
"p4 = (%g, %g), f(p4) = %g\n", p4[0], p4[1], p4val);
1681 SCIPdebugMsg(scip,
"skip hyperplane since function cannot be evaluated\n");
1696 if( x0y0[1] <= ylb + (yub - ylb)/(xub - xlb) * (x0y0[0] - xlb) )
1698 SCIP_CALL(
SCIPcomputeHyperplaneThreePoints(scip, p1[0], p1[1], p1val, p2[0], p2[1], p2val, p3[0], p3[1], p3val, &alpha,
1699 &beta, &gamma_, &delta) );
1706 if(
SCIPisInfinity(scip, delta) || alpha * p4[0] + beta * p4[1] + gamma_ * p4val > delta )
1711 SCIP_CALL(
SCIPcomputeHyperplaneThreePoints(scip, p1[0], p1[1], p1val, p3[0], p3[1], p3val, p4[0], p4[1], p4val, &alpha,
1712 &beta, &gamma_, &delta) );
1719 if(
SCIPisInfinity(scip, delta) || alpha * p2[0] + beta * p2[1] + gamma_ * p2val > delta )
1725 if( x0y0[1] <= yub + (ylb - yub)/(xub - xlb) * (x0y0[0] - xlb) )
1727 SCIP_CALL(
SCIPcomputeHyperplaneThreePoints(scip, p1[0], p1[1], p1val, p2[0], p2[1], p2val, p4[0], p4[1], p4val,
1728 &alpha, &beta, &gamma_, &delta) );
1738 SCIP_CALL(
SCIPcomputeHyperplaneThreePoints(scip, p2[0], p2[1], p2val, p3[0], p3[1], p3val, p4[0], p4[1], p4val,
1739 &alpha, &beta, &gamma_, &delta) );
1749 SCIPdebugMsg(scip,
"alpha = %g, beta = %g, gamma = %g, delta = %g\n", alpha, beta, gamma_, delta);
1760 *coefx = -alpha / gamma_;
1761 *coefy = -beta / gamma_;
1762 *constant = delta / gamma_;
1784 assert(scip !=
NULL);
1785 assert(cons !=
NULL);
1786 assert(row !=
NULL);
1791 assert(consdata !=
NULL);
1802 SCIP_CALL(
SCIPcreateRowCons(scip, row,
SCIPconsGetHdlr(cons),
"bivaroveresthyperplanecut", 0,
NULL,
NULL, consdata->lhs - constant,
SCIPinfinity(scip),
TRUE,
FALSE,
TRUE) );
1805 if( consdata->z !=
NULL )
1861 assert(scip !=
NULL);
1862 assert(exprinterpreter !=
NULL);
1864 assert(xyref !=
NULL);
1865 assert(success !=
NULL);
1897 t = (yub - yval) / (yub - ylb);
1947 slb = (yval - yub) / (ylb - yval) * (xval / t - xub);
1948 sub = (yval - yub) / (ylb - yval) * (xval / t - xlb);
1959 if( *success ==
FALSE )
1966 rval = 1.0 / t * xval + (1.0 - 1.0 / t) * sval;
1969 rval =
MAX(xlb,
MIN(rval, xub));
2020 *convenvvalue = t * frval + (1.0 - t) * fsval;
2022 SCIPdebugMsg(scip,
"Parallel: Cut of (xval,yval)=(%g,%g)\n",xval,yval);
2023 SCIPdebugMsg(scip,
"Parallel: r=%g in [%g,%g], s=%g in [%g,%g], f(r,ylb)=%g, f(xlb,s)=%g\n",rval,xlb,xub,sval,ylb,yub,frval,fsval);
2024 SCIPdebugMsg(scip,
"(r,ylb)=(%g,%g), (s,yub)=(%g,%g), vredval=%g\n",rval,ylb,sval,yub,*convenvvalue);
2028 SCIPdebugMsg(scip,
"f not differentiable in (x0,y0) w.r.t. x\n");
2033 cutcoeff[0] = (yub - ylb) * grad[0];
2034 cutcoeff[1] = fsval - frval - (sval - rval) * grad[0];
2035 cutcoeff[2] = yub - ylb;
2036 cutcoeff[3] = cutcoeff[0] * xval + cutcoeff[1] * yval - cutcoeff[2] * *convenvvalue;
2038 SCIPdebugMsg(scip,
"Parallel: cutcoeff[0]=%g, cutcoeff[1]=%g, cutcoeff[2]=1.0, cutcoeff[3]=%g\n",cutcoeff[0]/cutcoeff[2],cutcoeff[1]/cutcoeff[2],cutcoeff[3]/cutcoeff[2]);
2093 assert(scip !=
NULL);
2094 assert(exprinterpreter !=
NULL);
2096 assert(convenvvalue !=
NULL);
2097 assert(success !=
NULL);
2128 SCIPdebugMsg(scip,
"%s[%g,%g] = %g %s[%g,%g] = %g\n",
SCIPvarGetName(x), xlb, xub, xval,
SCIPvarGetName(y), ylb, yub, yval);
2131 if( yval <= (ylb-yub) / (xub-xlb) * (xval-xlb) + yub )
2195 tlb = (yval-ylb)/(yub-ylb);
2196 tub = (xub-xval)/(xub-xlb);
2202 if( *success ==
FALSE )
2210 rval = (yval-(1-tval)*ylb)/tval;
2211 rval =
MAX(ylb,
MIN(yub, rval));
2212 sval = (xval-xlb*tval)/(1-tval);
2213 sval =
MAX(xlb,
MIN(xub, sval));
2215 SCIPdebugMsg(scip,
"LowerLeft: t[%g,%g] = %g -> r = %g, s = %g\n",tlb,tub,tval,rval,sval);
2244 cutcoeff[0] = (rval-ylb) * grad_sval[0];
2245 cutcoeff[1] = (sval-xlb) * grad_sval[0] + frval - fsval;
2246 cutcoeff[2] = rval-ylb;
2247 cutcoeff[3] = cutcoeff[0]*xlb+cutcoeff[1]*rval-cutcoeff[2]*frval;
2249 else if( !
SCIPisEQ(scip,rval,yub) )
2257 cutcoeff[0] = (rval-ylb)*grad_rval[1]+fsval-frval;
2258 cutcoeff[1] = (sval-xlb)*grad_rval[1];
2259 cutcoeff[2] = sval-xlb;
2260 cutcoeff[3] = cutcoeff[0]*xlb+cutcoeff[1]*rval-cutcoeff[2]*frval;
2271 cutcoeff[0] = (rval-ylb)*
MIN(grad_sval[0],grad_rval[0]);
2272 cutcoeff[1] = (sval-xlb)*
MIN(grad_sval[0],grad_rval[0])+frval-fsval;
2273 cutcoeff[2] = (rval-ylb);
2274 cutcoeff[3] = cutcoeff[0]*xlb+cutcoeff[1]*rval-cutcoeff[2]*frval;
2277 SCIPdebugMsg(scip,
"LowerLeft: Cut of (xval,yval)=(%g,%g)\n",xval,yval);
2278 SCIPdebugMsg(scip,
"LowerLeft: r=%g in [%g,%g], s=%g in [%g,%g], f(s,ylb)=%g, f(xlb,r)=%g\n",rval,xlb,xub,sval,ylb,yub,fsval,frval);
2279 SCIPdebugMsg(scip,
"(s,ylb)=(%g,%g) (xlb,r)=(%g,%g) t=%g, vredval=%g\n",sval,ylb,xlb,rval,tval,*convenvvalue);
2280 SCIPdebugMsg(scip,
"LowerLeft: cutcoeff[0]=%g, cutcoeff[1]=%g,cutcoeff[2]=%g,cutcoeff[3]=%g\n",cutcoeff[0],cutcoeff[1],cutcoeff[2],cutcoeff[3]);
2345 tlb = (yub-yval)/(yub-ylb);
2346 tub = (xval-xlb)/(xub-xlb);
2353 if( *success ==
FALSE )
2362 rval = (yval-(1.0-tval)*yub)/tval;
2365 rval =
MAX(ylb,
MIN(yub, rval));
2367 sval = (xval-xub*tval)/(1.0-tval);
2370 sval =
MAX(xlb,
MIN(xub, sval));
2383 *convenvvalue = tval * frval + (1.0-tval) * fsval;
2397 cutcoeff[0] = (yub-rval)*grad_sval[0];
2398 cutcoeff[1] = (xub-sval)*grad_sval[0]+fsval-frval;
2399 cutcoeff[2] = yub-rval;
2400 cutcoeff[3] = cutcoeff[0]*sval+cutcoeff[1]*yub-cutcoeff[2]*fsval;
2402 else if( !
SCIPisEQ(scip,rval,ylb) )
2410 cutcoeff[0] = (yub-rval)*grad_rval[1]+frval-fsval;
2411 cutcoeff[1] = (xub-sval)*grad_rval[1];
2412 cutcoeff[2] = xub-sval;
2413 cutcoeff[3] = cutcoeff[0]*sval+cutcoeff[1]*yub-cutcoeff[2]*fsval;
2420 assert(
SCIPisFeasLE(scip, yval, (ylb-yub) / (xub-xlb) * (xval-xlb) + yub));
2428 cutcoeff[0] = (yub-rval)*
MIN(grad_sval[0],grad_rval[0]);
2429 cutcoeff[1] = (xub-sval)*
MIN(grad_sval[0],grad_rval[0])+fsval-frval;
2430 cutcoeff[2] = xub-sval;
2431 cutcoeff[3] = cutcoeff[0]*sval+cutcoeff[1]*yub-cutcoeff[2]*fsval;
2434 SCIPdebugMsg(scip,
"UpperRight: Cut of (xval,yval)=(%g,%g)\n",xval,yval);
2435 SCIPdebugMsg(scip,
"UpperRight: r=%g in [%g,%g], s=%g in [%g,%g], f(r,yub)=%g, f(xub,s)=%g\n",rval,xlb,xub,sval,ylb,yub,frval,fsval);
2436 SCIPdebugMsg(scip,
"(s,yub)=(%g,%g) (xub,r)=(%g,%g) t=%g, vredval=%g\n",sval,yub,xub,rval,tval,*convenvvalue);
2437 SCIPdebugMsg(scip,
"UpperRight: cutcoeff[0]=%g, cutcoeff[1]=%g, cutcoeff[2]=%g, cutcoeff[3]=%g\n",cutcoeff[0],cutcoeff[1],cutcoeff[2],cutcoeff[3]);
2489 assert(scip !=
NULL);
2490 assert(exprinterpreter !=
NULL);
2492 assert(convenvvalue !=
NULL);
2493 assert(success !=
NULL);
2526 if( yval <= (yub-ylb)/(xub-xlb)*(xval-xlb)+ylb )
2593 tlb = (xub-xval)/(xub-xlb);
2594 tub = (yub-yval)/(yub-ylb);
2599 if( *success ==
FALSE )
2609 rval = xub+(xval-xub)/tval;
2610 rval =
MAX(xlb,
MIN(xub, rval));
2611 sval = (yval-tval*ylb)/(1-tval);
2612 sval =
MAX(ylb,
MIN(yub, sval));
2639 cutcoeff[0] = (sval-ylb)*grad_rval[0];
2640 cutcoeff[1] = (rval-xub)*grad_rval[0]-frval+fsval;
2641 cutcoeff[2] = sval-ylb;
2642 cutcoeff[3] = cutcoeff[0]*xub+cutcoeff[1]*sval-cutcoeff[2]*fsval;
2644 else if( !(
SCIPisEQ(scip,sval,yub)) )
2652 cutcoeff[0] = (ylb-sval)*grad_sval[1]-frval+fsval;
2653 cutcoeff[1] = (xub-rval)*grad_sval[1];
2654 cutcoeff[2] = xub-rval;
2655 cutcoeff[3] = cutcoeff[0]*xub+cutcoeff[1]*sval-cutcoeff[2]*fsval;
2666 cutcoeff[0] = (sval-ylb)*
MIN(grad_sval[0],grad_rval[0]);
2667 cutcoeff[1] = (rval-xub)*
MIN(grad_sval[0],grad_rval[0])+fsval-frval;
2668 cutcoeff[2] = sval-ylb;
2669 cutcoeff[3] = cutcoeff[0]*xub+cutcoeff[1]*sval-cutcoeff[2]*fsval;
2673 SCIPdebugMsg(scip,
"LowerRight: Cut of (xval,yval)=(%g,%g)\n",xval,yval);
2674 SCIPdebugMsg(scip,
"LowerRight: t=%g in [%g,%g], r=%g in [%g,%g], s=%g in [%g,%g]\n",tval,tlb,tub,rval,xlb,xub,sval,ylb,yub);
2675 SCIPdebugMsg(scip,
"LowerRight: (r,ylb)=(%g,%g) (xub,sval)=(%g,%g) vredval=%g\n",rval,ylb,xub,sval,*convenvvalue);
2676 SCIPdebugMsg(scip,
"LowerRight: cutcoeff[0]=%g, cutcoeff[1]=%g,cutcoeff[2]=1.0,cutcoeff[3]=%g\n",cutcoeff[0]/cutcoeff[2],cutcoeff[1]/cutcoeff[2],cutcoeff[3]/cutcoeff[2]);
2745 tlb = (xval-xlb)/(xub-xlb);
2746 tub = (yval-ylb)/(yub-ylb);
2751 if( *success ==
FALSE )
2761 rval = xlb+(xval-xlb)/tval;
2762 rval =
MAX(xlb,
MIN(xub, rval));
2763 sval = (yval-tval*yub)/(1-tval);
2764 sval =
MAX(ylb,
MIN(yub, sval));
2791 cutcoeff[0] = (yub-sval)*grad_rval[0];
2792 cutcoeff[1] = (xlb-rval)*grad_rval[0]-fsval+frval;
2793 cutcoeff[2] = yub-sval;
2794 cutcoeff[3] = cutcoeff[0]*xlb+cutcoeff[1]*sval-cutcoeff[2]*fsval;
2796 else if( !
SCIPisEQ(scip,sval,ylb) )
2804 cutcoeff[0] = (sval-yub)*grad_sval[1]-fsval+frval;
2805 cutcoeff[1] = (rval-xlb)*grad_sval[1];
2806 cutcoeff[2] = rval-xlb;
2807 cutcoeff[3] = cutcoeff[0]*xlb+cutcoeff[1]*sval-cutcoeff[2]*fsval;
2818 cutcoeff[0] = (yub-sval)*
MIN(grad_rval[0],grad_sval[0]);
2819 cutcoeff[1] = (xlb-rval)*
MIN(grad_rval[0],grad_sval[0])-fsval+frval;
2820 cutcoeff[2] = yub-sval;
2821 cutcoeff[3] = cutcoeff[0]*xlb+cutcoeff[1]*sval-cutcoeff[2]*fsval;
2824 SCIPdebugMsg(scip,
"UpperLeft: Cut of (xval,yval)=(%g,%g)\n",xval,yval);
2825 SCIPdebugMsg(scip,
"UpperLeft: r=%g in [%g,%g], s=%g in [%g,%g], f(r,yub)=%g, f(xlb,s)=%g\n",rval,xlb,xub,sval,ylb,yub,frval,fsval);
2826 SCIPdebugMsg(scip,
"t=%g in [%g,%g], (r,yub)=(%g,%g) (xlb,sval)=(%g,%g) vredval=%g\n",tval,tlb,tub,rval,yub,xlb,sval,*convenvvalue);
2827 SCIPdebugMsg(scip,
"UpperLeft: cutcoeff[0]=%g, cutcoeff[1]=%g,cutcoeff[2]=1.0,cutcoeff[3]=%g\n",cutcoeff[0]/cutcoeff[2],cutcoeff[1]/cutcoeff[2],cutcoeff[3]/cutcoeff[2]);
2859 assert(scip !=
NULL);
2860 assert(exprinterpreter !=
NULL);
2862 assert(success !=
NULL);
2863 assert(xyref !=
NULL);
2887 SCIPdebugMsg(scip,
"skip convex-concave underestimator, since y is unbounded\n");
2905 SCIPdebugMsg(scip,
"skip convex-concave underestimator, since both x and y are fixed\n");
2916 SCIPdebugMsg(scip,
"cannot evaluate function at (xlb, ylb)\n");
2926 SCIPdebugMsg(scip,
"cannot evaluate function at (xlb, yub)\n");
2930 slope = (f_yub - f_ylb) / (yub - ylb);
2935 cutcoeff[1] = slope;
2937 cutcoeff[3] = -(f_ylb - slope * ylb);
2938 *convenvvalue = f_ylb+slope*(yval-ylb);
2957 perturb(&xval, xlb, xub, 0.001);
2964 SCIPdebugMsg(scip,
"cannot evaluate function or derivative in (xval,ylb), also after perturbation\n");
2971 cutcoeff[0] = grad[0];
2974 cutcoeff[3] = -(fval - grad[0] * xval);
2975 *convenvvalue = fval;
3006 perturb(&xval, xlb, xub, 0.001);
3012 cutcoeff[0] = (yub - ylb) *
MIN(gradylb[0], gradyub[0]);
3014 cutcoeff[0] = (yub - ylb) *
MAX(gradylb[0], gradyub[0]);
3015 cutcoeff[1] = fvalyub - fvalylb;
3016 cutcoeff[2] = yub - ylb;
3017 cutcoeff[3] = cutcoeff[0] * xval + cutcoeff[1] * ylb - cutcoeff[2] * fvalylb;
3018 *convenvvalue = fvalylb;
3020 SCIPdebugMsg(scip,
"alpha: %g, beta: %g, gamma: 1.0, delta: %g\n",
3021 cutcoeff[0]/cutcoeff[2], cutcoeff[1]/cutcoeff[2], cutcoeff[3]/cutcoeff[2]);
3037 assert(!
SCIPisEQ(scip, xlb, xval));
3038 assert(!
SCIPisEQ(scip, xub, xval));
3040 assert(f_yfixed !=
NULL);
3050 perturb(&yval, ylb, yub, 0.001);
3076 SCIPdebugMsg(scip,
"couldn't solve deriv equ, compare f(%g,%g) - %g*%g = %g and f(%g,%g) - %g*%g = %g\n",
3077 xlb, ylb, grad[0], xlb, fxlb - grad[0] * xlb,
3078 xub, ylb, grad[0], xub, fxub - grad[0] * xub);
3082 if( fxlb - grad[0] * xlb > fxub - grad[0] * xub )
3091 perturb(&yval, ylb, yub, 0.001);
3100 SCIPdebugMsg(scip,
"xtilde = %g, f(%g,%g) = %g\n", xtilde, xtilde, yub, ftilde);
3103 cutcoeff[0] = (yub - ylb) * grad[0];
3104 cutcoeff[1] = ftilde - fval - grad[0] * (xtilde - xval);
3105 cutcoeff[2] = yub - ylb;
3106 cutcoeff[3] = cutcoeff[0] * xval + cutcoeff[1] * ylb - cutcoeff[2] * fval;
3107 *convenvvalue = fval;
3109 SCIPdebugMsg(scip,
"alpha: %g, beta: %g, gamma: %g, delta: %g\n", cutcoeff[0], cutcoeff[1], cutcoeff[2], cutcoeff[3]);
3125 assert(f_yfixed !=
NULL);
3135 perturb(&yval, ylb, yub, 0.001);
3157 SCIPdebugMsg(scip,
"couldn't solve deriv equ, compare f(%g,%g) - %g*%g = %g and f(%g,%g) - %g*%g = %g\n",
3158 xlb, yub, grad[0], xlb, fxlb - grad[0] * xlb,
3159 xub, yub, grad[0], xub, fxub - grad[0] * xub);
3163 if( fxlb - grad[0] * xlb < fxub - grad[0] * xub )
3172 perturb(&yval, ylb, yub, 0.001);
3181 SCIPdebugMsg(scip,
"xtilde = %g, f(%g,%g) = %g\n", xtilde, xtilde, ylb, ftilde);
3184 cutcoeff[0] = (yub - ylb) * grad[0];
3185 cutcoeff[1] = grad[0] * (xtilde - xval) - ftilde + fval;
3186 cutcoeff[2] = yub - ylb;
3187 cutcoeff[3] = cutcoeff[0] * xval + cutcoeff[1] * yub - cutcoeff[2] * fval;
3188 *convenvvalue = fval;
3190 SCIPdebugMsg(scip,
"alpha: %g, beta: %g, gamma: %g, delta: %g\n", cutcoeff[0], cutcoeff[1], cutcoeff[2], cutcoeff[3]);
3203 const char* paramnames[4] = {
"x0",
"y0",
"ylb",
"yub"};
3215 assert(vred !=
NULL);
3225 paramvals[0] = xval;
3226 paramvals[1] = yval;
3237 t = (yub - yval) / (yub - ylb);
3239 slb = (yval - yub) / (ylb - yval) * (xval / t - xub);
3243 sub = (yval - yub) / (ylb - yval) * (xval / t - xlb);
3258 rval = xval / t + (1.0 - 1.0 / t) * sval;
3261 rval =
MAX(xlb,
MIN(rval, xub));
3312 *convenvvalue = t * frval + (1.0 - t) * fsval;
3314 SCIPdebugMsg(scip,
"Parallel: Cut of (xval,yval)=(%g,%g)\n",xval,yval);
3315 SCIPdebugMsg(scip,
"Parallel: r=%g s=%g in [%g,%g], y in [%g,%g], f(r,ylb)=%g, f(xlb,s)=%g\n",rval,sval,xlb,xub,ylb,yub,frval,fsval);
3316 SCIPdebugMsg(scip,
"(r,ylb)=(%g,%g), (s,yub)=(%g,%g), vredval=%g\n",rval,ylb,sval,yub,*convenvvalue);
3320 SCIPdebugMsg(scip,
"f not differentiable at (x0,y0) w.r.t. x\n");
3326 cutcoeff[0] = (yub - ylb) * grad[0];
3327 cutcoeff[1] = fsval - frval - (sval - rval) * grad[0];
3328 cutcoeff[2] = yub - ylb;
3329 cutcoeff[3] = cutcoeff[0] * xval + cutcoeff[1] * yval - cutcoeff[2] * *convenvvalue;
3331 SCIPdebugMsg(scip,
"Parallel: cutcoeff[0]=%g, cutcoeff[1]=%g,cutcoeff[2]=1.0,cutcoeff[3]=%g\n",cutcoeff[0]/cutcoeff[2],cutcoeff[1]/cutcoeff[2],cutcoeff[3]/cutcoeff[2]);
3357 assert(scip !=
NULL);
3359 assert(cons !=
NULL);
3360 assert(row !=
NULL);
3363 assert(consdata !=
NULL);
3364 assert(consdata->f !=
NULL);
3369 SCIPdebugMsg(scip,
"generate %sestimator for convex-concave constraint <%s>\n",
3378 if( consdata->sepaconvexconcave.lineariny )
3392 SCIP_CALL(
SCIPcreateRowCons(scip, row,
SCIPconsGetHdlr(cons), cutname, 0,
NULL,
NULL, consdata->lhs - constant,
SCIPinfinity(scip),
TRUE,
FALSE,
TRUE) );
3395 if( consdata->z !=
NULL )
3406 assert(consdata->sepaconvexconcave.f_neg_swapped !=
NULL);
3408 xyref_[0] = xyref[1];
3409 xyref_[1] = xyref[0];
3410 SCIP_CALL(
generateConvexConcaveUnderestimator(scip, exprinterpreter, consdata->sepaconvexconcave.f_neg_swapped, consdata->sepaconvexconcave.f_neg_swapped_yfixed, consdata->sepaconvexconcave.vred_neg_swapped, xyref_, cutcoeff, &dummy, &success) );
3425 coefs[0] = -cutcoeff[1] / cutcoeff[2];
3426 coefs[1] = -cutcoeff[0] / cutcoeff[2];
3431 if( consdata->z !=
NULL )
3444 if( consdata->sepaconvexconcave.linearinx )
3458 SCIP_CALL(
SCIPcreateRowCons(scip, row,
SCIPconsGetHdlr(cons), cutname, 0,
NULL,
NULL, -
SCIPinfinity(scip), consdata->rhs - constant,
TRUE,
FALSE,
TRUE) );
3461 if( consdata->z !=
NULL )
3470 assert(!consdata->sepaconvexconcave.linearinx);
3488 coefs[0] = cutcoeff[0] / cutcoeff[2];
3489 coefs[1] = cutcoeff[1] / cutcoeff[2];
3494 if( consdata->z !=
NULL )
3537 assert(success !=
NULL);
3540 idx =
SCIPisEQ(scip, xlb, xub) ? 0 : 1;
3561 if( min_max * (grad_lb[idx] - grad_ub[idx]) >= 0 )
3576 cutcoeff[1] = grad[1];
3583 cutcoeff[0] = grad[0];
3587 cutcoeff[3] = -(fval-cutcoeff[0]*xval-cutcoeff[1]*yval);
3588 *convenvvalue = fval;
3617 assert(scip !=
NULL);
3618 assert(exprinterpreter !=
NULL);
3620 assert(convenvvalue !=
NULL);
3621 assert(success !=
NULL);
3641 SCIPdebugMsg(scip,
"xval=%g in [%g,%g], yval=%g in [%g,%g]\n",xval,xlb,xub,yval,ylb,yub);
3658 cutcoeff[0] = grad[0];
3661 cutcoeff[3] = -(fval - grad[0] * xval);
3683 cutcoeff[1] = grad[1];
3685 cutcoeff[3] = -(fval - grad[1] * yval);
3703 SCIP_CALL(
lifting(scip,exprinterpreter,f,xval,yval,xlb,xlb,ylb,yub,-1,cutcoeff,convenvvalue,success) );
3708 SCIPdebugMsg(scip,
"Boundary x=lb: Cut of (xval,yval)=(%g,%g)\n",xval,yval);
3709 SCIPdebugMsg(scip,
"convenvvalue = %g\n",*convenvvalue);
3710 SCIPdebugMsg(scip,
"cutcoeff[0]=%g, cutcoeff[1]=%g,cutcoeff[2]=%g,cutcoeff[3]=%g\n",
3711 cutcoeff[0],cutcoeff[1],cutcoeff[2],cutcoeff[3]);
3720 SCIP_CALL(
lifting(scip,exprinterpreter,f,xval,yval,xlb,xub,ylb,ylb,-1,cutcoeff,convenvvalue,success) );
3725 SCIPdebugMsg(scip,
"Boundary y=lb: Cut of (xval,yval)=(%g,%g)\n",xval,yval);
3726 SCIPdebugMsg(scip,
"convenvvalue = %g\n",*convenvvalue);
3727 SCIPdebugMsg(scip,
"cutcoeff[0]=%g, cutcoeff[1]=%g,cutcoeff[2]=%g,cutcoeff[3]=%g\n",
3728 cutcoeff[0],cutcoeff[1],cutcoeff[2],cutcoeff[3]);
3745 SCIP_CALL(
lifting(scip,exprinterpreter,f,xval,yval,xub,xub,ylb,yub,1,cutcoeff,convenvvalue,success) );
3750 SCIPdebugMsg(scip,
"Boundary x=ub: Cut of (xval,yval)=(%g,%g)\n",xval,yval);
3751 SCIPdebugMsg(scip,
"convenvvalue = %g\n",*convenvvalue);
3752 SCIPdebugMsg(scip,
"cutcoeff[0]=%g, cutcoeff[1]=%g,cutcoeff[2]=%g,cutcoeff[3]=%g\n",
3753 cutcoeff[0],cutcoeff[1],cutcoeff[2],cutcoeff[3]);
3762 SCIP_CALL(
lifting(scip,exprinterpreter,f,xval,yval,xlb,xub,yub,yub,1,cutcoeff,convenvvalue,success) );
3767 SCIPdebugMsg(scip,
"Boundary y=ub: Cut of (xval,yval)=(%g,%g)\n",xval,yval);
3768 SCIPdebugMsg(scip,
"convenvvalue = %g\n",*convenvvalue);
3769 SCIPdebugMsg(scip,
"cutcoeff[0]=%g, cutcoeff[1]=%g,cutcoeff[2]=%g,cutcoeff[3]=%g\n",
3770 cutcoeff[0],cutcoeff[1],cutcoeff[2],cutcoeff[3]);
3776 SCIPerrorMessage(
"Tries to compute underestimator for a point at the boundary. But point is not on the boundary!\n");
3829 assert(scip !=
NULL);
3830 assert(exprinterpreter !=
NULL);
3832 assert(convenvvalue !=
NULL);
3833 assert(success !=
NULL);
3856 SCIPdebugMsg(scip,
"skip 1-convex underestimator since function cannot be evaluated\n");
3862 SCIPdebugMsg(scip,
"skip 1-convex underestimator since function cannot be differentiated\n");
3870 SCIPdebugMsg(scip,
"xval=%g in [%g,%g], yval=%g in [%g,%g]\n", xyref[0], xlb, xub, xyref[1], ylb, yub);
3874 if( fval_xub_ylb-fval_xlb_yub <= (xub-xlb)*grad_xub_ylb[0]-(yub-ylb)*grad_xlb_yub[1] )
3909 assert(swapped == 1);
3911 xyref_[0] = xyref[1];
3912 xyref_[1] = xyref[0];
3920 swap_buffer = all_cutcoeff[0][0];
3921 all_cutcoeff[0][0] = all_cutcoeff[0][1];
3922 all_cutcoeff[0][1] = swap_buffer;
3924 swap_buffer = all_cutcoeff[1][0];
3925 all_cutcoeff[1][0] = all_cutcoeff[1][1];
3926 all_cutcoeff[1][1] = swap_buffer;
3933 SCIPdebugMsg(scip,
"Triangulation: convenvvalue=%g\n", all_convenvvalue[0]);
3934 SCIPdebugMsg(scip,
"Parallel Y: convenvvalue=%g\n", all_convenvvalue[1]);
3939 if( all_success[0] && all_success[1] )
3942 for( i = 0; i < 2; ++i )
3949 if( all_convenvvalue[i] < lowest )
3952 lowest = all_convenvvalue[i];
3956 assert(lowestidx >= 0);
3958 *convenvvalue = all_convenvvalue[lowestidx];
3959 cutcoeff[0] = all_cutcoeff[lowestidx][0];
3960 cutcoeff[1] = all_cutcoeff[lowestidx][1];
3961 cutcoeff[2] = all_cutcoeff[lowestidx][2];
3962 cutcoeff[3] = all_cutcoeff[lowestidx][3];
4024 assert(scip !=
NULL);
4025 assert(exprinterpreter !=
NULL);
4027 assert(convenvvalue !=
NULL);
4028 assert(success !=
NULL);
4055 SCIPdebugMsg(scip,
"skip 1-convex underestimator since function cannot be evaluated\n");
4061 SCIPdebugMsg(scip,
"skip 1-convex underestimator since function cannot be differentiated\n");
4065 SCIPdebugMsg(scip,
"xval=%g in [%g,%g], yval=%g in [%g,%g]\n",xyref[0],xlb,xub,xyref[1],ylb,yub);
4068 if(
SCIPisGE( scip, fval_xlb_ylb+(yub-ylb)*grad_xlb_ylb[1], fval_xub_yub+(xlb-xub)*grad_xub_yub[0] ) )
4103 assert(swapped == 1);
4105 xyref_[0] = xyref[1];
4106 xyref_[1] = xyref[0];
4113 swap_buffer = all_cutcoeff[0][0];
4114 all_cutcoeff[0][0] = all_cutcoeff[0][1];
4115 all_cutcoeff[0][1] = swap_buffer;
4117 swap_buffer = all_cutcoeff[1][0];
4118 all_cutcoeff[1][0] = all_cutcoeff[1][1];
4119 all_cutcoeff[1][1] = swap_buffer;
4126 SCIPdebugMsg(scip,
"Triangulation: convenvvalue=%g\n", all_convenvvalue[0]);
4127 SCIPdebugMsg(scip,
"Parallel Y: convenvvalue=%g\n", all_convenvvalue[1]);
4132 if( all_success[0] && all_success[1] )
4135 for( i = 0; i < 2; ++i )
4143 if( all_convenvvalue[i] < lowest )
4145 lowest = all_convenvvalue[i];
4149 assert(lowestidx >= 0);
4151 *convenvvalue = all_convenvvalue[lowestidx];
4152 cutcoeff[0] = all_cutcoeff[lowestidx][0];
4153 cutcoeff[1] = all_cutcoeff[lowestidx][1];
4154 cutcoeff[2] = all_cutcoeff[lowestidx][2];
4155 cutcoeff[3] = all_cutcoeff[lowestidx][3];
4199 assert(scip !=
NULL);
4200 assert(cons !=
NULL);
4201 assert(row !=
NULL);
4204 assert(consdata !=
NULL);
4221 xy_mid[0] = 0.5 * (xlb+xub);
4222 xy_mid[1] = 0.5 * (ylb+yub);
4247 perturb(&xyref[0], xlb, xub, 0.001);
4248 perturb(&xyref[1], ylb, yub, 0.001);
4305 rhs = consdata->rhs + cutcoeff[3]/cutcoeff[2];
4310 if( consdata->z !=
NULL )
4335 assert(scip !=
NULL);
4336 assert(cons !=
NULL);
4337 assert(row !=
NULL);
4340 assert(consdata !=
NULL);
4361 SCIPdebugMsg(scip,
"convextype = %d\n",consdata->convextype);
4362 SCIPdebugMsg(scip,
"%s = %g with bounds [%g, %g], %s = %g with bounds [%g, %g]",
4365 if( consdata->z !=
NULL )
4371 switch( consdata->convextype )
4411 SCIPdebugMsg(scip,
"cut generation for convexity type not implemented\n");
4428 while( maxcoef / mincoef > cutmaxrange )
4436 SCIPdebugMsg(scip,
"cut coefficients for constraint <%s> have very large range: mincoef = %g maxcoef = %g\n",
SCIPconsGetName(cons), mincoef, maxcoef);
4439 if( mincoef == consdata->zcoef )
4441 SCIPdebugMsg(scip,
"could not eliminate small coefficient, since it comes from linear part\n");
4453 assert(var !=
NULL);
4479 SCIPdebugMsg(scip,
"could not eliminate small coefficient\n");
4499 if( maxcoef / mincoef > cutmaxrange )
4501 SCIPdebugMsg(scip,
"drop row for constraint <%s> because range of coefficients is too large: mincoef = %g, maxcoef = %g -> range = %g\n",
4532 assert(consdata !=
NULL);
4533 assert(consdata->f !=
NULL);
4535 switch( consdata->convextype )
4573 void printEstimator(
4582 const char* varnames[2] = {
"x",
"y"};
4587 assert(scip !=
NULL);
4588 assert(cons !=
NULL);
4589 assert(row !=
NULL);
4592 assert(consdata !=
NULL);
4606 if( var != x && var != y )
4612 SCIPinfoMessage(scip,
NULL,
", \"< echo '%g %g %g'\" with circles",
SCIPgetSolVal(scip, sol, x),
SCIPgetSolVal(scip, sol, y), consdata->activity);
4645 assert(scip !=
NULL);
4646 assert(conshdlr !=
NULL);
4647 assert(conss !=
NULL || nconss == 0);
4648 assert(nusefulconss <= nconss);
4649 assert(result !=
NULL);
4653 if( bestefficacy !=
NULL )
4654 *bestefficacy = 0.0;
4657 assert(conshdlrdata !=
NULL);
4659 for( c = 0; c < nconss; ++c )
4661 assert(conss !=
NULL);
4663 assert(consdata !=
NULL);
4674 SCIP_CALL(
generateCut(scip, conshdlrdata->exprinterpreter, conss[c], sol, violside, conshdlrdata->cutmaxrange, &row) );
4683 switch( conshdlrdata->scaling )
4686 efficacy = -feasibility;
4695 efficacy = -feasibility /
MAX(1.0, norm);
4704 efficacy = -feasibility /
MAX(1.0, minval);
4714 SCIPdebug( printEstimator(scip, sol, conss[c], violside, row) );
4717 if( (
SCIPisGT(scip, efficacy, minefficacy) ||
4732 SCIPdebugMsg(scip,
"added cut with efficacy %g for constraint <%s> violated by %g\n", efficacy,
SCIPconsGetName(conss[c]),
MAX(consdata->lhsviol, consdata->rhsviol));
4735 if( bestefficacy !=
NULL && efficacy > *bestefficacy )
4736 *bestefficacy = efficacy;
4739 if( inenforcement && !conshdlrdata->enfocutsremovable )
4744 SCIPdebugMsg(scip,
"abandon cut since efficacy %g is too small or not applicable\n", efficacy);
4777 assert(scip !=
NULL);
4778 assert(event !=
NULL);
4779 assert(eventdata !=
NULL);
4780 assert(eventhdlr !=
NULL);
4792 assert(conshdlrdata !=
NULL);
4795 assert(sol !=
NULL);
4805 assert(conss !=
NULL);
4811 for( c = 0; c < nconss; ++c )
4817 assert(consdata !=
NULL);
4856 assert(scip !=
NULL);
4857 assert(conss !=
NULL || nconss == 0);
4861 for( c = 0; c < nconss; ++c )
4863 assert(conss !=
NULL);
4865 assert(consdata !=
NULL);
4873 switch( consdata->convextype )
4971 assert(scip !=
NULL);
4972 assert(conss !=
NULL || nconss == 0);
4977 for( c = 0; c < nconss; ++c )
4979 assert(conss !=
NULL);
4981 assert(consdata !=
NULL);
4982 assert(consdata->f !=
NULL);
4987 for( i = 0; i < 2; ++i )
5002 if( *brvar !=
NULL )
5028 assert(scip !=
NULL);
5029 assert(conss !=
NULL || nconss == 0);
5030 assert(reduceddom !=
NULL);
5031 assert(infeasible !=
NULL);
5033 *reduceddom =
FALSE;
5034 *infeasible =
FALSE;
5036 for( c = 0; c < nconss; ++c )
5038 assert(conss !=
NULL);
5040 assert(consdata !=
NULL);
5063 if( consdata->z !=
NULL )
5068 coef = consdata->zcoef;
5071 SCIPdebugMsg(scip,
"Linear constraint with one variable: %g <= %g <%s> <= %g\n", lhs, coef,
SCIPvarGetName(consdata->z), rhs);
5102 SCIPdebugMsg(scip,
"Lower bound leads to infeasibility.\n");
5118 SCIPdebugMsg(scip,
"Upper bound leads to infeasibility.\n");
5154 assert(scip !=
NULL);
5155 assert(var !=
NULL);
5156 assert(result !=
NULL);
5158 assert(nchgbds !=
NULL);
5231 assert(scip !=
NULL);
5232 assert(cons !=
NULL);
5233 assert(result !=
NULL);
5234 assert(nchgbds !=
NULL);
5237 assert(conshdlrdata !=
NULL);
5238 assert(conshdlrdata->exprgraph !=
NULL);
5241 assert(consdata !=
NULL);
5242 assert(consdata->exprgraphnode !=
NULL);
5257 if( consdata->z !=
NULL )
5275 SCIPdebugMsg(scip,
"found constraint <%s> to be redundant: sides: [%g, %g], activity: [%g, %g]\n",
5284 SCIPdebugMsg(scip,
"found constraint <%s> to be infeasible; sides: [%g, %g], activity: [%g, %g], infeas: %g\n",
5292 if( consdata->z !=
NULL )
5352 assert(scip !=
NULL);
5353 assert(conshdlr !=
NULL);
5354 assert(conss !=
NULL || nconss == 0);
5355 assert(result !=
NULL);
5356 assert(nchgbds !=
NULL);
5357 assert(ndelconss !=
NULL);
5360 assert(conshdlrdata !=
NULL);
5361 assert(conshdlrdata->exprgraph !=
NULL);
5368 if( conshdlrdata->ispropagated )
5373 for( c = 0; c < nconss; ++c )
5375 assert(conss[c] !=
NULL);
5391 SCIPdebugMsg(scip,
"starting domain propagation round %d for %d constraints\n", roundnr, nconss);
5393 conshdlrdata->ispropagated =
TRUE;
5403 SCIPdebugMsg(scip,
"current bounds out of domain for some expression, do cutoff\n");
5411 for( c = 0; c < nconss && *result !=
SCIP_CUTOFF; ++c )
5413 assert(conss !=
NULL);
5420 *result = propresult;
5436 SCIPdebugMsg(scip,
"start backward propagation in expression graph\n");
5453 for( i = 0; i < nvars && propresult !=
SCIP_CUTOFF; ++i )
5459 *result = propresult;
5463 while( success && *result !=
SCIP_CUTOFF && ++roundnr < conshdlrdata->maxproprounds );
5492 assert(scip !=
NULL);
5493 assert(conshdlr !=
NULL);
5494 assert(conss !=
NULL || nconss == 0);
5495 assert(success !=
NULL);
5498 assert(conshdlrdata !=
NULL);
5499 assert(conshdlrdata->trysolheur !=
NULL);
5517 for( c = 0; c < nconss; ++c )
5520 assert(consdata !=
NULL);
5527 viol = consdata->lhs - consdata->activity;
5532 viol = consdata->rhs - consdata->activity;
5537 assert(viol != 0.0);
5538 if( consdata->mayincreasez &&
5539 ((viol > 0.0 && consdata->zcoef > 0.0) || (viol < 0.0 && consdata->zcoef < 0.0)) )
5544 delta = viol / consdata->zcoef;
5545 assert(delta > 0.0);
5550 delta =
MIN(
MAX(0.0, gap), delta);
5562 viol -= consdata->zcoef * delta;
5568 assert(viol != 0.0);
5569 if( consdata->maydecreasez &&
5570 ((viol > 0.0 && consdata->zcoef < 0.0) || (viol < 0.0 && consdata->zcoef > 0.0)) )
5575 delta = viol / consdata->zcoef;
5576 assert(delta < 0.0);
5581 delta =
MAX(
MIN(0.0, gap), delta);
5592 viol -= consdata->zcoef * delta;
5658 assert(scip !=
NULL);
5659 assert(srccons !=
NULL);
5660 assert(cons !=
NULL);
5661 assert(name !=
NULL);
5667 if( coefxx >= 0 && coefyy >= 0 && 4 * coefxx * coefyy >= coefxy * coefxy )
5673 else if( coefxx <= 0 && coefyy <= 0 && 4 * coefxx * coefyy >= coefxy * coefxy )
5679 else if( coefxx > 0 && coefyy > 0 )
5682 assert(4 * coefxx * coefyy < coefxy * coefxy);
5686 else if( coefxx < 0 && coefyy < 0 )
5689 assert(4 * coefxx * coefyy < coefxy * coefxy);
5696 assert(coefxx * coefyy <= 0);
5708 else if( coefyy != 0.0 )
5722 assert(coefxy != 0.0);
5730 lincoefs[0] = coefx * mult;
5731 lincoefs[1] = coefy * mult;
5736 quadelems[nquadelems].
idx1 = 0;
5737 quadelems[nquadelems].
idx2 = 0;
5738 quadelems[nquadelems].
coef = coefxx * mult;
5743 quadelems[nquadelems].
idx1 = 1;
5744 quadelems[nquadelems].
idx2 = 1;
5745 quadelems[nquadelems].
coef = coefyy * mult;
5750 quadelems[nquadelems].
idx1 = 0;
5751 quadelems[nquadelems].
idx2 = 1;
5752 quadelems[nquadelems].
coef = coefxy * mult;
5775 assert(mult == 1.0);
5778 SCIPdebugMsg(scip,
"upgrading constraint <%s> to bivariate constraint <%s> with convexity type %d\n",
SCIPconsGetName(srccons), name, convextype);
5781 exprtree, convextype, z, coefz, lhs, rhs,
5815 assert(scip !=
NULL);
5821 assert(exprtree !=
NULL);
5822 assert(mult !=
NULL);
5823 assert(convextype !=
NULL);
5826 *mult = coef < 0.0 ? -1.0 : 1.0;
5829 if( (p + q >= 1.0 && ((p > 1.0 && q < 0.0) || (p < 0.0 && q > 1.0))) ||
5830 (p < 0.0 && q < 0.0) )
5834 else if( (p > 1.0 && q > 1.0) || (p + q < 1.0 && ((p > 1.0 && q < 0.0) || (p < 0.0 && q > 1.0))) )
5838 else if( (p < 0.0 || p > 1.0) && q > 0.0 && q < 1.0 )
5842 else if( (p < 0.0 || p > 1.0) && q == 1.0 )
5848 else if( (q < 0.0 || q > 1.0) && p > 0.0 && p <= 1.0 )
5853 else if( p > 0.0 && p < 1.0 && q > 0.0 && q < 1.0 && p + q > 1.0 )
5858 else if( p == 1.0 && q > 0.0 && q < 1.0 )
5862 else if( q == 1.0 && p > 0.0 && p < 1.0 )
5867 else if( p == 1.0 && q == 1.0 )
5871 else if( p > 0.0 && p < 1.0 && q > 0.0 && q < 1.0 && p + q <= 1.0 )
5900 assert( e !=
NULL );
5932 assert(scip !=
NULL);
5933 assert(cons !=
NULL);
5934 assert(name !=
NULL);
5955 assert(mult == 1.0);
5958 SCIPdebugMsg(scip,
"upgrading monomial %g<%s>^%g<%s>^%g from constraint <%s> to bivariate constraint with convexity type %d\n",
5961 if( srccons !=
NULL )
5964 exprtree, convextype, z, zcoef, lhs, rhs,
5973 exprtree, convextype, z, zcoef, lhs, rhs,
6008 assert(scip !=
NULL);
6009 assert(conshdlr !=
NULL);
6010 assert(conss !=
NULL || nconss == 0);
6011 assert(result !=
NULL);
6014 assert(conshdlrdata !=
NULL);
6017 if( maxviolcons ==
NULL )
6034 if( conshdlrdata->nenforounds > 100 )
6047 ++conshdlrdata->nenforounds;
6052 conshdlrdata->nenforounds = 0;
6056 assert(consdata !=
NULL);
6057 maxviol = consdata->lhsviol + consdata->rhsviol;
6061 sol ==
NULL ?
"LP" :
"relaxation");
6068 *result = propresult;
6077 minefficacy =
MIN(0.75*maxviol, conshdlrdata->mincutefficacyenfo);
6083 SCIPdebugMessage(
"separation succeeded (bestefficacy = %g, minefficacy = %g, cutoff = %d)\n", sepaefficacy,
6085 *result = separateresult;
6093 SCIPdebugMsg(scip,
"separation failed (bestefficacy = %g < %g = minefficacy ); max viol: %g\n", sepaefficacy,
6094 minefficacy, maxviol);
6101 if( nnotify == 0 && !solinfeasible && minefficacy > leastpossibleefficacy )
6105 &separateresult, &sepaefficacy) );
6108 *result = separateresult;
6113 if( nnotify == 0 && !solinfeasible )
6135 else if ( reduceddom )
6140 SCIPwarningMessage(scip,
"could not enforce feasibility by separating or branching; declaring solution with viol %g as feasible\n", maxviol);
6146 SCIPdebugMsg(scip,
"Could not find any usual branching variable candidate. Proposed variable <%s> with LP value %g for branching.\n",
6164 assert(scip !=
NULL);
6165 assert(conshdlr !=
NULL);
6182 assert(scip !=
NULL);
6183 assert(conshdlr !=
NULL);
6186 assert(conshdlrdata !=
NULL);
6187 assert(conshdlrdata->exprinterpreter !=
NULL);
6188 assert(conshdlrdata->exprgraph !=
NULL);
6194 if( conshdlrdata->exprinterpreter !=
NULL )
6210 assert(scip !=
NULL);
6211 assert(conshdlr !=
NULL);
6214 assert(conshdlrdata !=
NULL);
6216 conshdlrdata->subnlpheur =
SCIPfindHeur(scip,
"subnlp");
6217 conshdlrdata->trysolheur =
SCIPfindHeur(scip,
"trysol");
6228 assert(scip !=
NULL);
6229 assert(conshdlr !=
NULL);
6232 assert(conshdlrdata !=
NULL);
6234 conshdlrdata->subnlpheur =
NULL;
6235 conshdlrdata->trysolheur =
NULL;
6247 assert(scip !=
NULL);
6248 assert(conss !=
NULL || nconss == 0);
6250 for( c = 0; c < nconss; ++c )
6253 assert(consdata !=
NULL);
6256 consdata->mayincreasez =
FALSE;
6257 consdata->maydecreasez =
FALSE;
6278 assert(scip !=
NULL);
6279 assert(conss !=
NULL || nconss == 0);
6282 assert(conshdlrdata !=
NULL);
6284 if( !conshdlrdata->isremovedfixings )
6287 assert(conshdlrdata->isremovedfixings);
6291 for( c = 0; c < nconss; ++c )
6293 assert(conss !=
NULL);
6294 assert(conss[c] !=
NULL);
6302 assert(consdata !=
NULL);
6304 assert(consdata->f !=
NULL);
6324 #ifdef TYPESTATISTICS 6329 assert(scip !=
NULL);
6330 assert(conss !=
NULL || nconss == 0);
6333 assert(conshdlrdata !=
NULL);
6335 #ifdef TYPESTATISTICS 6340 for( c = 0; c < nconss; ++c )
6342 assert(conss[c] !=
NULL);
6345 assert(consdata !=
NULL);
6348 if( consdata->z !=
NULL )
6353 if( consdata->zcoef > 0.0 )
6367 consdata->maydecreasez =
TRUE;
6374 consdata->mayincreasez =
TRUE;
6385 consdata->z !=
NULL ? 1 : 0, consdata->z !=
NULL ? &consdata->z :
NULL, &consdata->zcoef,
6387 consdata->f, consdata->lhs, consdata->rhs,
6397 #ifdef TYPESTATISTICS 6399 ++nconvextypeslhs[consdata->convextype];
6401 ++nconvextypesrhs[consdata->convextype];
6405 conshdlrdata->newsoleventfilterpos = -1;
6411 assert(eventhdlr !=
NULL);
6415 #ifdef TYPESTATISTICS 6418 const char*
typename;
6422 typename =
"allconvex";
6425 typename =
"1-convex";
6428 typename =
"convex-concave";
6432 typename =
"unknown";
6441 conshdlrdata->lastenfonode =
NULL;
6442 conshdlrdata->nenforounds = 0;
6454 assert(scip !=
NULL);
6455 assert(conss !=
NULL || nconss == 0);
6458 assert(conshdlrdata !=
NULL);
6460 if( conshdlrdata->newsoleventfilterpos >= 0 )
6465 assert(eventhdlr !=
NULL);
6468 conshdlrdata->newsoleventfilterpos = -1;
6471 for( c = 0; c < nconss; ++c )
6474 assert(conss[c] !=
NULL);
6490 assert(scip !=
NULL);
6491 assert(cons !=
NULL);
6492 assert(consdata !=
NULL);
6496 assert(conshdlrdata !=
NULL);
6500 assert((*consdata)->exprgraphnode ==
NULL);
6502 if( (*consdata)->f !=
NULL )
6523 assert(sourcedata !=
NULL);
6526 assert(targetdata->eventfilterpos == -1);
6528 assert(sourcedata->f !=
NULL);
6533 if( sourcedata->z !=
NULL )
6565 assert(scip !=
NULL);
6566 assert(conshdlr !=
NULL);
6567 assert(conss !=
NULL || nconss == 0);
6570 assert(conshdlrdata !=
NULL);
6572 *infeasible =
FALSE;
6574 nref = conshdlrdata->ninitlprefpoints;
6578 SCIPdebugMsg(scip,
"skip LP initialization since ninitlprefpoints is 0\n");
6585 for( c = 0; c < nconss; ++c )
6587 assert(conss[c] !=
NULL);
6590 assert(consdata !=
NULL);
6591 assert(consdata->f !=
NULL);
6602 for( i = 0; i < 2; ++i )
6607 unbounded[i] =
FALSE;
6610 unbounded[i] =
TRUE;
6617 lb[i] = 2.0 * ub[i];
6621 unbounded[i] =
TRUE;
6629 ub[i] = 2.0 * lb[i];
6633 for( ix = 0; ix < nref; ++ix )
6636 xy[0] = lb[0] + ix * (ub[0] - lb[0]) / (nref - 1.0);
6638 xy[0] = (lb[0] + ub[0]) / 2.0;
6640 for( iy = 0; iy < nref; ++iy )
6643 xy[1] = lb[1] + iy * (ub[1] - lb[1]) / (nref - 1.0);
6645 xy[1] = (lb[1] + ub[1]) / 2.0;
6647 SCIPdebugMsg(scip,
"cons <%s>: generate cuts for <%s> = %g [%g,%g], <%s> = %g [%g,%g]\n",
6656 switch( consdata->convextype )
6660 if( !
SCIPisInfinity(scip, -consdata->lhs) && !unbounded[0] && !unbounded[1] && (ix == 0 || ix == nref-1) && (iy == 0 || iy == nref-1) )
6693 if( !
SCIPisInfinity(scip, -consdata->lhs) && !unbounded[0] && !unbounded[1] && (ix == 0 || ix == nref-1) && (iy == 0 || iy == nref-1) )
6701 if( !
SCIPisInfinity(scip, consdata->rhs) && !unbounded[0] && !unbounded[1] )
6710 SCIPwarningMessage(scip,
"initlp for convexity type %d not implemented\n", consdata->convextype);
6719 SCIPdebugMsg(scip,
"drop row1 for constraint <%s> because range of coefficients is too large: mincoef = %g, maxcoef = %g -> range = %g\n",
6741 SCIPdebugMsg(scip,
"drop row2 for constraint <%s> because range of coefficients is too large: mincoef = %g, maxcoef = %g -> range = %g\n",
6751 else if( !(*infeasible) )
6775 assert(scip !=
NULL);
6776 assert(conshdlr !=
NULL);
6777 assert(conss !=
NULL || nconss == 0);
6778 assert(result !=
NULL);
6783 assert(conshdlrdata !=
NULL);
6786 if( maxviolcon ==
NULL )
6803 assert(scip !=
NULL);
6804 assert(conshdlr !=
NULL);
6805 assert(conss !=
NULL || nconss == 0);
6806 assert(sol !=
NULL);
6807 assert(result !=
NULL);
6810 assert(conshdlrdata !=
NULL);
6815 if( maxviolcon ==
NULL )
6855 assert(scip !=
NULL);
6856 assert(conss !=
NULL || nconss == 0);
6859 if( maxviolcons ==
NULL )
6874 *result = propresult;
6883 for( c = 0; c < nconss; ++c )
6885 assert(conss !=
NULL);
6887 assert(consdata !=
NULL);
6888 assert(consdata->f !=
NULL);
6902 for( i = 0; i < 2; ++i )
6915 SCIPdebugMsg(scip,
"All variables in violated constraints fixed (up to epsilon). Cannot find branching candidate. Forcing solution of LP.\n");
6933 assert(scip !=
NULL);
6934 assert(conss !=
NULL || nconss == 0);
6935 assert(sol !=
NULL);
6936 assert(result !=
NULL);
6939 assert(conshdlrdata !=
NULL);
6944 maypropfeasible = conshdlrdata->linfeasshift && (conshdlrdata->trysolheur !=
NULL);
6945 for( c = 0; c < nconss; ++c )
6947 assert(conss !=
NULL);
6951 assert(consdata !=
NULL);
6961 SCIPinfoMessage(scip,
NULL,
"violation: left hand side is violated by %.15g (scaled: %.15g)\n", consdata->lhs - consdata->activity, consdata->lhsviol);
6965 SCIPinfoMessage(scip,
NULL,
"violation: right hand side is violated by %.15g (scaled: %.15g)\n", consdata->activity - consdata->rhs, consdata->rhsviol);
6969 if( (conshdlrdata->subnlpheur ==
NULL || sol ==
NULL) && !maypropfeasible && !completely )
6972 if( consdata->lhsviol > maxviol || consdata->rhsviol > maxviol )
6973 maxviol = consdata->lhsviol + consdata->rhsviol;
6977 maypropfeasible =
FALSE;
6979 if( maypropfeasible )
6985 if( !(consdata->mayincreasez && consdata->zcoef > 0.0) && !(consdata->maydecreasez && consdata->zcoef < 0.0) )
6986 maypropfeasible =
FALSE;
6993 if( !(consdata->mayincreasez && consdata->zcoef < 0.0) && !(consdata->maydecreasez && consdata->zcoef > 0.0) )
6994 maypropfeasible =
FALSE;
7025 assert(scip !=
NULL);
7026 assert(conshdlr !=
NULL);
7027 assert(conss !=
NULL || nconss == 0);
7028 assert(result !=
NULL);
7049 assert(scip !=
NULL);
7050 assert(conshdlr !=
NULL);
7051 assert(conss !=
NULL || nconss == 0);
7052 assert(result !=
NULL);
7057 assert(conshdlrdata !=
NULL);
7058 assert(conshdlrdata->exprgraph !=
NULL);
7060 if( !conshdlrdata->isremovedfixings )
7063 assert(conshdlrdata->isremovedfixings);
7067 for( c = 0; c < nconss; ++c )
7069 assert(conss !=
NULL);
7073 assert(consdata !=
NULL);
7097 switch( propresult )
7103 SCIPdebugMsg(scip,
"propagation says problem is infeasible in presolve\n");
7119 assert(scip !=
NULL);
7120 assert(cons !=
NULL);
7123 assert(consdata !=
NULL);
7125 if( consdata->z !=
NULL )
7127 if( consdata->zcoef > 0 )
7163 assert(scip !=
NULL);
7164 assert(conshdlr !=
NULL);
7165 assert(cons !=
NULL);
7169 assert(conshdlrdata !=
NULL);
7170 assert(conshdlrdata->exprgraph !=
NULL);
7173 assert(consdata !=
NULL);
7174 assert(consdata->exprgraphnode ==
NULL);
7180 assert(consdata->exprgraphnode !=
NULL);
7206 assert(scip !=
NULL);
7207 assert(conshdlr !=
NULL);
7208 assert(cons !=
NULL);
7212 assert(conshdlrdata !=
NULL);
7213 assert(conshdlrdata->exprgraph !=
NULL);
7216 assert(consdata !=
NULL);
7217 assert(consdata->exprgraphnode !=
NULL);
7233 assert(scip !=
NULL);
7234 assert(conshdlr !=
NULL);
7235 assert(cons !=
NULL);
7240 assert(conshdlrdata !=
NULL);
7241 assert(conshdlrdata->exprgraph !=
NULL);
7244 assert(consdata !=
NULL);
7245 assert(consdata->exprgraphnode !=
NULL);
7265 assert(scip !=
NULL);
7266 assert(conshdlr !=
NULL);
7267 assert(cons !=
NULL);
7271 assert(conshdlrdata !=
NULL);
7272 assert(conshdlrdata->exprgraph !=
NULL);
7275 assert(consdata !=
NULL);
7276 assert(consdata->exprgraphnode !=
NULL);
7294 assert(scip !=
NULL);
7295 assert(cons !=
NULL);
7298 assert(consdata !=
NULL);
7303 && !
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
7309 if( consdata->z !=
NULL )
7316 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
7334 switch( consdata->convextype )
7360 assert(scip !=
NULL);
7361 assert(cons !=
NULL);
7362 assert(sourcescip !=
NULL);
7363 assert(sourceconshdlr !=
NULL);
7364 assert(sourcecons !=
NULL);
7365 assert(varmap !=
NULL);
7366 assert(valid !=
NULL);
7369 assert(consdata !=
NULL);
7370 assert(consdata->f !=
NULL);
7374 if( consdata->z !=
NULL )
7377 assert(!*valid || z !=
NULL);
7385 assert(!*valid || xy[0] !=
NULL);
7391 assert(!*valid || xy[1] !=
NULL);
7405 f, consdata->convextype, z, consdata->zcoef, consdata->lhs, consdata->rhs,
7406 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
7428 assert(cons !=
NULL);
7429 assert(vars !=
NULL);
7432 assert(consdata !=
NULL);
7436 vars[2] = consdata->z;
7479 assert(nupgdconss !=
NULL);
7480 assert(upgdconss !=
NULL);
7485 if( nbinquad + nintquad + ncontquad < 2 )
7498 x = quadvarterms[0].
var;
7499 y = quadvarterms[1].
var;
7501 coefxx = quadvarterms[0].
sqrcoef;
7502 coefyy = quadvarterms[1].
sqrcoef;
7505 if( coefxx == 0.0 && coefyy == 0.0 )
7509 if( nbilinterms == 0 )
7511 assert(nbilinterms == 1);
7513 assert(bilinterms[0].var1 == x || bilinterms[0].var1 == y);
7514 assert(bilinterms[0].var2 == x || bilinterms[0].var2 == y);
7516 coefxy = bilinterms[0].
coef;
7518 coefx = quadvarterms[0].
lincoef;
7519 coefy = quadvarterms[1].
lincoef;
7533 if( upgdconsssize < 1 )
7540 x, y, z, coefxx, coefx, coefyy, coefy, coefxy, zcoef,
SCIPgetLhsQuadratic(scip, cons),
SCIPgetRhsQuadratic(scip, cons)) );
7565 for( i = 0; i < nquadvarterms; ++i )
7566 if( quadvarterms[i].sqrcoef != 0.0 && quadvarterms[i].nadjbilin > 0 )
7570 if( i == nquadvarterms )
7595 if( !upgdlhs && !upgdrhs )
7599 if( upgdconsssize < nbilinterms + 1 + (keeporig ? 1 : 0) )
7601 *nupgdconss = -(nbilinterms + 1 + (keeporig ? 1 : 0));
7622 for( i = 0; i < nbilinterms; ++i )
7624 assert(bilinterms[i].coef != 0.0);
7626 x = bilinterms[i].
var1;
7627 y = bilinterms[i].
var2;
7631 assert(xpos < nquadvarterms);
7632 assert(quadvarterms[xpos].var == x);
7636 assert(ypos < nquadvarterms);
7637 assert(quadvarterms[ypos].var == y);
7639 coefxx = marked[xpos] ? 0.0 : quadvarterms[xpos].
sqrcoef;
7640 coefyy = marked[ypos] ? 0.0 : quadvarterms[ypos].
sqrcoef;
7645 if( coefxx == 0.0 && coefyy == 0.0 )
7664 coefx = marked[xpos] ? 0.0 : quadvarterms[xpos].
lincoef;
7665 coefy = marked[ypos] ? 0.0 : quadvarterms[ypos].
lincoef;
7666 coefxy = bilinterms[i].
coef;
7678 assert(*nupgdconss < upgdconsssize);
7681 x, y, auxvar, coefxx, coefx, coefyy, coefy, coefxy, -1.0,
7690 #ifdef SCIP_DEBUG_SOLUTION 7691 if( SCIPdebugIsMainscip(scip) )
7697 SCIP_CALL(
SCIPdebugAddSolVal(scip, auxvar, coefxx * xval * xval + coefyy * yval * yval + coefxy * xval * yval + coefx * xval + coefy * yval) );
7703 marked[xpos] =
TRUE;
7704 marked[ypos] =
TRUE;
7707 if( *nupgdconss == 0 )
7715 for( i = 0; i < nquadvarterms; ++i )
7720 x = quadvarterms[i].
var;
7726 if( quadvarterms[i].nadjbilin > 0 )
7732 if( quadvarterms[i].sqrcoef != 0.0 )
7744 else if( quadvarterms[i].lincoef != 0.0 )
7752 assert(*nupgdconss < upgdconsssize);
7753 upgdconss[*nupgdconss] = quadcons;
7760 assert(*nupgdconss < upgdconsssize);
7799 assert(scip !=
NULL);
7800 assert(exprgraph !=
NULL);
7801 assert(node !=
NULL);
7802 assert(naddcons !=
NULL);
7803 assert(reformnode !=
NULL);
7821 assert(monomial !=
NULL);
7848 SCIPdebugMsg(scip,
"reformulate bivariate monomial in node %p\n", (
void*)node);
7868 #ifdef SCIP_DEBUG_SOLUTION 7869 if( SCIPdebugIsMainscip(scip) )
7900 consEnfolpBivariate, consEnfopsBivariate, consCheckBivariate, consLockBivariate,
7903 assert(conshdlr !=
NULL);
7939 "minimal efficacy for a cut to be added to the LP during separation; overwrites separating/efficacy",
7943 "minimal target efficacy of a cut in order to add it to relaxation during enforcement (may be ignored)",
7947 "maximal coef range of a cut (maximal coefficient divided by minimal coefficient) in order to be added to LP relaxation",
7951 "whether to try to make solutions in check function feasible by shifting a linear variable (esp. useful if constraint was actually objective function)",
7955 "limit on number of propagation rounds for a single constraint within one round of SCIP propagation",
7956 &conshdlrdata->maxproprounds,
FALSE, 1, 0, INT_MAX,
NULL,
NULL) );
7959 "number of reference points in each direction where to compute linear support for envelope in LP initialization",
7960 &conshdlrdata->ninitlprefpoints,
FALSE, 3, 0, INT_MAX,
NULL,
NULL) );
7963 "are cuts added during enforcement removable from the LP in the same node?",
7967 "whether scaling of infeasibility is 'o'ff, by sup-norm of function 'g'radient, or by left/right hand 's'ide",
7968 &conshdlrdata->scaling,
TRUE,
'o',
"ogs",
NULL,
NULL) );
7970 conshdlrdata->linvareventhdlr =
NULL;
7972 processLinearVarEvent,
NULL) );
7973 assert(conshdlrdata->linvareventhdlr !=
NULL);
7975 conshdlrdata->nonlinvareventhdlr =
NULL;
7978 assert(conshdlrdata->nonlinvareventhdlr !=
NULL);
7981 processNewSolutionEvent,
NULL) );
7988 exprgraphVarAdded, exprgraphVarRemove,
NULL, (
void*)conshdlrdata) );
7989 conshdlrdata->isremovedfixings =
TRUE;
7990 conshdlrdata->ispropagated =
TRUE;
7992 conshdlrdata->scip = scip;
8041 assert(modifiable ==
FALSE);
8045 if( conshdlr ==
NULL )
8056 consdata->convextype = convextype;
8058 consdata->zcoef = zcoef;
8059 consdata->lhs = lhs;
8060 consdata->rhs = rhs;
8068 consdata->eventfilterpos = -1;
8071 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
8072 local, modifiable, dynamic, removable, stickingatnode) );
8097 assert(scip !=
NULL);
8111 assert(cons !=
NULL);
8123 assert(cons !=
NULL);
8135 assert(cons !=
NULL);
8147 assert(cons !=
NULL);
8159 assert(cons !=
NULL);
enum SCIP_Result SCIP_RESULT
static SCIP_DECL_CONSENFOLP(consEnfolpBivariate)
SCIP_VAR ** SCIPgetLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLinearCoefBivariate(SCIP *scip, SCIP_CONS *cons)
void SCIPintervalDivScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
SCIP_Real SCIPexprgraphGetNodeVal(SCIP_EXPRGRAPHNODE *node)
static SCIP_RETCODE createExprtreeFromMonomial(SCIP *scip, SCIP_VAR *x, SCIP_VAR *y, SCIP_Real coef, SCIP_Real p, SCIP_Real q, SCIP_EXPRTREE **exprtree, SCIP_Real *mult, SCIP_BIVAR_CONVEXITY *convextype)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPexprgraphPropagateVarBounds(SCIP_EXPRGRAPH *exprgraph, SCIP_Real infinity, SCIP_Bool clearreverseprop, SCIP_Bool *domainerror)
void SCIPexprFreeDeep(BMS_BLKMEM *blkmem, SCIP_EXPR **expr)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
SCIP_RETCODE SCIPexprgraphReplaceVarByLinearSum(SCIP_EXPRGRAPH *exprgraph, void *var, int ncoefs, SCIP_Real *coefs, void **vars, SCIP_Real constant)
static SCIP_RETCODE catchLinearVarEvents(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE computeViolation(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_SOL *sol)
SCIP_RETCODE SCIPincludeNonlinconsUpgrade(SCIP *scip, SCIP_DECL_NONLINCONSUPGD((*nonlinconsupgd)), SCIP_DECL_EXPRGRAPHNODEREFORM((*nodereform)), int priority, SCIP_Bool active, const char *conshdlrname)
static SCIP_RETCODE generateConvexConcaveEstimator(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_CONS *cons, SCIP_Real xyref[2], SCIP_SIDETYPE violside, SCIP_ROW **row)
SCIP_Real SCIPfeastol(SCIP *scip)
void SCIPexprgraphSetVarNodeValue(SCIP_EXPRGRAPHNODE *varnode, SCIP_Real value)
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
SCIP_RETCODE SCIPexprSubstituteVars(BMS_BLKMEM *blkmem, SCIP_EXPR *expr, SCIP_EXPR **substexprs)
SCIP_Bool SCIPintervalIsEmpty(SCIP_Real infinity, SCIP_INTERVAL operand)
primal heuristic that tries a given solution
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
SCIP_RETCODE SCIPaddQuadVarQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real lincoef, SCIP_Real sqrcoef)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
static SCIP_DECL_CONSPRESOL(consPresolBivariate)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_QUADCONSUPGD(quadconsUpgdBivariate)
static SCIP_RETCODE initSepaData(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_CONS *cons)
SCIP_RETCODE SCIPexprgraphAddVars(SCIP_EXPRGRAPH *exprgraph, int nvars, void **vars, SCIP_EXPRGRAPHNODE **varnodes)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
methods to interpret (evaluate) an expression tree "fast"
static SCIP_RETCODE registerLargeRelaxValueVariableForBranching(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_VAR **brvar)
#define SCIP_EVENTTYPE_VARFIXED
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
void SCIPexprtreePrint(SCIP_EXPRTREE *tree, SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char **varnames, const char **paramnames)
SCIP_RETCODE SCIPincSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var, SCIP_Real incval)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
SCIP_RETCODE SCIPcreateConsBivariate(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_EXPRTREE *f, SCIP_BIVAR_CONVEXITY convextype, SCIP_VAR *z, 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)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_EXPRGRAPHNODEREFORM(exprgraphnodeReformBivariate)
SCIP_RETCODE SCIPaddSquareCoefQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
static SCIP_RETCODE generateOverestimatingHyperplaneCut(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_CONS *cons, SCIP_Real *x0y0, SCIP_ROW **row)
#define CONSHDLR_NEEDSCONS
SCIP_Real SCIPgetRhsBivariate(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE propagateBoundsCons(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_RESULT *result, int *nchgbds, SCIP_Bool *redundant)
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)
int SCIPexprgraphGetNodeNChildren(SCIP_EXPRGRAPHNODE *node)
SCIP_EXPROP SCIPexprGetOperator(SCIP_EXPR *expr)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
int SCIPexprgraphGetNVars(SCIP_EXPRGRAPH *exprgraph)
SCIP_RETCODE SCIPincludeQuadconsUpgrade(SCIP *scip, SCIP_DECL_QUADCONSUPGD((*quadconsupgd)), int priority, SCIP_Bool active, const char *conshdlrname)
static SCIP_RETCODE dropLinearVarEvents(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
static SCIP_RETCODE removeFixedNonlinearVariables(SCIP *scip, SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
int SCIProwGetNNonz(SCIP_ROW *row)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
internal methods for NLPI solver interfaces
SCIP_RETCODE SCIPsetConshdlrDeactive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
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)
static SCIP_RETCODE computeViolations(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_CONS **maxviolcon)
SCIP_RETCODE SCIPexprCreateMonomial(BMS_BLKMEM *blkmem, SCIP_EXPRDATA_MONOMIAL **monomial, SCIP_Real coef, int nfactors, int *childidxs, SCIP_Real *exponents)
void SCIPexprgraphSetVarNodeBounds(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *varnode, SCIP_INTERVAL varbounds)
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_RESULT *result, SCIP_Real *bestefficacy)
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyBivariate)
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
#define CONSHDLR_PROP_TIMING
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPgetRelaxFeastolFactor(SCIP *scip)
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
void SCIPexprgraphPropagateNodeBounds(SCIP_EXPRGRAPH *exprgraph, SCIP_Real infinity, SCIP_Real minstrength, SCIP_Bool *cutoff)
SCIP_Real SCIProwGetLhs(SCIP_ROW *row)
SCIP_RETCODE SCIPcreateConsBasicBivariate(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_EXPRTREE *f, SCIP_BIVAR_CONVEXITY convextype, SCIP_VAR *z, SCIP_Real zcoef, SCIP_Real lhs, SCIP_Real rhs)
#define CONSHDLR_SEPAPRIORITY
SCIP_EXPRGRAPHNODE ** SCIPexprgraphGetVarNodes(SCIP_EXPRGRAPH *exprgraph)
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 SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPunmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
enum SCIP_Retcode SCIP_RETCODE
#define infty2infty(infty1, infty2, val)
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
static SCIP_DECL_CONSCHECK(consCheckBivariate)
SCIP_RETCODE SCIPexprtreeCopy(BMS_BLKMEM *blkmem, SCIP_EXPRTREE **targettree, SCIP_EXPRTREE *sourcetree)
SCIP_RETCODE SCIPexprintCompile(SCIP_EXPRINT *exprint, SCIP_EXPRTREE *tree)
SCIP_INTERVAL SCIPexprgraphGetNodeBounds(SCIP_EXPRGRAPHNODE *node)
void SCIPexprReindexVars(SCIP_EXPR *expr, int *newindices)
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
static SCIP_RETCODE solveDerivativeEquation(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_EXPRTREE *f, SCIP_Real targetvalue, SCIP_Real lb, SCIP_Real ub, SCIP_Real *val, SCIP_Bool *success)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
static SCIP_DECL_CONSGETNVARS(consGetNVarsBivariate)
SCIP_RETCODE SCIPexprtreeSetVars(SCIP_EXPRTREE *tree, int nvars, SCIP_VAR **vars)
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
#define SCIPfreeBlockMemory(scip, ptr)
#define CONSHDLR_ENFOPRIORITY
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
SCIP_Bool SCIPintervalIsNegativeInfinity(SCIP_Real infinity, SCIP_INTERVAL operand)
SCIP_EVENTHDLR * SCIPfindEventhdlr(SCIP *scip, const char *name)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
SCIP_RETCODE SCIPexprgraphAddExprtreeSum(SCIP_EXPRGRAPH *exprgraph, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *coefs, SCIP_EXPRGRAPHNODE **rootnode, SCIP_Bool *rootnodeisnew)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPincludeConshdlrBivariate(SCIP *scip)
static SCIP_RETCODE createConsFromMonomial(SCIP *scip, SCIP_CONS *srccons, SCIP_CONS **cons, const char *name, SCIP_VAR *x, SCIP_VAR *y, SCIP_VAR *z, SCIP_Real coef, SCIP_Real p, SCIP_Real q, SCIP_Real zcoef, SCIP_Real lhs, SCIP_Real rhs)
static SCIP_DECL_CONSACTIVE(consActiveBivariate)
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_RETCODE generate1ConvexIndefiniteUnderestimatorAtBoundary(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_EXPRTREE *f, SCIP_Real xyref[2], SCIP_Real cutcoeff[4], SCIP_Real *convenvvalue, SCIP_Bool *success)
static SCIP_RETCODE generateOrthogonal_lx_ly_Underestimator(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_EXPRTREE *f, SCIP_Real *xyref, SCIP_Real cutcoeff[4], SCIP_Real *convenvvalue, SCIP_Bool *success)
#define SCIPfreeBufferArray(scip, ptr)
static SCIP_RETCODE createConsFromQuadTerm(SCIP *scip, SCIP_CONS *srccons, SCIP_CONS **cons, const char *name, SCIP_VAR *x, SCIP_VAR *y, SCIP_VAR *z, SCIP_Real coefxx, SCIP_Real coefx, SCIP_Real coefyy, SCIP_Real coefy, SCIP_Real coefxy, SCIP_Real coefz, SCIP_Real lhs, SCIP_Real rhs)
SCIP_Real SCIPadjustedVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real lb)
#define SCIPallocBlockMemory(scip, ptr)
void SCIPexprtreeSetParamVal(SCIP_EXPRTREE *tree, int paramidx, SCIP_Real paramval)
#define SCIPdebugPrintCons(x, y, z)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
#define SCIP_EVENTTYPE_BOUNDCHANGED
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
#define SCIPdebugMsgPrint
SCIP_RETCODE SCIPaddIntParam(SCIP *scip, const char *name, const char *desc, int *valueptr, SCIP_Bool isadvanced, int defaultvalue, int minvalue, int maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
SCIP_Real SCIPgetLhsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPexprgraphFree(SCIP_EXPRGRAPH **exprgraph)
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_VAR ** SCIPexprtreeGetVars(SCIP_EXPRTREE *tree)
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)
SCIP_Real SCIPepsilon(SCIP *scip)
int SCIPexprgraphGetNodePolynomialNMonomials(SCIP_EXPRGRAPHNODE *node)
#define SCIP_PRESOLTIMING_FAST
SCIP_Real SCIPgetRowMaxCoef(SCIP *scip, SCIP_ROW *row)
SCIP_RETCODE SCIPaddLinearVarQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
SCIP_RETCODE SCIPcreateConsQuadratic(SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadterms, SCIP_VAR **quadvars1, SCIP_VAR **quadvars2, SCIP_Real *quadcoefs, 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)
int SCIPgetNQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE registerBranchingVariables(SCIP *scip, SCIP_CONS **conss, int nconss, int *nnotify)
#define SCIP_EVENTTYPE_LBCHANGED
SCIP_Bool SCIPintervalIsPositiveInfinity(SCIP_Real infinity, SCIP_INTERVAL operand)
int SCIPexprGetMonomialNFactors(SCIP_EXPRDATA_MONOMIAL *monomial)
SCIP_RETCODE SCIPexprtreePrintWithNames(SCIP_EXPRTREE *tree, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
static SCIP_DECL_CONSENFORELAX(consEnforelaxBivariate)
SCIP_EXPRTREE * SCIPgetExprtreeBivariate(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNBilinTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
#define CONSHDLR_DELAYPROP
SCIP_RETCODE SCIPheurPassSolTrySol(SCIP *scip, SCIP_HEUR *heur, SCIP_SOL *sol)
SCIP_EXPROP SCIPexprgraphGetNodeOperator(SCIP_EXPRGRAPHNODE *node)
static SCIP_DECL_CONSPROP(consPropBivariate)
SCIP_EXPRDATA_MONOMIAL ** SCIPexprgraphGetNodePolynomialMonomials(SCIP_EXPRGRAPHNODE *node)
SCIP_RETCODE SCIPexprgraphCreate(BMS_BLKMEM *blkmem, SCIP_EXPRGRAPH **exprgraph, int varssizeinit, int depthinit, SCIP_DECL_EXPRGRAPHVARADDED((*exprgraphvaradded)), SCIP_DECL_EXPRGRAPHVARREMOVE((*exprgraphvarremove)), SCIP_DECL_EXPRGRAPHVARCHGIDX((*exprgraphvarchgidx)), void *userdata)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_VAR * SCIPvarGetProbvar(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrInitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITSOL((*consinitsol)))
SCIP_Bool SCIPisConcaveQuadratic(SCIP *scip, SCIP_CONS *cons)
#define SCIP_EVENTTYPE_SOLFOUND
SCIP_Real SCIPeventGetNewbound(SCIP_EVENT *event)
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
#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_EXPRCURV SCIPexprgraphGetNodeCurvature(SCIP_EXPRGRAPHNODE *node)
SCIP_RETCODE SCIPexprCreateQuadratic(BMS_BLKMEM *blkmem, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_Real constant, SCIP_Real *lincoefs, int nquadelems, SCIP_QUADELEM *quadelems)
const char * SCIPheurGetName(SCIP_HEUR *heur)
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
SCIP_RETCODE SCIPfindQuadVarTermQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, int *pos)
SCIP_Real SCIPgetRowMinCoef(SCIP *scip, SCIP_ROW *row)
#define QUADCONSUPGD_PRIORITY
SCIP_RETCODE SCIPexprintEval(SCIP_EXPRINT *exprint, SCIP_EXPRTREE *tree, SCIP_Real *varvals, SCIP_Real *val)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPexprintCreate(BMS_BLKMEM *blkmem, SCIP_EXPRINT **exprint)
SCIP_RETCODE SCIPaddNlRow(SCIP *scip, SCIP_NLROW *nlrow)
static SCIP_RETCODE unlockLinearVariable(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
static SCIP_DECL_CONSINITSOL(consInitsolBivariate)
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPintervalGetInf(SCIP_INTERVAL interval)
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
static SCIP_RETCODE proposeFeasibleSolution(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_Bool *success)
SCIP_RETCODE SCIPexprCopyDeep(BMS_BLKMEM *blkmem, SCIP_EXPR **targetexpr, SCIP_EXPR *sourceexpr)
SCIP_RETCODE SCIPreleaseNlRow(SCIP *scip, SCIP_NLROW **nlrow)
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
static SCIP_DECL_CONSLOCK(consLockBivariate)
SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
SCIP_Real * SCIPgetCoefsLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
static SCIP_DECL_CONSDELETE(consDeleteBivariate)
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
SCIP_RETCODE SCIPsetConsChecked(SCIP *scip, SCIP_CONS *cons, SCIP_Bool check)
static SCIP_DECL_CONSCOPY(consCopyBivariate)
#define CONSHDLR_EAGERFREQ
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
static SCIP_DECL_EXPRGRAPHVARADDED(exprgraphVarAdded)
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)))
constraint handler for quadratic constraints
static SCIP_DECL_CONSENFOPS(consEnfopsBivariate)
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)
static SCIP_RETCODE propagateBounds(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_RESULT *result, int *nchgbds, int *ndelconss)
int SCIPexprtreeGetNVars(SCIP_EXPRTREE *tree)
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
#define SCIP_EVENTTYPE_LBTIGHTENED
static SCIP_DECL_EXPRGRAPHVARREMOVE(exprgraphVarRemove)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPexprCreatePolynomial(BMS_BLKMEM *blkmem, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, int nmonomials, SCIP_EXPRDATA_MONOMIAL **monomials, SCIP_Real constant, SCIP_Bool copymonomials)
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
static SCIP_DECL_CONSTRANS(consTransBivariate)
static SCIP_RETCODE lockLinearVariable(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
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_Bool SCIPconsIsLocal(SCIP_CONS *cons)
void SCIPexprgraphTightenNodeBounds(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, SCIP_INTERVAL nodebounds, SCIP_Real minstrength, SCIP_Real infinity, SCIP_Bool *cutoff)
static SCIP_RETCODE freeSepaData(SCIP *scip, SCIP_CONS *cons)
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)
SCIP_RETCODE SCIPcreateRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, int len, SCIP_COL **cols, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
#define SCIPdebugGetSolVal(scip, var, val)
SCIP_RETCODE SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible)
struct SCIP_ConsData SCIP_CONSDATA
SCIP_BILINTERM * SCIPgetBilinTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
#define SCIP_EVENTTYPE_BOUNDTIGHTENED
SCIP_EXPR * SCIPexprtreeGetRoot(SCIP_EXPRTREE *tree)
SCIP_COL ** SCIProwGetCols(SCIP_ROW *row)
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
static SCIP_DECL_CONSDEACTIVE(consDeactiveBivariate)
SCIP_Real SCIPgetRhsQuadratic(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_EVENTEXEC(processLinearVarEvent)
SCIP_RETCODE SCIPaddBilinTermQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var1, SCIP_VAR *var2, SCIP_Real coef)
static SCIP_DECL_CONSSEPALP(consSepalpBivariate)
#define SCIPallocBufferArray(scip, ptr, num)
SCIP_Real * SCIProwGetVals(SCIP_ROW *row)
static SCIP_RETCODE lifting(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_EXPRTREE *f, SCIP_Real xval, SCIP_Real yval, SCIP_Real xlb, SCIP_Real xub, SCIP_Real ylb, SCIP_Real yub, int min_max, SCIP_Real cutcoeff[4], SCIP_Real *convenvvalue, SCIP_Bool *success)
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
SCIP_RETCODE SCIPchgRowRhs(SCIP *scip, SCIP_ROW *row, SCIP_Real rhs)
SCIP_RETCODE SCIPexprintNewParametrization(SCIP_EXPRINT *exprint, SCIP_EXPRTREE *tree)
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
SCIP_Real SCIPgetLhsBivariate(SCIP *scip, SCIP_CONS *cons)
void SCIPexprgraphSetVarNodeLb(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *varnode, SCIP_Real lb)
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)
static SCIP_Bool isConvexLocal(SCIP *scip, SCIP_CONS *cons, SCIP_SIDETYPE side)
SCIP_EXPRINTDATA * SCIPexprtreeGetInterpreterData(SCIP_EXPRTREE *tree)
constraint handler for nonlinear constraints
static SCIP_DECL_CONSDISABLE(consDisableBivariate)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_RETCODE SCIPaddPoolCut(SCIP *scip, SCIP_ROW *row)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
void SCIPexprgraphSetVarNodeUb(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *varnode, SCIP_Real ub)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
SCIP_RETCODE SCIPchgRowLhs(SCIP *scip, SCIP_ROW *row, SCIP_Real lhs)
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_RETCODE SCIPexprtreeFree(SCIP_EXPRTREE **tree)
static SCIP_RETCODE removeFixedVariables(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_Bool *ischanged, SCIP_Bool *isupgraded)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
static SCIP_DECL_CONSEXITSOL(consExitsolBivariate)
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)
void SCIPintervalAdd(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
void SCIPexprgraphDisableNode(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node)
SCIP_Real SCIPintervalGetSup(SCIP_INTERVAL interval)
SCIP_Bool SCIPintervalAreDisjoint(SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
static SCIP_DECL_CONSINITPRE(consInitpreBivariate)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
SCIP_RETCODE SCIPexprintHessianDense(SCIP_EXPRINT *exprint, SCIP_EXPRTREE *tree, SCIP_Real *varvals, SCIP_Bool new_varvals, SCIP_Real *val, SCIP_Real *hessian)
constraint handler for bivariate nonlinear constraints
#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)
SCIP_RETCODE SCIPexprintGrad(SCIP_EXPRINT *exprint, SCIP_EXPRTREE *tree, SCIP_Real *varvals, SCIP_Bool new_varvals, SCIP_Real *val, SCIP_Real *gradient)
SCIP_RETCODE SCIPsetConshdlrEnable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENABLE((*consenable)))
void * SCIPexprgraphGetNodeVar(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node)
SCIP_Bool SCIPinProbing(SCIP *scip)
SCIP_VAR * SCIPgetLinearVarBivariate(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcheckCurvatureQuadratic(SCIP *scip, SCIP_CONS *cons)
#define SCIP_EVENTTYPE_DISABLED
static SCIP_DECL_CONSSEPASOL(consSepasolBivariate)
#define CONSHDLR_CHECKPRIORITY
SCIP_Real SCIPnodeGetEstimate(SCIP_NODE *node)
void SCIPenableNLP(SCIP *scip)
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
int SCIPgetNLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
int SCIPvarGetNLocksDown(SCIP_VAR *var)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_CONSEXIT(consExitBivariate)
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)
SCIP_VAR * SCIPcolGetVar(SCIP_COL *col)
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 SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
SCIP_RETCODE SCIPsetConsEnforced(SCIP *scip, SCIP_CONS *cons, SCIP_Bool enforce)
SCIP_RETCODE SCIPsetConshdlrExit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit)))
static SCIP_DECL_CONSINITLP(consInitlpBivariate)
#define SCIP_EVENTTYPE_FORMAT
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
#define CONSHDLR_PROPFREQ
static SCIP_DECL_CONSGETVARS(consGetVarsBivariate)
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_RETCODE SCIPexprgraphReleaseNode(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE **node)
SCIP_Real SCIPgetRowLPFeasibility(SCIP *scip, SCIP_ROW *row)
SCIP_Real SCIPeventGetOldbound(SCIP_EVENT *event)
#define CONSHDLR_MAXPREROUNDS
static SCIP_RETCODE generateEstimatingHyperplane(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_EXPRTREE *f, SCIP_Bool doover, SCIP_Real *x0y0, SCIP_Real *coefx, SCIP_Real *coefy, SCIP_Real *constant, SCIP_Bool *success)
#define NONLINCONSUPGD_PRIORITY
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
static SCIP_DECL_CONSINIT(consInitBivariate)
static SCIP_RETCODE generateOrthogonal_lx_uy_Underestimator(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_EXPRTREE *f, SCIP_Real *xyref, SCIP_Real cutcoeff[4], SCIP_Real *convenvvalue, SCIP_Bool *success)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
static SCIP_RETCODE generateConvexConcaveUnderestimator(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_EXPRTREE *f, SCIP_EXPRTREE *f_yfixed, SCIP_EXPRTREE *vred, SCIP_Real xyref[2], SCIP_Real cutcoeff[4], SCIP_Real *convenvvalue, SCIP_Bool *success)
static SCIP_RETCODE propagateBoundsTightenVar(SCIP *scip, SCIP_VAR *var, SCIP_INTERVAL bounds, SCIP_CONS *cons, SCIP_RESULT *result, int *nchgbds)
SCIP_Bool SCIPisStopped(SCIP *scip)
static SCIP_RETCODE generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternB(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_EXPRTREE *f, SCIP_Real xyref[2], SCIP_Real cutcoeff[4], SCIP_Real *convenvvalue, SCIP_Bool *success)
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
void SCIPintervalMulScalar(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_Real operand2)
SCIP_RETCODE SCIPcreateConsNonlinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *nonlincoefs, 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_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_EXPRGRAPHNODE ** SCIPexprgraphGetNodeChildren(SCIP_EXPRGRAPHNODE *node)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_RETCODE SCIPexprintHessianSparsityDense(SCIP_EXPRINT *exprint, SCIP_EXPRTREE *tree, SCIP_Real *varvals, SCIP_Bool *sparsity)
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
SCIP_Real * SCIPexprGetMonomialExponents(SCIP_EXPRDATA_MONOMIAL *monomial)
SCIP_RETCODE SCIPexprtreeSubstituteVars(SCIP_EXPRTREE *tree, SCIP_EXPR **substexprs)
SCIP_RETCODE SCIPcreateConsQuadratic2(SCIP *scip, SCIP_CONS **cons, const char *name, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nquadvarterms, SCIP_QUADVARTERM *quadvarterms, int nbilinterms, SCIP_BILINTERM *bilinterms, 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_RETCODE SCIPaddQuadVarLinearCoefQuadratic(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
static SCIP_DECL_CONSENABLE(consEnableBivariate)
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
SCIP_RETCODE SCIPunlinkSol(SCIP *scip, SCIP_SOL *sol)
static SCIP_RETCODE generate1ConvexIndefiniteUnderestimatorInTheInteriorPatternA(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_EXPRTREE *f, SCIP_Real xyref[2], SCIP_Real cutcoeff[4], SCIP_Real *convenvvalue, SCIP_Bool *success)
#define SCIPdebugAddSolVal(scip, var, val)
static SCIP_RETCODE generateCut(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_SIDETYPE violside, SCIP_Real cutmaxrange, SCIP_ROW **row)
void SCIPintervalSub(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
static SCIP_RETCODE enforceViolatedFixedNonlinear(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool *reduceddom, SCIP_Bool *infeasible)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
SCIP_RETCODE SCIPcomputeHyperplaneThreePoints(SCIP *scip, SCIP_Real a1, SCIP_Real a2, SCIP_Real a3, SCIP_Real b1, SCIP_Real b2, SCIP_Real b3, SCIP_Real c1, SCIP_Real c2, SCIP_Real c3, SCIP_Real *alpha, SCIP_Real *beta, SCIP_Real *gamma_, SCIP_Real *delta)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPupdateStartpointHeurSubNlp(SCIP *scip, SCIP_HEUR *heur, SCIP_SOL *solcand, SCIP_Real violation)
SCIP_Bool SCIPconsIsMarkedPropagate(SCIP_CONS *cons)
static SCIP_RETCODE generateLinearizationCut(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_CONS *cons, SCIP_Real *x0y0, SCIP_Bool newxy, SCIP_ROW **row)
static SCIP_RETCODE generate1ConvexIndefiniteUnderestimator(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_CONS *cons, SCIP_Real *xyref, SCIP_ROW **row)
SCIP_Real SCIPgetUpperbound(SCIP *scip)
SCIP_RETCODE SCIPexprintFree(SCIP_EXPRINT **exprint)
#define BMSclearMemoryArray(ptr, num)
SCIP_Bool SCIPisSumLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_CONSFREE(consFreeBivariate)
SCIP_RETCODE SCIPsetConshdlrActive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSACTIVE((*consactive)))
SCIP_QUADVARTERM * SCIPgetQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
#define CONSHDLR_SEPAFREQ
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_Real SCIPceil(SCIP *scip, SCIP_Real val)
void ** SCIPexprgraphGetVars(SCIP_EXPRGRAPH *exprgraph)
SCIP_EVENTHDLRDATA * SCIPeventhdlrGetData(SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPexprCreateLinear(BMS_BLKMEM *blkmem, SCIP_EXPR **expr, int nchildren, SCIP_EXPR **children, SCIP_Real *coefs, SCIP_Real constant)
static SCIP_RETCODE generateUnderestimatorParallelYFacets(SCIP *scip, SCIP_EXPRINT *exprinterpreter, SCIP_EXPRTREE *f, SCIP_Real *xyref, SCIP_Real cutcoeff[4], SCIP_Real *convenvvalue, SCIP_Bool *success)
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
SCIP_Longint SCIPgetNLPs(SCIP *scip)
SCIP_RETCODE SCIPwriteVarName(SCIP *scip, FILE *file, SCIP_VAR *var, SCIP_Bool type)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
static SCIP_RETCODE initSepaDataCreateVred(SCIP *scip, SCIP_EXPRTREE **vred, SCIP_EXPRTREE *f)
SCIP_RETCODE SCIPexprtreeSetParams(SCIP_EXPRTREE *tree, int nparams, SCIP_Real *paramvals)
static SCIP_DECL_CONSPRINT(consPrintBivariate)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
static void perturb(SCIP_Real *val, SCIP_Real lb, SCIP_Real ub, SCIP_Real amount)
SCIP_SOL * SCIPeventGetSol(SCIP_EVENT *event)
#define CONSHDLR_PRESOLTIMING
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)
static SCIP_DECL_CONSEXITPRE(consExitpreBivariate)
SCIP_Bool SCIPisConvexQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPevalExprtreeLocalBounds(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val)
SCIP_Bool SCIPintervalIsSubsetEQ(SCIP_Real infinity, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
SCIP_RETCODE SCIPexprtreeEval(SCIP_EXPRTREE *tree, SCIP_Real *varvals, SCIP_Real *val)
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)
#define SCIPreallocBufferArray(scip, ptr, num)
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
#define CONSHDLR_DELAYSEPA
void SCIPexprgraphEnableNode(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node)
enum SCIP_SideType SCIP_SIDETYPE