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 )
1798 for( i = 0; i < consdata->nlinvars; ++i )
1812 for( i = 0; i < consdata->nlinvars; ++i )
1836 for( i = 0; i < consdata->nlinvars; ++i )
1850 for( i = 0; i < consdata->nlinvars; ++i )
1868 else if( constant != 0.0 )
1872 consdata->lhs -= constant;
1877 consdata->rhs -= constant;
1883 for( i = 0; i < nlinvars; ++i )
1905 assert(scip != NULL);
1906 assert(cons != NULL);
1909 assert(consdata != NULL);
1911 if( consdata->nlrow != NULL )
1916 if( consdata->nexprtrees == 0 )
1919 consdata->nlinvars, consdata->linvars, consdata->lincoefs,
1921 NULL, consdata->lhs, consdata->rhs,
1922 consdata->curvature) );
1924 else if( consdata->nexprtrees == 1 && consdata->nonlincoefs[0] == 1.0 )
1926 assert(consdata->exprtrees[0] != NULL);
1928 consdata->nlinvars, consdata->linvars, consdata->lincoefs,
1930 consdata->exprtrees[0], consdata->lhs, consdata->rhs,
1931 consdata->curvature) );
1941 assert(consdata->exprgraphnode != NULL);
1943 assert(conshdlrdata != NULL);
1947 consdata->nlinvars, consdata->linvars, consdata->lincoefs,
1949 exprtree, consdata->lhs, consdata->rhs,
1950 consdata->curvature) );
1974 assert(scip != NULL);
1975 assert(conshdlr != NULL);
1976 assert(cons != NULL);
1978 assert(upgraded != NULL);
1979 assert(nupgdconss != NULL);
1980 assert(naddconss != NULL);
1994 #ifdef WITH_DEBUG_SOLUTION 1995 if( SCIPdebugIsMainscip(scip) )
2015 SCIPdebugMsg(scip,
"upgrading nonlinear constraint <%s> (up to %d upgrade methods):\n",
2024 if(
conshdlrdata->nlconsupgrades[i]->nlconsupgd == NULL )
2027 SCIP_CALL(
conshdlrdata->nlconsupgrades[i]->nlconsupgd(scip, cons, &nupgdconss_, upgdconss, upgdconsssize) );
2029 while( nupgdconss_ < 0 )
2032 assert(-nupgdconss_ > upgdconsssize);
2033 upgdconsssize = -nupgdconss_;
2036 SCIP_CALL(
conshdlrdata->nlconsupgrades[i]->nlconsupgd(scip, cons, &nupgdconss_, upgdconss, upgdconsssize) );
2038 assert(nupgdconss_ != 0);
2041 if( nupgdconss_ > 0 )
2046 SCIPdebugMsg(scip,
" -> upgraded to %d constraints:\n", nupgdconss_);
2049 for( j = 0; j < nupgdconss_; ++j )
2060 *naddconss += nupgdconss_ - 1;
2092 assert(scip != NULL);
2093 assert(cons != NULL);
2096 assert(consdata != NULL);
2098 if( consdata->iscurvchecked )
2104 consdata->iscurvchecked =
TRUE;
2109 for( i = 0; i < consdata->nexprtrees; ++i )
2111 assert(consdata->exprtrees[i] != NULL);
2126 if( varboundssize == 0 )
2136 assert(varbounds != NULL);
2147 consdata->curvatures[i] =
SCIPexprcurvMultiply(consdata->nonlincoefs[i], consdata->curvatures[i]);
2159 consdata->curvature =
SCIPexprcurvAdd(consdata->curvature, consdata->curvatures[i]);
2186 assert(exprgraph != NULL);
2187 assert(node != NULL);
2188 assert(*node != NULL);
2189 assert(replacement != NULL);
2190 assert(conss != NULL || nconss == 0);
2203 for( c = 0; c < nconss; ++c )
2205 assert(conss[c] != NULL);
2208 assert(consdata != NULL);
2210 if( consdata->exprgraphnode == *node )
2213 consdata->exprgraphnode = replacement;
2217 consdata->ispresolved =
FALSE;
2247 assert(scip != NULL);
2248 assert(exprgraph != NULL);
2249 assert(node != NULL);
2250 assert(naddcons != NULL);
2262 #ifdef WITH_DEBUG_SOLUTION 2263 if( SCIPdebugIsMainscip(scip) )
2284 SCIP_CALL(
SCIPcreateConsNonlinear2(scip, &auxcons, name, 1, &auxvar, &minusone, node, 0.0, 0.0,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
2316 assert(scip != NULL);
2317 assert(exprgraph != NULL);
2318 assert(node != NULL);
2319 assert(naddcons != NULL);
2328 assert(child != NULL);
2332 SCIPdebugMsg(scip,
"add auxiliary variable for child %p(%d,%d) with curvature %s\n",
2374 assert(scip != NULL);
2375 assert(exprgraph != NULL);
2376 assert(nfactors > 0);
2377 assert(factors != NULL);
2378 assert(resultnode != NULL);
2379 assert(naddcons != NULL);
2382 if( nfactors == 1 && (exponents == NULL || exponents[0] == 1.0) )
2384 *resultnode = factors[0];
2398 SCIPdebugMsg(scip,
"add auxiliary variable and constraint %s\n", name);
2405 #ifdef WITH_DEBUG_SOLUTION 2407 if( SCIPdebugIsMainscip(scip) )
2422 reformfactors[0] = *resultnode;
2423 reformfactors[1] = factors[0];
2425 reformexp[1] = -exponents[0];
2446 assert(exponents != NULL);
2466 if( expnode == NULL )
2482 SCIPdebugMsg(scip,
"add auxiliary variable and constraint %s\n", name);
2489 #ifdef WITH_DEBUG_SOLUTION 2490 if( SCIPdebugIsMainscip(scip) )
2499 SCIP_CALL(
SCIPcreateConsNonlinear2(scip, &auxcons, name, 1, &auxvar, &minusone, expnode, 0.0, 0.0,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
2510 *resultnode = expnode;
2516 if( nfactors == 2 && exponents != NULL && exponents[0] != 1.0 && exponents[0] == exponents[1] )
2525 SCIP_CALL(
reformMonomial(scip, exprgraph, 1, &productnode, &exponents[0], resultnode, createauxcons, mindepth, naddcons) );
2530 if( nfactors == 2 && exponents != NULL && exponents[0] == -exponents[1] )
2541 SCIPdebugMsg(scip,
"add auxiliary variable and constraint %s\n", name);
2548 #ifdef WITH_DEBUG_SOLUTION 2550 if( SCIPdebugIsMainscip(scip) )
2553 if( exponents[0] > 0.0 )
2563 leftright[0] = auxvarnode;
2564 leftright[1] = exponents[0] > 0.0 ? factors[1] : factors[0];
2569 leftright[0] = auxconsnode;
2570 leftright[1] = exponents[0] > 0.0 ? factors[0] : factors[1];
2586 absexp = fabs(exponents[0]);
2587 SCIP_CALL(
reformMonomial(scip, exprgraph, 1, &auxvarnode, &absexp, resultnode, createauxcons, mindepth, naddcons) );
2605 half = nfactors / 2;
2607 assert(half < nfactors);
2610 SCIP_CALL(
reformMonomial(scip, exprgraph, nfactors-half, &factors[half], exponents != NULL ? &exponents[half] : NULL, &leftright[1],
TRUE, mindepth, naddcons) );
2624 productnode = parent;
2628 if( productnode == NULL )
2641 SCIPdebugMsg(scip,
"add auxiliary variable and constraint %s\n", name);
2648 #ifdef WITH_DEBUG_SOLUTION 2649 if( SCIPdebugIsMainscip(scip) )
2658 SCIP_CALL(
SCIPcreateConsNonlinear2(scip, &auxcons, name, 1, &auxvar, &minusone, productnode, 0.0, 0.0,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
2669 *resultnode = productnode;
2705 assert(scip != NULL);
2706 assert(conshdlr != NULL);
2707 assert(conss != NULL || nconss == 0);
2708 assert(naddcons != NULL);
2717 SCIPdebugMsg(scip,
"skip reformulation, already done\n");
2725 assert(!domainerror);
2728 #ifdef WITH_DEBUG_SOLUTION 2729 if( SCIPdebugIsMainscip(scip) )
2750 assert(node != NULL);
2768 SCIP_CALL(
conshdlrdata->nlconsupgrades[u]->nodereform(scip, exprgraph, node, naddcons, &reformnode) );
2769 if( reformnode == NULL )
2772 SCIPdebugMsg(scip,
"external nodereform reformulated node %p(%d,%d), replace by %p\n",
2783 if( u < conshdlrdata->nnlconsupgrades )
2810 assert(children != NULL || nchildren == 0);
2816 for( j = 0; j < nchildren; ++j )
2818 assert(children[j] != NULL);
2819 if( havenonlinparent ||
2845 if( havenonlinparent )
2848 assert(node != NULL);
2871 assert(child != NULL);
2875 SCIPdebugMessage(
"add auxiliary variable for child %p(%d,%d) with curvature %s operator %s\n",
2908 assert(node != NULL);
2932 assert(children != NULL);
2933 assert(nchildren == 2);
2945 #ifdef WITH_DEBUG_SOLUTION 2946 if( SCIPdebugIsMainscip(scip) )
2956 auxchildren[0] = children[0];
2957 auxchildren[1] = children[1];
2958 auxchildren[2] = auxvarnode;
2966 quadelem.
coef = 1.0;
3008 assert(nchildren == 1);
3039 assert(nchildren == 1);
3067 if( havenonlinparent )
3070 assert(node != NULL);
3130 assert(nmonomials >= 1);
3132 if( nmonomials > 1 )
3165 for( m = 0; m < nmonomials; ++m )
3167 monomial = monomials[m];
3168 assert(monomial != NULL);
3174 assert(nfactors >= 1);
3175 assert(coef != 0.0);
3177 if( nfactors == 1 && exponents[0] == 1.0 )
3180 if( lincoefs == NULL )
3185 assert(0 <= childidxs[0] && childidxs[0] < nchildren);
3186 assert(lincoefs[childidxs[0]] == 0.0);
3187 lincoefs[childidxs[0]] = coef;
3189 else if( nfactors == 1 && exponents[0] == 2.0 )
3192 if( quadelems == NULL )
3196 quadelems[nquadelems].
idx1 = childidxs[0];
3197 quadelems[nquadelems].
idx2 = childidxs[0];
3198 quadelems[nquadelems].
coef = coef;
3201 else if( nfactors == 2 && exponents[0] == 1.0 && exponents[1] == 1.0 )
3204 if( quadelems == NULL )
3208 if( childidxs[0] < childidxs[1] )
3210 quadelems[nquadelems].
idx1 = childidxs[0];
3211 quadelems[nquadelems].
idx2 = childidxs[1];
3215 quadelems[nquadelems].
idx1 = childidxs[1];
3216 quadelems[nquadelems].
idx2 = childidxs[0];
3218 quadelems[nquadelems].
coef = coef;
3231 if( childrennew == NULL )
3235 assert(nfactors <= nchildren);
3236 for( f = 0; f < nfactors; ++f )
3237 childrennew[f] = children[childidxs[f]];
3247 assert(lincoefs != NULL || nquadelems > 0 || nmonomialnodes > 0);
3249 if( nquadelems > 0 )
3257 else if( lincoefs != NULL )
3265 assert(constant == 0.0);
3271 assert(nmonomialnodes > 0);
3272 if( nmonomialnodes > 1 )
3282 sumnode = monomialnodes[0];
3289 SCIPdebugMsg(scip,
"splitup polynomial into sum of %d nodes\n", nmonomialnodes);
3296 monomial = monomials[0];
3297 assert(monomial != NULL);
3303 assert(nfactors >= 1);
3304 assert(coef != 0.0);
3305 assert(children != NULL);
3364 for( f = 0; f < nfactors; ++f )
3369 if( childbounds.
inf < 0.0 && childbounds.
sup > 0.0 )
3372 if( exponents[f] < 0.0 )
3376 sum += exponents[f];
3379 if( childbounds.
inf < 0.0 )
3407 if( nnegative == nfactors || (nnegative == nfactors-1 &&
SCIPisGE(scip, sum, 1.0)) )
3410 SCIPdebugMsg(scip,
"%d-variate monomial is convex (modulo sign), child curv fits = %u\n", nfactors, expcurvpos);
3412 assert(!expcurvpos);
3415 else if( npositive == nfactors &&
SCIPisLE(scip, sum, 1.0) )
3418 SCIPdebugMsg(scip,
"%d-variate monomial is concave (modulo sign), child curv fits = %u\n", nfactors, expcurvneg);
3420 assert(!expcurvneg);
3433 for( f = 0; f < nfactors; ++f )
3438 assert(childbounds.
inf >= 0.0 || childbounds.
sup <= 0.0);
3441 if( childbounds.
inf < 0.0 )
3449 SCIPdebugMsg(scip,
"reform child %d (factor %d) with curv %s into var\n",
3473 assert(nfactors > 1 ||
3479 assert(!(nfactors == 2 && exponents[0] == 1.0 && exponents[1] == 1.0));
3483 if( nfactors > 1 || havenonlinparent || exponents[0] < 0.0 )
3491 for( f = 0; f < nfactors; ++f )
3492 factors[f] = children[childidxs[f]];
3495 factors = &children[childidxs[0]];
3497 SCIPdebugMsg(scip,
"reform monomial node, create auxvar = %u\n", havenonlinparent);
3528 SCIPdebugMsg(scip,
"no reformulation of monomial node, assume signpower will take care of it\n");
3563 for( c = 0; c < nconss; ++c )
3568 assert(conss[c] != NULL);
3575 assert(consdata != NULL);
3577 if( consdata->exprgraphnode == NULL )
3584 consdata->forcebackprop =
TRUE;
3597 assert(monomial != NULL);
3626 SCIPdebugMsg(scip,
"replace linear multivariate node %p(%d,%d) in expression of cons <%s> by auxvar\n",
3646 multivarnode = consdata->exprgraphnode;
3658 if( multivarnode == consdata->exprgraphnode )
3666 SCIPdebugMsg(scip,
"replace linear multivariate node %p(%d,%d) in expression of cons <%s> by auxvar\n",
3700 assert(scip != NULL);
3701 assert(conshdlr != NULL);
3702 assert(cons != NULL);
3703 assert(solviolbounds != NULL);
3710 assert(consdata != NULL);
3712 consdata->activity = 0.0;
3713 consdata->lhsviol = 0.0;
3714 consdata->rhsviol = 0.0;
3716 *solviolbounds =
FALSE;
3718 for( i = 0; i < consdata->nlinvars; ++i )
3722 var = consdata->linvars[i];
3732 *solviolbounds =
TRUE;
3737 activity = consdata->lincoefs[i] * varval;
3759 consdata->activity += activity;
3762 for( i = 0; i < consdata->nexprtrees; ++i )
3789 *solviolbounds =
TRUE;
3804 for( j = 0; j < nvars; ++j )
3816 *solviolbounds =
TRUE;
3845 activity = consdata->nonlincoefs[i] * val;
3863 consdata->activity += activity;
3866 if( consdata->nexprtrees == 0 && consdata->exprgraphnode != NULL )
3899 consdata->activity += val;
3903 consdata->lhsviol = consdata->lhs - consdata->activity;
3905 consdata->lhsviol = 0.0;
3908 consdata->rhsviol = consdata->activity - consdata->rhs;
3910 consdata->rhsviol = 0.0;
3920 absviol =
MAX(consdata->lhsviol, consdata->rhsviol);
3922 lhsrelviol =
SCIPrelDiff(consdata->lhs, consdata->activity);
3923 rhsrelviol =
SCIPrelDiff(consdata->activity, consdata->rhs);
3924 relviol =
MAX(lhsrelviol, rhsrelviol);
3952 assert(scip != NULL);
3953 assert(conshdlr != NULL);
3954 assert(conss != NULL || nconss == 0);
3955 assert(maxviolcon != NULL);
3956 assert(solviolbounds != NULL);
3964 assert(conshdlrdata != NULL);
3965 assert(conshdlrdata->exprgraph != NULL);
3979 for( c = 0; c < nconss; ++c )
3981 assert(conss != NULL);
3982 assert(conss[c] != NULL);
3987 if( *solviolbounds )
3991 assert(consdata != NULL);
3993 viol =
MAX(consdata->lhsviol, consdata->rhsviol);
3997 *maxviolcon = conss[c];
4029 assert(scip != NULL);
4030 assert(cons != NULL);
4032 assert(rowprep != NULL);
4033 assert(success != NULL);
4036 assert(consdata != NULL);
4037 assert(exprtreeidx >= 0);
4038 assert(exprtreeidx < consdata->nexprtrees);
4039 assert(consdata->exprtrees != NULL);
4041 exprtree = consdata->exprtrees[exprtreeidx];
4042 assert(exprtree != NULL);
4045 treecoef = consdata->nonlincoefs[exprtreeidx];
4068 for( i = 0; i < nvars; ++i )
4073 grad[i] *= treecoef;
4074 constant -= grad[i] * x[i];
4085 if( grad[i] != 0.0 &&
SCIPisZero(scip, grad[i]) )
4102 SCIPdebugMsg(scip,
"var <%s> [%g,%g] has tiny gradient %g, replace coefficient by constant %g\n",
4104 constant += grad[i] * xbnd;
4110 SCIPdebugMsg(scip,
"skipping linearization, var <%s> [%g,%g] has tiny gradient %g but no finite bound in this direction\n",
4129 for( i = 0; i < nvars; ++i )
4135 else if(
SCIPisEQ(scip, x[i], ub) )
4138 x[i] += MIN3(0.9*(ub-x[i]), 0.9*(x[i]-lb), i*
SCIPfeastol(scip)) * (i%2 != 0 ? -1.0 : 1.0);
4187 assert(scip != NULL);
4188 assert(cons != NULL);
4189 assert(rowprep != NULL);
4190 assert(success != NULL);
4193 assert(consdata != NULL);
4194 assert(exprtreeidx >= 0);
4195 assert(exprtreeidx < consdata->nexprtrees);
4196 assert(consdata->exprtrees != NULL);
4198 exprtree = consdata->exprtrees[exprtreeidx];
4199 assert(exprtree != NULL);
4202 treecoef = consdata->nonlincoefs[exprtreeidx];
4213 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since variable is unbounded\n", exprtreeidx,
SCIPconsGetName(cons));
4221 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since function cannot be evaluated in lower bound\n", exprtreeidx,
SCIPconsGetName(cons));
4229 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since function cannot be evaluated in upper bound\n", exprtreeidx,
SCIPconsGetName(cons));
4239 constant =
MAX(vallb, valub);
4241 constant = MIN(vallb, valub);
4245 slope = (valub - vallb) / (xub - xlb);
4246 constant = vallb - slope * xlb;
4294 assert(scip != NULL);
4295 assert(cons != NULL);
4296 assert(ref != NULL);
4297 assert(rowprep != NULL);
4298 assert(success != NULL);
4301 assert(consdata != NULL);
4302 assert(exprtreeidx >= 0);
4303 assert(exprtreeidx < consdata->nexprtrees);
4304 assert(consdata->exprtrees != NULL);
4306 exprtree = consdata->exprtrees[exprtreeidx];
4307 assert(exprtree != NULL);
4310 treecoef = consdata->nonlincoefs[exprtreeidx];
4330 ref[0] = MIN(xub,
MAX(xlb, ref[0]));
4333 ref[1] = MIN(yub,
MAX(ylb, ref[1]));
4357 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since function cannot be evaluated\n", exprtreeidx,
SCIPconsGetName(cons));
4367 else if(
SCIPisEQ(scip, xlb, xub) )
4376 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since function cannot be evaluated\n", exprtreeidx,
SCIPconsGetName(cons));
4383 coefy = (p4val - p1val) / (yub - ylb);
4384 constant = p1val - coefy * ylb;
4386 else if(
SCIPisEQ(scip, ylb, yub) )
4395 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since function cannot be evaluated\n", exprtreeidx,
SCIPconsGetName(cons));
4402 coefx = (p2val - p1val) / (xub - xlb);
4404 constant = p1val - coefx * xlb;
4423 SCIPdebugMsg(scip,
"skip secant for tree %d of constraint <%s> since function cannot be evaluated\n", exprtreeidx,
SCIPconsGetName(cons));
4440 SCIPdebugMsg(scip,
"p1 = (%g, %g), f(p1) = %g\n", p1[0], p1[1], p1val);
4441 SCIPdebugMsg(scip,
"p2 = (%g, %g), f(p2) = %g\n", p2[0], p2[1], p2val);
4442 SCIPdebugMsg(scip,
"p3 = (%g, %g), f(p3) = %g\n", p3[0], p3[1], p3val);
4443 SCIPdebugMsg(scip,
"p4 = (%g, %g), f(p4) = %g\n", p4[0], p4[1], p4val);
4456 if( ref[1] <= ylb + (yub - ylb)/(xub - xlb) * (ref[0] - xlb) )
4458 SCIP_CALL(
SCIPcomputeHyperplaneThreePoints(scip, p1[0], p1[1], p1val, p2[0], p2[1], p2val, p3[0], p3[1], p3val,
4459 &alpha, &beta, &gamma_, &delta) );
4461 assert(
SCIPisRelEQ(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4462 assert(
SCIPisRelEQ(scip, alpha * p2[0] + beta * p2[1] + gamma_ * p2val, delta));
4463 assert(
SCIPisRelEQ(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4466 if( alpha * p4[0] + beta * p4[1] + gamma_ * p4val > delta )
4473 p4val, &alpha, &beta, &gamma_, &delta) );
4475 assert(
SCIPisRelEQ(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4476 assert(
SCIPisRelEQ(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4477 assert(
SCIPisRelEQ(scip, alpha * p4[0] + beta * p4[1] + gamma_ * p4val, delta));
4480 if( alpha * p2[0] + beta * p2[1] + gamma_ * p2val > delta )
4486 SCIP_CALL(
SCIPcomputeHyperplaneThreePoints(scip, p1[0], p1[1], p1val, p3[0], p3[1], p3val, p4[0], p4[1], p4val,
4487 &alpha, &beta, &gamma_, &delta) );
4489 assert(
SCIPisRelEQ(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4490 assert(
SCIPisRelEQ(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4491 assert(
SCIPisRelEQ(scip, alpha * p4[0] + beta * p4[1] + gamma_ * p4val, delta));
4494 if( alpha * p2[0] + beta * p2[1] + gamma_ * p2val > delta )
4501 p3val, &alpha, &beta, &gamma_, &delta) );
4503 assert(
SCIPisRelEQ(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4504 assert(
SCIPisRelEQ(scip, alpha * p2[0] + beta * p2[1] + gamma_ * p2val, delta));
4505 assert(
SCIPisRelEQ(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4508 if( alpha * p4[0] + beta * p4[1] + gamma_ * p4val > delta )
4515 if( ref[1] <= yub + (ylb - yub)/(xub - xlb) * (ref[0] - xlb) )
4518 p4val, &alpha, &beta, &gamma_, &delta) );
4521 assert(
SCIPisRelEQ(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4522 assert(
SCIPisRelEQ(scip, alpha * p2[0] + beta * p2[1] + gamma_ * p2val, delta));
4523 assert(
SCIPisRelLE(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4524 assert(
SCIPisRelEQ(scip, alpha * p4[0] + beta * p4[1] + gamma_ * p4val, delta));
4531 p4val, &alpha, &beta, &gamma_, &delta) );
4534 assert(
SCIPisRelLE(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4535 assert(
SCIPisRelEQ(scip, alpha * p2[0] + beta * p2[1] + gamma_ * p2val, delta));
4536 assert(
SCIPisRelEQ(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4537 assert(
SCIPisRelEQ(scip, alpha * p4[0] + beta * p4[1] + gamma_ * p4val, delta));
4543 p4val, &alpha, &beta, &gamma_, &delta) );
4546 assert(
SCIPisRelLE(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4547 assert(
SCIPisRelEQ(scip, alpha * p2[0] + beta * p2[1] + gamma_ * p2val, delta));
4548 assert(
SCIPisRelEQ(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4549 assert(
SCIPisRelEQ(scip, alpha * p4[0] + beta * p4[1] + gamma_ * p4val, delta));
4556 p4val, &alpha, &beta, &gamma_, &delta) );
4559 assert(
SCIPisRelEQ(scip, alpha * p1[0] + beta * p1[1] + gamma_ * p1val, delta));
4560 assert(
SCIPisRelEQ(scip, alpha * p2[0] + beta * p2[1] + gamma_ * p2val, delta));
4561 assert(
SCIPisRelLE(scip, alpha * p3[0] + beta * p3[1] + gamma_ * p3val, delta));
4562 assert(
SCIPisRelEQ(scip, alpha * p4[0] + beta * p4[1] + gamma_ * p4val, delta));
4567 SCIPdebugMsg(scip,
"alpha = %g, beta = %g, gamma = %g, delta = %g\n", alpha, beta, gamma_, delta);
4578 coefx = -alpha / gamma_;
4579 coefy = -beta / gamma_;
4580 constant = delta / gamma_;
4643 assert(lpi != NULL);
4644 assert(nvars <= 10);
4647 treecoef = consdata->nonlincoefs[exprtreeidx];
4657 nrows = (int)(1u << nvars);
4662 nnonz = nrows * ncols;
4669 for( i = 0; i < nrows; ++i )
4673 for( j = 0; j < nvars; ++j )
4677 if( ((
unsigned int)i >> j) & 0x1 )
4691 SCIPdebugMsg(scip,
"cannot compute underestimator for concave because constaint <%s> cannot be evaluated\n",
SCIPconsGetName(cons));
4695 funcval *= treecoef;
4710 for( j = 0; j < nvars; ++j )
4712 if( corner[j] != 0.0 )
4715 val[idx] = corner[j];
4728 for( j = 0; j < ncols; ++j )
4740 funcval *= treecoef;
4759 SCIPwarningMessage(scip,
"solving auxiliary LP for underestimator of concave function returned %d\n", lpret);
4778 SCIPwarningMessage(scip,
"computed cut does not underestimate concave function in refpoint\n");
4781 assert( doupper ||
SCIPisFeasLE(scip, lpobj, funcval) );
4782 assert(!doupper ||
SCIPisFeasLE(scip, funcval, lpobj) );
4839 assert(scip != NULL);
4840 assert(cons != NULL);
4841 assert(ref != NULL);
4842 assert(rowprep != NULL);
4843 assert(success != NULL);
4846 assert(consdata != NULL);
4847 assert(exprtreeidx >= 0);
4848 assert(exprtreeidx < consdata->nexprtrees);
4849 assert(consdata->exprtrees != NULL);
4851 exprtree = consdata->exprtrees[exprtreeidx];
4852 assert(exprtree != NULL);
4862 if( !warned_highdim_concave )
4865 warned_highdim_concave =
TRUE;
4876 for( j = 0; j < nvars; ++j )
4880 SCIPdebugMsg(scip,
"cannot compute underestimator for concave because variable <%s> is unbounded\n",
SCIPvarGetName(vars[j]));
4899 retcode = _addConcaveEstimatorMultivariate(scip, lpi, cons, exprtreeidx, ref, rowprep, vars, exprtree, nvars, doupper, success);
4901 assert(lpi != NULL);
4990 for( c = 0; c < nchildren; ++c )
5057 assert( consdata != NULL );
5058 assert( exprtreeidx >= 0 );
5059 assert( exprtreeidx < consdata->nexprtrees );
5060 assert( consdata->exprtrees != NULL );
5061 assert( rowprep != NULL );
5062 assert( success != NULL );
5064 exprtree = consdata->exprtrees[exprtreeidx];
5065 assert( exprtree != NULL );
5084 for( i = 0; i < nvars; ++i )
5098 for( i = 0; i < nchildren; ++i )
5115 treecoef = consdata->nonlincoefs[exprtreeidx];
5116 constant *= treecoef;
5118 for( i = 0; i < nchildren; ++i )
5167 assert(scip != NULL);
5168 assert(cons != NULL);
5170 assert(rowprep != NULL);
5171 assert(success != NULL);
5174 assert(consdata != NULL);
5175 assert(exprtreeidx >= 0);
5176 assert(exprtreeidx < consdata->nexprtrees);
5177 assert(consdata->exprtrees != NULL);
5179 exprtree = consdata->exprtrees[exprtreeidx];
5180 assert(exprtree != NULL);
5199 for( i = 0; i < nvars; ++i )
5208 goto INTGRADESTIMATOR_CLEANUP;
5217 x[i] = (2.0*x[i] < lb+ub) ? lb : ub;
5234 SCIPdebugMsg(scip,
"Got nonfinite function value from evaluation of constraint %s tree %d. skipping interval gradient estimator.\n",
SCIPconsGetName(cons), exprtreeidx);
5235 goto INTGRADESTIMATOR_CLEANUP;
5238 treecoef = consdata->nonlincoefs[exprtreeidx];
5252 for( i = 0; i < nvars; ++i )
5262 else if( (overestimate && val == ub) ||
5263 (!overestimate && val == lb) )
5273 SCIPdebugMsg(scip,
"skip intgrad estimator because of infinite interval bound\n");
5274 goto INTGRADESTIMATOR_CLEANUP;
5277 constant -= coefs[i] * val;
5284 INTGRADESTIMATOR_CLEANUP:
5316 assert(scip != NULL);
5317 assert(cons != NULL);
5318 assert(row != NULL);
5325 assert(consdata != NULL);
5327 if( consdata->nexprtrees == 0 )
5350 for( i = 0; i < consdata->nexprtrees; ++i )
5367 else if( (side ==
SCIP_SIDETYPE_LEFT && (consdata->curvatures[i] & SCIP_EXPRCURV_CONVEX)) ||
5386 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);
5426 success = coefrange <= maxrange;
5474 assert(scip != NULL);
5475 assert(conshdlr != NULL);
5476 assert(conss != NULL || nconss == 0);
5477 assert(nusefulconss <= nconss);
5478 assert(result != NULL);
5485 if( bestefficacy != NULL )
5486 *bestefficacy = 0.0;
5490 assert(conss != NULL);
5498 assert(consdata != NULL);
5511 SCIP_CALL(
generateCut(scip,
conshdlrdata->exprinterpreter, conss[c], NULL, sol, newsol ||
SCIPisInfinity(scip, consdata->activity), violside, &row, minefficacy,
conshdlrdata->cutmaxrange,
conshdlrdata->checkconvexexpensive,
conshdlrdata->assumeconvex) );
5520 efficacy = -feasibility;
5535 SCIPdebugMsg(scip,
"add cut with efficacy %g for constraint <%s> violated by %g\n", efficacy,
SCIPconsGetName(conss[c]),
MAX(consdata->lhsviol, consdata->rhsviol));
5538 if( bestefficacy != NULL && efficacy > *bestefficacy )
5539 *bestefficacy = efficacy;
5542 if( inenforcement && !
conshdlrdata->enfocutsremovable )
5547 SCIPdebugMsg(scip,
"drop cut since efficacy %g is too small (< %g)\n", efficacy, minefficacy);
5587 assert(scip != NULL);
5588 assert(conshdlr != NULL);
5589 assert(conss != NULL || nconss == 0);
5594 if( separatedlpsol != NULL )
5595 *separatedlpsol =
FALSE;
5597 for( c = 0; c < nconss; ++c )
5599 assert(conss[c] != NULL);
5607 assert(consdata != NULL);
5624 if( separatedlpsol != NULL )
5630 *separatedlpsol =
TRUE;
5633 assert( ! infeasible );
5658 assert(scip != NULL);
5659 assert(event != NULL);
5660 assert(eventdata != NULL);
5661 assert(eventhdlr != NULL);
5673 assert(sol != NULL);
5676 assert(conshdlrdata != NULL);
5686 assert(conss != NULL);
5711 assert(scip != NULL);
5712 assert(conshdlr != NULL);
5713 assert(conss != NULL || nconss == 0);
5717 for( c = 0; c < nconss; ++c )
5719 assert(conss != NULL);
5721 assert(consdata != NULL);
5723 if( consdata->nexprtrees == 0 )
5732 for( i = 0; i < consdata->nexprtrees; ++i )
5742 assert(var != NULL);
5756 SCIPdebugMsg(scip,
"registered %d branching candidates\n", *nnotify);
5779 assert(scip != NULL);
5780 assert(conss != NULL || nconss == 0);
5785 for( c = 0; c < nconss; ++c )
5787 assert(conss != NULL);
5789 assert(consdata != NULL);
5794 for( j = 0; j < consdata->nexprtrees; ++j )
5805 brvarval = ABS(val);
5812 if( *brvar != NULL )
5847 assert(scip != NULL);
5848 assert(conss != NULL || nconss == 0);
5849 assert(addedcons != NULL);
5850 assert(reduceddom != NULL);
5851 assert(infeasible != NULL);
5854 *reduceddom =
FALSE;
5855 *infeasible =
FALSE;
5857 for( c = 0; c < nconss; ++c )
5859 assert(conss != NULL);
5861 assert(consdata != NULL);
5866 lhs = consdata->lhs;
5867 rhs = consdata->rhs;
5869 for( i = 0; i < consdata->nexprtrees; ++i )
5951 if ( consdata->nlinvars == 0 )
5955 else if ( consdata->nlinvars == 1 )
5959 coef = *consdata->lincoefs;
5960 SCIPdebugMsg(scip,
"Linear constraint with one variable: %g <= %g <%s> <= %g\n", lhs, coef,
SCIPvarGetName(*consdata->linvars), rhs);
5991 assert(consdata->linvars[0] != NULL);
5992 SCIPwarningMessage(scip,
"Activity of nonlinear part is beyond SCIP's value for infinity. To enforce " 5993 "the constraint %s SCIP needs to tight bounds of %s to a value beyond +/- infinity. Please check if " 6003 SCIPdebugMsg(scip,
"Lower bound leads to infeasibility.\n");
6019 SCIPdebugMsg(scip,
"Upper bound leads to infeasibility.\n");
6033 consdata->nlinvars, consdata->linvars, consdata->lincoefs, lhs, rhs,
6039 SCIPdebugMsg(scip,
"replace violated nonlinear constraint <%s> by linear constraint after all nonlinear vars have been fixed\n",
SCIPconsGetName(conss[c]) );
6047 SCIPdebugMsg(scip,
"linear constraint is feasible, thus do not add\n");
6076 assert(scip != NULL);
6078 assert(var != NULL);
6079 assert(result != NULL);
6081 assert(nchgbds != NULL);
6137 assert(scip != NULL);
6139 assert(var != NULL);
6140 assert(result != NULL);
6142 assert(nchgbds != NULL);
6205 assert(scip != NULL);
6206 assert(conshdlr != NULL);
6207 assert(cons != NULL);
6208 assert(result != NULL);
6209 assert(nchgbds != NULL);
6212 assert(consdata != NULL);
6231 assert(consdata->minlinactivityinf >= 0);
6232 assert(consdata->maxlinactivityinf >= 0);
6233 assert(consdata->exprgraphnode != NULL || consdata->nexprtrees == 0);
6236 if( consdata->exprgraphnode != NULL )
6254 SCIPdebugMsg(scip,
"found constraint <%s> to be infeasible; sides: [%g, %g], activity: [%g, %g], infeas: %.20g\n",
6268 SCIPdebugMsg(scip,
"found constraint <%s> to be redundant: sides: [%g, %g], activity: [%g, %g]\n",
6280 for( i = 0; i < consdata->nlinvars; ++i )
6282 coef = consdata->lincoefs[i];
6283 var = consdata->linvars[i];
6298 if( consdata->minlinactivityinf == 0 )
6305 bnd -= consdata->minlinactivity;
6320 bnd -= consdata->minlinactivity;
6334 if( consdata->maxlinactivityinf == 0 )
6341 bnd -= consdata->maxlinactivity;
6356 bnd -= consdata->maxlinactivity;
6368 assert(coef < 0.0 );
6373 if( consdata->maxlinactivityinf == 0 )
6379 bnd = consdata->maxlinactivity;
6394 bnd = consdata->maxlinactivity;
6409 if( consdata->minlinactivityinf == 0 )
6415 bnd = consdata->minlinactivity;
6430 bnd = consdata->minlinactivity;
6471 assert(scip != NULL);
6472 assert(conshdlr != NULL);
6473 assert(result != NULL);
6474 assert(nchgbds != NULL);
6482 SCIPdebugMsg(scip,
"start backward propagation in expression graph\n");
6487 file = fopen(
"exprgraph_propconss1.dot",
"w");
6498 for( c = 0; c < nconss; ++c )
6501 assert(consdata != NULL);
6503 if( consdata->exprgraphnode == NULL )
6513 if( !
SCIPisInfinity(scip, -consdata->lhs) && consdata->maxlinactivityinf == 0 )
6514 bounds.
inf = consdata->lhs - consdata->maxlinactivity -
SCIPfeastol(scip);
6518 if( !
SCIPisInfinity(scip, consdata->rhs) && consdata->minlinactivityinf == 0 )
6528 consdata->forcebackprop =
FALSE;
6544 file = fopen(
"exprgraph_propconss2.dot",
"w");
6566 for( i = 0; i < nvars && *result !=
SCIP_CUTOFF; ++i )
6605 assert(scip != NULL);
6606 assert(conshdlr != NULL);
6607 assert(conss != NULL || nconss == 0);
6608 assert(result != NULL);
6609 assert(nchgbds != NULL);
6610 assert(ndelconss != NULL);
6629 SCIPdebugMsg(scip,
"starting domain propagation round %d for %d constraints\n", roundnr, nconss);
6642 file = fopen(
"exprgraph_propvars.dot",
"w");
6653 SCIPdebugMsg(scip,
"current bounds out of domain for some expression, do cutoff\n");
6659 for( c = 0; c < nconss && *result !=
SCIP_CUTOFF; ++c )
6661 assert(conss != NULL);
6668 assert(consdata != NULL);
6675 *result = propresult;
6694 *result = propresult;
6699 while( success && *result !=
SCIP_CUTOFF && ++roundnr < conshdlrdata->maxproprounds );
6715 consdata->linvar_maydecrease = -1;
6716 consdata->linvar_mayincrease = -1;
6720 for( i = 0; i < consdata->nlinvars; ++i )
6723 assert(consdata->lincoefs[i] != 0.0);
6724 if( consdata->lincoefs[i] > 0.0 )
6739 if( (consdata->linvar_maydecrease < 0) ||
6740 (
SCIPvarGetObj(consdata->linvars[consdata->linvar_maydecrease]) / consdata->lincoefs[consdata->linvar_maydecrease] >
SCIPvarGetObj(consdata->linvars[i]) / consdata->lincoefs[i]) )
6741 consdata->linvar_maydecrease = i;
6748 if( (consdata->linvar_mayincrease < 0) ||
6749 (
SCIPvarGetObj(consdata->linvars[consdata->linvar_mayincrease]) / consdata->lincoefs[consdata->linvar_mayincrease] >
SCIPvarGetObj(consdata->linvars[i]) / consdata->lincoefs[i]) )
6750 consdata->linvar_mayincrease = i;
6755 if( consdata->linvar_mayincrease >= 0 )
6757 SCIPdebugMsg(scip,
"may increase <%s> to become feasible\n",
SCIPvarGetName(consdata->linvars[consdata->linvar_mayincrease]));
6759 if( consdata->linvar_maydecrease >= 0 )
6761 SCIPdebugMsg(scip,
"may decrease <%s> to become feasible\n",
SCIPvarGetName(consdata->linvars[consdata->linvar_maydecrease]));
6790 assert(scip != NULL);
6791 assert(conshdlr != NULL);
6792 assert(conss != NULL || nconss == 0);
6793 assert(success != NULL);
6815 for( c = 0; c < nconss; ++c )
6818 assert(consdata != NULL);
6825 assert(!solviolbounds);
6826 viol = consdata->lhs - consdata->activity;
6831 assert(!solviolbounds);
6832 viol = consdata->rhs - consdata->activity;
6837 assert(viol != 0.0);
6838 if( consdata->linvar_mayincrease >= 0 &&
6839 (( viol > 0.0 && consdata->lincoefs[consdata->linvar_mayincrease] > 0.0) ||
6840 (viol < 0.0 && consdata->lincoefs[consdata->linvar_mayincrease] < 0.0)) )
6843 var = consdata->linvars[consdata->linvar_mayincrease];
6845 delta = viol / consdata->lincoefs[consdata->linvar_mayincrease];
6846 assert(delta > 0.0);
6851 delta = MIN(
MAX(0.0, gap), delta);
6863 viol -= consdata->lincoefs[consdata->linvar_mayincrease] * delta;
6869 assert(viol != 0.0);
6870 if( consdata->linvar_maydecrease >= 0 &&
6871 (( viol > 0.0 && consdata->lincoefs[consdata->linvar_maydecrease] < 0.0) ||
6872 (viol < 0.0 && consdata->lincoefs[consdata->linvar_maydecrease] > 0.0)) )
6875 var = consdata->linvars[consdata->linvar_maydecrease];
6877 delta = viol / consdata->lincoefs[consdata->linvar_maydecrease];
6878 assert(delta < 0.0);
6883 delta =
MAX(MIN(0.0, gap), delta);
6894 viol -= consdata->lincoefs[consdata->linvar_maydecrease] * delta;
6943 assert(scip != NULL);
6944 assert(conshdlr != NULL);
6945 assert(conss != NULL || nconss == 0);
6952 if( maxviolcons == NULL )
6967 assert(solinfeasible);
6970 if( !solinfeasible )
6976 assert(consdata != NULL);
6978 maxviol = consdata->lhsviol + consdata->rhsviol;
6982 sol == NULL ?
"LP" :
"relaxation");
7022 *result = propresult;
7029 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, sol,
TRUE ,
SCIPfeastol(scip),
TRUE, &separateresult, &sepaefficacy) );
7038 SCIPdebugMsg(scip,
"separation succeeded (bestefficacy = %g, minefficacy = %g)\n", sepaefficacy,
SCIPfeastol(scip));
7046 SCIPdebugMsg(scip,
"separation failed (bestefficacy = %g < %g = minefficacy ); max viol: %g\n", sepaefficacy,
SCIPfeastol(scip), maxviol);
7054 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, sol,
FALSE,
SCIPlpfeastol(scip),
TRUE, &separateresult, &sepaefficacy) );
7057 *result = separateresult;
7062 if( nnotify == 0 && !solinfeasible )
7076 SCIPdebugMsg(scip,
"All nonlinear variables seem to be fixed. Replace remaining violated nonlinear constraints by linear constraints.\n");
7084 else if ( addedcons )
7086 else if ( reduceddom )
7091 SCIPwarningMessage(scip,
"could not enforce feasibility by separating or branching; declaring solution with viol %g as feasible\n", maxviol);
7098 SCIPdebugMsg(scip,
"Could not find any usual branching variable candidate. Proposed variable <%s> with LP value %g for branching.\n",
7116 assert(scip != NULL);
7117 assert(conshdlr != NULL);
7135 assert(scip != NULL);
7136 assert(conshdlr != NULL);
7139 assert(conshdlrdata != NULL);
7140 assert(conshdlrdata->exprinterpreter != NULL);
7141 assert(conshdlrdata->exprgraph != NULL);
7148 for( i = 0; i < conshdlrdata->nnlconsupgrades; ++i )
7150 assert(conshdlrdata->nlconsupgrades[i] != NULL);
7169 assert(scip != NULL);
7170 assert(conshdlr != NULL);
7173 assert(conshdlrdata != NULL);
7175 conshdlrdata->subnlpheur =
SCIPfindHeur(scip,
"subnlp");
7176 conshdlrdata->trysolheur =
SCIPfindHeur(scip,
"trysol");
7179 conshdlrdata->naddedreformconss = 0;
7184 file = fopen(
"exprgraph_init.dot",
"w");
7202 assert(scip != NULL);
7203 assert(conshdlr != NULL);
7206 assert(conshdlrdata != NULL);
7208 conshdlrdata->subnlpheur = NULL;
7209 conshdlrdata->trysolheur = NULL;
7222 assert(scip != NULL);
7223 assert(conshdlr != NULL);
7224 assert(conss != NULL || nconss == 0);
7226 for( c = 0; c < nconss; ++c )
7233 assert(consdata != NULL);
7236 assert(consdata->nexprtrees == 0 || consdata->exprgraphnode != NULL);
7262 assert(scip != NULL);
7263 assert(conshdlr != NULL);
7264 assert(conss != NULL || nconss == 0);
7267 assert(conshdlrdata != NULL);
7269 havegraphchange =
FALSE;
7271 if( !conshdlrdata->isremovedfixings )
7274 assert(conshdlrdata->isremovedfixings);
7276 havegraphchange =
TRUE;
7281 SCIPdebugMsg(scip,
"expression graph simplifier found %schange, domain error = %u\n", havechange ?
"" :
"no ", domainerror);
7282 havegraphchange |= havechange;
7288 for( c = 0; c < nconss; ++c )
7290 assert(conss != NULL);
7298 assert(consdata != NULL);
7300 if( !consdata->isremovedfixingslin )
7305 if( !consdata->ispresolved || havegraphchange )
7311 assert(!infeasible);
7316 assert(consdata->isremovedfixingslin);
7317 assert(consdata->linvarsmerged);
7319 for( i = 0; i < consdata->nlinvars; ++i )
7323 if( consdata->exprgraphnode != NULL )
7337 exprtreessize, &nexprtrees, exprtrees, coefs) );
7338 assert(nexprtrees > 0);
7345 assert(consdata->nexprtrees > 0 );
7347 for( j = 0; j < consdata->nexprtrees; ++j )
7369 assert(scip != NULL);
7370 assert(conshdlr != NULL);
7371 assert(conss != NULL || nconss == 0);
7374 assert(conshdlrdata != NULL);
7376 for( c = 0; c < nconss; ++c )
7378 assert(conss != NULL);
7380 assert(consdata != NULL);
7387 consdata->lincoefsmax = 0.0;
7388 for( i = 0; i < consdata->nlinvars; ++i )
7390 consdata->lincoefsmin = MIN(consdata->lincoefsmin,
REALABS(consdata->lincoefs[i]));
7391 consdata->lincoefsmax =
MAX(consdata->lincoefsmax,
REALABS(consdata->lincoefs[i]));
7397 if( consdata->nlrow == NULL )
7403 assert(consdata->nlrow != NULL);
7409 conshdlrdata->newsoleventfilterpos = -1;
7415 assert(eventhdlr != NULL);
7421 conshdlrdata->sepanlp =
FALSE;
7422 conshdlrdata->lastenfonode = NULL;
7423 conshdlrdata->nenforounds = 0;
7436 assert(scip != NULL);
7437 assert(conshdlr != NULL);
7438 assert(conss != NULL || nconss == 0);
7441 assert(conshdlrdata != NULL);
7443 if( conshdlrdata->newsoleventfilterpos >= 0 )
7448 assert(eventhdlr != NULL);
7451 conshdlrdata->newsoleventfilterpos = -1;
7454 for( c = 0; c < nconss; ++c )
7457 assert(consdata != NULL);
7460 if( consdata->nlrow != NULL )
7474 assert(scip != NULL);
7475 assert(conshdlr != NULL);
7476 assert(cons != NULL);
7478 assert(consdata != NULL);
7484 assert((*consdata)->exprgraphnode == NULL);
7488 assert(*consdata == NULL);
7502 assert(sourcedata != NULL);
7505 sourcedata->lhs, sourcedata->rhs,
7506 sourcedata->nlinvars, sourcedata->linvars, sourcedata->lincoefs,
7507 sourcedata->nexprtrees, sourcedata->exprtrees, sourcedata->nonlincoefs,
7511 if( sourcedata->iscurvchecked && sourcedata->nexprtrees > 0 )
7513 BMScopyMemoryArray(targetdata->curvatures, sourcedata->curvatures, sourcedata->nexprtrees);
7514 targetdata->curvature = sourcedata->curvature;
7515 targetdata->iscurvchecked =
TRUE;
7518 for( i = 0; i < targetdata->nlinvars; ++i )
7524 for( i = 0; i < targetdata->nexprtrees; ++i )
7536 SCIPdebugMsg(scip,
"created transformed nonlinear constraint ");
7557 assert(scip != NULL);
7558 assert(conshdlr != NULL);
7559 assert(conss != NULL || nconss == 0);
7562 assert(conshdlrdata != NULL);
7564 *infeasible =
FALSE;
7566 for( c = 0; c < nconss && !(*infeasible); ++c )
7568 assert(conss[c] != NULL);
7573 assert(consdata != NULL);
7577 if( consdata->nexprtrees == 0 )
7579 assert(consdata->exprgraphnode == NULL);
7591 haveunboundedvar =
FALSE;
7592 for( j = 0; j < consdata->nexprtrees; ++j )
7597 for( i = 0; i < nvars; ++i )
7600 assert(var != NULL);
7609 haveunboundedvar =
TRUE;
7661 for( j = 0; j < consdata->nexprtrees; ++j )
7679 assert(scip != NULL);
7680 assert(conshdlr != NULL);
7681 assert(conss != NULL || nconss == 0);
7682 assert(result != NULL);
7687 assert(conshdlrdata != NULL);
7696 if( maxviolcon == NULL )
7702 if(
SCIPgetDepth(scip) == 0 && !conshdlrdata->sepanlp &&
7719 for( c = 0; c < nconss; ++c )
7721 assert(conss[c] != NULL);
7724 assert(consdata != NULL);
7743 if( conshdlrdata->subnlpheur != NULL )
7758 SCIPdebugMsg(scip,
"solved NLP relax, solution status: %d\n", solstat);
7764 conshdlrdata->sepanlp =
TRUE;
7768 SCIPdebugMsg(scip,
"NLP relaxation is globally infeasible, thus can cutoff node\n");
7780 assert(nlpsol != NULL);
7783 if( solvednlp && conshdlrdata->trysolheur != NULL )
7793 if( nfracvars == 0 )
7804 if( lpsolseparated )
7806 SCIPdebugMsg(scip,
"linearization cuts separate LP solution\n");
7818 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, NULL,
TRUE,
SCIPgetSepaMinEfficacy(scip),
FALSE, result, NULL) );
7830 assert(scip != NULL);
7831 assert(conshdlr != NULL);
7832 assert(conss != NULL || nconss == 0);
7833 assert(sol != NULL);
7834 assert(result != NULL);
7845 if( maxviolcon == NULL )
7851 SCIP_CALL(
separatePoint(scip, conshdlr, conss, nconss, nusefulconss, sol,
FALSE,
SCIPgetSepaMinEfficacy(scip),
FALSE, result, NULL) );
7889 assert(scip != NULL);
7890 assert(conss != NULL || nconss == 0);
7895 assert(!solviolbounds);
7897 if( maxviolcons == NULL )
7915 *result = propresult;
7922 for( c = 0; c < nconss; ++c )
7924 assert(conss != NULL);
7926 assert(consdata != NULL);
7931 for( i = 0; i < consdata->nlinvars; ++i )
7933 var = consdata->linvars[i];
7941 for( j = 0; j < consdata->nexprtrees; ++j )
7957 SCIPdebugMsg(scip,
"All variables in violated constraints fixed (up to epsilon). Cannot find branching candidate. Forcing solution of LP.\n");
7977 assert(scip != NULL);
7978 assert(conss != NULL || nconss == 0);
7979 assert(result != NULL);
7982 assert(conshdlrdata != NULL);
7991 assert(conshdlrdata->exprgraph != NULL);
8003 maypropfeasible = conshdlrdata->linfeasshift && (conshdlrdata->trysolheur != NULL) &&
8008 for( c = 0; c < nconss; ++c )
8010 assert(conss != NULL);
8012 assert(!solviolbounds);
8015 assert(consdata != NULL);
8026 SCIPinfoMessage(scip, NULL,
"violation: left hand side is violated by %.15g (scaled: %.15g)\n", consdata->lhs - consdata->activity, consdata->lhsviol);
8030 SCIPinfoMessage(scip, NULL,
"violation: right hand side is violated by %.15g (scaled: %.15g)\n", consdata->activity - consdata->rhs, consdata->rhsviol);
8034 if( (conshdlrdata->subnlpheur == NULL || sol == NULL) && !maypropfeasible && !completely )
8037 if( consdata->lhsviol > maxviol || consdata->rhsviol > maxviol )
8038 maxviol =
MAX(consdata->lhsviol, consdata->rhsviol);
8042 maypropfeasible =
FALSE;
8044 if( maypropfeasible )
8054 if( !(consdata->linvar_mayincrease >= 0 && consdata->lincoefs[consdata->linvar_mayincrease] > 0.0) &&
8055 ! (consdata->linvar_maydecrease >= 0 && consdata->lincoefs[consdata->linvar_maydecrease] < 0.0) )
8056 maypropfeasible =
FALSE;
8063 if( !(consdata->linvar_mayincrease >= 0 && consdata->lincoefs[consdata->linvar_mayincrease] < 0.0) &&
8064 ! (consdata->linvar_maydecrease >= 0 && consdata->lincoefs[consdata->linvar_maydecrease] > 0.0) )
8065 maypropfeasible =
FALSE;
8101 assert(scip != NULL);
8102 assert(conshdlr != NULL);
8103 assert(conss != NULL || nconss == 0);
8104 assert(result != NULL);
8125 assert(scip != NULL);
8126 assert(conshdlr != NULL);
8127 assert(conss != NULL || nconss == 0);
8128 assert(result != NULL);
8133 assert(conshdlrdata != NULL);
8134 assert(conshdlrdata->exprgraph != NULL);
8136 havegraphchange =
FALSE;
8138 if( !conshdlrdata->isremovedfixings )
8141 assert(conshdlrdata->isremovedfixings);
8143 havegraphchange =
TRUE;
8147 SCIPdebugMsg(scip,
"expression graph simplifier found %schange, domain error = %u\n", havechange ?
"" :
"no ", domainerror);
8156 havegraphchange |= havechange;
8159 tryupgrades = havegraphchange;
8164 for( c = 0; c < nconss; ++c )
8166 assert(conss != NULL);
8169 assert(consdata != NULL);
8176 if( !consdata->isremovedfixingslin )
8179 assert(consdata->isremovedfixingslin);
8189 if( !consdata->ispresolved || havegraphchange )
8202 if( consdata->nlinvars == 0 && consdata->exprgraphnode == NULL )
8228 consdata->ispresolved =
FALSE;
8231 if( !consdata->ispresolved )
8246 SCIPdebugMsg(scip,
"propagating variable bounds through expression graph found that some expressions cannot be evaluated w.r.t. current bounds, thus cutoff\n");
8251 for( c = 0; c < nconss; ++c )
8254 assert(consdata != NULL);
8257 if( !consdata->ispresolved || havegraphchange )
8269 consdata->ispresolved =
TRUE;
8277 switch( propresult )
8283 SCIPdebugMsg(scip,
"propagation says problem is infeasible in presolve\n");
8291 if( conshdlrdata->reformulate && !conshdlrdata->assumeconvex )
8299 int naddconssbefore;
8301 SCIPdebugMsg(scip,
"reformulating expression graph\n");
8303 naddconssbefore = conshdlrdata->naddedreformconss;
8306 if( conshdlrdata->naddedreformconss > naddconssbefore )
8309 *naddconss += conshdlrdata->naddedreformconss - naddconssbefore;
8312 for( c = 0; c < nconss; ++c )
8314 assert(conss[c] != NULL);
8317 assert(consdata != NULL);
8319 consdata->ispresolved =
FALSE;
8338 assert(scip != NULL);
8339 assert(cons != NULL);
8347 assert(consdata != NULL);
8352 for( i = 0; i < consdata->nlinvars; ++i )
8354 if( consdata->lincoefs[i] > 0 )
8388 assert(scip != NULL);
8389 assert(conshdlr != NULL);
8390 assert(cons != NULL);
8394 assert(conshdlrdata != NULL);
8395 assert(conshdlrdata->exprgraph != NULL);
8398 assert(consdata != NULL);
8402 if( consdata->nexprtrees > 0 )
8406 assert(consdata->exprgraphnode == NULL);
8410 assert(consdata->exprgraphnode != NULL);
8420 conshdlrdata->isreformulated =
FALSE;
8425 consdata->forcebackprop =
TRUE;
8427 else if( consdata->exprgraphnode != NULL )
8430 conshdlrdata->isreformulated =
FALSE;
8435 consdata->forcebackprop =
TRUE;
8448 assert(scip != NULL);
8449 assert(conshdlr != NULL);
8450 assert(cons != NULL);
8454 assert(conshdlrdata != NULL);
8455 assert(conshdlrdata->exprgraph != NULL);
8458 assert(consdata != NULL);
8459 assert(consdata->exprgraphnode != NULL || consdata->nexprtrees == 0);
8463 if( consdata->exprgraphnode != NULL )
8465 if( consdata->nexprtrees == 0 )
8492 assert(scip != NULL);
8493 assert(conshdlr != NULL);
8494 assert(cons != NULL);
8499 assert(conshdlrdata != NULL);
8500 assert(conshdlrdata->exprgraph != NULL);
8503 assert(consdata != NULL);
8507 if( consdata->exprgraphnode != NULL )
8514 consdata->isremovedfixingslin =
TRUE;
8515 for( i = 0; i < consdata->nlinvars; ++i )
8519 consdata->isremovedfixingslin = consdata->isremovedfixingslin &&
SCIPvarIsActive(consdata->linvars[i]);
8533 assert(scip != NULL);
8534 assert(conshdlr != NULL);
8535 assert(cons != NULL);
8539 assert(conshdlrdata != NULL);
8540 assert(conshdlrdata->exprgraph != NULL);
8543 assert(consdata != NULL);
8544 assert(consdata->lineventdata != NULL || consdata->nlinvars == 0);
8549 if( consdata->exprgraphnode != NULL )
8554 for( i = 0; i < consdata->nlinvars; ++i )
8570 assert(scip != NULL);
8571 assert(cons != NULL);
8574 assert(consdata != NULL);
8579 && !
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
8583 if( consdata->nlinvars == 0 && consdata->nexprtrees == 0 && consdata->exprgraphnode == 0 )
8589 if( consdata->nexprtrees > 0 )
8591 for( j = 0; j < consdata->nexprtrees; ++j )
8593 if( j > 0 || consdata->nonlincoefs[j] != 1.0 )
8598 else if( consdata->exprgraphnode != NULL )
8604 assert(conshdlrdata != NULL);
8612 for( j = 0; j < consdata->nlinvars; ++j )
8622 if(
SCIPisEQ(scip, consdata->lhs, consdata->rhs) )
8655 assert(scip != NULL);
8656 assert(cons != NULL);
8657 assert(sourcescip != NULL);
8658 assert(sourceconshdlr != NULL);
8659 assert(sourcecons != NULL);
8660 assert(varmap != NULL);
8661 assert(valid != NULL);
8664 assert(consdata != NULL);
8671 if( consdata->nlinvars != 0 )
8674 for( i = 0; i < consdata->nlinvars && *valid; ++i )
8676 SCIP_CALL(
SCIPgetVarCopy(sourcescip, scip, consdata->linvars[i], &linvars[i], varmap, consmap, global, valid) );
8677 assert(!*valid || linvars[i] != NULL);
8684 if( *valid && consdata->nexprtrees > 0 )
8688 nonlincoefs = consdata->nonlincoefs;
8689 nexprtrees = consdata->nexprtrees;
8695 for( j = 0; j < consdata->nexprtrees; ++j )
8701 assert(!*valid || nonlinvars[i] != NULL);
8716 if( *valid && consdata->nexprtrees == 0 && consdata->exprgraphnode != NULL )
8732 assert(!*valid || nonlinvars[i] != NULL);
8739 consdata->nlinvars, linvars, consdata->lincoefs,
8740 nexprtrees, exprtrees, nonlincoefs,
8741 consdata->lhs, consdata->rhs,
8742 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
8746 targetconsdata->curvature = consdata->curvature;
8747 targetconsdata->iscurvchecked = consdata->iscurvchecked && global;
8751 if( exprtrees != NULL )
8753 for( j = 0; j < nexprtrees; ++j )
8755 if( exprtrees[j] != NULL )
8773 assert(cons != NULL);
8776 assert(consdata != NULL);
8780 if( varssize < consdata->nlinvars )
8787 cnt = consdata->nlinvars;
8789 if( consdata->exprgraphnode != NULL )
8796 assert(conshdlrdata != NULL);
8804 if( varsusage[i] == 0 )
8807 if( cnt >= varssize )
8825 for( e = 0; e < consdata->nexprtrees; ++e )
8829 assert(exprvars != NULL || nexprvars == 0);
8831 if( cnt + nexprvars > varssize )
8852 assert(consdata != NULL);
8854 *nvars = consdata->nlinvars;
8856 if( consdata->exprgraphnode != NULL )
8863 assert(conshdlrdata != NULL);
8870 if( varsusage[i] > 0 )
8879 for( e = 0; e < consdata->nexprtrees; ++e )
8900 char* nonconstendptr;
8901 const char* exprstart;
8902 const char* exprlastchar;
8908 SCIPdebugMsg(scip,
"cons_nonlinear::consparse parsing %s\n",str);
8910 assert(scip != NULL);
8911 assert(success != NULL);
8912 assert(str != NULL);
8913 assert(name != NULL);
8914 assert(cons != NULL);
8932 if( isdigit((
unsigned char)str[0]) || ((str[0] ==
'-' || str[0] ==
'+') && isdigit((
unsigned char)str[1])) )
8940 endptr = nonconstendptr;
8943 while( isspace((
unsigned char)*endptr) )
8946 if( endptr[0] !=
'<' || endptr[1] !=
'=' )
8957 while( isspace((
unsigned char)*str) )
8963 while( !(strncmp(endptr,
"[free]", 6) == 0) &&
8964 !(endptr[0] ==
'<' && endptr[1] ==
'=') &&
8965 !(endptr[0] ==
'=' && endptr[1] ==
'=') &&
8966 !(endptr[0] ==
'>' && endptr[1] ==
'=') &&
8967 !(endptr[0] ==
'\0') )
8971 exprlastchar = endptr - 1;
8977 while( isspace((
unsigned char)*str) )
8981 if( strncmp(str,
"[free]", 6) == 0 )
9030 varnameslength = (int) (exprlastchar - exprstart) + 5;
9046 curvarname = varnames;
9047 for( i = 0; i < nvars; ++i )
9049 assert(*curvarname == i);
9052 exprvars[i] =
SCIPfindVar(scip, (
char*)curvarname);
9053 if( exprvars[i] == NULL )
9055 SCIPerrorMessage(
"Unknown SCIP variable <%s> encountered in expression.\n", (
char*)curvarname);
9060 curvarname += (strlen((
char*)curvarname) + 1)/
sizeof(
int) + 1;
9072 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
9105 consEnfolpNonlinear, consEnfopsNonlinear, consCheckNonlinear, consLockNonlinear,
9107 assert(conshdlr != NULL);
9138 "maximal coef range of a cut (maximal coefficient divided by minimal coefficient) in order to be added to LP relaxation",
9142 "whether to try to make solutions in check function feasible by shifting a linear variable (esp. useful if constraint was actually objective function)",
9147 "whether to apply expensive curvature checking methods",
9152 "whether to assume that nonlinear functions in inequalities (<=) are convex (disables reformulation)",
9156 "limit on number of propagation rounds for a single constraint within one round of SCIP propagation",
9160 "whether to reformulate expression graph",
9164 "maximal exponent where still expanding non-monomial polynomials in expression simplification",
9168 "minimal required fraction of continuous variables in problem to use solution of NLP relaxation in root for separation",
9172 "are cuts added during enforcement removable from the LP in the same node?",
9177 processLinearVarEvent, NULL) );
9186 processNewSolutionEvent, NULL) );
9193 exprgraphVarAdded, exprgraphVarRemove, NULL, (
void*)
conshdlrdata) );
9209 const char* conshdlrname
9219 assert(conshdlrname != NULL );
9222 if( nonlinconsupgd == NULL && nodereform == NULL )
9227 if( conshdlr == NULL )
9234 assert(conshdlrdata != NULL);
9237 for( i = conshdlrdata->nnlconsupgrades - 1; i >= 0; --i )
9239 if( conshdlrdata->nlconsupgrades[i]->nlconsupgd == nonlinconsupgd && conshdlrdata->nlconsupgrades[i]->nodereform == nodereform)
9242 SCIPwarningMessage(scip,
"Try to add already known upgrade method pair (%p,%p) for constraint handler <%s>.\n", nonlinconsupgd, nodereform, conshdlrname);
9250 nlconsupgrade->nlconsupgd = nonlinconsupgd;
9251 nlconsupgrade->nodereform = nodereform;
9252 nlconsupgrade->
priority = priority;
9256 assert(conshdlrdata->nnlconsupgrades <= conshdlrdata->nlconsupgradessize);
9257 if( conshdlrdata->nnlconsupgrades+1 > conshdlrdata->nlconsupgradessize )
9263 conshdlrdata->nlconsupgradessize = newsize;
9265 assert(conshdlrdata->nnlconsupgrades+1 <= conshdlrdata->nlconsupgradessize);
9267 for( i = conshdlrdata->nnlconsupgrades; i > 0 && conshdlrdata->nlconsupgrades[i-1]->priority < nlconsupgrade->
priority; --i )
9268 conshdlrdata->nlconsupgrades[i] = conshdlrdata->nlconsupgrades[i-1];
9269 assert(0 <= i && i <= conshdlrdata->nnlconsupgrades);
9270 conshdlrdata->nlconsupgrades[i] = nlconsupgrade;
9271 conshdlrdata->nnlconsupgrades++;
9277 paramname, paramdesc,
9278 &nlconsupgrade->
active,
FALSE, active, NULL, NULL) );
9329 assert(linvars != NULL || nlinvars == 0);
9330 assert(lincoefs != NULL || nlinvars == 0);
9331 assert(exprtrees != NULL || nexprtrees == 0);
9332 assert(modifiable ==
FALSE);
9336 if( conshdlr == NULL )
9345 consdata->lhs = lhs;
9346 consdata->rhs = rhs;
9349 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
9350 local, modifiable, dynamic, removable, stickingatnode) );
9354 for( i = 0; i < nlinvars; ++i )
9395 assert(scip != NULL);
9398 nonlincoefs, lhs, rhs,
9450 assert(modifiable ==
FALSE);
9455 if( conshdlr == NULL )
9464 consdata->lhs = lhs;
9465 consdata->rhs = rhs;
9468 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
9469 local, modifiable, dynamic, removable, stickingatnode) );
9473 for( i = 0; i < nlinvars; ++i )
9482 if( exprgraphnode != NULL )
9484 consdata->exprgraphnode = exprgraphnode;
9486 consdata->iscurvchecked =
FALSE;
9521 assert(scip != NULL);
9537 assert(scip != NULL);
9538 assert(cons != NULL);
9539 assert(var != NULL);
9558 assert(scip != NULL);
9559 assert(cons != NULL);
9562 assert(exprtrees != NULL || nexprtrees == 0);
9580 assert(scip != NULL);
9581 assert(cons != NULL);
9584 assert(exprtrees != NULL || nexprtrees == 0);
9600 assert(cons != NULL);
9601 assert(nlrow != NULL);
9604 assert(consdata != NULL);
9606 if( consdata->nlrow == NULL )
9610 assert(consdata->nlrow != NULL);
9611 *nlrow = consdata->nlrow;
9622 assert(cons != NULL);
9634 assert(cons != NULL);
9646 assert(cons != NULL);
9658 assert(cons != NULL);
9671 assert(cons != NULL);
9684 assert(cons != NULL);
9697 assert(cons != NULL);
9709 assert(cons != NULL);
9721 assert(cons != NULL);
9736 assert(scip != NULL);
9737 assert(cons != NULL);
9740 assert(conshdlr != NULL);
9761 assert(scip != NULL);
9762 assert(cons != NULL);
9763 assert(curvature != NULL);
9766 assert(consdata != NULL);
9769 assert(conshdlr != NULL);
9773 if( checkcurv && !consdata->iscurvchecked )
9778 *curvature = consdata->curvature;
9795 assert(scip != NULL);
9796 assert(cons != NULL);
9797 assert(curvatures != NULL);
9801 assert(consdata != NULL);
9804 assert(conshdlr != NULL);
9810 if( checkcurv && !consdata->iscurvchecked )
9815 *curvatures = consdata->curvatures;
9832 assert(scip != NULL);
9833 assert(cons != NULL);
9834 assert(violation != NULL);
9839 SCIPwarningMessage(scip,
"SCIPgetViolationNonlinear is not available for active constraints during presolve.\n");
9845 assert(conshdlr != NULL);
9851 SCIPerrorMessage(
"Solution passed to SCIPgetViolationNonlinear() does not satisfy variable bounds.\n");
9856 assert(consdata != NULL);
9858 *violation =
MAX(consdata->lhsviol, consdata->rhsviol);
9871 assert(scip != NULL);
9872 assert(cons != NULL);
9875 assert(consdata != NULL);
9877 if( consdata->linvar_mayincrease == -1 && consdata->linvar_maydecrease == -1 )
9880 return consdata->linvar_maydecrease;
9891 assert(scip != NULL);
9892 assert(cons != NULL);
9895 assert(consdata != NULL);
9897 if( consdata->linvar_mayincrease == -1 && consdata->linvar_maydecrease == -1 )
9900 return consdata->linvar_mayincrease;
9911 assert(scip != NULL);
9912 assert(conshdlr != NULL);
9943 assert(scip != NULL);
9944 assert(alpha != NULL);
9945 assert(beta != NULL);
9946 assert(gamma_ != NULL);
9947 assert(delta != NULL);
9949 *alpha = -b3*c2 + a3*(-b2+c2) + a2*(b3-c3) + b2*c3;
9950 *beta = -(-b3*c1 + a3*(-b1+c1) + a1*(b3-c3) + b1*c3);
9951 *gamma_ = -a2*b1 + a1*b2 + a2*c1 - b2*c1 - a1*c2 + b1*c2;
9952 *delta = -a3*b2*c1 + a2*b3*c1 + a3*b1*c2 - a1*b3*c2 - a2*b1*c3 + a1*b2*c3;
9955 if( !
SCIPisRelEQ(scip, *alpha * a1 + *beta * a2 + *gamma_ * a3, *delta) ||
9956 !
SCIPisRelEQ(scip, *alpha * b1 + *beta * b2 + *gamma_ * b3, *delta) ||
9957 !
SCIPisRelEQ(scip, *alpha * c1 + *beta * c2 + *gamma_ * c3, *delta) )
9979 SCIPdebugMsg(scip,
"numerical troubles - try to solve the linear system via an LU factorization\n");
9992 if( !success || !
SCIPisRelEQ(scip, *alpha * a1 + *beta * a2 + *gamma_ * a3, *delta) ||
9993 !
SCIPisRelEQ(scip, *alpha * b1 + *beta * b2 + *gamma_ * b3, *delta) ||
9994 !
SCIPisRelEQ(scip, *alpha * c1 + *beta * c2 + *gamma_ * c3, *delta) )
9996 SCIPdebugMsg(scip,
"could not resolve numerical difficulties\n");
10004 if( *gamma_ < 0.0 )
10008 *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