30 #define SCIP_PRIVATE_ROWPREP 40 #define CONSHDLR_NAME "nonlinear" 41 #define CONSHDLR_DESC "constraint handler for nonlinear constraints" 42 #define CONSHDLR_SEPAPRIORITY 10 43 #define CONSHDLR_ENFOPRIORITY -60 44 #define CONSHDLR_CHECKPRIORITY -4000010 45 #define CONSHDLR_SEPAFREQ 1 46 #define CONSHDLR_PROPFREQ 1 47 #define CONSHDLR_EAGERFREQ 100 49 #define CONSHDLR_MAXPREROUNDS -1 50 #define CONSHDLR_DELAYSEPA FALSE 51 #define CONSHDLR_DELAYPROP FALSE 52 #define CONSHDLR_NEEDSCONS TRUE 54 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP 55 #define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_ALWAYS 57 #define INTERVALINFTY 1E+43 58 #define BOUNDTIGHTENING_MINSTRENGTH 0.05 59 #define INITLPMAXVARVAL 1000.0 96 unsigned int linvarssorted:1;
97 unsigned int linvarsmerged:1;
99 unsigned int iscurvchecked:1;
100 unsigned int isremovedfixingslin:1;
101 unsigned int ispresolved:1;
102 unsigned int forcebackprop:1;
106 int minlinactivityinf;
107 int maxlinactivityinf;
112 int linvar_maydecrease;
113 int linvar_mayincrease;
131 struct SCIP_ConshdlrData
141 int maxexpansionexponent;
149 int newsoleventfilterpos;
152 int nlconsupgradessize;
157 unsigned int isremovedfixings:1;
158 unsigned int ispropagated:1;
159 unsigned int isreformulated:1;
160 unsigned int sepanlp:1;
161 int naddedreformconss;
174 #define infty2infty(infty1, infty2, val) ((val) >= (infty1) ? (infty2) : (val)) 189 assert(scip != NULL);
190 assert(cons != NULL);
196 assert(conshdlrdata != NULL);
197 assert(conshdlrdata->linvareventhdlr != NULL);
200 assert(consdata != NULL);
202 assert(linvarpos >= 0);
203 assert(linvarpos < consdata->nlinvars);
211 if( consdata->lincoefs[linvarpos] > 0.0 )
219 if( consdata->lincoefs[linvarpos] > 0.0 )
227 eventdata->
varidx = linvarpos;
231 if( consdata->lineventdata == NULL )
236 consdata->lineventdata[linvarpos] = eventdata;
260 assert(scip != NULL);
261 assert(cons != NULL);
270 assert(consdata != NULL);
272 assert(linvarpos >= 0);
273 assert(linvarpos < consdata->nlinvars);
274 assert(consdata->lineventdata != NULL);
275 assert(consdata->lineventdata[linvarpos] != NULL);
276 assert(consdata->lineventdata[linvarpos]->cons == cons);
277 assert(consdata->lineventdata[linvarpos]->varidx == linvarpos);
278 assert(consdata->lineventdata[linvarpos]->filterpos >= 0);
284 if( consdata->lincoefs[linvarpos] > 0.0 )
292 if( consdata->lincoefs[linvarpos] > 0.0 )
316 assert(scip != NULL);
317 assert(cons != NULL);
322 assert(consdata != NULL);
347 assert(scip != NULL);
348 assert(cons != NULL);
353 assert(consdata != NULL);
382 assert(scip != NULL);
383 assert(consdata != NULL);
388 assert(consdata->minlinactivityinf >= 0);
389 assert(consdata->maxlinactivityinf >= 0);
393 consdata->minlinactivityinf = 0;
394 consdata->maxlinactivityinf = 0;
402 if( consdata->nlinvars == 0 )
407 assert(consdata->lineventdata != NULL);
416 for( i = 0; i < consdata->nlinvars; ++i )
419 assert(consdata->lineventdata[i] != NULL);
420 if( consdata->lincoefs[i] >= 0.0 )
425 ++consdata->minlinactivityinf;
435 ++consdata->minlinactivityinf;
440 consdata->minlinactivity += consdata->lincoefs[i] * bnd;
449 for( i = 0; i < consdata->nlinvars; ++i )
451 assert(consdata->lineventdata[i] != NULL);
453 if( consdata->lincoefs[i] >= 0.0 )
458 ++consdata->maxlinactivityinf;
468 ++consdata->maxlinactivityinf;
473 consdata->maxlinactivity += consdata->lincoefs[i] * bnd;
476 assert(consdata->minlinactivity <= consdata->maxlinactivity || consdata->minlinactivityinf > 0 || consdata->maxlinactivityinf > 0);
493 assert(scip != NULL);
494 assert(consdata != NULL);
521 --consdata->minlinactivityinf;
522 assert(consdata->minlinactivityinf >= 0);
531 ++consdata->minlinactivityinf;
535 consdata->minlinactivity += coef * newbnd;
557 --consdata->maxlinactivityinf;
558 assert(consdata->maxlinactivityinf >= 0);
567 ++consdata->maxlinactivityinf;
571 consdata->maxlinactivity += coef * newbnd;
590 assert(scip != NULL);
591 assert(consdata != NULL);
617 --consdata->maxlinactivityinf;
618 assert(consdata->maxlinactivityinf >= 0);
627 ++consdata->maxlinactivityinf;
631 consdata->maxlinactivity += coef * newbnd;
653 --consdata->minlinactivityinf;
654 assert(consdata->minlinactivityinf >= 0);
663 ++consdata->minlinactivityinf;
667 consdata->minlinactivity += coef * newbnd;
683 assert(scip != NULL);
684 assert(event != NULL);
685 assert(eventdata != NULL);
686 assert(eventhdlr != NULL);
689 assert(cons != NULL);
692 assert(consdata != NULL);
696 assert(varidx < consdata->nlinvars);
702 consdata->isremovedfixingslin =
FALSE;
733 assert(scip != NULL);
734 assert(event != NULL);
735 assert(eventdata != NULL);
736 assert(eventhdlr != NULL);
739 assert(conshdlrdata != NULL);
740 assert(conshdlrdata->exprgraph != NULL);
749 SCIPdebugMsg(scip,
"changed %s bound on expression graph variable <%s> from %g to %g\n",
754 conshdlrdata->ispropagated =
FALSE;
758 if( eventtype & SCIP_EVENTTYPE_LBCHANGED )
783 conshdlrdata->isremovedfixings =
FALSE;
797 assert(exprgraph != NULL);
799 assert(varnode != NULL);
804 assert(conshdlrdata != NULL);
805 assert(conshdlrdata->exprgraph == exprgraph);
825 conshdlrdata->ispropagated =
FALSE;
837 assert(exprgraph != NULL);
839 assert(varnode != NULL);
844 assert(conshdlrdata != NULL);
845 assert(conshdlrdata->exprgraph == exprgraph);
872 assert(scip != NULL);
873 assert(consdata != NULL);
874 assert(consdata->exprtrees != NULL || consdata->nexprtrees == 0);
876 if( nexprtrees == 0 )
883 if( consdata->nlrow != NULL )
888 consdata->ispresolved =
FALSE;
890 consdata->iscurvchecked =
FALSE;
892 if( consdata->nexprtrees == 0 )
894 assert(consdata->exprtrees == NULL);
895 assert(consdata->nonlincoefs == NULL);
902 assert(consdata->exprtrees != NULL);
903 assert(consdata->nonlincoefs != NULL);
909 for( i = 0; i < nexprtrees; ++i )
911 assert(exprtrees[i] != NULL);
921 consdata->exprtrees[consdata->nexprtrees + i] = exprtrees[i];
924 consdata->nonlincoefs[consdata->nexprtrees + i] = (coefs != NULL ? coefs[i] : 1.0);
927 consdata->nexprtrees += nexprtrees;
945 assert(scip != NULL);
946 assert(consdata != NULL);
947 assert(consdata->exprtrees != NULL || consdata->nexprtrees == 0);
950 if( consdata->nexprtrees > 0 )
952 for( i = 0; i < consdata->nexprtrees; ++i )
954 assert(consdata->exprtrees[i] != NULL);
962 if( consdata->nlrow != NULL )
967 consdata->ispresolved =
FALSE;
969 consdata->iscurvchecked =
TRUE;
974 consdata->nexprtrees = 0;
990 assert(scip != NULL);
991 assert(consdata != NULL);
992 assert(consdata->nlinvars <= consdata->linvarssize);
994 if( num > consdata->linvarssize )
1001 if( consdata->lineventdata != NULL )
1005 consdata->linvarssize = newsize;
1007 assert(num <= consdata->linvarssize);
1030 assert(scip != NULL);
1031 assert(consdata != NULL);
1033 assert(nlinvars == 0 || linvars != NULL);
1034 assert(nlinvars == 0 || lincoefs != NULL);
1035 assert(nexprtrees == 0 || exprtrees != NULL);
1036 assert(nexprtrees == 0 || nonlincoefs != NULL);
1043 (*consdata)->minlinactivityinf = -1;
1044 (*consdata)->maxlinactivityinf = -1;
1046 (*consdata)->lhs = lhs;
1047 (*consdata)->rhs = rhs;
1053 (*consdata)->nlinvars = nlinvars;
1054 (*consdata)->linvarssize = nlinvars;
1057 for( i = 0; i < nlinvars; ++i )
1064 (*consdata)->linvarssorted =
TRUE;
1065 (*consdata)->linvarsmerged =
TRUE;
1070 (*consdata)->linvar_maydecrease = -1;
1071 (*consdata)->linvar_mayincrease = -1;
1087 assert(scip != NULL);
1088 assert(consdata != NULL);
1096 (*consdata)->linvarssorted =
TRUE;
1097 (*consdata)->linvarsmerged =
TRUE;
1099 (*consdata)->isremovedfixingslin =
TRUE;
1101 (*consdata)->linvar_maydecrease = -1;
1102 (*consdata)->linvar_mayincrease = -1;
1106 (*consdata)->minlinactivityinf = -1;
1107 (*consdata)->maxlinactivityinf = -1;
1110 (*consdata)->iscurvchecked =
TRUE;
1112 (*consdata)->ncuts = 0;
1126 assert(scip != NULL);
1127 assert(consdata != NULL);
1128 assert(*consdata != NULL);
1131 if( (*consdata)->linvarssize > 0 )
1133 for( i = 0; i < (*consdata)->nlinvars; ++i )
1135 assert((*consdata)->lineventdata == NULL || (*consdata)->lineventdata[i] == NULL);
1142 assert((*consdata)->linvars == NULL);
1143 assert((*consdata)->lincoefs == NULL);
1144 assert((*consdata)->lineventdata == NULL);
1146 if( (*consdata)->nexprtrees > 0 )
1148 assert((*consdata)->exprtrees != NULL);
1149 assert((*consdata)->nonlincoefs != NULL);
1150 assert((*consdata)->curvatures != NULL);
1151 for( i = 0; i < (*consdata)->nexprtrees; ++i )
1153 assert((*consdata)->exprtrees[i] != NULL);
1155 assert((*consdata)->exprtrees[i] == NULL);
1161 assert((*consdata)->exprtrees == NULL);
1162 assert((*consdata)->nonlincoefs == NULL);
1163 assert((*consdata)->curvatures == NULL);
1166 if( (*consdata)->nlrow != NULL )
1183 assert(consdata != NULL);
1185 if( consdata->linvarssorted )
1188 if( consdata->nlinvars <= 1 )
1190 consdata->linvarssorted =
TRUE;
1194 if( consdata->lineventdata == NULL )
1196 SCIPsortPtrReal((
void**)consdata->linvars, consdata->lincoefs, SCIPvarComp, consdata->nlinvars);
1202 SCIPsortPtrPtrReal((
void**)consdata->linvars, (
void**)consdata->lineventdata, consdata->lincoefs, SCIPvarComp, consdata->nlinvars);
1205 for( i = 0; i < consdata->nlinvars; ++i )
1206 if( consdata->lineventdata[i] != NULL )
1207 consdata->lineventdata[i]->varidx = i;
1210 consdata->linvarssorted =
TRUE;
1214 #ifdef SCIP_DISABLED_CODE 1217 int consdataFindLinearVar(
1224 assert(consdata != NULL);
1225 assert(var != NULL);
1227 if( consdata->nlinvars == 0 )
1232 if( !
SCIPsortedvecFindPtr((
void**)consdata->linvars, SCIPvarComp, (
void*)var, consdata->nlinvars, &pos) )
1247 assert(consdata != NULL);
1248 assert(oldpos >= 0);
1249 assert(oldpos < consdata->nlinvars);
1250 assert(newpos >= 0);
1251 assert(newpos < consdata->linvarssize);
1253 if( newpos == oldpos )
1256 consdata->linvars [newpos] = consdata->linvars [oldpos];
1257 consdata->lincoefs[newpos] = consdata->lincoefs[oldpos];
1259 if( consdata->lineventdata != NULL )
1261 assert(newpos >= consdata->nlinvars || consdata->lineventdata[newpos] == NULL);
1263 consdata->lineventdata[newpos] = consdata->lineventdata[oldpos];
1264 consdata->lineventdata[newpos]->varidx = newpos;
1266 consdata->lineventdata[oldpos] = NULL;
1269 consdata->linvarssorted =
FALSE;
1284 assert(scip != NULL);
1285 assert(cons != NULL);
1286 assert(var != NULL);
1293 assert(consdata != NULL);
1303 assert(var != NULL);
1307 consdata->linvars [consdata->nlinvars] = var;
1308 consdata->lincoefs[consdata->nlinvars] = coef;
1310 ++consdata->nlinvars;
1323 consdata->minlinactivityinf = -1;
1324 consdata->maxlinactivityinf = -1;
1327 if( consdata->nlrow != NULL )
1338 consdata->ispresolved =
FALSE;
1339 consdata->isremovedfixingslin = consdata->isremovedfixingslin &&
SCIPvarIsActive(var);
1340 if( consdata->nlinvars == 1 )
1341 consdata->linvarssorted =
TRUE;
1343 consdata->linvarssorted = consdata->linvarssorted &&
1344 (
SCIPvarCompare(consdata->linvars[consdata->nlinvars-2], consdata->linvars[consdata->nlinvars-1]) == -1);
1346 consdata->linvarsmerged =
FALSE;
1363 assert(scip != NULL);
1364 assert(cons != NULL);
1367 assert(consdata != NULL);
1368 assert(0 <= pos && pos < consdata->nlinvars);
1370 var = consdata->linvars[pos];
1371 coef = consdata->lincoefs[pos];
1372 assert(var != NULL);
1390 --consdata->nlinvars;
1396 consdata->minlinactivityinf = -1;
1397 consdata->maxlinactivityinf = -1;
1400 if( consdata->nlrow != NULL )
1405 consdata->ispresolved =
FALSE;
1423 assert(scip != NULL);
1424 assert(cons != NULL);
1428 assert(consdata != NULL);
1430 assert(pos < consdata->nlinvars);
1433 var = consdata->linvars[pos];
1434 coef = consdata->lincoefs[pos];
1435 assert(var != NULL);
1442 consdata->minlinactivityinf = -1;
1443 consdata->maxlinactivityinf = -1;
1446 if( consdata->nlrow != NULL )
1452 if( newcoef * coef < 0.0 )
1470 consdata->lincoefs[pos] = newcoef;
1473 if( newcoef * coef < 0.0 )
1488 consdata->ispresolved =
FALSE;
1506 assert(scip != NULL);
1507 assert(cons != NULL);
1511 if( consdata->linvarsmerged )
1514 if( consdata->nlinvars == 0 )
1516 consdata->linvarsmerged =
TRUE;
1521 while( i < consdata->nlinvars )
1527 newcoef = consdata->lincoefs[i];
1528 for( j = i+1; j < consdata->nlinvars && consdata->linvars[i] == consdata->linvars[j]; ++j )
1529 newcoef += consdata->lincoefs[j];
1531 for( j = j-1; j > i; --j )
1548 consdata->linvarsmerged =
TRUE;
1567 assert(scip != NULL);
1568 assert(cons != NULL);
1572 if( !consdata->isremovedfixingslin )
1575 while( i < consdata->nlinvars )
1577 var = consdata->linvars[i];
1585 coef = consdata->lincoefs[i];
1600 consdata->lhs -= offset;
1605 consdata->rhs -= offset;
1636 for( j = 0; j < naggrs; ++j )
1641 if( aggrconstant != 0.0 )
1645 consdata->lhs -= coef * aggrconstant;
1650 consdata->rhs -= coef * aggrconstant;
1659 consdata->isremovedfixingslin =
TRUE;
1666 for( i = 0; i < consdata->nlinvars; ++i )
1718 if( requsize > varssize )
1722 varssize = requsize;
1729 for( j = 0; j < nvars; ++j )
1768 assert(scip != NULL);
1769 assert(conshdlr != NULL);
1770 assert(cons != NULL);
1773 assert(consdata != NULL);
1775 *infeasible =
FALSE;
1777 if( consdata->exprgraphnode == NULL )
1792 assert(child != NULL);
1796 consdata->exprgraphnode = child;
1813 for( i = 0; i < consdata->nlinvars; ++i )
1827 for( i = 0; i < consdata->nlinvars; ++i )
1851 for( i = 0; i < consdata->nlinvars; ++i )
1865 for( i = 0; i < consdata->nlinvars; ++i )
1883 else if( constant != 0.0 )
1887 consdata->lhs -= constant;
1892 consdata->rhs -= constant;
1898 for( i = 0; i < nlinvars; ++i )
1920 assert(scip != NULL);
1921 assert(cons != NULL);
1924 assert(consdata != NULL);
1926 if( consdata->nlrow != NULL )
1931 if( consdata->nexprtrees == 0 )
1934 consdata->nlinvars, consdata->linvars, consdata->lincoefs,
1936 NULL, consdata->lhs, consdata->rhs,
1937 consdata->curvature) );
1939 else if( consdata->nexprtrees == 1 && consdata->nonlincoefs[0] == 1.0 )
1941 assert(consdata->exprtrees[0] != NULL);
1943 consdata->nlinvars, consdata->linvars, consdata->lincoefs,
1945 consdata->exprtrees[0], consdata->lhs, consdata->rhs,
1946 consdata->curvature) );
1956 assert(consdata->exprgraphnode != NULL);
1958 assert(conshdlrdata != NULL);
1962 consdata->nlinvars, consdata->linvars, consdata->lincoefs,
1964 exprtree, consdata->lhs, consdata->rhs,
1965 consdata->curvature) );
1989 assert(scip != NULL);
1990 assert(conshdlr != NULL);
1991 assert(cons != NULL);
1993 assert(upgraded != NULL);
1994 assert(nupgdconss != NULL);
1995 assert(naddconss != NULL);
2009 #ifdef WITH_DEBUG_SOLUTION 2010 if( SCIPdebugIsMainscip(scip) )
2030 SCIPdebugMsg(scip,
"upgrading nonlinear constraint <%s> (up to %d upgrade methods):\n",
2039 if(
conshdlrdata->nlconsupgrades[i]->nlconsupgd == NULL )
2042 SCIP_CALL(
conshdlrdata->nlconsupgrades[i]->nlconsupgd(scip, cons, &nupgdconss_, upgdconss, upgdconsssize) );
2044 while( nupgdconss_ < 0 )
2047 assert(-nupgdconss_ > upgdconsssize);
2048 upgdconsssize = -nupgdconss_;
2051 SCIP_CALL(
conshdlrdata->nlconsupgrades[i]->nlconsupgd(scip, cons, &nupgdconss_, upgdconss, upgdconsssize) );
2053 assert(nupgdconss_ != 0);
2056 if( nupgdconss_ > 0 )
2061 SCIPdebugMsg(scip,
" -> upgraded to %d constraints:\n", nupgdconss_);
2064 for( j = 0; j < nupgdconss_; ++j )
2075 *naddconss += nupgdconss_ - 1;
2107 assert(scip != NULL);
2108 assert(cons != NULL);
2111 assert(consdata != NULL);
2113 if( consdata->iscurvchecked )
2119 consdata->iscurvchecked =
TRUE;
2124 for( i = 0; i < consdata->nexprtrees; ++i )
2126 assert(consdata->exprtrees[i] != NULL);
2141 if( varboundssize == 0 )
2151 assert(varbounds != NULL);
2162 consdata->curvatures[i] =
SCIPexprcurvMultiply(consdata->nonlincoefs[i], consdata->curvatures[i]);
2174 consdata->curvature =
SCIPexprcurvAdd(consdata->curvature, consdata->curvatures[i]);
2201 assert(exprgraph != NULL);
2202 assert(node != NULL);
2203 assert(*node != NULL);
2204 assert(replacement != NULL);
2205 assert(conss != NULL || nconss == 0);
2218 for( c = 0; c < nconss; ++c )
2220 assert(conss[c] != NULL);
2223 assert(consdata != NULL);
2225 if( consdata->exprgraphnode == *node )
2228 consdata->exprgraphnode = replacement;
2232 consdata->ispresolved =
FALSE;
2262 assert(scip != NULL);
2263 assert(exprgraph != NULL);
2264 assert(node != NULL);
2265 assert(naddcons != NULL);
2277 #ifdef WITH_DEBUG_SOLUTION 2278 if( SCIPdebugIsMainscip(scip) )
2299 SCIP_CALL(
SCIPcreateConsNonlinear2(scip, &auxcons, name, 1, &auxvar, &minusone, node, 0.0, 0.0,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
2331 assert(scip != NULL);
2332 assert(exprgraph != NULL);
2333 assert(node != NULL);
2334 assert(naddcons != NULL);
2343 assert(child != NULL);
2347 SCIPdebugMsg(scip,
"add auxiliary variable for child %p(%d,%d) with curvature %s\n",
2389 assert(scip != NULL);
2390 assert(exprgraph != NULL);
2391 assert(nfactors > 0);
2392 assert(factors != NULL);
2393 assert(resultnode != NULL);
2394 assert(naddcons != NULL);
2397 if( nfactors == 1 && (exponents == NULL || exponents[0] == 1.0) )
2399 *resultnode = factors[0];
2413 SCIPdebugMsg(scip,
"add auxiliary variable and constraint %s\n", name);
2420 #ifdef WITH_DEBUG_SOLUTION 2422 if( SCIPdebugIsMainscip(scip) )
2437 reformfactors[0] = *resultnode;
2438 reformfactors[1] = factors[0];
2440 reformexp[1] = -exponents[0];
2461 assert(exponents != NULL);
2481 if( expnode == NULL )
2497 SCIPdebugMsg(scip,
"add auxiliary variable and constraint %s\n", name);
2504 #ifdef WITH_DEBUG_SOLUTION 2505 if( SCIPdebugIsMainscip(scip) )
2514 SCIP_CALL(
SCIPcreateConsNonlinear2(scip, &auxcons, name, 1, &auxvar, &minusone, expnode, 0.0, 0.0,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
2525 *resultnode = expnode;
2531 if( nfactors == 2 && exponents != NULL && exponents[0] != 1.0 && exponents[0] == exponents[1] )
2540 SCIP_CALL(
reformMonomial(scip, exprgraph, 1, &productnode, &exponents[0], resultnode, createauxcons, mindepth, naddcons) );
2545 if( nfactors == 2 && exponents != NULL && exponents[0] == -exponents[1] )
2556 SCIPdebugMsg(scip,
"add auxiliary variable and constraint %s\n", name);
2563 #ifdef WITH_DEBUG_SOLUTION 2565 if( SCIPdebugIsMainscip(scip) )
2568 if( exponents[0] > 0.0 )
2578 leftright[0] = auxvarnode;
2579 leftright[1] = exponents[0] > 0.0 ? factors[1] : factors[0];
2584 leftright[0] = auxconsnode;
2585 leftright[1] = exponents[0] > 0.0 ? factors[0] : factors[1];
2601 absexp = fabs(exponents[0]);
2602 SCIP_CALL(
reformMonomial(scip, exprgraph, 1, &auxvarnode, &absexp, resultnode, createauxcons, mindepth, naddcons) );
2620 half = nfactors / 2;
2622 assert(half < nfactors);
2625 SCIP_CALL(
reformMonomial(scip, exprgraph, nfactors-half, &factors[half], exponents != NULL ? &exponents[half] : NULL, &leftright[1],
TRUE, mindepth, naddcons) );
2639 productnode = parent;
2643 if( productnode == NULL )
2656 SCIPdebugMsg(scip,
"add auxiliary variable and constraint %s\n", name);
2663 #ifdef WITH_DEBUG_SOLUTION 2664 if( SCIPdebugIsMainscip(scip) )
2673 SCIP_CALL(
SCIPcreateConsNonlinear2(scip, &auxcons, name, 1, &auxvar, &minusone, productnode, 0.0, 0.0,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
2684 *resultnode = productnode;
2720 assert(scip != NULL);
2721 assert(conshdlr != NULL);
2722 assert(conss != NULL || nconss == 0);
2723 assert(naddcons != NULL);
2732 SCIPdebugMsg(scip,
"skip reformulation, already done\n");
2740 assert(!domainerror);
2743 #ifdef WITH_DEBUG_SOLUTION 2744 if( SCIPdebugIsMainscip(scip) )
2765 assert(node != NULL);
2783 SCIP_CALL(
conshdlrdata->nlconsupgrades[u]->nodereform(scip, exprgraph, node, naddcons, &reformnode) );
2784 if( reformnode == NULL )
2787 SCIPdebugMsg(scip,
"external nodereform reformulated node %p(%d,%d), replace by %p\n",
2798 if( u < conshdlrdata->nnlconsupgrades )
2825 assert(children != NULL || nchildren == 0);
2831 for( j = 0; j < nchildren; ++j )
2833 assert(children[j] != NULL);
2834 if( havenonlinparent ||
2860 if( havenonlinparent )
2863 assert(node != NULL);
2886 assert(child != NULL);
2890 SCIPdebugMessage(
"add auxiliary variable for child %p(%d,%d) with curvature %s operator %s\n",
2923 assert(node != NULL);
2947 assert(children != NULL);
2948 assert(nchildren == 2);
2960 #ifdef WITH_DEBUG_SOLUTION 2961 if( SCIPdebugIsMainscip(scip) )
2971 auxchildren[0] = children[0];
2972 auxchildren[1] = children[1];
2973 auxchildren[2] = auxvarnode;
2981 quadelem.
coef = 1.0;
3023 assert(nchildren == 1);
3054 assert(nchildren == 1);
3082 if( havenonlinparent )
3085 assert(node != NULL);
3145 assert(nmonomials >= 1);
3147 if( nmonomials > 1 )
3180 for( m = 0; m < nmonomials; ++m )
3182 monomial = monomials[m];
3183 assert(monomial != NULL);
3189 assert(nfactors >= 1);
3190 assert(coef != 0.0);
3192 if( nfactors == 1 && exponents[0] == 1.0 )
3195 if( lincoefs == NULL )
3200 assert(0 <= childidxs[0] && childidxs[0] < nchildren);
3201 assert(lincoefs[childidxs[0]] == 0.0);
3202 lincoefs[childidxs[0]] = coef;
3204 else if( nfactors == 1 && exponents[0] == 2.0 )
3207 if( quadelems == NULL )
3211 quadelems[nquadelems].
idx1 = childidxs[0];
3212 quadelems[nquadelems].
idx2 = childidxs[0];
3213 quadelems[nquadelems].
coef = coef;
3216 else if( nfactors == 2 && exponents[0] == 1.0 && exponents[1] == 1.0 )
3219 if( quadelems == NULL )
3223 if( childidxs[0] < childidxs[1] )
3225 quadelems[nquadelems].
idx1 = childidxs[0];
3226 quadelems[nquadelems].
idx2 = childidxs[1];
3230 quadelems[nquadelems].
idx1 = childidxs[1];
3231 quadelems[nquadelems].
idx2 = childidxs[0];
3233 quadelems[nquadelems].
coef = coef;
3246 if( childrennew == NULL )
3250 assert(nfactors <= nchildren);
3251 for( f = 0; f < nfactors; ++f )
3252 childrennew[f] = children[childidxs[f]];
3262 assert(lincoefs != NULL || nquadelems > 0 || nmonomialnodes > 0);
3264 if( nquadelems > 0 )
3272 else if( lincoefs != NULL )
3280 assert(constant == 0.0);
3286 assert(nmonomialnodes > 0);
3287 if( nmonomialnodes > 1 )
3297 sumnode = monomialnodes[0];
3304 SCIPdebugMsg(scip,
"splitup polynomial into sum of %d nodes\n", nmonomialnodes);
3311 monomial = monomials[0];
3312 assert(monomial != NULL);
3318 assert(nfactors >= 1);
3319 assert(coef != 0.0);
3320 assert(children != NULL);
3379 for( f = 0; f < nfactors; ++f )
3384 if( childbounds.
inf < 0.0 && childbounds.
sup > 0.0 )
3387 if( exponents[f] < 0.0 )
3391 sum += exponents[f];
3394 if( childbounds.
inf < 0.0 )
3422 if( nnegative == nfactors || (nnegative == nfactors-1 &&
SCIPisGE(scip, sum, 1.0)) )
3425 SCIPdebugMsg(scip,
"%d-variate monomial is convex (modulo sign), child curv fits = %u\n", nfactors, expcurvpos);
3427 assert(!expcurvpos);
3430 else if( npositive == nfactors &&
SCIPisLE(scip, sum, 1.0) )
3433 SCIPdebugMsg(scip,
"%d-variate monomial is concave (modulo sign), child curv fits = %u\n", nfactors, expcurvneg);
3435 assert(!expcurvneg);
3448 for( f = 0; f < nfactors; ++f )
3453 assert(childbounds.
inf >= 0.0 || childbounds.
sup <= 0.0);
3456 if( childbounds.
inf < 0.0 )
3464 SCIPdebugMsg(scip,
"reform child %d (factor %d) with curv %s into var\n",
3488 assert(nfactors > 1 ||
3494 assert(!(nfactors == 2 && exponents[0] == 1.0 && exponents[1] == 1.0));
3498 if( nfactors > 1 || havenonlinparent || exponents[0] < 0.0 )
3506 for( f = 0; f < nfactors; ++f )
3507 factors[f] = children[childidxs[f]];
3510 factors = &children[childidxs[0]];
3512 SCIPdebugMsg(scip,
"reform monomial node, create auxvar = %u\n", havenonlinparent);
3543 SCIPdebugMsg(scip,
"no reformulation of monomial node, assume signpower will take care of it\n");
3578 for( c = 0; c < nconss; ++c )
3583 assert(conss[c] != NULL);
3590 assert(consdata != NULL);
3592 if( consdata->exprgraphnode == NULL )
3599 consdata->forcebackprop =
TRUE;
3612 assert(monomial != NULL);
3641 SCIPdebugMsg(scip,
"replace linear multivariate node %p(%d,%d) in expression of cons <%s> by auxvar\n",
3661 multivarnode = consdata->exprgraphnode;
3673 if( multivarnode == consdata->exprgraphnode )
3681 SCIPdebugMsg(scip,
"replace linear multivariate node %p(%d,%d) in expression of cons <%s> by auxvar\n",
3715 assert(scip != NULL);
3716 assert(conshdlr != NULL);
3717 assert(cons != NULL);
3718 assert(solviolbounds != NULL);
3725 assert(consdata != NULL);
3727 consdata->activity = 0.0;
3728 consdata->lhsviol = 0.0;
3729 consdata->rhsviol = 0.0;
3731 *solviolbounds =
FALSE;
3733 for( i = 0; i < consdata->nlinvars; ++i )
3737 var = consdata->linvars[i];
3747 *solviolbounds =
TRUE;
3752 activity = consdata->lincoefs[i] * varval;
3774 consdata->activity += activity;
3777 for( i = 0; i < consdata->nexprtrees; ++i )
3804 *solviolbounds =
TRUE;
3819 for( j = 0; j < nvars; ++j )
3831 *solviolbounds =
TRUE;
3860 activity = consdata->nonlincoefs[i] * val;
3878 consdata->activity += activity;
3881 if( consdata->nexprtrees == 0 && consdata->exprgraphnode != NULL )
3914 consdata->activity += val;
3918 consdata->lhsviol = consdata->lhs - consdata->activity;
3920 consdata->lhsviol = 0.0;
3923 consdata->rhsviol = consdata->activity - consdata->rhs;
3925 consdata->rhsviol = 0.0;
3935 absviol =
MAX(consdata->lhsviol, consdata->rhsviol);
3937 lhsrelviol =
SCIPrelDiff(consdata->lhs, consdata->activity);
3938 rhsrelviol =
SCIPrelDiff(consdata->activity, consdata->rhs);
3939 relviol =
MAX(lhsrelviol, rhsrelviol);
3967 assert(scip != NULL);
3968 assert(conshdlr != NULL);
3969 assert(conss != NULL || nconss == 0);
3970 assert(maxviolcon != NULL);
3971 assert(solviolbounds != NULL);
3979 assert(conshdlrdata != NULL);
3980 assert(conshdlrdata->exprgraph != NULL);
3994 for( c = 0; c < nconss; ++c )
3996 assert(conss != NULL);
3997 assert(conss[c] != NULL);
4002 if( *solviolbounds )
4006 assert(consdata != NULL);
4008 viol =
MAX(consdata->lhsviol, consdata->rhsviol);
4012 *maxviolcon = conss[c];
4044 assert(scip != NULL);
4045 assert(cons != NULL);
4047 assert(rowprep != NULL);
4048 assert(success != NULL);
4051 assert(consdata != NULL);
4052 assert(exprtreeidx >= 0);
4053 assert(exprtreeidx < consdata->nexprtrees);
4054 assert(consdata->exprtrees != NULL);
4056 exprtree = consdata->exprtrees[exprtreeidx];
4057 assert(exprtree != NULL);
4060 treecoef = consdata->nonlincoefs[exprtreeidx];
4083 for( i = 0; i < nvars; ++i )
4088 grad[i] *= treecoef;
4089 constant -= grad[i] * x[i];
4100 if( grad[i] != 0.0 &&
SCIPisZero(scip, grad[i]) )
4117 SCIPdebugMsg(scip,
"var <%s> [%g,%g] has tiny gradient %g, replace coefficient by constant %g\n",
4119 constant += grad[i] * xbnd;
4125 SCIPdebugMsg(scip,
"skipping linearization, var <%s> [%g,%g] has tiny gradient %g but no finite bound in this direction\n",
4144 for( i = 0; i < nvars; ++i )
4150 else if(
SCIPisEQ(scip, x[i], ub) )
4153 x[i] += MIN3(0.9*(ub-x[i]), 0.9*(x[i]-lb), i*
SCIPfeastol(scip)) * (i%2 != 0 ? -1.0 : 1.0);
4202 assert(scip != NULL);
4203 assert(cons != NULL);
4204 assert(rowprep != NULL);
4205 assert(success != NULL);
4208 assert(consdata != NULL);
4209 assert(exprtreeidx >= 0);
4210 assert(exprtreeidx < consdata->nexprtrees);
4211 assert(consdata->exprtrees != NULL);
4213 exprtree = consdata->exprtrees[exprtreeidx];
4214 assert(exprtree != NULL);
4217 treecoef = consdata->nonlincoefs[exprtreeidx];
4228 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since variable is unbounded\n", exprtreeidx,
SCIPconsGetName(cons));
4236 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since function cannot be evaluated in lower bound\n", exprtreeidx,
SCIPconsGetName(cons));
4244 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since function cannot be evaluated in upper bound\n", exprtreeidx,
SCIPconsGetName(cons));
4254 constant =
MAX(vallb, valub);
4256 constant = MIN(vallb, valub);
4260 slope = (valub - vallb) / (xub - xlb);
4261 constant = vallb - slope * xlb;
4309 assert(scip != NULL);
4310 assert(cons != NULL);
4311 assert(ref != NULL);
4312 assert(rowprep != NULL);
4313 assert(success != NULL);
4316 assert(consdata != NULL);
4317 assert(exprtreeidx >= 0);
4318 assert(exprtreeidx < consdata->nexprtrees);
4319 assert(consdata->exprtrees != NULL);
4321 exprtree = consdata->exprtrees[exprtreeidx];
4322 assert(exprtree != NULL);
4325 treecoef = consdata->nonlincoefs[exprtreeidx];
4345 ref[0] = MIN(xub,
MAX(xlb, ref[0]));
4348 ref[1] = MIN(yub,
MAX(ylb, ref[1]));
4372 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since function cannot be evaluated\n", exprtreeidx,
SCIPconsGetName(cons));
4382 else if(
SCIPisEQ(scip, xlb, xub) )
4391 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since function cannot be evaluated\n", exprtreeidx,
SCIPconsGetName(cons));
4398 coefy = (p4val - p1val) / (yub - ylb);
4399 constant = p1val - coefy * ylb;
4401 else if(
SCIPisEQ(scip, ylb, yub) )
4410 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since function cannot be evaluated\n", exprtreeidx,
SCIPconsGetName(cons));
4417 coefx = (p2val - p1val) / (xub - xlb);
4419 constant = p1val - coefx * xlb;
4438 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since function cannot be evaluated\n", exprtreeidx,
SCIPconsGetName(cons));
4455 SCIPdebugMsg(scip,
"p1 = (%g, %g), f(p1) = %g\n", p1[0], p1[1], p1val);
4456 SCIPdebugMsg(scip,
"p2 = (%g, %g), f(p2) = %g\n", p2[0], p2[1], p2val);
4457 SCIPdebugMsg(scip,
"p3 = (%g, %g), f(p3) = %g\n", p3[0], p3[1], p3val);
4458 SCIPdebugMsg(scip,
"p4 = (%g, %g), f(p4) = %g\n", p4[0], p4[1], p4val);
4471 if( ref[1] <= ylb + (yub - ylb)/(xub - xlb) * (ref[0] - xlb) )
4473 SCIP_CALL(
SCIPcomputeHyperplaneThreePoints(scip, p1[0], p1[1], p1val, p2[0], p2[1], p2val, p3[0], p3[1], p3val,
4474 &alpha, &beta, &gamma_, &delta) );
4476 assert(
SCIPisRelEQ(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4477 assert(
SCIPisRelEQ(scip, alpha * p2[0] + beta * p2[1] + gamma_ * p2val, delta));
4478 assert(
SCIPisRelEQ(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4481 if( alpha * p4[0] + beta * p4[1] + gamma_ * p4val > delta )
4488 p4val, &alpha, &beta, &gamma_, &delta) );
4490 assert(
SCIPisRelEQ(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4491 assert(
SCIPisRelEQ(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4492 assert(
SCIPisRelEQ(scip, alpha * p4[0] + beta * p4[1] + gamma_ * p4val, delta));
4495 if( alpha * p2[0] + beta * p2[1] + gamma_ * p2val > delta )
4501 SCIP_CALL(
SCIPcomputeHyperplaneThreePoints(scip, p1[0], p1[1], p1val, p3[0], p3[1], p3val, p4[0], p4[1], p4val,
4502 &alpha, &beta, &gamma_, &delta) );
4504 assert(
SCIPisRelEQ(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4505 assert(
SCIPisRelEQ(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4506 assert(
SCIPisRelEQ(scip, alpha * p4[0] + beta * p4[1] + gamma_ * p4val, delta));
4509 if( alpha * p2[0] + beta * p2[1] + gamma_ * p2val > delta )
4516 p3val, &alpha, &beta, &gamma_, &delta) );
4518 assert(
SCIPisRelEQ(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4519 assert(
SCIPisRelEQ(scip, alpha * p2[0] + beta * p2[1] + gamma_ * p2val, delta));
4520 assert(
SCIPisRelEQ(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4523 if( alpha * p4[0] + beta * p4[1] + gamma_ * p4val > delta )
4530 if( ref[1] <= yub + (ylb - yub)/(xub - xlb) * (ref[0] - xlb) )
4533 p4val, &alpha, &beta, &gamma_, &delta) );
4536 assert(
SCIPisRelEQ(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4537 assert(
SCIPisRelEQ(scip, alpha * p2[0] + beta * p2[1] + gamma_ * p2val, delta));
4538 assert(
SCIPisRelLE(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4539 assert(
SCIPisRelEQ(scip, alpha * p4[0] + beta * p4[1] + gamma_ * p4val, delta));
4546 p4val, &alpha, &beta, &gamma_, &delta) );
4549 assert(
SCIPisRelLE(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4550 assert(
SCIPisRelEQ(scip, alpha * p2[0] + beta * p2[1] + gamma_ * p2val, delta));
4551 assert(
SCIPisRelEQ(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4552 assert(
SCIPisRelEQ(scip, alpha * p4[0] + beta * p4[1] + gamma_ * p4val, delta));
4558 p4val, &alpha, &beta, &gamma_, &delta) );
4561 assert(
SCIPisRelLE(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4562 assert(
SCIPisRelEQ(scip, alpha * p2[0] + beta * p2[1] + gamma_ * p2val, delta));
4563 assert(
SCIPisRelEQ(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4564 assert(
SCIPisRelEQ(scip, alpha * p4[0] + beta * p4[1] + gamma_ * p4val, delta));
4571 p4val, &alpha, &beta, &gamma_, &delta) );
4574 assert(
SCIPisRelEQ(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4575 assert(
SCIPisRelEQ(scip, alpha * p2[0] + beta * p2[1] + gamma_ * p2val, delta));
4576 assert(
SCIPisRelLE(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4577 assert(
SCIPisRelEQ(scip, alpha * p4[0] + beta * p4[1] + gamma_ * p4val, delta));
4582 SCIPdebugMsg(scip,
"alpha = %g, beta = %g, gamma = %g, delta = %g\n", alpha, beta, gamma_, delta);
4593 coefx = -alpha / gamma_;
4594 coefy = -beta / gamma_;
4595 constant = delta / gamma_;
4658 assert(lpi != NULL);
4659 assert(nvars <= 10);
4662 treecoef = consdata->nonlincoefs[exprtreeidx];
4672 nrows = (int)(1u << nvars);
4677 nnonz = nrows * ncols;
4684 for( i = 0; i < nrows; ++i )
4688 for( j = 0; j < nvars; ++j )
4692 if( ((
unsigned int)i >> j) & 0x1 )
4706 SCIPdebugMsg(scip,
"cannot compute underestimator for concave because constaint <%s> cannot be evaluated\n",
SCIPconsGetName(cons));
4710 funcval *= treecoef;
4725 for( j = 0; j < nvars; ++j )
4727 if( corner[j] != 0.0 )
4730 val[idx] = corner[j];
4743 for( j = 0; j < ncols; ++j )
4755 funcval *= treecoef;
4774 SCIPwarningMessage(scip,
"solving auxiliary LP for underestimator of concave function returned %d\n", lpret);
4793 SCIPwarningMessage(scip,
"computed cut does not underestimate concave function in refpoint\n");
4796 assert( doupper ||
SCIPisFeasLE(scip, lpobj, funcval) );
4797 assert(!doupper ||
SCIPisFeasLE(scip, funcval, lpobj) );
4854 assert(scip != NULL);
4855 assert(cons != NULL);
4856 assert(ref != NULL);
4857 assert(rowprep != NULL);
4858 assert(success != NULL);
4861 assert(consdata != NULL);
4862 assert(exprtreeidx >= 0);
4863 assert(exprtreeidx < consdata->nexprtrees);
4864 assert(consdata->exprtrees != NULL);
4866 exprtree = consdata->exprtrees[exprtreeidx];
4867 assert(exprtree != NULL);
4877 if( !warned_highdim_concave )
4880 warned_highdim_concave =
TRUE;
4891 for( j = 0; j < nvars; ++j )
4895 SCIPdebugMsg(scip,
"cannot compute underestimator for concave because variable <%s> is unbounded\n",
SCIPvarGetName(vars[j]));
4914 retcode = _addConcaveEstimatorMultivariate(scip, lpi, cons, exprtreeidx, ref, rowprep, vars, exprtree, nvars, doupper, success);
4916 assert(lpi != NULL);
5005 for( c = 0; c < nchildren; ++c )
5072 assert( consdata != NULL );
5073 assert( exprtreeidx >= 0 );
5074 assert( exprtreeidx < consdata->nexprtrees );
5075 assert( consdata->exprtrees != NULL );
5076 assert( rowprep != NULL );
5077 assert( success != NULL );
5079 exprtree = consdata->exprtrees[exprtreeidx];
5080 assert( exprtree != NULL );
5099 for( i = 0; i < nvars; ++i )
5113 for( i = 0; i < nchildren; ++i )
5130 treecoef = consdata->nonlincoefs[exprtreeidx];
5131 constant *= treecoef;
5133 for( i = 0; i < nchildren; ++i )
5182 assert(scip != NULL);
5183 assert(cons != NULL);
5185 assert(rowprep != NULL);
5186 assert(success != NULL);
5189 assert(consdata != NULL);
5190 assert(exprtreeidx >= 0);
5191 assert(exprtreeidx < consdata->nexprtrees);
5192 assert(consdata->exprtrees != NULL);
5194 exprtree = consdata->exprtrees[exprtreeidx];
5195 assert(exprtree != NULL);
5214 for( i = 0; i < nvars; ++i )
5223 goto INTGRADESTIMATOR_CLEANUP;
5232 x[i] = (2.0*x[i] < lb+ub) ? lb : ub;
5249 SCIPdebugMsg(scip,
"Got nonfinite function value from evaluation of constraint %s tree %d. skipping interval gradient estimator.\n",
SCIPconsGetName(cons), exprtreeidx);
5250 goto INTGRADESTIMATOR_CLEANUP;
5253 treecoef = consdata->nonlincoefs[exprtreeidx];
5267 for( i = 0; i < nvars; ++i )
5277 else if( (overestimate && val == ub) ||
5278 (!overestimate && val == lb) )
5288 SCIPdebugMsg(scip,
"skip intgrad estimator because of infinite interval bound\n");
5289 goto INTGRADESTIMATOR_CLEANUP;
5292 constant -= coefs[i] * val;
5299 INTGRADESTIMATOR_CLEANUP:
5331 assert(scip != NULL);
5332 assert(cons != NULL);
5333 assert(row != NULL);
5340 assert(consdata != NULL);
5342 if( consdata->nexprtrees == 0 )
5365 for( i = 0; i < consdata->nexprtrees; ++i )
5382 else if( (side ==
SCIP_SIDETYPE_LEFT && (consdata->curvatures[i] & SCIP_EXPRCURV_CONVEX)) ||
5401 SCIPdebugMsg(scip,
"failed to generate polyhedral estimator for %d-dim concave function in exprtree %d, fall back to intervalgradient cut\n",
SCIPexprtreeGetNVars(consdata->exprtrees[i]), i);
5441 success = coefrange <= maxrange;
5489 assert(scip != NULL);
5490 assert(conshdlr != NULL);
5491 assert(conss != NULL || nconss == 0);
5492 assert(nusefulconss <= nconss);
5493 assert(result != NULL);
5500 if( bestefficacy != NULL )
5501 *bestefficacy = 0.0;
5505 assert(conss != NULL);
5513 assert(consdata != NULL);
5526 SCIP_CALL(
generateCut(scip,
conshdlrdata->exprinterpreter, conss[c], NULL, sol, newsol ||
SCIPisInfinity(scip, consdata->activity), violside, &row, minefficacy,
conshdlrdata->cutmaxrange,
conshdlrdata->checkconvexexpensive,
conshdlrdata->assumeconvex) );
5535 efficacy = -feasibility;
5550 SCIPdebugMsg(scip,
"add cut with efficacy %g for constraint <%s> violated by %g\n", efficacy,
SCIPconsGetName(conss[c]),
MAX(consdata->lhsviol, consdata->rhsviol));
5553 if( bestefficacy != NULL && efficacy > *bestefficacy )
5554 *bestefficacy = efficacy;
5557 if( inenforcement && !
conshdlrdata->enfocutsremovable )
5562 SCIPdebugMsg(scip,
"drop cut since efficacy %g is too small (< %g)\n", efficacy, minefficacy);
5602 assert(scip != NULL);
5603 assert(conshdlr != NULL);
5604 assert(conss != NULL || nconss == 0);
5609 if( separatedlpsol != NULL )
5610 *separatedlpsol =
FALSE;
5612 for( c = 0; c < nconss; ++c )
5614 assert(conss[c] != NULL);
5622 assert(consdata != NULL);
5639 if( separatedlpsol != NULL )
5645 *separatedlpsol =
TRUE;
5648 assert( ! infeasible );
5673 assert(scip != NULL);
5674 assert(event != NULL);
5675 assert(eventdata != NULL);
5676 assert(eventhdlr != NULL);
5688 assert(sol != NULL);
5691 assert(conshdlrdata != NULL);
5701 assert(conss != NULL);
5726 assert(scip != NULL);
5727 assert(conshdlr != NULL);
5728 assert(conss != NULL || nconss == 0);
5732 for( c = 0; c < nconss; ++c )
5734 assert(conss != NULL);
5736 assert(consdata != NULL);
5738 if( consdata->nexprtrees == 0 )
5747 for( i = 0; i < consdata->nexprtrees; ++i )
5757 assert(var != NULL);
5771 SCIPdebugMsg(scip,
"registered %d branching candidates\n", *nnotify);
5794 assert(scip != NULL);
5795 assert(conss != NULL || nconss == 0);
5800 for( c = 0; c < nconss; ++c )
5802 assert(conss != NULL);
5804 assert(consdata != NULL);
5809 for( j = 0; j < consdata->nexprtrees; ++j )
5820 brvarval = ABS(val);
5827 if( *brvar != NULL )
5862 assert(scip != NULL);
5863 assert(conss != NULL || nconss == 0);
5864 assert(addedcons != NULL);
5865 assert(reduceddom != NULL);
5866 assert(infeasible != NULL);
5869 *reduceddom =
FALSE;
5870 *infeasible =
FALSE;
5872 for( c = 0; c < nconss; ++c )
5874 assert(conss != NULL);
5876 assert(consdata != NULL);
5881 lhs = consdata->lhs;
5882 rhs = consdata->rhs;
5884 for( i = 0; i < consdata->nexprtrees; ++i )
5966 if ( consdata->nlinvars == 0 )
5970 else if ( consdata->nlinvars == 1 )
5974 coef = *consdata->lincoefs;
5975 SCIPdebugMsg(scip,
"Linear constraint with one variable: %g <= %g <%s> <= %g\n", lhs, coef,
SCIPvarGetName(*consdata->linvars), rhs);
6006 assert(consdata->linvars[0] != NULL);
6007 SCIPwarningMessage(scip,
"Activity of nonlinear part is beyond SCIP's value for infinity. To enforce " 6008 "the constraint %s SCIP needs to tight bounds of %s to a value beyond +/- infinity. Please check if " 6018 SCIPdebugMsg(scip,
"Lower bound leads to infeasibility.\n");
6034 SCIPdebugMsg(scip,
"Upper bound leads to infeasibility.\n");
6048 consdata->nlinvars, consdata->linvars, consdata->lincoefs, lhs, rhs,
6054 SCIPdebugMsg(scip,
"replace violated nonlinear constraint <%s> by linear constraint after all nonlinear vars have been fixed\n",
SCIPconsGetName(conss[c]) );
6062 SCIPdebugMsg(scip,
"linear constraint is feasible, thus do not add\n");
6091 assert(scip != NULL);
6093 assert(var != NULL);
6094 assert(result != NULL);
6096 assert(nchgbds != NULL);
6152 assert(scip != NULL);
6154 assert(var != NULL);
6155 assert(result != NULL);
6157 assert(nchgbds != NULL);
6220 assert(scip != NULL);
6221 assert(conshdlr != NULL);
6222 assert(cons != NULL);
6223 assert(result != NULL);
6224 assert(nchgbds != NULL);
6227 assert(consdata != NULL);
6246 assert(consdata->minlinactivityinf >= 0);
6247 assert(consdata->maxlinactivityinf >= 0);
6248 assert(consdata->exprgraphnode != NULL || consdata->nexprtrees == 0);
6251 if( consdata->exprgraphnode != NULL )
6269 SCIPdebugMsg(scip,
"found constraint <%s> to be infeasible; sides: [%g, %g], activity: [%g, %g], infeas: %.20g\n",
6283 SCIPdebugMsg(scip,
"found constraint <%s> to be redundant: sides: [%g, %g], activity: [%g, %g]\n",
6295 for( i = 0; i < consdata->nlinvars; ++i )
6297 coef = consdata->lincoefs[i];
6298 var = consdata->linvars[i];
6313 if( consdata->minlinactivityinf == 0 )
6320 bnd -= consdata->minlinactivity;
6335 bnd -= consdata->minlinactivity;
6349 if( consdata->maxlinactivityinf == 0 )
6356 bnd -= consdata->maxlinactivity;
6371 bnd -= consdata->maxlinactivity;
6383 assert(coef < 0.0 );
6388 if( consdata->maxlinactivityinf == 0 )
6394 bnd = consdata->maxlinactivity;
6409 bnd = consdata->maxlinactivity;
6424 if( consdata->minlinactivityinf == 0 )
6430 bnd = consdata->minlinactivity;
6445 bnd = consdata->minlinactivity;
6486 assert(scip != NULL);
6487 assert(conshdlr != NULL);
6488 assert(result != NULL);
6489 assert(nchgbds != NULL);
6497 SCIPdebugMsg(scip,
"start backward propagation in expression graph\n");
6502 file = fopen(
"exprgraph_propconss1.dot",
"w");
6513 for( c = 0; c < nconss; ++c )
6516 assert(consdata != NULL);
6518 if( consdata->exprgraphnode == NULL )
6528 if( !
SCIPisInfinity(scip, -consdata->lhs) && consdata->maxlinactivityinf == 0 )
6529 bounds.
inf = consdata->lhs - consdata->maxlinactivity -
SCIPfeastol(scip);
6533 if( !
SCIPisInfinity(scip, consdata->rhs) && consdata->minlinactivityinf == 0 )
6543 consdata->forcebackprop =
FALSE;
6559 file = fopen(
"exprgraph_propconss2.dot",
"w");
6581 for( i = 0; i < nvars && *result !=
SCIP_CUTOFF; ++i )
6620 assert(scip != NULL);
6621 assert(conshdlr != NULL);
6622 assert(conss != NULL || nconss == 0);
6623 assert(result != NULL);
6624 assert(nchgbds != NULL);
6625 assert(ndelconss != NULL);
6644 SCIPdebugMsg(scip,
"starting domain propagation round %d for %d constraints\n", roundnr, nconss);
6657 file = fopen(
"exprgraph_propvars.dot",
"w");
6668 SCIPdebugMsg(scip,
"current bounds out of domain for some expression, do cutoff\n");
6674 for( c = 0; c < nconss && *result !=
SCIP_CUTOFF; ++c )
6676 assert(conss != NULL);
6683 assert(consdata != NULL);
6690 *result = propresult;
6709 *result = propresult;
6714 while( success && *result !=
SCIP_CUTOFF && ++roundnr < conshdlrdata->maxproprounds );
6730 consdata->linvar_maydecrease = -1;
6731 consdata->linvar_mayincrease = -1;
6735 for( i = 0; i < consdata->nlinvars; ++i )
6738 assert(consdata->lincoefs[i] != 0.0);
6739 if( consdata->lincoefs[i] > 0.0 )
6754 if( (consdata->linvar_maydecrease < 0) ||
6755 (
SCIPvarGetObj(consdata->linvars[consdata->linvar_maydecrease]) / consdata->lincoefs[consdata->linvar_maydecrease] >
SCIPvarGetObj(consdata->linvars[i]) / consdata->lincoefs[i]) )
6756 consdata->linvar_maydecrease = i;
6763 if( (consdata->linvar_mayincrease < 0) ||
6764 (
SCIPvarGetObj(consdata->linvars[consdata->linvar_mayincrease]) / consdata->lincoefs[consdata->linvar_mayincrease] >
SCIPvarGetObj(consdata->linvars[i]) / consdata->lincoefs[i]) )
6765 consdata->linvar_mayincrease = i;
6770 if( consdata->linvar_mayincrease >= 0 )
6772 SCIPdebugMsg(scip,
"may increase <%s> to become feasible\n",
SCIPvarGetName(consdata->linvars[consdata->linvar_mayincrease]));
6774 if( consdata->linvar_maydecrease >= 0 )
6776 SCIPdebugMsg(scip,
"may decrease <%s> to become feasible\n",
SCIPvarGetName(consdata->linvars[consdata->linvar_maydecrease]));
6805 assert(scip != NULL);
6806 assert(conshdlr != NULL);
6807 assert(conss != NULL || nconss == 0);
6808 assert(success != NULL);
6830 for( c = 0; c < nconss; ++c )
6833 assert(consdata != NULL);
6840 assert(!solviolbounds);
6841 viol = consdata->lhs - consdata->activity;
6846 assert(!solviolbounds);
6847 viol = consdata->rhs - consdata->activity;
6852 assert(viol != 0.0);
6853 if( consdata->linvar_mayincrease >= 0 &&
6854 (( viol > 0.0 && consdata->lincoefs[consdata->linvar_mayincrease] > 0.0) ||
6855 (viol < 0.0 && consdata->lincoefs[consdata->linvar_mayincrease] < 0.0)) )
6858 var = consdata->linvars[consdata->linvar_mayincrease];
6860 delta = viol / consdata->lincoefs[consdata->linvar_mayincrease];
6861 assert(delta > 0.0);
6866 delta = MIN(
MAX(0.0, gap), delta);
6878 viol -= consdata->lincoefs[consdata->linvar_mayincrease] * delta;
6884 assert(viol != 0.0);
6885 if( consdata->linvar_maydecrease >= 0 &&
6886 (( viol > 0.0 && consdata->lincoefs[consdata->linvar_maydecrease] < 0.0) ||
6887 (viol < 0.0 && consdata->lincoefs[consdata->linvar_maydecrease] > 0.0)) )
6890 var = consdata->linvars[consdata->linvar_maydecrease];
6892 delta = viol / consdata->lincoefs[consdata->linvar_maydecrease];
6893 assert(delta < 0.0);
6898 delta =
MAX(MIN(0.0, gap), delta);
6909 viol -= consdata->lincoefs[consdata->linvar_maydecrease] * delta;
6958 assert(scip != NULL);
6959 assert(conshdlr != NULL);
6960 assert(conss != NULL || nconss == 0);
6967 if( maxviolcons == NULL )
6982 assert(solinfeasible);
6985 if( !solinfeasible )
6991 assert(consdata != NULL);
6993 maxviol = consdata->lhsviol + consdata->rhsviol;
6997 sol == NULL ?
"LP" :
"relaxation");
7037 *result = propresult;
7044 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, sol,
TRUE ,
SCIPfeastol(scip),
TRUE, &separateresult, &sepaefficacy) );
7053 SCIPdebugMsg(scip,
"separation succeeded (bestefficacy = %g, minefficacy = %g)\n", sepaefficacy,
SCIPfeastol(scip));
7061 SCIPdebugMsg(scip,
"separation failed (bestefficacy = %g < %g = minefficacy ); max viol: %g\n", sepaefficacy,
SCIPfeastol(scip), maxviol);
7069 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, sol,
FALSE,
SCIPlpfeastol(scip),
TRUE, &separateresult, &sepaefficacy) );
7072 *result = separateresult;
7077 if( nnotify == 0 && !solinfeasible )
7091 SCIPdebugMsg(scip,
"All nonlinear variables seem to be fixed. Replace remaining violated nonlinear constraints by linear constraints.\n");
7099 else if ( addedcons )
7101 else if ( reduceddom )
7106 SCIPwarningMessage(scip,
"could not enforce feasibility by separating or branching; declaring solution with viol %g as feasible\n", maxviol);
7113 SCIPdebugMsg(scip,
"Could not find any usual branching variable candidate. Proposed variable <%s> with LP value %g for branching.\n",
7131 assert(scip != NULL);
7132 assert(conshdlr != NULL);
7150 assert(scip != NULL);
7151 assert(conshdlr != NULL);
7154 assert(conshdlrdata != NULL);
7155 assert(conshdlrdata->exprinterpreter != NULL);
7156 assert(conshdlrdata->exprgraph != NULL);
7163 for( i = 0; i < conshdlrdata->nnlconsupgrades; ++i )
7165 assert(conshdlrdata->nlconsupgrades[i] != NULL);
7184 assert(scip != NULL);
7185 assert(conshdlr != NULL);
7188 assert(conshdlrdata != NULL);
7190 conshdlrdata->subnlpheur =
SCIPfindHeur(scip,
"subnlp");
7191 conshdlrdata->trysolheur =
SCIPfindHeur(scip,
"trysol");
7194 conshdlrdata->naddedreformconss = 0;
7199 file = fopen(
"exprgraph_init.dot",
"w");
7217 assert(scip != NULL);
7218 assert(conshdlr != NULL);
7221 assert(conshdlrdata != NULL);
7223 conshdlrdata->subnlpheur = NULL;
7224 conshdlrdata->trysolheur = NULL;
7237 assert(scip != NULL);
7238 assert(conshdlr != NULL);
7239 assert(conss != NULL || nconss == 0);
7241 for( c = 0; c < nconss; ++c )
7248 assert(consdata != NULL);
7251 assert(consdata->nexprtrees == 0 || consdata->exprgraphnode != NULL);
7277 assert(scip != NULL);
7278 assert(conshdlr != NULL);
7279 assert(conss != NULL || nconss == 0);
7282 assert(conshdlrdata != NULL);
7284 havegraphchange =
FALSE;
7286 if( !conshdlrdata->isremovedfixings )
7289 assert(conshdlrdata->isremovedfixings);
7291 havegraphchange =
TRUE;
7296 SCIPdebugMsg(scip,
"expression graph simplifier found %schange, domain error = %u\n", havechange ?
"" :
"no ", domainerror);
7297 havegraphchange |= havechange;
7303 for( c = 0; c < nconss; ++c )
7305 assert(conss != NULL);
7313 assert(consdata != NULL);
7315 if( !consdata->isremovedfixingslin )
7320 if( !consdata->ispresolved || havegraphchange )
7326 assert(!infeasible);
7331 assert(consdata->isremovedfixingslin);
7332 assert(consdata->linvarsmerged);
7334 for( i = 0; i < consdata->nlinvars; ++i )
7338 if( consdata->exprgraphnode != NULL )
7352 exprtreessize, &nexprtrees, exprtrees, coefs) );
7353 assert(nexprtrees > 0);
7360 assert(consdata->nexprtrees > 0 );
7362 for( j = 0; j < consdata->nexprtrees; ++j )
7384 assert(scip != NULL);
7385 assert(conshdlr != NULL);
7386 assert(conss != NULL || nconss == 0);
7389 assert(conshdlrdata != NULL);
7391 for( c = 0; c < nconss; ++c )
7393 assert(conss != NULL);
7395 assert(consdata != NULL);
7402 consdata->lincoefsmax = 0.0;
7403 for( i = 0; i < consdata->nlinvars; ++i )
7405 consdata->lincoefsmin = MIN(consdata->lincoefsmin,
REALABS(consdata->lincoefs[i]));
7406 consdata->lincoefsmax =
MAX(consdata->lincoefsmax,
REALABS(consdata->lincoefs[i]));
7412 if( consdata->nlrow == NULL )
7418 assert(consdata->nlrow != NULL);
7424 conshdlrdata->newsoleventfilterpos = -1;
7430 assert(eventhdlr != NULL);
7436 conshdlrdata->sepanlp =
FALSE;
7437 conshdlrdata->lastenfonode = NULL;
7438 conshdlrdata->nenforounds = 0;
7451 assert(scip != NULL);
7452 assert(conshdlr != NULL);
7453 assert(conss != NULL || nconss == 0);
7456 assert(conshdlrdata != NULL);
7458 if( conshdlrdata->newsoleventfilterpos >= 0 )
7463 assert(eventhdlr != NULL);
7466 conshdlrdata->newsoleventfilterpos = -1;
7469 for( c = 0; c < nconss; ++c )
7472 assert(consdata != NULL);
7475 if( consdata->nlrow != NULL )
7489 assert(scip != NULL);
7490 assert(conshdlr != NULL);
7491 assert(cons != NULL);
7493 assert(consdata != NULL);
7499 assert((*consdata)->exprgraphnode == NULL);
7503 assert(*consdata == NULL);
7517 assert(sourcedata != NULL);
7520 sourcedata->lhs, sourcedata->rhs,
7521 sourcedata->nlinvars, sourcedata->linvars, sourcedata->lincoefs,
7522 sourcedata->nexprtrees, sourcedata->exprtrees, sourcedata->nonlincoefs,
7526 if( sourcedata->iscurvchecked && sourcedata->nexprtrees > 0 )
7528 BMScopyMemoryArray(targetdata->curvatures, sourcedata->curvatures, sourcedata->nexprtrees);
7529 targetdata->curvature = sourcedata->curvature;
7530 targetdata->iscurvchecked =
TRUE;
7533 for( i = 0; i < targetdata->nlinvars; ++i )
7539 for( i = 0; i < targetdata->nexprtrees; ++i )
7551 SCIPdebugMsg(scip,
"created transformed nonlinear constraint ");
7572 assert(scip != NULL);
7573 assert(conshdlr != NULL);
7574 assert(conss != NULL || nconss == 0);
7577 assert(conshdlrdata != NULL);
7579 *infeasible =
FALSE;
7581 for( c = 0; c < nconss && !(*infeasible); ++c )
7583 assert(conss[c] != NULL);
7588 assert(consdata != NULL);
7592 if( consdata->nexprtrees == 0 )
7594 assert(consdata->exprgraphnode == NULL);
7606 haveunboundedvar =
FALSE;
7607 for( j = 0; j < consdata->nexprtrees; ++j )
7612 for( i = 0; i < nvars; ++i )
7615 assert(var != NULL);
7624 haveunboundedvar =
TRUE;
7676 for( j = 0; j < consdata->nexprtrees; ++j )
7694 assert(scip != NULL);
7695 assert(conshdlr != NULL);
7696 assert(conss != NULL || nconss == 0);
7697 assert(result != NULL);
7702 assert(conshdlrdata != NULL);
7711 if( maxviolcon == NULL )
7717 if(
SCIPgetDepth(scip) == 0 && !conshdlrdata->sepanlp &&
7734 for( c = 0; c < nconss; ++c )
7736 assert(conss[c] != NULL);
7739 assert(consdata != NULL);
7758 if( conshdlrdata->subnlpheur != NULL )
7773 SCIPdebugMsg(scip,
"solved NLP relax, solution status: %d\n", solstat);
7779 conshdlrdata->sepanlp =
TRUE;
7783 SCIPdebugMsg(scip,
"NLP relaxation is globally infeasible, thus can cutoff node\n");
7795 assert(nlpsol != NULL);
7798 if( solvednlp && conshdlrdata->trysolheur != NULL )
7808 if( nfracvars == 0 )
7819 if( lpsolseparated )
7821 SCIPdebugMsg(scip,
"linearization cuts separate LP solution\n");
7833 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, NULL,
TRUE,
SCIPgetSepaMinEfficacy(scip),
FALSE, result, NULL) );
7845 assert(scip != NULL);
7846 assert(conshdlr != NULL);
7847 assert(conss != NULL || nconss == 0);
7848 assert(sol != NULL);
7849 assert(result != NULL);
7860 if( maxviolcon == NULL )
7866 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, sol,
FALSE,
SCIPgetSepaMinEfficacy(scip),
FALSE, result, NULL) );
7904 assert(scip != NULL);
7905 assert(conss != NULL || nconss == 0);
7910 assert(!solviolbounds);
7912 if( maxviolcons == NULL )
7930 *result = propresult;
7937 for( c = 0; c < nconss; ++c )
7939 assert(conss != NULL);
7941 assert(consdata != NULL);
7946 for( i = 0; i < consdata->nlinvars; ++i )
7948 var = consdata->linvars[i];
7956 for( j = 0; j < consdata->nexprtrees; ++j )
7972 SCIPdebugMsg(scip,
"All variables in violated constraints fixed (up to epsilon). Cannot find branching candidate. Forcing solution of LP.\n");
7992 assert(scip != NULL);
7993 assert(conss != NULL || nconss == 0);
7994 assert(result != NULL);
7997 assert(conshdlrdata != NULL);
8006 assert(conshdlrdata->exprgraph != NULL);
8018 maypropfeasible = conshdlrdata->linfeasshift && (conshdlrdata->trysolheur != NULL) &&
8023 for( c = 0; c < nconss; ++c )
8025 assert(conss != NULL);
8027 assert(!solviolbounds);
8030 assert(consdata != NULL);
8041 SCIPinfoMessage(scip, NULL,
"violation: left hand side is violated by %.15g (scaled: %.15g)\n", consdata->lhs - consdata->activity, consdata->lhsviol);
8045 SCIPinfoMessage(scip, NULL,
"violation: right hand side is violated by %.15g (scaled: %.15g)\n", consdata->activity - consdata->rhs, consdata->rhsviol);
8049 if( (conshdlrdata->subnlpheur == NULL || sol == NULL) && !maypropfeasible && !completely )
8052 if( consdata->lhsviol > maxviol || consdata->rhsviol > maxviol )
8053 maxviol =
MAX(consdata->lhsviol, consdata->rhsviol);
8057 maypropfeasible =
FALSE;
8059 if( maypropfeasible )
8069 if( !(consdata->linvar_mayincrease >= 0 && consdata->lincoefs[consdata->linvar_mayincrease] > 0.0) &&
8070 ! (consdata->linvar_maydecrease >= 0 && consdata->lincoefs[consdata->linvar_maydecrease] < 0.0) )
8071 maypropfeasible =
FALSE;
8078 if( !(consdata->linvar_mayincrease >= 0 && consdata->lincoefs[consdata->linvar_mayincrease] < 0.0) &&
8079 ! (consdata->linvar_maydecrease >= 0 && consdata->lincoefs[consdata->linvar_maydecrease] > 0.0) )
8080 maypropfeasible =
FALSE;
8116 assert(scip != NULL);
8117 assert(conshdlr != NULL);
8118 assert(conss != NULL || nconss == 0);
8119 assert(result != NULL);
8140 assert(scip != NULL);
8141 assert(conshdlr != NULL);
8142 assert(conss != NULL || nconss == 0);
8143 assert(result != NULL);
8148 assert(conshdlrdata != NULL);
8149 assert(conshdlrdata->exprgraph != NULL);
8151 havegraphchange =
FALSE;
8153 if( !conshdlrdata->isremovedfixings )
8156 assert(conshdlrdata->isremovedfixings);
8158 havegraphchange =
TRUE;
8162 SCIPdebugMsg(scip,
"expression graph simplifier found %schange, domain error = %u\n", havechange ?
"" :
"no ", domainerror);
8171 havegraphchange |= havechange;
8174 tryupgrades = havegraphchange;
8179 for( c = 0; c < nconss; ++c )
8181 assert(conss != NULL);
8184 assert(consdata != NULL);
8191 if( !consdata->isremovedfixingslin )
8194 assert(consdata->isremovedfixingslin);
8204 if( !consdata->ispresolved || havegraphchange )
8217 if( consdata->nlinvars == 0 && consdata->exprgraphnode == NULL )
8243 consdata->ispresolved =
FALSE;
8246 if( !consdata->ispresolved )
8261 SCIPdebugMsg(scip,
"propagating variable bounds through expression graph found that some expressions cannot be evaluated w.r.t. current bounds, thus cutoff\n");
8266 for( c = 0; c < nconss; ++c )
8269 assert(consdata != NULL);
8272 if( !consdata->ispresolved || havegraphchange )
8284 consdata->ispresolved =
TRUE;
8292 switch( propresult )
8298 SCIPdebugMsg(scip,
"propagation says problem is infeasible in presolve\n");
8306 if( conshdlrdata->reformulate && !conshdlrdata->assumeconvex )
8314 int naddconssbefore;
8316 SCIPdebugMsg(scip,
"reformulating expression graph\n");
8318 naddconssbefore = conshdlrdata->naddedreformconss;
8321 if( conshdlrdata->naddedreformconss > naddconssbefore )
8324 *naddconss += conshdlrdata->naddedreformconss - naddconssbefore;
8327 for( c = 0; c < nconss; ++c )
8329 assert(conss[c] != NULL);
8332 assert(consdata != NULL);
8334 consdata->ispresolved =
FALSE;
8353 assert(scip != NULL);
8354 assert(cons != NULL);
8362 assert(consdata != NULL);
8367 for( i = 0; i < consdata->nlinvars; ++i )
8369 if( consdata->lincoefs[i] > 0 )
8403 assert(scip != NULL);
8404 assert(conshdlr != NULL);
8405 assert(cons != NULL);
8409 assert(conshdlrdata != NULL);
8410 assert(conshdlrdata->exprgraph != NULL);
8413 assert(consdata != NULL);
8417 if( consdata->nexprtrees > 0 )
8421 assert(consdata->exprgraphnode == NULL);
8425 assert(consdata->exprgraphnode != NULL);
8435 conshdlrdata->isreformulated =
FALSE;
8440 consdata->forcebackprop =
TRUE;
8442 else if( consdata->exprgraphnode != NULL )
8445 conshdlrdata->isreformulated =
FALSE;
8450 consdata->forcebackprop =
TRUE;
8463 assert(scip != NULL);
8464 assert(conshdlr != NULL);
8465 assert(cons != NULL);
8469 assert(conshdlrdata != NULL);
8470 assert(conshdlrdata->exprgraph != NULL);
8473 assert(consdata != NULL);
8474 assert(consdata->exprgraphnode != NULL || consdata->nexprtrees == 0);
8478 if( consdata->exprgraphnode != NULL )
8480 if( consdata->nexprtrees == 0 )
8507 assert(scip != NULL);
8508 assert(conshdlr != NULL);
8509 assert(cons != NULL);
8514 assert(conshdlrdata != NULL);
8515 assert(conshdlrdata->exprgraph != NULL);
8518 assert(consdata != NULL);
8522 if( consdata->exprgraphnode != NULL )
8529 consdata->isremovedfixingslin =
TRUE;
8530 for( i = 0; i < consdata->nlinvars; ++i )
8534 consdata->isremovedfixingslin = consdata->isremovedfixingslin &&
SCIPvarIsActive(consdata->linvars[i]);
8548 assert(scip != NULL);
8549 assert(conshdlr != NULL);
8550 assert(cons != NULL);
8554 assert(conshdlrdata != NULL);
8555 assert(conshdlrdata->exprgraph != NULL);
8558 assert(consdata != NULL);
8559 assert(consdata->lineventdata != NULL || consdata->nlinvars == 0);
8564 if( consdata->exprgraphnode != NULL )
8569 for( i = 0; i < consdata->nlinvars; ++i )
8585 assert(scip != NULL);
8586 assert(cons != NULL);
8589 assert(consdata != NULL);
8594 && !
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
8598 if( consdata->nlinvars == 0 && consdata->nexprtrees == 0 && consdata->exprgraphnode == 0 )
8604 if( consdata->nexprtrees > 0 )
8606 for( j = 0; j < consdata->nexprtrees; ++j )
8608 if( j > 0 || consdata->nonlincoefs[j] != 1.0 )
8613 else if( consdata->exprgraphnode != NULL )
8619 assert(conshdlrdata != NULL);
8627 for( j = 0; j < consdata->nlinvars; ++j )
8637 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
8670 assert(scip != NULL);
8671 assert(cons != NULL);
8672 assert(sourcescip != NULL);
8673 assert(sourceconshdlr != NULL);
8674 assert(sourcecons != NULL);
8675 assert(varmap != NULL);
8676 assert(valid != NULL);
8679 assert(consdata != NULL);
8686 if( consdata->nlinvars != 0 )
8689 for( i = 0; i < consdata->nlinvars && *valid; ++i )
8691 SCIP_CALL(
SCIPgetVarCopy(sourcescip, scip, consdata->linvars[i], &linvars[i], varmap, consmap, global, valid) );
8692 assert(!*valid || linvars[i] != NULL);
8699 if( *valid && consdata->nexprtrees > 0 )
8703 nonlincoefs = consdata->nonlincoefs;
8704 nexprtrees = consdata->nexprtrees;
8710 for( j = 0; j < consdata->nexprtrees; ++j )
8716 assert(!*valid || nonlinvars[i] != NULL);
8731 if( *valid && consdata->nexprtrees == 0 && consdata->exprgraphnode != NULL )
8747 assert(!*valid || nonlinvars[i] != NULL);
8754 consdata->nlinvars, linvars, consdata->lincoefs,
8755 nexprtrees, exprtrees, nonlincoefs,
8756 consdata->lhs, consdata->rhs,
8757 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
8761 targetconsdata->curvature = consdata->curvature;
8762 targetconsdata->iscurvchecked = consdata->iscurvchecked && global;
8766 if( exprtrees != NULL )
8768 for( j = 0; j < nexprtrees; ++j )
8770 if( exprtrees[j] != NULL )
8788 assert(cons != NULL);
8791 assert(consdata != NULL);
8795 if( varssize < consdata->nlinvars )
8802 cnt = consdata->nlinvars;
8804 if( consdata->exprgraphnode != NULL )
8811 assert(conshdlrdata != NULL);
8819 if( varsusage[i] == 0 )
8822 if( cnt >= varssize )
8840 for( e = 0; e < consdata->nexprtrees; ++e )
8844 assert(exprvars != NULL || nexprvars == 0);
8846 if( cnt + nexprvars > varssize )
8867 assert(consdata != NULL);
8869 *nvars = consdata->nlinvars;
8871 if( consdata->exprgraphnode != NULL )
8878 assert(conshdlrdata != NULL);
8885 if( varsusage[i] > 0 )
8894 for( e = 0; e < consdata->nexprtrees; ++e )
8915 char* nonconstendptr;
8916 const char* exprstart;
8917 const char* exprlastchar;
8923 SCIPdebugMsg(scip,
"cons_nonlinear::consparse parsing %s\n",str);
8925 assert(scip != NULL);
8926 assert(success != NULL);
8927 assert(str != NULL);
8928 assert(name != NULL);
8929 assert(cons != NULL);
8947 if( isdigit((
unsigned char)str[0]) || ((str[0] ==
'-' || str[0] ==
'+') && isdigit((
unsigned char)str[1])) )
8955 endptr = nonconstendptr;
8958 while( isspace((
unsigned char)*endptr) )
8961 if( endptr[0] !=
'<' || endptr[1] !=
'=' )
8972 while( isspace((
unsigned char)*str) )
8978 while( !(strncmp(endptr,
"[free]", 6) == 0) &&
8979 !(endptr[0] ==
'<' && endptr[1] ==
'=') &&
8980 !(endptr[0] ==
'=' && endptr[1] ==
'=') &&
8981 !(endptr[0] ==
'>' && endptr[1] ==
'=') &&
8982 !(endptr[0] ==
'\0') )
8986 exprlastchar = endptr - 1;
8992 while( isspace((
unsigned char)*str) )
8996 if( strncmp(str,
"[free]", 6) == 0 )
9045 varnameslength = (int) (exprlastchar - exprstart) + 5;
9061 curvarname = varnames;
9062 for( i = 0; i < nvars; ++i )
9064 assert(*curvarname == i);
9067 exprvars[i] =
SCIPfindVar(scip, (
char*)curvarname);
9068 if( exprvars[i] == NULL )
9070 SCIPerrorMessage(
"Unknown SCIP variable <%s> encountered in expression.\n", (
char*)curvarname);
9075 curvarname += (strlen((
char*)curvarname) + 1)/
sizeof(
int) + 1;
9087 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
9120 consEnfolpNonlinear, consEnfopsNonlinear, consCheckNonlinear, consLockNonlinear,
9122 assert(conshdlr != NULL);
9153 "maximal coef range of a cut (maximal coefficient divided by minimal coefficient) in order to be added to LP relaxation",
9157 "whether to try to make solutions in check function feasible by shifting a linear variable (esp. useful if constraint was actually objective function)",
9162 "whether to apply expensive curvature checking methods",
9167 "whether to assume that nonlinear functions in inequalities (<=) are convex (disables reformulation)",
9171 "limit on number of propagation rounds for a single constraint within one round of SCIP propagation",
9175 "whether to reformulate expression graph",
9179 "maximal exponent where still expanding non-monomial polynomials in expression simplification",
9183 "minimal required fraction of continuous variables in problem to use solution of NLP relaxation in root for separation",
9187 "are cuts added during enforcement removable from the LP in the same node?",
9192 processLinearVarEvent, NULL) );
9201 processNewSolutionEvent, NULL) );
9208 exprgraphVarAdded, exprgraphVarRemove, NULL, (
void*)
conshdlrdata) );
9224 const char* conshdlrname
9234 assert(conshdlrname != NULL );
9237 if( nonlinconsupgd == NULL && nodereform == NULL )
9242 if( conshdlr == NULL )
9249 assert(conshdlrdata != NULL);
9252 for( i = conshdlrdata->nnlconsupgrades - 1; i >= 0; --i )
9254 if( conshdlrdata->nlconsupgrades[i]->nlconsupgd == nonlinconsupgd && conshdlrdata->nlconsupgrades[i]->nodereform == nodereform)
9257 SCIPwarningMessage(scip,
"Try to add already known upgrade method pair (%p,%p) for constraint handler <%s>.\n", nonlinconsupgd, nodereform, conshdlrname);
9265 nlconsupgrade->nlconsupgd = nonlinconsupgd;
9266 nlconsupgrade->nodereform = nodereform;
9267 nlconsupgrade->
priority = priority;
9271 assert(conshdlrdata->nnlconsupgrades <= conshdlrdata->nlconsupgradessize);
9272 if( conshdlrdata->nnlconsupgrades+1 > conshdlrdata->nlconsupgradessize )
9278 conshdlrdata->nlconsupgradessize = newsize;
9280 assert(conshdlrdata->nnlconsupgrades+1 <= conshdlrdata->nlconsupgradessize);
9282 for( i = conshdlrdata->nnlconsupgrades; i > 0 && conshdlrdata->nlconsupgrades[i-1]->priority < nlconsupgrade->
priority; --i )
9283 conshdlrdata->nlconsupgrades[i] = conshdlrdata->nlconsupgrades[i-1];
9284 assert(0 <= i && i <= conshdlrdata->nnlconsupgrades);
9285 conshdlrdata->nlconsupgrades[i] = nlconsupgrade;
9286 conshdlrdata->nnlconsupgrades++;
9292 paramname, paramdesc,
9293 &nlconsupgrade->
active,
FALSE, active, NULL, NULL) );
9344 assert(linvars != NULL || nlinvars == 0);
9345 assert(lincoefs != NULL || nlinvars == 0);
9346 assert(exprtrees != NULL || nexprtrees == 0);
9347 assert(modifiable ==
FALSE);
9351 if( conshdlr == NULL )
9360 consdata->lhs = lhs;
9361 consdata->rhs = rhs;
9364 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
9365 local, modifiable, dynamic, removable, stickingatnode) );
9369 for( i = 0; i < nlinvars; ++i )
9410 assert(scip != NULL);
9413 nonlincoefs, lhs, rhs,
9465 assert(modifiable ==
FALSE);
9470 if( conshdlr == NULL )
9479 consdata->lhs = lhs;
9480 consdata->rhs = rhs;
9483 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
9484 local, modifiable, dynamic, removable, stickingatnode) );
9488 for( i = 0; i < nlinvars; ++i )
9497 if( exprgraphnode != NULL )
9499 consdata->exprgraphnode = exprgraphnode;
9501 consdata->iscurvchecked =
FALSE;
9536 assert(scip != NULL);
9552 assert(scip != NULL);
9553 assert(cons != NULL);
9554 assert(var != NULL);
9573 assert(scip != NULL);
9574 assert(cons != NULL);
9577 assert(exprtrees != NULL || nexprtrees == 0);
9595 assert(scip != NULL);
9596 assert(cons != NULL);
9599 assert(exprtrees != NULL || nexprtrees == 0);
9615 assert(cons != NULL);
9616 assert(nlrow != NULL);
9619 assert(consdata != NULL);
9621 if( consdata->nlrow == NULL )
9625 assert(consdata->nlrow != NULL);
9626 *nlrow = consdata->nlrow;
9637 assert(cons != NULL);
9649 assert(cons != NULL);
9661 assert(cons != NULL);
9673 assert(cons != NULL);
9686 assert(cons != NULL);
9699 assert(cons != NULL);
9712 assert(cons != NULL);
9724 assert(cons != NULL);
9736 assert(cons != NULL);
9751 assert(scip != NULL);
9752 assert(cons != NULL);
9755 assert(conshdlr != NULL);
9776 assert(scip != NULL);
9777 assert(cons != NULL);
9778 assert(curvature != NULL);
9781 assert(consdata != NULL);
9784 assert(conshdlr != NULL);
9788 if( checkcurv && !consdata->iscurvchecked )
9793 *curvature = consdata->curvature;
9810 assert(scip != NULL);
9811 assert(cons != NULL);
9812 assert(curvatures != NULL);
9816 assert(consdata != NULL);
9819 assert(conshdlr != NULL);
9825 if( checkcurv && !consdata->iscurvchecked )
9830 *curvatures = consdata->curvatures;
9847 assert(scip != NULL);
9848 assert(cons != NULL);
9849 assert(violation != NULL);
9854 SCIPwarningMessage(scip,
"SCIPgetViolationNonlinear is not available for active constraints during presolve.\n");
9860 assert(conshdlr != NULL);
9866 SCIPerrorMessage(
"Solution passed to SCIPgetViolationNonlinear() does not satisfy variable bounds.\n");
9871 assert(consdata != NULL);
9873 *violation =
MAX(consdata->lhsviol, consdata->rhsviol);
9886 assert(scip != NULL);
9887 assert(cons != NULL);
9890 assert(consdata != NULL);
9892 if( consdata->linvar_mayincrease == -1 && consdata->linvar_maydecrease == -1 )
9895 return consdata->linvar_maydecrease;
9906 assert(scip != NULL);
9907 assert(cons != NULL);
9910 assert(consdata != NULL);
9912 if( consdata->linvar_mayincrease == -1 && consdata->linvar_maydecrease == -1 )
9915 return consdata->linvar_mayincrease;
9926 assert(scip != NULL);
9927 assert(conshdlr != NULL);
9958 assert(scip != NULL);
9959 assert(alpha != NULL);
9960 assert(beta != NULL);
9961 assert(gamma_ != NULL);
9962 assert(delta != NULL);
9964 *alpha = -b3*c2 + a3*(-b2+c2) + a2*(b3-c3) + b2*c3;
9965 *beta = -(-b3*c1 + a3*(-b1+c1) + a1*(b3-c3) + b1*c3);
9966 *gamma_ = -a2*b1 + a1*b2 + a2*c1 - b2*c1 - a1*c2 + b1*c2;
9967 *delta = -a3*b2*c1 + a2*b3*c1 + a3*b1*c2 - a1*b3*c2 - a2*b1*c3 + a1*b2*c3;
9970 if( !
SCIPisRelEQ(scip, *alpha * a1 + *beta * a2 + *gamma_ * a3, *delta) ||
9971 !
SCIPisRelEQ(scip, *alpha * b1 + *beta * b2 + *gamma_ * b3, *delta) ||
9972 !
SCIPisRelEQ(scip, *alpha * c1 + *beta * c2 + *gamma_ * c3, *delta) )
9994 SCIPdebugMsg(scip,
"numerical troubles - try to solve the linear system via an LU factorization\n");
10007 if( !success || !
SCIPisRelEQ(scip, *alpha * a1 + *beta * a2 + *gamma_ * a3, *delta) ||
10008 !
SCIPisRelEQ(scip, *alpha * b1 + *beta * b2 + *gamma_ * b3, *delta) ||
10009 !
SCIPisRelEQ(scip, *alpha * c1 + *beta * c2 + *gamma_ * c3, *delta) )
10011 SCIPdebugMsg(scip,
"could not resolve numerical difficulties\n");
10019 if( *gamma_ < 0.0 )
10023 *gamma_ = -*gamma_;
enum SCIP_Result SCIP_RESULT
static SCIP_DECL_CONSENABLE(consEnableNonlinear)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
static SCIP_DECL_EXPRGRAPHVARREMOVE(exprgraphVarRemove)
SCIP_Real SCIPexprgraphGetNodeVal(SCIP_EXPRGRAPHNODE *node)
int SCIPgetNIntVars(SCIP *scip)
static SCIP_RETCODE presolveUpgrade(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_Bool *upgraded, int *nupgdconss, int *naddconss)
SCIP_RETCODE SCIPexprgraphPropagateVarBounds(SCIP_EXPRGRAPH *exprgraph, SCIP_Real infinity, SCIP_Bool clearreverseprop, SCIP_Bool *domainerror)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
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 void consdataUpdateLinearActivityUbChange(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Real coef, SCIP_Real oldbnd, SCIP_Real newbnd)
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 SCIPfeastol(SCIP *scip)
SCIP_RETCODE SCIPlpiFree(SCIP_LPI **lpi)
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)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
primal heuristic that tries a given solution
SCIP_Bool SCIPisNLPConstructed(SCIP *scip)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPexprgraphGetSumTrees(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, int exprtreessize, int *nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *exprtreecoefs)
SCIP_NODE * SCIPgetCurrentNode(SCIP *scip)
SCIP_RETCODE SCIPexprgraphAddVars(SCIP_EXPRGRAPH *exprgraph, int nvars, void **vars, SCIP_EXPRGRAPHNODE **varnodes)
SCIP_STAGE SCIPgetStage(SCIP *scip)
static void consdataFindUnlockedLinearVar(SCIP *scip, SCIP_CONSDATA *consdata)
methods to interpret (evaluate) an expression tree "fast"
#define SCIP_EVENTTYPE_VARFIXED
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_Real * SCIPvarGetMultaggrScalars(SCIP_VAR *var)
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)))
int * SCIPexprGetMonomialChildIndices(SCIP_EXPRDATA_MONOMIAL *monomial)
static SCIP_RETCODE getCoeffsAndConstantFromLinearExpr(SCIP_EXPR *expr, SCIP_Real scalar, SCIP_Real *varcoeffs, SCIP_Real *constant)
SCIP_RETCODE SCIPexprgraphUpdateNodeBoundsCurvature(SCIP_EXPRGRAPHNODE *node, SCIP_Real infinity, SCIP_Real minstrength, SCIP_Bool clearreverseprop)
SCIP_Bool SCIPisRelEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE addLinearizationCuts(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *ref, SCIP_Bool *separatedlpsol, SCIP_Real minefficacy)
static SCIP_DECL_CONSEXIT(consExitNonlinear)
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_RETCODE SCIPlpiGetSol(SCIP_LPI *lpi, SCIP_Real *objval, SCIP_Real *primsol, SCIP_Real *dualsol, SCIP_Real *activity, SCIP_Real *redcost)
SCIP_Real SCIPintervalNegateReal(SCIP_Real x)
static SCIP_DECL_CONSDISABLE(consDisableNonlinear)
SCIP_EXPROP SCIPexprGetOperator(SCIP_EXPR *expr)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
static SCIP_RETCODE unlockLinearVariable(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
int SCIPexprgraphGetNVars(SCIP_EXPRGRAPH *exprgraph)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
static SCIP_RETCODE addUserEstimator(SCIP *scip, SCIP_CONS *cons, int exprtreeidx, SCIP_Real *x, SCIP_Bool overestimate, SCIP_ROWPREP *rowprep, SCIP_Bool *success)
SCIP_RETCODE SCIPgetExprtreeCurvaturesNonlinear(SCIP *scip, SCIP_CONS *cons, SCIP_Bool checkcurv, SCIP_EXPRCURV **curvatures)
SCIP_RETCODE SCIPlpiSetIntpar(SCIP_LPI *lpi, SCIP_LPPARAM type, int ival)
void SCIPsortPtrPtrReal(void **ptrarray1, void **ptrarray2, SCIP_Real *realarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
SCIP_RETCODE SCIPaddRowprepTerms(SCIP *scip, SCIP_ROWPREP *rowprep, int nvars, SCIP_VAR **vars, SCIP_Real *coefs)
static SCIP_RETCODE consdataAddExprtrees(SCIP *scip, SCIP_CONSDATA *consdata, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *coefs, SCIP_Bool copytrees)
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
SCIPInterval pow(const SCIPInterval &x, const SCIPInterval &y)
static SCIP_DECL_EXPRGRAPHVARADDED(exprgraphVarAdded)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
SCIP_VAR ** SCIPvarGetMultaggrVars(SCIP_VAR *var)
SCIP_RETCODE SCIPexprintGradInt(SCIP_EXPRINT *exprint, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *varvals, SCIP_Bool new_varvals, SCIP_INTERVAL *val, SCIP_INTERVAL *gradient)
int SCIPexprgraphGetDepth(SCIP_EXPRGRAPH *exprgraph)
SCIP_RETCODE SCIPcleanupRowprep(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_SOL *sol, SCIP_Real maxcoefrange, SCIP_Real minviol, SCIP_Real *coefrange, SCIP_Real *viol)
SCIP_RETCODE SCIPsetExprtreesNonlinear(SCIP *scip, SCIP_CONS *cons, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *coefs)
const char * SCIPexpropGetName(SCIP_EXPROP op)
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)
SCIP_RETCODE SCIPaddRowprepTerm(SCIP *scip, SCIP_ROWPREP *rowprep, SCIP_VAR *var, SCIP_Real coef)
SCIP_RETCODE SCIPsetConshdlrDeactive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
static SCIP_RETCODE checkCurvature(SCIP *scip, SCIP_CONS *cons, SCIP_Bool expensivechecks, SCIP_Bool assumeconvex)
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_Real * SCIPexprtreeGetParamVals(SCIP_EXPRTREE *tree)
SCIP_NLPSOLSTAT SCIPgetNLPSolstat(SCIP *scip)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
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 reformEnsureChildrenMinCurvature(SCIP *scip, SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, SCIP_EXPRCURV mincurv, SCIP_CONS **conss, int nconss, int *naddcons)
void SCIPexprgraphCaptureNode(SCIP_EXPRGRAPHNODE *node)
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
static SCIP_RETCODE splitOffLinearPart(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
struct SCIP_EventhdlrData SCIP_EVENTHDLRDATA
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
#define SCIP_EXPRINTCAPABILITY_INTGRADIENT
SCIP_RETCODE SCIPexprgraphCreateNodeQuadratic(BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node, int nchildren, SCIP_Real *lincoefs, int nquadelems, SCIP_QUADELEM *quadelems, SCIP_Real constant)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
static SCIP_RETCODE consdataCreateEmpty(SCIP *scip, SCIP_CONSDATA **consdata)
int SCIPexprGetOpIndex(SCIP_EXPR *expr)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
void SCIPintervalSetRoundingMode(SCIP_ROUNDMODE roundmode)
SCIP_CONS ** SCIPconshdlrGetConss(SCIP_CONSHDLR *conshdlr)
void SCIPexprgraphPropagateNodeBounds(SCIP_EXPRGRAPH *exprgraph, SCIP_Real infinity, SCIP_Real minstrength, SCIP_Bool *cutoff)
SCIP_Real SCIPadjustedVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real ub)
static SCIP_DECL_CONSINITPRE(consInitpreNonlinear)
static SCIP_DECL_CONSENFOLP(consEnfolpNonlinear)
SCIP_EXPRGRAPHNODE ** SCIPexprgraphGetVarNodes(SCIP_EXPRGRAPH *exprgraph)
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)
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 SCIPgetNlRowNonlinear(SCIP *scip, SCIP_CONS *cons, SCIP_NLROW **nlrow)
SCIP_RETCODE SCIPunmarkConsPropagate(SCIP *scip, SCIP_CONS *cons)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPsolveNLP(SCIP *scip)
static SCIP_RETCODE addLinearization(SCIP *scip, SCIP_EXPRINT *exprint, SCIP_CONS *cons, int exprtreeidx, SCIP_Real *x, SCIP_Bool newx, SCIP_ROWPREP *rowprep, SCIP_Bool *success)
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
#define SCIP_PRESOLTIMING_EXHAUSTIVE
SCIP_RETCODE SCIPlpiSetRealpar(SCIP_LPI *lpi, SCIP_LPPARAM type, SCIP_Real dval)
static SCIP_RETCODE consdataSetExprtrees(SCIP *scip, SCIP_CONSDATA *consdata, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *coefs, SCIP_Bool copytrees)
SCIP_RETCODE SCIPexprtreeCopy(BMS_BLKMEM *blkmem, SCIP_EXPRTREE **targettree, SCIP_EXPRTREE *sourcetree)
SCIP_RETCODE SCIPexprintCompile(SCIP_EXPRINT *exprint, SCIP_EXPRTREE *tree)
int SCIPexprgraphGetNodeNParents(SCIP_EXPRGRAPHNODE *node)
SCIP_INTERVAL SCIPexprgraphGetNodeBounds(SCIP_EXPRGRAPHNODE *node)
static SCIP_RETCODE addConcaveEstimatorUnivariate(SCIP *scip, SCIP_CONS *cons, int exprtreeidx, SCIP_ROWPREP *rowprep, SCIP_Bool *success)
SCIP_RETCODE SCIPgetCurvatureNonlinear(SCIP *scip, SCIP_CONS *cons, SCIP_Bool checkcurv, SCIP_EXPRCURV *curvature)
SCIP_RETCODE SCIPexprgraphEval(SCIP_EXPRGRAPH *exprgraph, SCIP_Real *varvals)
void SCIPintervalSetBounds(SCIP_INTERVAL *resultant, SCIP_Real inf, SCIP_Real sup)
int * SCIPexprgraphGetNNodes(SCIP_EXPRGRAPH *exprgraph)
SCIP_Real SCIPgetRhsNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
SCIP_RETCODE SCIPexprEvalInt(SCIP_EXPR *expr, SCIP_Real infinity, SCIP_INTERVAL *varvals, SCIP_Real *param, SCIP_INTERVAL *val)
static GRAPHNODE ** active
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_SEPAFREQ
static SCIP_DECL_CONSSEPALP(consSepalpNonlinear)
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
SCIP_EVENTHDLR * SCIPfindEventhdlr(SCIP *scip, const char *name)
SCIP_MESSAGEHDLR * SCIPgetMessagehdlr(SCIP *scip)
int SCIPgetLinvarMayDecreaseNonlinear(SCIP *scip, SCIP_CONS *cons)
static void consdataUpdateLinearActivityLbChange(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_Real coef, SCIP_Real oldbnd, SCIP_Real newbnd)
SCIP_RETCODE SCIPexprgraphAddExprtreeSum(SCIP_EXPRGRAPH *exprgraph, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *coefs, SCIP_EXPRGRAPHNODE **rootnode, SCIP_Bool *rootnodeisnew)
SCIP_EXPRTREE ** SCIPgetExprtreesNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_CONSACTIVE(consActiveNonlinear)
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_CONSSEPASOL(consSepasolNonlinear)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_Real SCIPadjustedVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real lb)
SCIP_RETCODE SCIPcreateConsBasicNonlinear2(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)
static SCIP_RETCODE reformReplaceNode(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE **node, SCIP_EXPRGRAPHNODE *replacement, SCIP_CONS **conss, int nconss)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPdebugPrintCons(x, y, z)
SCIP_RETCODE SCIPaddExprtreesNonlinear(SCIP *scip, SCIP_CONS *cons, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *coefs)
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 SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
SCIP_RETCODE SCIPexprgraphFree(SCIP_EXPRGRAPH **exprgraph)
SCIP_RETCODE SCIPlpiCreate(SCIP_LPI **lpi, SCIP_MESSAGEHDLR *messagehdlr, const char *name, SCIP_OBJSEN objsen)
SCIP_Bool SCIPconsIsActive(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)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
int SCIPgetNContVars(SCIP *scip)
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)
#define SCIP_DECL_EXPRGRAPHNODEREFORM(x)
SCIP_Real SCIPepsilon(SCIP *scip)
int SCIPexprgraphGetNodePolynomialNMonomials(SCIP_EXPRGRAPHNODE *node)
#define SCIP_PRESOLTIMING_FAST
static SCIP_RETCODE removeFixedNonlinearVariables(SCIP *scip, SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPlpiAddCols(SCIP_LPI *lpi, int ncols, const SCIP_Real *obj, const SCIP_Real *lb, const SCIP_Real *ub, char **colnames, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
int SCIPgetNExprtreesNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPexprgraphMoveNodeParents(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE **srcnode, SCIP_EXPRGRAPHNODE *targetnode)
SCIP_Bool SCIPlpiIsPrimalUnbounded(SCIP_LPI *lpi)
#define SCIP_EVENTTYPE_LBCHANGED
SCIP_EXPRCURV SCIPexprcurvMultiply(SCIP_Real factor, SCIP_EXPRCURV curvature)
int SCIPexprGetMonomialNFactors(SCIP_EXPRDATA_MONOMIAL *monomial)
SCIP_RETCODE SCIPexprtreePrintWithNames(SCIP_EXPRTREE *tree, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
SCIP_RETCODE SCIPheurPassSolTrySol(SCIP *scip, SCIP_HEUR *heur, SCIP_SOL *sol)
SCIP_RETCODE SCIPexprtreeCheckCurvature(SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *varbounds, SCIP_EXPRCURV *curv, SCIP_INTERVAL *bounds)
SCIP_EXPROP SCIPexprgraphGetNodeOperator(SCIP_EXPRGRAPHNODE *node)
SCIP_VAR * SCIPfindVar(SCIP *scip, const char *name)
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_RETCODE SCIPlpiSolveDual(SCIP_LPI *lpi)
static SCIP_DECL_CONSGETVARS(consGetVarsNonlinear)
int SCIPgetLinvarMayIncreaseNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrInitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITSOL((*consinitsol)))
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
#define SCIP_EVENTTYPE_SOLFOUND
SCIP_RETCODE SCIPlpiAddRows(SCIP_LPI *lpi, int nrows, const SCIP_Real *lhs, const SCIP_Real *rhs, char **rownames, int nnonz, const int *beg, const int *ind, const SCIP_Real *val)
void SCIPfreeRowprep(SCIP *scip, SCIP_ROWPREP **rowprep)
const char * SCIPexprcurvGetName(SCIP_EXPRCURV curv)
SCIP_Real SCIPeventGetNewbound(SCIP_EVENT *event)
SCIP_RETCODE SCIPcreateSolCopy(SCIP *scip, SCIP_SOL **sol, SCIP_SOL *sourcesol)
static SCIP_DECL_CONSCHECK(consCheckNonlinear)
SCIP_Bool SCIPisPresolveFinished(SCIP *scip)
static SCIP_RETCODE addConcaveEstimatorMultivariate(SCIP *scip, SCIP_CONS *cons, int exprtreeidx, SCIP_Real *ref, SCIP_ROWPREP *rowprep, SCIP_Bool *success)
SCIP_Bool SCIPconsIsLocked(SCIP_CONS *cons)
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)))
static SCIP_RETCODE registerBranchingVariables(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int *nnotify)
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)
const char * SCIPheurGetName(SCIP_HEUR *heur)
SCIP_Bool SCIPintervalIsEntire(SCIP_Real infinity, SCIP_INTERVAL operand)
SCIP_RETCODE SCIPexprEval(SCIP_EXPR *expr, SCIP_Real *varvals, SCIP_Real *param, SCIP_Real *val)
SCIP_HEUR * SCIPfindHeur(SCIP *scip, const char *name)
static SCIP_DECL_EVENTEXEC(processLinearVarEvent)
SCIP_RETCODE SCIPexprintEval(SCIP_EXPRINT *exprint, SCIP_EXPRTREE *tree, SCIP_Real *varvals, SCIP_Real *val)
static SCIP_RETCODE consdataEnsureLinearVarsSize(SCIP *scip, SCIP_CONSDATA *consdata, int num)
#define CONSHDLR_ENFOPRIORITY
static SCIP_DECL_CONSINITLP(consInitlpNonlinear)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE propagateBoundsTightenVarLb(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real bnd, SCIP_RESULT *result, int *nchgbds)
static SCIP_RETCODE computeViolation(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *solviolbounds)
SCIP_RETCODE SCIPexprintCreate(BMS_BLKMEM *blkmem, SCIP_EXPRINT **exprint)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPaddConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_NODE *validnode)
SCIP_RETCODE SCIPaddNlRow(SCIP *scip, SCIP_NLROW *nlrow)
enum SCIP_NlpSolStat SCIP_NLPSOLSTAT
SCIP_EXPRGRAPHNODE *** SCIPexprgraphGetNodes(SCIP_EXPRGRAPH *exprgraph)
#define SCIP_DECL_NONLINCONSUPGD(x)
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPintervalGetInf(SCIP_INTERVAL interval)
int SCIPexprgraphGetSumTreesNSummands(SCIP_EXPRGRAPHNODE *node)
#define CONSHDLR_PROP_TIMING
SCIP_RETCODE SCIPgetSolVals(SCIP *scip, SCIP_SOL *sol, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
static SCIP_RETCODE lockLinearVariable(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
SCIP_Bool SCIProwIsLocal(SCIP_ROW *row)
SCIP_RETCODE SCIPreleaseNlRow(SCIP *scip, SCIP_NLROW **nlrow)
SCIP_RETCODE SCIPgetViolationNonlinear(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Real *violation)
SCIP_RETCODE SCIPgetProbvarSum(SCIP *scip, SCIP_VAR **var, SCIP_Real *scalar, SCIP_Real *constant)
#define SCIPfreeBufferArrayNull(scip, ptr)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
SCIP_RETCODE SCIPcheckCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result)
SCIP_Bool SCIPsortedvecFindPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), void *val, int len, int *pos)
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
static SCIP_DECL_CONSDEACTIVE(consDeactiveNonlinear)
static SCIP_RETCODE mergeAndCleanLinearVars(SCIP *scip, SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
SCIP_EXPRCURV SCIPexprcurvPower(SCIP_INTERVAL basebounds, SCIP_EXPRCURV basecurv, SCIP_Real exponent)
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)))
constraint handler for quadratic constraints
#define BOUNDTIGHTENING_MINSTRENGTH
static SCIP_RETCODE propagateBoundsTightenVarUb(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real bnd, SCIP_RESULT *result, int *nchgbds)
static SCIP_RETCODE propagateBounds(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_Bool needclear, SCIP_RESULT *result, int *nchgbds, int *ndelconss)
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
SCIP_Real * SCIPgetExprtreeCoefsNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateRowprep(SCIP *scip, SCIP_ROWPREP **rowprep, SCIP_SIDETYPE sidetype, SCIP_Bool local)
SCIP_RETCODE SCIPgetExprtreeTransformedVars(SCIP *scip, SCIP_EXPRTREE *tree)
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)
int SCIPexprtreeGetNVars(SCIP_EXPRTREE *tree)
SCIP_RETCODE SCIPsetNLPInitialGuessSol(SCIP *scip, SCIP_SOL *sol)
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
SCIP_RETCODE SCIPexprgraphCreateNodeLinear(BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node, int ncoefs, SCIP_Real *coefs, SCIP_Real constant)
static SCIP_RETCODE reformNode2Var(SCIP *scip, SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, SCIP_CONS **conss, int nconss, int *naddcons, SCIP_Bool donotmultaggr)
SCIP_Real SCIPgetSepaMinEfficacy(SCIP *scip)
SCIP_Bool SCIPexprgraphIsNodeEnabled(SCIP_EXPRGRAPHNODE *node)
static SCIP_RETCODE chgLinearCoefPos(SCIP *scip, SCIP_CONS *cons, int pos, SCIP_Real newcoef)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE addConcaveEstimatorBivariate(SCIP *scip, SCIP_CONS *cons, int exprtreeidx, SCIP_Real *ref, SCIP_ROWPREP *rowprep, SCIP_Bool *success)
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
SCIP_Real SCIPvarGetMultaggrConstant(SCIP_VAR *var)
SCIP_EXPRINTCAPABILITY SCIPexprintGetCapability(void)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
void SCIPintervalSet(SCIP_INTERVAL *resultant, SCIP_Real value)
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)
SCIP_RETCODE SCIPexprEstimateUser(SCIP_EXPR *expr, SCIP_Real infinity, SCIP_Real *argvals, SCIP_INTERVAL *argbounds, SCIP_Bool overestimate, SCIP_Real *coeffs, SCIP_Real *constant, SCIP_Bool *success)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
#define SCIPdebugGetSolVal(scip, var, val)
struct SCIP_ConsData SCIP_CONSDATA
#define SCIP_EVENTTYPE_BOUNDTIGHTENED
SCIP_EXPR * SCIPexprtreeGetRoot(SCIP_EXPRTREE *tree)
SCIP_Bool SCIPexprgraphHasNodeSibling(SCIP_EXPRGRAPHNODE *node)
SCIP_RETCODE SCIPexprgraphGetNodePolynomialMonomialCurvature(SCIP_EXPRGRAPHNODE *node, int monomialidx, SCIP_Real infinity, SCIP_EXPRCURV *curv)
#define SCIP_EVENTTYPE_UBCHANGED
int SCIPconshdlrGetNConss(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPaddLinearVarNonlinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
static SCIP_RETCODE delLinearCoefPos(SCIP *scip, SCIP_CONS *cons, int pos)
static SCIP_RETCODE dropLinearVarEvents(SCIP *scip, SCIP_CONS *cons, int linvarpos)
static void consdataSortLinearVars(SCIP_CONSDATA *consdata)
static SCIP_RETCODE reformMonomial(SCIP *scip, SCIP_EXPRGRAPH *exprgraph, int nfactors, SCIP_EXPRGRAPHNODE **factors, SCIP_Real *exponents, SCIP_EXPRGRAPHNODE **resultnode, SCIP_Bool createauxcons, int mindepth, int *naddcons)
#define SCIPallocBufferArray(scip, ptr, num)
#define CONSHDLR_CHECKPRIORITY
static SCIP_RETCODE catchLinearVarEvents(SCIP *scip, SCIP_CONS *cons, int linvarpos)
SCIP_EXPR ** SCIPexprGetChildren(SCIP_EXPR *expr)
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
#define infty2infty(infty1, infty2, val)
SCIP_RETCODE SCIPcatchEvent(SCIP *scip, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
static SCIP_DECL_CONSENFORELAX(consEnforelaxNonlinear)
SCIP_LPSOLSTAT SCIPgetLPSolstat(SCIP *scip)
static SCIP_RETCODE createNlRow(SCIP *scip, SCIP_CONS *cons)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
static SCIP_RETCODE reformulate(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int *naddcons)
static SCIP_RETCODE propagateConstraintSides(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_RESULT *result, int *nchgbds)
SCIP_Real SCIPlpiInfinity(SCIP_LPI *lpi)
void SCIPexprgraphSetVarNodeLb(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *varnode, SCIP_Real lb)
static void consdataUpdateLinearActivity(SCIP *scip, SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPcreateEmptyRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
SCIP_Real SCIPgetLhsNonlinear(SCIP *scip, SCIP_CONS *cons)
int SCIPgetDepth(SCIP *scip)
SCIP_Real SCIPlpfeastol(SCIP *scip)
SCIP_EXPRINTDATA * SCIPexprtreeGetInterpreterData(SCIP_EXPRTREE *tree)
constraint handler for nonlinear constraints
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
void SCIPmergeRowprepTerms(SCIP *scip, SCIP_ROWPREP *rowprep)
SCIP_Bool SCIPexprHasUserEstimator(SCIP_EXPR *expr)
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
SCIP_RETCODE SCIPaddPoolCut(SCIP *scip, SCIP_ROW *row)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
int SCIPexprGetNChildren(SCIP_EXPR *expr)
int SCIPvarCompare(SCIP_VAR *var1, SCIP_VAR *var2)
void SCIPexprgraphGetSubtreeVarsUsage(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, int *varsusage)
void SCIPexprgraphSetVarNodeUb(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *varnode, SCIP_Real ub)
#define CONSHDLR_PROPFREQ
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
#define CONSHDLR_NEEDSCONS
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 SCIPexprgraphNodeSplitOffLinear(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE **node, int linvarssize, int *nlinvars, void **linvars, SCIP_Real *lincoefs, SCIP_Real *constant)
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)
static SCIP_RETCODE proposeFeasibleSolution(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_Bool *success)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
#define CONSHDLR_DELAYSEPA
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)
static SCIP_RETCODE registerLargeRelaxValueVariableForBranching(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_VAR **brvar)
void SCIPexprgraphDisableNode(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node)
SCIP_Real SCIPintervalGetSup(SCIP_INTERVAL interval)
#define BMScopyMemoryArray(ptr, source, num)
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
Constraint handler for linear constraints in their most general form, .
SCIP_Bool SCIPisCutApplicable(SCIP *scip, SCIP_ROW *cut)
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyNonlinear)
int SCIPvarGetMultaggrNVars(SCIP_VAR *var)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
static SCIP_DECL_CONSPROP(consPropNonlinear)
#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 SCIPgetRowprepRowCons(SCIP *scip, SCIP_ROW **row, SCIP_ROWPREP *rowprep, SCIP_CONSHDLR *conshdlr)
SCIP_Bool SCIPlpiIsOptimal(SCIP_LPI *lpi)
char name[SCIP_MAXSTRLEN]
SCIP_RETCODE SCIPsetConshdlrEnable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENABLE((*consenable)))
int SCIPgetNBinVars(SCIP *scip)
SCIP_Bool SCIPinProbing(SCIP *scip)
int SCIPgetNVars(SCIP *scip)
#define CONSHDLR_SEPAPRIORITY
int SCIPexprgraphGetNodeIntPowerExponent(SCIP_EXPRGRAPHNODE *node)
SCIP_Real SCIPnodeGetEstimate(SCIP_NODE *node)
static SCIP_DECL_CONSDELETE(consDeleteNonlinear)
void SCIPenableNLP(SCIP *scip)
SCIP_EXPRGRAPHNODE ** SCIPexprgraphGetNodeParents(SCIP_EXPRGRAPHNODE *node)
static SCIP_RETCODE addLinearCoef(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real coef)
static SCIP_DECL_CONSTRANS(consTransNonlinear)
static SCIP_RETCODE removeFixedLinearVariables(SCIP *scip, SCIP_CONS *cons)
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)))
enum SCIP_ExprCurv SCIP_EXPRCURV
#define CONSHDLR_PRESOLTIMING
SCIP_RETCODE SCIPsolveLinearProb(int N, SCIP_Real *A, SCIP_Real *b, SCIP_Real *x, SCIP_Bool *success)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
SCIP_RETCODE SCIPcreateNLPSol(SCIP *scip, SCIP_SOL **sol, SCIP_HEUR *heur)
static SCIP_RETCODE generateCut(SCIP *scip, SCIP_EXPRINT *exprint, SCIP_CONS *cons, SCIP_Real **ref, SCIP_SOL *sol, SCIP_Bool newsol, SCIP_SIDETYPE side, SCIP_ROW **row, SCIP_Real minviol, SCIP_Real maxrange, SCIP_Bool expensivecurvchecks, SCIP_Bool assumeconvex)
int SCIPvarGetNLocksDown(SCIP_VAR *var)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_CONSGETNVARS(consGetNVarsNonlinear)
SCIP_RETCODE SCIPcheckCurvatureNonlinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_Real * SCIPexprGetLinearCoefs(SCIP_EXPR *expr)
int SCIPgetNLinearVarsNonlinear(SCIP *scip, SCIP_CONS *cons)
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)
#define CONSHDLR_DELAYPROP
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_Real SCIPexprGetOpReal(SCIP_EXPR *expr)
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINIT((*consinit)))
int SCIPexprgraphGetNodePosition(SCIP_EXPRGRAPHNODE *node)
SCIP_RETCODE SCIPsetConshdlrExit(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXIT((*consexit)))
#define SCIP_EVENTTYPE_FORMAT
static SCIP_RETCODE propagateBoundsCons(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS *cons, SCIP_RESULT *result, int *nchgbds, SCIP_Bool *redundant)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
void SCIPintervalSetRoundingModeUpwards(void)
SCIP_RETCODE SCIPexprgraphCreateNodePolynomial(BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node, int nmonomials, SCIP_EXPRDATA_MONOMIAL **monomials, SCIP_Real constant, SCIP_Bool copymonomials)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
SCIP_CONSHDLRDATA * conshdlrdata
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 SCIPexprgraphCreateNode(BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node, SCIP_EXPROP op,...)
NLP local search primal heuristic using sub-SCIPs.
void SCIPupdateSolConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
SCIP_RETCODE SCIPexprgraphReleaseNode(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE **node)
SCIP_Real SCIPgetRowLPFeasibility(SCIP *scip, SCIP_ROW *row)
static SCIP_RETCODE separatePoint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int nusefulconss, SCIP_SOL *sol, SCIP_Bool newsol, SCIP_Real minefficacy, SCIP_Bool inenforcement, SCIP_RESULT *result, SCIP_Real *bestefficacy)
SCIP_Real SCIPeventGetOldbound(SCIP_EVENT *event)
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_Bool SCIPlpiIsObjlimExc(SCIP_LPI *lpi)
SCIP_RETCODE SCIPexprgraphGetTree(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *rootnode, SCIP_EXPRTREE **exprtree)
SCIP_RETCODE SCIPincludeConshdlrNonlinear(SCIP *scip)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddVarsToRow(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real *vals)
#define CONSHDLR_EAGERFREQ
SCIP_VAR ** SCIPgetLinearVarsNonlinear(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSFREE(consFreeNonlinear)
SCIP_Bool SCIPlpiIsPrimalFeasible(SCIP_LPI *lpi)
static void consdataMoveLinearVar(SCIP_CONSDATA *consdata, int oldpos, int newpos)
SCIP_Bool SCIPisStopped(SCIP *scip)
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)
static SCIP_DECL_CONSENFOPS(consEnfopsNonlinear)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_EXPRGRAPHNODE ** SCIPexprgraphGetNodeChildren(SCIP_EXPRGRAPHNODE *node)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
void SCIPsortPtrReal(void **ptrarray, SCIP_Real *realarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
SCIP_RETCODE SCIPprintRow(SCIP *scip, SCIP_ROW *row, FILE *file)
SCIP_Real * SCIPexprGetMonomialExponents(SCIP_EXPRDATA_MONOMIAL *monomial)
void SCIPexprgraphPrintNode(SCIP_EXPRGRAPHNODE *node, SCIP_MESSAGEHDLR *messagehdlr, FILE *file)
static SCIP_DECL_CONSINITSOL(consInitsolNonlinear)
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
SCIP_RETCODE SCIPexprParse(BMS_BLKMEM *blkmem, SCIP_MESSAGEHDLR *messagehdlr, SCIP_EXPR **expr, const char *str, const char *lastchar, int *nvars, int *varnames, int varnameslength)
SCIP_RETCODE SCIPunlinkSol(SCIP *scip, SCIP_SOL *sol)
#define SCIPdebugAddSolVal(scip, var, val)
static SCIP_DECL_CONSEXITPRE(consExitpreNonlinear)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_RETCODE SCIPexprgraphSimplify(SCIP_EXPRGRAPH *exprgraph, SCIP_MESSAGEHDLR *messagehdlr, SCIP_Real eps, int maxexpansionexponent, SCIP_Bool *havechange, SCIP_Bool *domainerror)
#define CONSHDLR_MAXPREROUNDS
static SCIP_DECL_CONSPRINT(consPrintNonlinear)
static SCIP_DECL_CONSINIT(consInitNonlinear)
void SCIPintervalSub(SCIP_Real infinity, SCIP_INTERVAL *resultant, SCIP_INTERVAL operand1, SCIP_INTERVAL operand2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
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)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
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)
SCIP_Bool SCIPlpiIsIterlimExc(SCIP_LPI *lpi)
SCIP_Real SCIPgetUpperbound(SCIP *scip)
SCIP_RETCODE SCIPexprintFree(SCIP_EXPRINT **exprint)
#define BMSclearMemoryArray(ptr, num)
static SCIP_RETCODE addIntervalGradientEstimator(SCIP *scip, SCIP_EXPRINT *exprint, SCIP_CONS *cons, int exprtreeidx, SCIP_Real *x, SCIP_Bool newx, SCIP_Bool overestimate, SCIP_ROWPREP *rowprep, SCIP_Bool *success)
SCIP_Bool SCIPisSumLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPsetConshdlrActive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSACTIVE((*consactive)))
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)
static SCIP_DECL_CONSLOCK(consLockNonlinear)
SCIP_Real SCIPceil(SCIP *scip, SCIP_Real val)
void ** SCIPexprgraphGetVars(SCIP_EXPRGRAPH *exprgraph)
SCIP_EVENTHDLRDATA * SCIPeventhdlrGetData(SCIP_EVENTHDLR *eventhdlr)
void SCIPprintRowprep(SCIP *scip, SCIP_ROWPREP *rowprep, FILE *file)
static SCIP_DECL_CONSPRESOL(consPresolNonlinear)
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
static SCIP_DECL_CONSPARSE(consParseNonlinear)
SCIP_Real SCIPexprGetLinearConstant(SCIP_EXPR *expr)
SCIP_RETCODE SCIPcreateConsBasicNonlinear(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_Real SCIPround(SCIP *scip, SCIP_Real val)
SCIP_EXPRCURV SCIPexprcurvAdd(SCIP_EXPRCURV curv1, SCIP_EXPRCURV curv2)
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
SCIP_ROUNDMODE SCIPintervalGetRoundingMode(void)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSDATA **consdata, SCIP_Real lhs, SCIP_Real rhs, int nlinvars, SCIP_VAR **linvars, SCIP_Real *lincoefs, int nexprtrees, SCIP_EXPRTREE **exprtrees, SCIP_Real *nonlincoefs, SCIP_Bool capturevars)
SCIP_SOL * SCIPeventGetSol(SCIP_EVENT *event)
SCIP_RETCODE SCIPexprgraphPrintDot(SCIP_EXPRGRAPH *exprgraph, SCIP_MESSAGEHDLR *messagehdlr, FILE *file, const char **varnames)
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_Bool SCIPisRelLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
void SCIPintervalSetRoundingModeDownwards(void)
SCIP_Real SCIPfloor(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPevalExprtreeLocalBounds(SCIP *scip, SCIP_EXPRTREE *tree, SCIP_Real infinity, SCIP_INTERVAL *val)
int SCIPexprgraphGetNodeDepth(SCIP_EXPRGRAPHNODE *node)
static SCIP_DECL_CONSCOPY(consCopyNonlinear)
SCIP_EXPRCURV SCIPexprcurvNegate(SCIP_EXPRCURV curvature)
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)
void SCIPaddRowprepConstant(SCIP_ROWPREP *rowprep, SCIP_Real constant)
static SCIP_RETCODE replaceViolatedByLinearConstraints(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_Bool *addedcons, SCIP_Bool *reduceddom, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)
static SCIP_DECL_CONSEXITSOL(consExitsolNonlinear)
void SCIPexprgraphEnableNode(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node)
enum SCIP_SideType SCIP_SIDETYPE