71#include "scip/cons_eqknapsack.h"
75#define CONSHDLR_NAME "pseudoboolean"
76#define CONSHDLR_DESC "constraint handler dealing with pseudo Boolean constraints"
77#define CONSHDLR_ENFOPRIORITY -1000000
78#define CONSHDLR_CHECKPRIORITY -5000000
79#define CONSHDLR_EAGERFREQ 100
81#define CONSHDLR_MAXPREROUNDS -1
82#define CONSHDLR_NEEDSCONS TRUE
84#define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_MEDIUM
86#define DEFAULT_DECOMPOSENORMALPBCONS FALSE
87#define DEFAULT_DECOMPOSEINDICATORPBCONS TRUE
89#define DEFAULT_SEPARATENONLINEAR TRUE
90#define DEFAULT_PROPAGATENONLINEAR TRUE
91#define DEFAULT_REMOVABLENONLINEAR TRUE
92#define NONLINCONSUPGD_PRIORITY 60000
95#undef NONLINCONSUPGD_PRIORITY
100#define HASHSIZE_PSEUDOBOOLEANNONLINEARTERMS 500
195 unsigned int issoftcons:1;
196 unsigned int changed:1;
197 unsigned int propagated:1;
198 unsigned int presolved:1;
199 unsigned int cliquesadded:1;
200 unsigned int upgradetried:1;
204struct SCIP_ConshdlrData
208 int nallconsanddatas;
210 int sallconsanddatas;
253 if( varind1 == -1 && varind2 == -1 )
259 if( varind1 < varind2 )
261 if( varind1 > varind2 )
264 if( varneg1 && !varneg2 )
266 if( !varneg1 && varneg2 )
295 consand1 = consanddata1->
cons;
296 consand2 = consanddata2->
cons;
354 for( v = cdata1->
nvars - 1; v > 0; --v )
357 for( v = cdata2->
nvars - 1; v > 0; --v )
370 for( v = cdata1->
nvars - 1; v >= 0; --v )
376 if( cdata1->
vars[v] != cdata2->
vars[v] )
406 for( v = cdata->
nvars - 1; v > 0; --v )
414 assert(minidx >= 0 && minidx <= maxidx);
428 if( ((*conshdlrdata)->inithashmapandtable) )
442 hashGetKeyAndConsDatas, hashKeyEqAndConsDatas, hashKeyValAndConsDatas, (
void*)
scip) );
448 (*conshdlrdata)->inithashmapandtable =
TRUE;
465 (*conshdlrdata)->allconsanddatas =
NULL;
466 (*conshdlrdata)->nallconsanddatas = 0;
467 (*conshdlrdata)->sallconsanddatas = 10;
472 (*conshdlrdata)->inithashmapandtable =
FALSE;
473 (*conshdlrdata)->hashtable =
NULL;
474 (*conshdlrdata)->hashtablesize = 0;
475 (*conshdlrdata)->hashmap =
NULL;
476 (*conshdlrdata)->hashmapsize = 0;
479 (*conshdlrdata)->nlinconss = 0;
482 (*conshdlrdata)->noriguses = 0;
498 assert((*conshdlrdata)->nallconsanddatas == 0);
501 if( (*conshdlrdata)->inithashmapandtable )
504 (*conshdlrdata)->hashmapsize = 0;
506 (*conshdlrdata)->hashtablesize = 0;
513 (*conshdlrdata)->inithashmapandtable =
FALSE;
518 (*conshdlrdata)->allconsanddatas =
NULL;
519 (*conshdlrdata)->nallconsanddatas = 0;
520 (*conshdlrdata)->sallconsanddatas = 0;
556 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
557 *
nvars = SCIPgetNVarsEQKnapsack(
scip, cons);
619 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
620 *lhs = SCIPgetCapacityEQKnapsack(
scip, cons);
666 for( v = 0; v < *
nvars; ++v )
668 vars[v] = linvars[v];
669 coefs[v] = lincoefs[v];
674 for( v = 0; v < *
nvars; ++v )
675 vars[v] = linvars[v];
687 for( v = 0; v < *
nvars; ++v )
689 vars[v] = linvars[v];
695 for( v = 0; v < *
nvars; ++v )
696 vars[v] = linvars[v];
712 for( v = 0; v < *
nvars; ++v )
714 vars[v] = linvars[v];
720 for( v = 0; v < *
nvars; ++v )
721 vars[v] = linvars[v];
733 for( v = 0; v < *
nvars; ++v )
735 vars[v] = linvars[v];
741 for( v = 0; v < *
nvars; ++v )
742 vars[v] = linvars[v];
747 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
751 *
nvars = SCIPgetNVarsEQKnapsack(
scip, cons);
752 linvars = SCIPgetVarsEQKnapsack(
scip, cons);
757 weights = SCIPgetWeightsEQKnapsack(
scip, cons);
759 for( v = 0; v < *
nvars; ++v )
761 vars[v] = linvars[v];
767 for( v = 0; v < *
nvars; ++v )
768 vars[v] = linvars[v];
816 if( nlinvars !=
NULL )
818 if( nandress !=
NULL )
828 for( v = 0; v <
nvars; ++v )
840 hashmapentryexists =
SCIPhashmapExists(conshdlrdata->hashmap, (
void*)(hashmapvar));
843 hashmapvar =
vars[v];
848 if( hashmapentryexists )
857 if( hashmapentryexists )
865 if( !hashmapentryexists && linvars !=
NULL && nlinvars !=
NULL )
867 linvars[*nlinvars] =
vars[v];
868 if( lincoefs !=
NULL )
871 lincoefs[*nlinvars] = coefs[v];
875 else if( hashmapentryexists && nandress !=
NULL )
877 if( andress !=
NULL )
879 andress[*nandress] = hashmapvar;
881 if( andcoefs !=
NULL )
885 andcoefs[*nandress] = coefs[v];
886 andnegs[*nandress] = (
vars[v] != hashmapvar);
897#ifdef CHECK_CONSISTENCY
937 assert(consdata->nconsanddatas > 0);
938 assert(consdata->nconsanddatas <= consdata->sconsanddatas);
950 assert(
nvars == consdata->nlinvars + consdata->nconsanddatas);
968 andress, andcoefs, andnegs, &nandress) );
969 assert(nlinvars == consdata->nlinvars);
970 assert(nandress == consdata->nconsanddatas);
972 for( v = nandress - 1; v >= 0; --v )
974 SCIP_VAR* andresultant = andress[v];
977 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
980 if( consdata->consanddatas[
c]->cons !=
NULL )
985 if( res == andresultant && consdata->andnegs[
c] == andnegs[v] && consdata->andcoefs[
c] == andcoefs[v] )
992 alreadyfound[
c] =
TRUE;
1001 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
1017#define checkConsConsistency(scip, cons)
1042 tmpvars = consanddata->
vars;
1043 ntmpvars = consanddata->
nvars;
1046 for( v = ntmpvars - 1; v >= 0; --v )
1056 tmpvars = consanddata->
newvars;
1060 for( v = ntmpvars - 1; v >= 0; --v )
1071 if( !origdata || consanddata->
nvars == 0 )
1076 consanddata->
nuses = 0;
1077 consanddata->
nvars = 0;
1078 consanddata->
svars = 0;
1093 if( consanddata->
nvars > 0 )
1104 if( conshdlrdata->inithashmapandtable )
1136 if( conshdlrdata->inithashmapandtable )
1165 int const nandconss,
1201 SCIPerrorMessage(
"left hand side of pseudo boolean constraint greater than right hand side\n");
1212 (*consdata)->issoftcons = issoftcons;
1215 (*consdata)->weight = weight;
1221 (*consdata)->indvar = indvar;
1224 (*consdata)->indvar =
NULL;
1227 (*consdata)->lincons = lincons;
1228 (*consdata)->linconstype = linconstype;
1240 if( transforming || transformed )
1250 (*consdata)->nlinvars =
nvars - nandconss;
1261 if( andnegs !=
NULL )
1269 (*consdata)->nconsanddatas = nandconss;
1270 (*consdata)->sconsanddatas = nandconss;
1280 for(
c = nandconss - 1;
c >= 0; --
c )
1289 assert((*consdata)->consanddatas[
c]->origcons == andconss[
c] || (*consdata)->consanddatas[
c]->cons == andconss[
c]);
1294 if( (*consdata)->consanddatas[
c]->origcons !=
NULL && (*consdata)->consanddatas[
c]->cons ==
NULL )
1304 assert((*consdata)->consanddatas[
c]->cons !=
NULL);
1305 assert((*consdata)->consanddatas[
c]->newvars ==
NULL);
1306 assert((*consdata)->consanddatas[
c]->isoriginal);
1308 (*consdata)->consanddatas[
c]->istransformed =
TRUE;
1313 vars = (*consdata)->consanddatas[
c]->vars;
1314 ncvars = (*consdata)->consanddatas[
c]->nvars;
1324 for( v = ncvars - 1; v >= 0; --v )
1329 else if( (*consdata)->consanddatas[
c]->cons !=
NULL )
1330 assert((*consdata)->consanddatas[
c]->istransformed);
1332 ++((*consdata)->consanddatas[
c]->nuses);
1334 else if( transformed )
1336 assert((*consdata)->consanddatas[
c]->cons == andconss[
c]);
1338 assert((*consdata)->consanddatas[
c]->istransformed);
1343 SCIPsortPtrPtrRealBool((
void**)andress, (
void**)((*consdata)->consanddatas), (*consdata)->andcoefs, (*consdata)->andnegs, resvarComp, nandconss);
1350 (*consdata)->consanddatas =
NULL;
1351 (*consdata)->andcoefs =
NULL;
1352 (*consdata)->andnegs =
NULL;
1353 (*consdata)->nconsanddatas = 0;
1354 (*consdata)->sconsanddatas = 0;
1358 (*consdata)->lhs = lhs;
1359 (*consdata)->rhs = rhs;
1361 (*consdata)->changed =
TRUE;
1362 (*consdata)->propagated =
FALSE;
1363 (*consdata)->presolved =
FALSE;
1364 (*consdata)->cliquesadded =
FALSE;
1365 (*consdata)->upgradetried =
TRUE;
1374 conshdlrdata->noriguses += (*consdata)->nconsanddatas;
1396 assert((*consdata)->consanddatas !=
NULL || (*consdata)->nconsanddatas == 0);
1400 if( (*consdata)->lincons !=
NULL )
1405 nconsanddatas = (*consdata)->nconsanddatas;
1406 consanddatas = (*consdata)->consanddatas;
1409 for(
c = nconsanddatas - 1;
c >= 0; --
c )
1411 assert((consanddatas[
c]->origcons ==
NULL) == (consanddatas[
c]->noriguses == 0));
1412 assert((consanddatas[
c]->cons ==
NULL) == (consanddatas[
c]->nuses == 0));
1413 assert(consanddatas[
c]->nuses >= 0);
1414 assert(consanddatas[
c]->noriguses >= 0);
1418 if( !isorig && consanddatas[
c]->cons !=
NULL )
1422 --(consanddatas[
c]->
nuses);
1425 if( consanddatas[
c]->nuses == 0 )
1427 if( conshdlrdata->inithashmapandtable )
1433 if( consanddatas[
c]->origcons ==
NULL )
1449 if( consanddatas[
c]->origcons ==
NULL )
1453 assert(conshdlrdata->nallconsanddatas > 0);
1455 for( d = conshdlrdata->nallconsanddatas - 1; d >= 0; --d )
1457 if( conshdlrdata->allconsanddatas[d] == consanddatas[
c] )
1459 --conshdlrdata->nallconsanddatas;
1463 conshdlrdata->allconsanddatas[d] = conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas];
1473 else if( isorig && consanddatas[
c]->origcons !=
NULL )
1476 assert(consanddatas[
c]->nuses == 0);
1477 assert(consanddatas[
c]->nnewvars == 0);
1478 assert(consanddatas[
c]->snewvars == 0);
1484 if( consanddatas[
c]->noriguses == 0 )
1488 if( conshdlrdata->inithashmapandtable )
1503 assert(consanddatas[
c]->svars > 0);
1507 consanddatas[
c]->
nvars = 0;
1508 consanddatas[
c]->
svars = 0;
1513 assert(consanddatas[
c]->svars == 0);
1521 assert(conshdlrdata->nallconsanddatas > 0);
1522 for( d = conshdlrdata->nallconsanddatas - 1; d >= 0; --d )
1524 if( conshdlrdata->allconsanddatas[d] == consanddatas[
c] )
1526 --conshdlrdata->nallconsanddatas;
1530 conshdlrdata->allconsanddatas[d] = conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas];
1541 assert(!consanddatas[
c]->istransformed);
1546 if( consanddatas[
c]->nuses == 0 && consanddatas[
c]->istransformed )
1551 else if( consanddatas[
c]->nuses == 0 )
1557 assert(consanddatas[
c]->nnewvars == 0);
1558 assert(consanddatas[
c]->snewvars == 0);
1561 tmpvars = consanddatas[
c]->
vars;
1562 ntmpvars = consanddatas[
c]->
nvars;
1565 for( v = ntmpvars - 1; v >= 0; --v )
1574 if( !consanddatas[
c]->istransformed && consanddatas[
c]->noriguses > 0 )
1577 assert(consanddatas[
c]->nuses == 0);
1578 assert(consanddatas[
c]->nnewvars == 0);
1579 assert(consanddatas[
c]->snewvars == 0);
1582 assert(consanddatas[
c]->svars > 0);
1585 assert(consanddatas[
c]->isoriginal);
1591 if( conshdlrdata->inithashmapandtable )
1686 for( v =
nvars - 1; v >= 0; --v )
1693 for( v =
nvars - 1; v >= 0; --v )
1750 for( v =
nvars - 1; v >= 0; --v )
1757 for( v =
nvars - 1; v >= 0; --v )
1810 assert(consdata->nlinvars + consdata->nconsanddatas >=
nvars);
1838 for( v = 0; v <
nvars; ++v )
1851 assert(!consdata->issoftcons ||
var != consdata->indvar);
1854 if( consanddata !=
NULL )
1868 if( consanddata ==
NULL )
1872 monomialvars[nmonomials] =
vars + v;
1873 monomialnvars[nmonomials] = 1;
1880 if( fixed != negated )
1896 monomialvars[nmonomials] = andvars;
1898 monomialnvars[nmonomials] = nandvars;
1902 monomialcoefs[nmonomials] = coefs[v];
1931 if( consdata->issoftcons )
2017 if( tmpdata !=
NULL )
2025 *andcons = tmpdata->
cons;
2058 for( v = 0; v <
nvars; ++v )
2076#ifdef SCIP_DISABLED_CODE
2077#ifdef WITH_DEBUG_SOLUTION
2078 if( SCIPdebugIsMainscip(
scip) )
2084 for( v =
nvars - 1; v >= 0; --v )
2092 val = ((val < 0.5) ? 0.0 : 1.0);
2097 SCIPerrorMessage(
"computed solution value %g for resultant <%s> violates debug solution value %g\n", val,
SCIPvarGetName(resultant), debugsolval);
2119 local, modifiable, dynamic, removable, stickingatnode) );
2127 if( conshdlrdata->nallconsanddatas == conshdlrdata->sallconsanddatas )
2133 conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas] = newdata;
2134 ++(conshdlrdata->nallconsanddatas);
2138 newdata->
cons = newcons;
2148 for( v = newdata->
nvars - 1; v >= 0; --v )
2225 if( consdata->nconsanddatas == consdata->sconsanddatas )
2235 ++(consdata->nconsanddatas);
2238 switch( consdata->linconstype )
2261#ifdef WITHEQKNAPSACK
2262 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
2279 consdata->changed =
TRUE;
2280 consdata->propagated =
FALSE;
2281 consdata->presolved =
FALSE;
2282 consdata->cliquesadded =
FALSE;
2283 consdata->upgradetried =
FALSE;
2305 SCIPerrorMessage(
"changing left hand side only allowed on standard lienar constraint \n");
2307#ifdef WITHEQKNAPSACK
2308 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
2336 SCIPerrorMessage(
"changing left hand side only allowed on standard lienar constraint \n");
2338#ifdef WITHEQKNAPSACK
2339 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
2411 SCIP_CALL(
getLinVarsAndAndRess(
scip, cons,
vars, coefs,
nvars, linvars, lincoefs, &nlinvars, andress, andcoefs, andnegs, &nandress) );
2412 assert(consdata->nconsanddatas == nandress);
2428 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2433 consanddata = consdata->consanddatas[
c];
2436 andcons = consanddata->
cons;
2441 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2446 for( v = nandvars - 1; v >= 0; --v )
2453 for( v = nandvars - 1; v >= 0; --v )
2463 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2468 consanddata = consdata->consanddatas[
c];
2471 andcons = consanddata->
cons;
2476 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2481 for( v = nandvars - 1; v >= 0; --v )
2488 for( v = nandvars - 1; v >= 0; --v )
2500 consdata->propagated =
FALSE;
2505 consdata->lhs = lhs;
2506 consdata->presolved =
FALSE;
2507 consdata->changed =
TRUE;
2582 SCIP_CALL(
getLinVarsAndAndRess(
scip, cons,
vars, coefs,
nvars, linvars, lincoefs, &nlinvars, andress, andcoefs, andnegs, &nandress) );
2583 assert(consdata->nconsanddatas == nandress);
2599 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2604 consanddata = consdata->consanddatas[
c];
2607 andcons = consanddata->
cons;
2612 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2617 for( v = nandvars - 1; v >= 0; --v )
2624 for( v = nandvars - 1; v >= 0; --v )
2634 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2639 consanddata = consdata->consanddatas[
c];
2642 andcons = consanddata->
cons;
2647 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2652 for( v = nandvars - 1; v >= 0; --v )
2659 for( v = nandvars - 1; v >= 0; --v )
2671 consdata->propagated =
FALSE;
2676 consdata->rhs = rhs;
2677 consdata->presolved =
FALSE;
2678 consdata->changed =
TRUE;
2700 int const*
const ntermvars,
2741 for( t = 0; t <
nterms; ++t )
2746 initial, enforce, check, local, modifiable, dynamic, stickingatnode,
2747 &(andconss[*nandconss])) );
2749 andvals[*nandconss] = termcoefs[t];
2750 andnegs[*nandconss] =
FALSE;
2828 assert(nlinvars > 0 || nandress > 0);
2838 ++(conshdlrdata->nlinconss);
2854 nvars = nlinvars + nandress;
2857 for( v = nlinvars - 1; v >= 0; --v )
2887 for( v = nandress - 1; v >= 0; --v )
2915 SCIPdebugMsg(
scip,
"While creating the linear constraint of the pseudoboolean constraint we found %d zero coefficients that were removed\n", nzero);
2933 if( upgrconshdlr !=
NULL &&
nvars > 2 && ncoeffspone + ncoeffsnone ==
nvars
2949 for( v = 0; v < nlinvars; ++v )
2951 if( mult * linvals[v] > 0.0 )
2952 transvars[v] = linvars[v];
2961 for( v = 0; v < nandress; ++v )
2963 if( mult * andvals[v] > 0.0 )
2964 transvars[nlinvars + v] = andress[v];
2976 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3005 if( upgrconshdlr !=
NULL && !created && ncoeffspone + ncoeffsnone ==
nvars )
3012 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a set partitioning constraint\n");
3015 mult =
SCIPisEQ(
scip, *lhs, 1.0 - ncoeffsnone) ? +1 : -1;
3021 for( v = 0; v < nlinvars; ++v )
3023 if( mult * linvals[v] > 0.0 )
3024 transvars[v] = linvars[v];
3033 for( v = 0; v < nandress; ++v )
3035 if( mult * andvals[v] > 0.0 )
3036 transvars[nlinvars + v] = andress[v];
3048 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3062 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a set packing constraint\n");
3071 for( v = 0; v < nlinvars; ++v )
3073 if( mult * linvals[v] > 0.0 )
3074 transvars[v] = linvars[v];
3083 for( v = 0; v < nandress; ++v )
3085 if( mult * andvals[v] > 0.0 )
3086 transvars[nlinvars + v] = andress[v];
3098 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3116 SCIPwarningMessage(
scip,
"Does not expect this, because this constraint should be a set packing constraint.\n");
3120 SCIPwarningMessage(
scip,
"Does not expect this, because this constraint should be a logicor constraint.\n");
3123 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a set covering constraint\n");
3132 for( v = 0; v < nlinvars; ++v )
3134 if( mult * linvals[v] > 0.0 )
3135 transvars[v] = linvars[v];
3144 for( v = 0; v < nandress; ++v )
3146 if( mult * andvals[v] > 0.0 )
3147 transvars[nlinvars + v] = andress[v];
3159 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3187 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a knapsack constraint\n");
3208 for( v = 0; v < nlinvars; ++v )
3214 transvars[v] = linvars[v];
3215 weights[v] = weight;
3220 weights[v] = -weight;
3226 for( v = 0; v < nandress; ++v )
3232 transvars[nlinvars + v] = andress[v];
3233 weights[nlinvars + v] = weight;
3239 weights[nlinvars + v] = -weight;
3247 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3259#ifdef WITHEQKNAPSACK
3268 if( upgrconshdlr !=
NULL && !created && (ncoeffspone + ncoeffsnone + ncoeffspint + ncoeffsnint ==
nvars) &&
SCIPisEQ(
scip, *lhs, *rhs) )
3278 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a equality-knapsack constraint\n");
3296 for( v = 0; v < nlinvars; ++v )
3302 transvars[v] = linvars[v];
3303 weights[v] = weight;
3308 weights[v] = -weight;
3314 for( v = 0; v < nandress; ++v )
3320 transvars[nlinvars + v] = andress[v];
3321 weights[nlinvars + v] = weight;
3327 weights[nlinvars + v] = -weight;
3334 SCIP_CALL( SCIPcreateConsEqKnapsack(
scip, &cons, name,
nvars, transvars, weights, capacity,
3335 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3338 (*linconstype) = SCIP_LINEARCONSTYPE_EQKNAPSACK;
3357 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3362 for( v = 0; v < nandress; ++v )
3452 assert(consdata->nlinvars + consdata->nconsanddatas >=
nvars);
3464 for( v = 0; v <
nvars; ++v )
3475 if( consanddata !=
NULL )
3483 if( consanddata ==
NULL )
3494 if( andcons ==
NULL )
3495 andcons = consanddata->
cons;
3505 for(
i = 0;
i < nandvars; ++
i )
3509 solval = 1.0 - solval;
3513 activity += coefs[v] * solval;
3516 SCIPdebugMsg(
scip,
"lhs = %g, activity = %g, rhs = %g\n", lhs, activity, rhs);
3519 lhsviol = lhs - activity;
3520 rhsviol = activity - rhs;
3522 if(lhsviol > rhsviol)
3601 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
3608 if( !conshdlrdata->allconsanddatas[
c]->istransformed )
3611 andcons = conshdlrdata->allconsanddatas[
c]->cons;
3614 if( andcons ==
NULL )
3627 for( v =
nvars - 1; v >= 0; --v )
3631 if( solval < minsolval )
3634 sumsolval += solval;
3641 viol =
MAX3(0.0, solval - minsolval, sumsolval - (
nvars - 1.0 + solval));
3666 SCIP*
const targetscip,
3668 SCIP*
const sourcescip,
3707 sourcelincons = sourceconsdata->lincons;
3717 int ntargetandconss;
3720 targetlinconstype = sourceconsdata->linconstype;
3722 switch( targetlinconstype )
3740#ifdef WITHEQKNAPSACK
3741 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
3752 if( conshdlrlinear ==
NULL )
3758 targetlincons =
NULL;
3778 targetandconss =
NULL;
3779 targetandcoefs =
NULL;
3780 ntargetandconss = 0;
3786 int nsourceandconss;
3795 nsourceandconss = sourceconsdata->nconsanddatas;
3810 targetlinvars, targetlincoefs, &ntargetlinvars) );
3817 SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL) );
3819 for(
c = 0 ;
c < ntargetlinvars; ++
c )
3828 for(
c = 0 ;
c < nsourceandconss; ++
c )
3835 consanddata = sourceconsdata->consanddatas[
c];
3848 targetandconss[ntargetandconss] =
NULL;
3860 targetandcoefs[ntargetandconss] = sourceconsdata->andcoefs[
c];
3866 assert(ntargetandconss <= ntargetlinvars);
3875 const char* consname;
3878 assert(sourceconsdata->issoftcons == (sourceconsdata->indvar !=
NULL));
3879 indvar = sourceconsdata->indvar;
3882 if( indvar !=
NULL )
3906 targetlinconstype, targetandconss, targetandcoefs, ntargetandconss, indvar, sourceconsdata->weight,
3907 sourceconsdata->issoftcons, targetlhs, targetrhs, initial,
separate, enforce, check,
propagate,
3908 local, modifiable, dynamic, removable, stickingatnode) );
3918 if( targetlincons !=
NULL )
3924 if( targetandconss !=
NULL )
3928 assert(ntargetandconss <= sourceconsdata->nconsanddatas);
3930 for(
c = 0 ;
c < ntargetandconss; ++
c )
3932 if( targetandconss[
c] !=
NULL )
3963 allconsanddatas = conshdlrdata->allconsanddatas;
3965 assert(conshdlrdata->nallconsanddatas >= 0);
3966 assert(conshdlrdata->nallconsanddatas <= conshdlrdata->sallconsanddatas);
3968 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
3977 consanddata = allconsanddatas[
c];
3982 if( consanddata->
nuses == 0 )
4000 cons = consanddata->
cons;
4023 for( v =
nvars - 1; v > 0; --v )
4026 for( v = nnewvars - 1; v > 0; --v )
4031 if(
nvars == nnewvars )
4038 for( v =
nvars - 1; v >= 0; --v )
4040 if(
vars[v] != newvars[v] )
4052 if( nnewvars > consanddata->
snewvars )
4062 for( v = consanddata->
nnewvars - 1; v >= 0; --v )
4144 int nnewconsanddatas;
4145 int snewconsanddatas;
4171 SCIPsortPtrRealBool((
void**)(consdata->consanddatas), consdata->andcoefs, consdata->andnegs, resvarCompWithInactive, consdata->nconsanddatas);
4176 consanddatas = consdata->consanddatas;
4177 oldandcoefs = consdata->andcoefs;
4178 oldandnegs = consdata->andnegs;
4179 nconsanddatas = consdata->nconsanddatas;
4180 assert(consanddatas !=
NULL || nconsanddatas == 0);
4181 assert(oldandcoefs !=
NULL || nconsanddatas == 0);
4183 snewconsanddatas = nconsanddatas + nandress;
4190 nnewconsanddatas = 0;
4193 for(
c = 0, c1 = 0;
c < nconsanddatas && c1 < nandress; )
4203 if( !consanddatas[
c]->istransformed )
4206 consdata->changed =
TRUE;
4207 consdata->upgradetried =
FALSE;
4211 andcons = consanddatas[
c]->
cons;
4214 if( andcons ==
NULL )
4217 consdata->changed =
TRUE;
4218 consdata->upgradetried =
FALSE;
4225 oldandnegs[
c] ? -oldandcoefs[
c] : oldandcoefs[
c], consdata->lhs, consdata->rhs) );
4227 consdata->changed =
TRUE;
4228 consdata->upgradetried =
FALSE;
4244 compval = resvarComp((
void*)res1, (
void*)res2);
4250 assert(consanddatas[
c]->nuses > 0);
4251 --(consanddatas[
c]->
nuses);
4255 consdata->lhs, consdata->rhs) );
4257 consdata->changed =
TRUE;
4258 consdata->upgradetried =
FALSE;
4259 consdata->propagated =
FALSE;
4260 consdata->presolved =
FALSE;
4262 else if( compval == +1 )
4267 newandcoefs[nnewconsanddatas] = andcoefs[c1];
4268 newandnegs[nnewconsanddatas] = andnegs[c1];
4269 ++(newconsanddatas[nnewconsanddatas]->
nuses);
4273 -newandcoefs[nnewconsanddatas] : newandcoefs[nnewconsanddatas], newlhs, newrhs) );
4275 consdata->changed =
TRUE;
4276 consdata->upgradetried =
FALSE;
4277 consdata->cliquesadded =
FALSE;
4278 consdata->propagated =
FALSE;
4279 consdata->presolved =
FALSE;
4294 newconsanddatas[nnewconsanddatas] = consanddatas[
c];
4296 newandcoefs[nnewconsanddatas] = andcoefs[c1];
4297 newandnegs[nnewconsanddatas] = andnegs[c1];
4299 if( ((oldandnegs[
c] == andnegs[c1]) && !
SCIPisEQ(
scip, oldandcoefs[
c], newandcoefs[c1]))
4300 || ((oldandnegs[
c] != newandnegs[c1]) && !
SCIPisEQ(
scip, oldandcoefs[
c], -newandcoefs[c1])) )
4301 consdata->upgradetried =
FALSE;
4303 coefsignchanged = (oldandnegs[
c] == andnegs[c1]) &&
4304 ((oldandcoefs[
c] < 0 && andcoefs[c1] > 0) || (oldandcoefs[
c] > 0 && andcoefs[c1] < 0));
4305 coefsignchanged = coefsignchanged || ((oldandnegs[
c] != andnegs[c1]) &&
4306 ((oldandcoefs[
c] < 0 && andcoefs[c1] < 0) || (oldandcoefs[
c] > 0 && andcoefs[c1] > 0)));
4308 || (consdata->lhs < 0 && newlhs > 0) || (consdata->lhs > 0 && newlhs < 0);
4310 || (consdata->rhs < 0 && newrhs > 0) || (consdata->rhs > 0 && newrhs < 0);
4313 if( coefsignchanged || lhschanged || rhschanged || newconsanddatas[nnewconsanddatas]->nnewvars > 0)
4317 -oldandcoefs[
c] : oldandcoefs[
c], consdata->lhs, consdata->rhs) );
4319 -newandcoefs[nnewconsanddatas] : newandcoefs[nnewconsanddatas], newlhs, newrhs) );
4321 consdata->changed =
TRUE;
4322 consdata->upgradetried =
FALSE;
4323 consdata->cliquesadded =
FALSE;
4324 consdata->propagated =
FALSE;
4325 consdata->presolved =
FALSE;
4335 if(
c < nconsanddatas )
4339 for( ;
c < nconsanddatas; ++
c )
4347 andcons = consanddatas[
c]->
cons;
4349 if( andcons !=
NULL )
4356 if( andcons ==
NULL )
4358 consdata->changed =
TRUE;
4359 consdata->upgradetried =
FALSE;
4363 assert(consanddatas[
c]->nuses > 0);
4364 --(consanddatas[
c]->
nuses);
4368 consdata->lhs, consdata->rhs) );
4369 consdata->changed =
TRUE;
4370 consdata->upgradetried =
FALSE;
4371 consdata->propagated =
FALSE;
4372 consdata->presolved =
FALSE;
4375 else if( c1 < nandress )
4377 for( ; c1 < nandress; ++c1 )
4385 newandcoefs[nnewconsanddatas] = andcoefs[c1];
4386 newandnegs[nnewconsanddatas] = andnegs[c1];
4387 ++(newconsanddatas[nnewconsanddatas]->
nuses);
4391 -newandcoefs[nnewconsanddatas] : newandcoefs[nnewconsanddatas], newlhs, newrhs) );
4394 consdata->changed =
TRUE;
4395 consdata->upgradetried =
FALSE;
4396 consdata->cliquesadded =
FALSE;
4397 consdata->propagated =
FALSE;
4398 consdata->presolved =
FALSE;
4401 assert(
c == nconsanddatas && c1 == nandress);
4410 consdata->upgradetried =
FALSE;
4411 consdata->lhs = newlhs;
4412 consdata->rhs = newrhs;
4415 consdata->consanddatas = newconsanddatas;
4416 consdata->andcoefs = newandcoefs;
4417 consdata->andnegs = newandnegs;
4418 consdata->nconsanddatas = nnewconsanddatas;
4419 consdata->sconsanddatas = snewconsanddatas;
4421 oldnvars = consdata->nlinvars;
4424 consdata->nlinvars -= nnewconsanddatas;
4426 if( oldnvars != consdata->nlinvars )
4428 consdata->changed =
TRUE;
4429 consdata->upgradetried =
FALSE;
4430 consdata->cliquesadded =
FALSE;
4431 consdata->propagated =
FALSE;
4432 consdata->presolved =
FALSE;
4436 consanddatas = consdata->consanddatas;
4437 nconsanddatas = consdata->nconsanddatas;
4438 assert(consanddatas !=
NULL || nconsanddatas == 0);
4441 for(
c = nconsanddatas - 1;
c > 0; --
c )
4472 if( resind1 == -1 && resind2 == -1 )
4478 if( resind1 <= resind2 )
4480 assert(resind1 == resind2);
4496 int*
const naggrvars,
4525 assert(consdata->nconsanddatas > 0);
4528 if( consdata->cliquesadded )
4531 consdata->cliquesadded =
TRUE;
4540 assert(consdata->nconsanddatas > 0);
4541 assert(consdata->nconsanddatas <= consdata->sconsanddatas);
4545 assert(
nvars == consdata->nlinvars + consdata->nconsanddatas);
4560 assert(nandress == consdata->nconsanddatas);
4564 for(
c = nandress - 1;
c >= 0; --
c )
4570 consanddata = consdata->consanddatas[
c];
4578 andvars = consanddata->
newvars;
4583 andvars = consanddata->
vars;
4584 nandvars = consanddata->
nvars;
4587 for( v1 = nandvars - 1; v1 >= 0; --v1 )
4605 for( v2 = nlinvars - 1; v2 >= 0; --v2 )
4635 if( values[0] != values[1] && var1 == var2 )
4641 clqvars[0] = andres;
4652 *nchgbds += nchgbdslocal;
4684 clqvars[0] = andres;
4695 *nchgbds += nchgbdslocal;
4715 for(
c = nandress - 1;
c > 0; --
c )
4724 consanddata1 = consdata->consanddatas[
c];
4726 consanddata2 = consdata->consanddatas[
c - 1];
4735 andvars1 = consanddata1->
newvars;
4736 nandvars1 = consanddata1->
nnewvars;
4740 andvars1 = consanddata1->
vars;
4741 nandvars1 = consanddata1->
nvars;
4747 andvars2 = consanddata2->
newvars;
4748 nandvars2 = consanddata2->
nnewvars;
4752 andvars2 = consanddata2->
vars;
4753 nandvars2 = consanddata2->
nvars;
4757 for( v1 = nandvars1 - 1; v1 >= 0; --v1 )
4762 var1 = andvars1[v1];
4775 for( v2 = nandvars2 - 1; v2 >= 0; --v2 )
4779 var2 = andvars2[v2];
4805 if( values[0] != values[1] && var1 == var2 )
4811 clqvars[0] = andres;
4812 clqvars[1] = andres2;
4821 *nchgbds += nchgbdslocal;
4854 clqvars[0] = andres;
4865 *nchgbds += nchgbdslocal;
4922 if( consdata->propagated )
4926 consdata->propagated =
TRUE;
4949 consanddatas = consdata->consanddatas;
4950 nconsanddatas = consdata->nconsanddatas;
4951 assert(consanddatas !=
NULL || nconsanddatas == 0);
4957 for(
c = nconsanddatas - 1;
c >= 0; --
c )
4963 if( !consanddatas[
c]->istransformed )
4966 andcons = consanddatas[
c]->
cons;
4997 if( conshdlrdata->nallconsanddatas == 0 )
5000 allconsanddatas = conshdlrdata->allconsanddatas;
5002 assert(conshdlrdata->nallconsanddatas >= 1);
5003 assert(conshdlrdata->nallconsanddatas <= conshdlrdata->sallconsanddatas);
5005 if( nfixedvars >= 1 &&
nvars >= 1 )
5013 activescalars =
NULL;
5016 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
5023 consanddata = allconsanddatas[
c];
5041 if( consanddata->
nvars == 0 )
5056 consanddata->
nuses = 0;
5077 if( consanddata->
nuses == 0 )
5114 for(
w = 0;
w < nfixedvars && del; ++
w )
5123 activevars[0] = fixedvars[
w];
5124 activescalars[0] = 1.0;
5125 activeconstant = 0.0;
5128 assert(requiredsize == nactivevars);
5130 for(
i = 0;
i < nactivevars && del; ++
i )
5134 if( activevars[
i] == resvar )
5148 if( !looseorcolumn )
5174 cons = consanddata->
cons;
5188 consanddata->
nuses = 0;
5212 tmpvars = consanddata->
vars;
5214 for( v = consanddata->
nvars - 1; v >= 0; --v )
5222 tmpvars = consanddata->
vars;
5223 stmpvars = consanddata->
svars;
5227 consanddata->
newvars = tmpvars;
5233 if( activevars !=
NULL )
5269 consanddatas = consdata->consanddatas;
5270 nconsanddatas = consdata->nconsanddatas;
5271 assert(nconsanddatas > 0 && consanddatas !=
NULL);
5275 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5279 consanddata = consanddatas[
c];
5289 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5293 consanddata = consanddatas[
c];
5295 assert(consanddatas[
c]->istransformed);
5299 if( consanddata->
nuses > 0 )
5300 --(consanddata->
nuses);
5303 if( consanddata->
nuses == 0 )
5338 if( !looseorcolumn )
5363 consdata->nconsanddatas = 0;
5393 int const nconsanddatas,
5420 assert(nconsanddatas > 0);
5421 assert(*xortype >= -1 && *xortype <= 1);
5424 SCIPsortPtr((
void**)linvars, SCIPvarCompActiveAndNegated, nlinvars);
5428 for( v = nlinvars - 1; v >= 0; --v )
5433 value += lincoefs[v];
5448 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5452 consanddata = consanddatas[
c];
5459 termvars = consanddata->
newvars;
5464 termvars = consanddata->
vars;
5465 ntermvars = consanddata->
nvars;
5473 SCIPsortPtrBool((
void**)repvars, negated, SCIPvarCompActiveAndNegated, ntermvars);
5475 for( v = ntermvars - 1; v >= 0; --v )
5484 if( (negated[v] && values[pos]) || (!negated[v] && !values[pos]) )
5500 if( val != consanddatanegs[
c] )
5501 value += consanddatacoefs[
c];
5507 if( *xortype == -1 )
5515 else if( *xortype == 1 && cnt % 2 == 0 )
5517 else if( *xortype == 0 && cnt % 2 == 1 )
5523 if( *xortype == -1 )
5531 else if( *xortype == 1 && cnt % 2 == 1 )
5533 else if( *xortype == 0 && cnt % 2 == 0 )
5554 int*
const ndelconss,
5555 int*
const naddconss,
5556 int*
const nfixedvars,
5557 int*
const nchgcoefs,
5558 int*
const nchgsides,
5606 consanddatas = consdata->consanddatas;
5607 andcoefs = consdata->andcoefs;
5608 andnegs = consdata->andnegs;
5609 nconsanddatas = consdata->nconsanddatas;
5610 assert(nconsanddatas > 0 && consanddatas !=
NULL);
5622 lincons = consdata->lincons;
5626 assert(nallvars - nconsanddatas == consdata->nlinvars);
5627 nlinvars = consdata->nlinvars;
5649 assert(nlinvars == consdata->nlinvars);
5650 assert(nandress == nallvars-nlinvars);
5656 assert(requiredsize == nlinvars);
5662 firstnlinvars = nlinvars;
5665 SCIPsortPtr((
void**)linvars, SCIPvarCompActiveAndNegated, nlinvars);
5667 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5669 consanddata = consanddatas[
c];
5695 oldnlinvars = nlinvars;
5698 for( v =
nvars - 1, v1 = nlinvars - 1; v >= 0 && v1 >= 0; )
5718 linvars[nlinvars] =
var;
5740 for( ; v >= 0; --v )
5755 linvars[nlinvars] =
var;
5764 if( nlinvars > oldnlinvars )
5767 SCIPsortPtr((
void**)linvars, SCIPvarCompActiveAndNegated, nlinvars);
5775 for( v = (1 << nlinvars) - 1; v >= 0; --v )
5778 for( v1 = nlinvars - 1; v1 >= 0; --v1 )
5791 consdata->lhs, consanddatas, andcoefs, andnegs, nconsanddatas, cnt, &xortype) );
5798 assert(xortype >= -1 && xortype <= 1);
5846 int*
const ndelconss,
5847 int*
const naddconss,
5848 int*
const nfixedvars,
5849 int*
const nchgcoefs,
5850 int*
const nchgsides,
5878 consanddatas = consdata->consanddatas;
5879 nconsanddatas = consdata->nconsanddatas;
5880 assert(nconsanddatas > 0 && consanddatas !=
NULL);
5888 if( nconsanddatas == 1 )
5908 if( consdata->nlinvars == 0 )
5920 lincons = consdata->lincons;
5922 consanddata = consanddatas[0];
5951 assert(nallvars == consdata->nlinvars + 1);
5953 nlinvars = consdata->nlinvars;
5968 assert(nlinvars == consdata->nlinvars);
5971 for( v = 0; v < nlinvars; ++v )
5977 for( v = 0; v <
nvars; ++v )
6009 c = nconsanddatas - 1;
6010 assert(consanddatas[
c]->istransformed);
6013 if( consanddatas[
c]->nnewvars > 0 )
6021 neqvars = consanddatas[
c]->
nvars;
6031 for( v = neqvars - 1; v > 0; --v )
6035 for( --
c ;
c >= 0; --
c )
6042 consanddata = consanddatas[
c];
6044 assert(consanddatas[
c]->istransformed);
6061 for( v =
nvars - 1; v > 0; --v )
6066 if(
nvars < nminvars )
6069 else if(
nvars > nmaxvars )
6072 assert(nminvars <= nmaxvars);
6075 for( v = 0, v2 = 0; v < neqvars && v2 <
nvars; )
6086 if( index1 < index2 )
6088 else if( index1 > index2 )
6092 assert(index1 == index2);
6095 if( nneweqvars < v )
6096 eqvars[nneweqvars] = eqvars[v];
6102 neqvars = nneweqvars;
6107 if( nminvars > neqvars + 1 )
6149 if( neqvars > 0 && consdata->nlinvars == 0 )
6155 for( v = 0; v < neqvars; ++v )
6172 if( nminvars == neqvars )
6184 if( neqvars > 0 && nminvars == nmaxvars && nminvars == neqvars + 1 )
6195 lincons = consdata->lincons;
6207 for(
c = nconsanddatas - 1;
c >= 0; --
c )
6213 consanddata = consanddatas[
c];
6215 assert(consanddatas[
c]->istransformed);
6230 for( v = 0, v2 = 0; v < neqvars && v2 <
nvars; )
6241 assert(index1 >= index2);
6243 if( index1 > index2 )
6250 assert(index1 == index2);
6260 for( ; v2 <
nvars; ++v2)
6272 if( consdata->nlinvars > 0 )
6282 for( v = 0; v < neqvars; ++v )
6289 assert(
nvars == consdata->nlinvars + consdata->nconsanddatas);
6303 for( v = 0; v <
nvars; ++v )
6309 assert(nlinvars == consdata->nlinvars);
6312 for( v = 0; v < nlinvars; ++v )
6358 int*
const ndelconss,
6359 int*
const naddconss,
6360 int*
const nfixedvars,
6361 int*
const nchgcoefs,
6362 int*
const nchgsides,
6391 consanddatas = consdata->consanddatas;
6392 nconsanddatas = consdata->nconsanddatas;
6393 assert(nconsanddatas > 0 && consanddatas !=
NULL);
6415 if( nconsanddatas == 1 )
6418 if( consdata->nlinvars == 0 )
6447 if( consdata->nlinvars > 0 )
6452 assert(consdata->nlinvars == 0 && nconsanddatas > 1);
6454 c = nconsanddatas - 1;
6455 assert(consanddatas[
c]->istransformed);
6458 if( consanddatas[
c]->nnewvars > 0 )
6466 neqvars = consanddatas[
c]->
nvars;
6476 for( v = neqvars - 1; v > 0; --v )
6480 for( --
c ;
c >= 0; --
c )
6487 consanddata = consanddatas[
c];
6489 assert(consanddatas[
c]->istransformed);
6506 for( v =
nvars - 1; v > 0; --v )
6511 if(
nvars < nminvars )
6514 else if(
nvars > nmaxvars )
6517 assert(nminvars <= nmaxvars);
6520 for( v = 0, v2 = 0; v < neqvars && v2 <
nvars; )
6531 if( index1 < index2 )
6533 else if( index1 > index2 )
6537 assert(index1 == index2);
6540 if( nneweqvars < v )
6541 eqvars[nneweqvars] = eqvars[v];
6547 neqvars = nneweqvars;
6589 if( neqvars > 0 && ((nminvars == nmaxvars && nminvars == neqvars + 1) || (nminvars == neqvars) || (type ==
SCIP_SETPPCTYPE_PARTITIONING)) )
6619 if( neqvars == nminvars )
6622 createcons = (
SCIPisLE(
scip, lhs, rhs) && ((nminvars == nmaxvars && nminvars == neqvars + 1) || (nminvars == neqvars)));
6627 lincons = consdata->lincons;
6645 for(
c = nconsanddatas - 1;
c >= 0; --
c )
6651 consanddata = consanddatas[
c];
6653 assert(consanddatas[
c]->istransformed);
6669 if( deletecons && neqvars + 1 <
nvars )
6688 for( v = 0, v2 = 0; v < neqvars && v2 <
nvars; )
6699 assert(index1 >= index2);
6701 if( index1 > index2 )
6708 else if( deletecons )
6725 assert(index1 == index2);
6736 for( ; v2 <
nvars; ++v2)
6742 else if( deletecons )
6763 for( v = 0; v < neqvars; ++v )
6834 int*
const ndelconss,
6835 int*
const naddconss,
6836 int*
const nfixedvars,
6837 int*
const nchgcoefs,
6838 int*
const nchgsides,
6860 if( consdata->nconsanddatas == 0 )
6877 assert(consdata->nlinvars + consdata->nconsanddatas ==
nvars);
6879 switch( consdata->linconstype )
6896#ifdef WITHEQKNAPSACK
6897 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
6914 consdata->upgradetried =
TRUE;
6925 int*
const ndelconss,
6926 int*
const naggrvars,
6962 consanddatas = consdata->consanddatas;
6963 nconsanddatas = consdata->nconsanddatas;
6964 assert(consanddatas !=
NULL || nconsanddatas == 0);
6973 if( nconsanddatas < 2 || nconsanddatas > 3 )
6979 assert(consdata->nlinvars + nconsanddatas ==
nvars);
6982 if( consdata->nlinvars != 1 )
6986 if( consanddatas[0]->nnewvars > 0 )
6991 if( consanddatas[1]->nnewvars > 0 )
6993 if(
nvars != consanddatas[1]->nnewvars )
7011 if( consanddatas[nconsanddatas - 1]->nnewvars > 0 )
7014 vars = consanddatas[nconsanddatas - 1]->
vars;
7022 for( v = 1; v <
nvars; ++v )
7047 for( v =
nvars - 1; v >= 0; --v )
7058 ++(varcount[negated[v]][v]);
7061 for(
c = nconsanddatas - 2;
c >= 0; --
c )
7066 if( consanddatas[nconsanddatas - 1]->nnewvars > 0 )
7080 for( v = 1; v <
nvars; ++v )
7105 for( v =
nvars - 1; v >= 0; --v )
7119 ++(varcount[negated[v]][pos]);
7132 for(
i = 1;
i >= 0; --
i )
7134 for( v =
nvars - 1; v >= 0; --v )
7138 if( varcount[
i][v] == 0 )
7140 else if( varcount[
i][v] == 1 )
7142 else if( varcount[
i][v] == 2 )
7150 if( othercount == 0 )
7155 if( nconsanddatas == 2 && twocount ==
nvars - 1 && onecount == 2 && zerocount == 1 )
7170 assert(nconsvars == consdata->nlinvars + nconsanddatas);
7175 for( v = 0; v < nconsvars; ++v )
7202 for(
i = 1;
i >= 0; --
i )
7204 for( v =
nvars - 1; v >= 0; --v )
7207 if( varcount[
i][v] == 2 )
7256 else if(
nvars == 2 && nconsanddatas == 3 && twocount == 2 && onecount == 2 && zerocount == 0)
7275 assert(nconsvars == consdata->nlinvars + nconsanddatas);
7280 for( v = 0; v < nconsvars; ++v )
7294 newandvars[0] =
NULL;
7295 newandvars[1] =
NULL;
7299 for(
i = 1;
i >= 0; --
i )
7301 for( v =
nvars - 1; v >= 0; --v )
7304 if( varcount[
i][v] == 1 )
7306 if( newandvars[0] ==
NULL )
7429 for(
i = 0;
i < tmpnvars; ++
i )
7430 vals[
i] = tmpvals[
i];
7435 for(
i = 0;
i < tmpnvars; ++
i )
7441 for(
i = 0;
i < tmpnvars; ++
i )
7447 for(
i = 0;
i < tmpnvars; ++
i )
7458 for(
i = 0;
i < tmpnvars; ++
i )
7471 for(
c = 0;
c < consdata->nconsanddatas; ++
c )
7478 tmpnvars = consdata->consanddatas[
c]->nvars;
7479 for(
i = 0;
i < tmpnvars; ++
i )
7480 vars[
i] = consdata->consanddatas[
c]->vars[
i];
7481 for(
i = 0;
i < tmpnvars; ++
i )
7503#ifdef NONLINCONSUPGD_PRIORITY
7509 SCIP_EXPRGRAPH* exprgraph;
7510 SCIP_EXPRGRAPHNODE* node;
7529 node = SCIPgetExprgraphNodeNonlinear(
scip, cons);
7535 switch( SCIPexprgraphGetNodeOperator(node) )
7537 case SCIP_EXPR_VARIDX:
7538 case SCIP_EXPR_CONST:
7539 case SCIP_EXPR_PLUS:
7540 case SCIP_EXPR_MINUS:
7542 case SCIP_EXPR_LINEAR:
7548 case SCIP_EXPR_SQUARE:
7549 case SCIP_EXPR_SQRT:
7550 case SCIP_EXPR_REALPOWER:
7551 case SCIP_EXPR_INTPOWER:
7552 case SCIP_EXPR_SIGNPOWER:
7563 case SCIP_EXPR_SIGN:
7564 case SCIP_EXPR_PRODUCT:
7565 case SCIP_EXPR_USER:
7569 case SCIP_EXPR_QUADRATIC:
7572 case SCIP_EXPR_POLYNOMIAL:
7576 case SCIP_EXPR_PARAM:
7577 case SCIP_EXPR_LAST:
7587 for(
i = 0;
i < SCIPgetNLinearVarsNonlinear(
scip, cons); ++
i )
7589 var = SCIPgetLinearVarsNonlinear(
scip, cons)[
i];
7601 for(
i = 0;
i < SCIPexprgraphGetNodeNChildren(node); ++
i )
7603 SCIP_EXPRGRAPHNODE* child;
7605 child = SCIPexprgraphGetNodeChildren(node)[
i];
7607 if( SCIPexprgraphGetNodeOperator(child) != SCIP_EXPR_VARIDX )
7609 SCIPdebugMsg(
scip,
"not pseudoboolean because child %d is not a variable\n",
i);
7613 var = (
SCIP_VAR*)SCIPexprgraphGetNodeVar(exprgraph, child);
7624 if( upgdconsssize < 1 )
7634 lhs -= SCIPexprgraphGetNodePolynomialConstant(node);
7636 rhs -= SCIPexprgraphGetNodePolynomialConstant(node);
7639 if( objvar !=
NULL )
7643 for(
i = 0;
i < SCIPgetNLinearVarsNonlinear(
scip, cons); ++
i )
7645 var = SCIPgetLinearVarsNonlinear(
scip, cons)[
i];
7647 linvars[nlinvars++] =
var;
7651 nlinvars = SCIPgetNLinearVarsNonlinear(
scip, cons);
7654 nterms = SCIPexprgraphGetNodePolynomialNMonomials(node);
7661 SCIP_EXPRDATA_MONOMIAL* monomial;
7663 monomial = SCIPexprgraphGetNodePolynomialMonomials(node)[
i];
7666 ntermvars[
i] = SCIPexprGetMonomialNFactors(monomial);
7669 for( j = 0; j < SCIPexprGetMonomialNFactors(monomial); ++j )
7671 terms[
i][j] = (
SCIP_VAR*)SCIPexprgraphGetNodeVar(exprgraph, SCIPexprgraphGetNodeChildren(node)[SCIPexprGetMonomialChildIndices(monomial)[j]]);
7672 assert(SCIPexprGetMonomialExponents(monomial)[j] > 0.0);
7675 termvals[
i] = SCIPexprGetMonomialCoef(monomial);
7680 objvar !=
NULL ? linvars : SCIPgetLinearVarsNonlinear(
scip, cons), nlinvars, SCIPgetLinearCoefsNonlinear(
scip, cons),
7755 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
7765 assert(conshdlrdata->allconsanddatas[
c]->newvars ==
NULL);
7767 vars = conshdlrdata->allconsanddatas[
c]->vars;
7768 nvars = conshdlrdata->allconsanddatas[
c]->nvars;
7772 for( v =
nvars - 1; v > 0; --v )
7780 andcons = conshdlrdata->allconsanddatas[
c]->cons;
7791 SCIPconsGetName(conshdlrdata->allconsanddatas[
c]->cons), (
void*)(conshdlrdata->allconsanddatas[
c]),
7792 (
void*)(conshdlrdata->allconsanddatas[
c]->cons));
7814 for(
c = 0;
c < nconss; ++
c )
7833 if( !conshdlrdata->decomposenormalpbcons && !consdata->issoftcons )
7848 if( !consdata->issoftcons )
7869 assert(consdata->weight != 0);
7885 updateandconss =
FALSE;
7888 if( conshdlrdata->decomposeindicatorpbcons )
7910 updateandconss =
TRUE;
7923 for( v =
nvars - 1; v >= 0; --v )
7933 if( !updateandconss )
7957 for( v =
nvars - 1; v >= 0; --v )
7991 updateandconss =
TRUE;
8003 ub = lhs - maxact - 1;
8034 if( !updateandconss )
8050 lb = rhs - minact + 1;
8112 for(
c = (*consdata)->nconsanddatas - 1;
c >= 0; --
c )
8114 assert((*consdata)->consanddatas[
c]->nuses == 0);
8115 assert((*consdata)->consanddatas[
c]->cons ==
NULL);
8116 assert((*consdata)->consanddatas[
c]->noriguses == 0 || ((*consdata)->consanddatas[
c]->origcons !=
NULL &&
SCIPconsIsOriginal((*consdata)->consanddatas[
c]->origcons)));
8119 conshdlrdata->noriguses -= (*consdata)->nconsanddatas;
8121 assert(conshdlrdata->noriguses >= 0);
8148 assert(sourcedata->consanddatas !=
NULL || sourcedata->nconsanddatas == 0);
8154 for(
c = sourcedata->nconsanddatas - 1;
c >= 0; --
c )
8157 andconss[
c] = sourcedata->consanddatas[
c]->origcons;
8164 sourcedata->andcoefs, sourcedata->andnegs, sourcedata->nconsanddatas, sourcedata->indvar, sourcedata->weight,
8285 if( consdata->issoftcons )
8318 int firstupgradetry;
8335 oldnfixedvars = *nfixedvars;
8336 oldnaggrvars = *naggrvars;
8337 oldnchgbds = *nchgbds;
8338 oldndelconss = *ndelconss;
8339 oldnupgdconss = *nupgdconss;
8340 oldnchgcoefs = *nchgcoefs;
8341 oldnchgsides = *nchgsides;
8349 firstchange = INT_MAX;
8350 firstupgradetry = INT_MAX;
8402 andress, andcoefs, andnegs, &nandress) );
8427 if( firstchange == INT_MAX && consdata->changed )
8440 if( consdata->changed )
8453 if( firstupgradetry == INT_MAX && !consdata->upgradetried )
8454 firstupgradetry =
c;
8459 consdata->presolved =
TRUE;
8477 consdata->changed =
FALSE;
8496 else if( *nfixedvars > oldnfixedvars || *naggrvars > oldnaggrvars || *nchgbds > oldnchgbds || *ndelconss > oldndelconss
8497 || *nupgdconss > oldnupgdconss || *nchgcoefs > oldnchgcoefs || *nchgsides > oldnchgsides )
8527 lhs = consdata->lhs;
8528 rhs = consdata->rhs;
8536 SCIPdebugMsg(
scip,
"%socking constraint <%s> by [%d;%d].\n", (nlocksneg < 0) || (nlockspos < 0) ?
"Unl" :
"L",
SCIPconsGetName(cons), nlocksneg, nlockspos);
8539 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
8548 consanddata = consdata->consanddatas[
c];
8554 andcons = consanddata->
cons;
8556 if( andcons ==
NULL )
8565 consanddata->
nvars = 0;
8566 consanddata->
svars = 0;
8576 andvars = consanddata->
newvars;
8581 andvars = consanddata->
vars;
8582 nandvars = consanddata->
nvars;
8590 val = consdata->andnegs[
c] ? -consdata->andcoefs[
c] : consdata->andcoefs[
c];
8597 for( v = nandvars - 1; v >= 0; --v )
8607 for( v = nandvars - 1; v >= 0; --v )
8624 for( v = nandvars - 1; v >= 0; --v )
8634 for( v = nandvars - 1; v >= 0; --v )
8674 const char* consname;
8686 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode, global,
8713 const char* firstcomp;
8714 const char* secondcomp;
8715 const char* lhsstrptr;
8716 const char* rhsstrptr;
8717 const char* varstrptr;
8718 char* polynomialstr;
8763 if( endptr[1] ==
'=' )
8772 if( strncmp(endptr,
"[free]", 6) == 0 )
8787 if( firstcomp ==
NULL )
8793 if( secondcomp !=
NULL )
8798 else if( strncmp(firstcomp,
"<=", 2) != 0 )
8803 else if( strncmp(endptr,
"<=", 2) != 0 )
8805 SCIPerrorMessage(
"Bad second comparator, expected ranged specification: %s", str);
8809 secondcomp = endptr;
8813 endptr += increment;
8817 if( firstcomp ==
NULL )
8829 switch( *firstcomp )
8832 assert(firstcomp[1] ==
'=');
8834 if( secondcomp !=
NULL )
8836 assert(secondcomp[0] ==
'<' && secondcomp[1] ==
'=');
8838 rhsstrptr = secondcomp + 2;
8839 varstrptr = firstcomp + 2;
8843 rhsstrptr = firstcomp + 2;
8846 assert(firstcomp[1] ==
'=');
8849 lhsstrptr = firstcomp + 2;
8852 assert(firstcomp[1] ==
'=');
8855 rhsstrptr = firstcomp + 2;
8856 lhsstrptr = firstcomp + 2;
8859 assert(strncmp(firstcomp,
"[free]", 6) == 0);
8862 endptr = firstcomp + 6;
8866 SCIPerrorMessage(
"Parsing has wrong comparator character '%c', should be one of <=>[", *firstcomp);
8875 if( lhsstrptr !=
NULL )
8879 SCIPerrorMessage(
"error parsing left hand side number from <%s>\n", lhsstrptr);
8884 if( rhsstrptr == lhsstrptr )
8889 if( rhsstrptr !=
NULL && rhsstrptr != lhsstrptr )
8893 SCIPerrorMessage(
"error parsing right hand side number from <%s>\n", lhsstrptr);
8908 if( *endptr ==
'(' )
8910 endptr = strchr(endptr + 1,
'=');
8912 if( endptr ==
NULL )
8921 if( indvar ==
NULL )
8928 endptr = strchr(endptr,
')');
8930 if( endptr ==
NULL )
8941 polynomialsize = (int)(
MAX(firstcomp, secondcomp) + 1 - varstrptr);
8943 (void)
SCIPstrncpy(polynomialstr, varstrptr, polynomialsize);
8949 polynomialsize -= (int)(endptr + 1 - polynomialstr);
8955 SCIPerrorMessage(
"no luck in parsing pseudoboolean polynomial '%s'\n", varstrptr);
8958 else if( polynomialsize >= 1 )
8960 SCIPerrorMessage(
"no completion of parsing pseudoboolean polynomial '%s'\n", varstrptr);
8977 for(
i = 0;
i < nmonomials; ++
i )
8985 for( j = 0; j < monomialnvars[
i]; ++j )
8987 if( monomialexps[
i][j] < 0.0 )
8989 SCIPerrorMessage(
"invalid exponent '%f' on variable <%s> in pseudoboolean polynomial '%s'\n", monomialexps[
i][j],
SCIPvarGetName(monomialvars[
i][j]), varstrptr);
8993 if( monomialexps[
i][j] == 0.0 )
8996 monomialvars[
i][ntermvars[
nterms]++] = monomialvars[
i][j];
8999 if( ntermvars[
nterms] > 1 )
9001 terms[
nterms] = monomialvars[
i];
9002 termvals[
nterms] = monomialcoefs[
i];
9005 else if( ntermvars[
nterms] == 1 )
9007 if( issoftcons && ( monomialvars[
i][0] == indvar ||
SCIPvarGetNegatedVar(monomialvars[
i][0]) == indvar ) )
9013 linvars[nlinvars] = monomialvars[
i][0];
9014 linvals[nlinvars] = monomialcoefs[
i];
9022 lhs -= monomialcoefs[
i];
9025 rhs -= monomialcoefs[
i];
9031 termvals, indvar, weight, issoftcons, lhs, rhs, initial,
separate, enforce, check,
propagate, local,
9032 modifiable, dynamic, removable, stickingatnode) );
9099 assert(nlinconsvars >= 0);
9102 if( nlinconsvars == 0 )
9109 else if( varssize < nlinconsvars )
9127 assert(nlinconsvars == nlinvars + nandress);
9149 for(
r = nandress - 1;
r >= 0; --
r )
9161 andcons = consanddata->
cons;
9168 if( varssize <=
nvars )
9187 if( varssize <
nvars + noperands )
9260 assert(nlinconsvars >= 0);
9263 if( nlinconsvars == 0 )
9281 assert(nlinconsvars == nlinvars + nandress);
9297 for(
r = nandress - 1;
r >= 0; --
r )
9309 andcons = consanddata->
cons;
9372 consEnfolpPseudoboolean, consEnfopsPseudoboolean, consCheckPseudoboolean, consLockPseudoboolean,
9396 "decompose every normal pseudo boolean constraint into a \"linear\" constraint and \"and\" constraints",
9400 "decompose every soft pseudo boolean constraint into \"indicator\" constraints and \"and\" constraints",
9403 "constraints/" CONSHDLR_NAME "/nlcseparate",
"should the nonlinear constraints be separated during LP processing?",
9406 "constraints/" CONSHDLR_NAME "/nlcpropagate",
"should the nonlinear constraints be propagated during node processing?",
9409 "constraints/" CONSHDLR_NAME "/nlcremovable",
"should the nonlinear constraints be removable?",
9412#ifdef NONLINCONSUPGD_PRIORITY
9482 if( conshdlr ==
NULL )
9488 if( isnan(lhs) || isnan(rhs) )
9490 SCIPerrorMessage(
"%s hand side of pseudo boolean constraint <%s> is nan\n",
9491 isnan(lhs) ?
"left" :
"right", name);
9499 SCIPerrorMessage(
"soft pseudo boolean constraint <%s> must not be modifiable because the implemented formulation requires finite activity bounds\n", name);
9505 SCIPerrorMessage(
"weight of pseudo boolean constraint <%s> is nan\n", name);
9519 assert(conshdlrdata->allconsanddatas !=
NULL);
9520 assert(conshdlrdata->nallconsanddatas <= conshdlrdata->sallconsanddatas);
9522 memisinvalid =
TRUE;
9528 for(
c = nandconss - 1;
c >= 0; --
c )
9583 newdata->
cons = andconss[
c];
9586 for( v = newdata->
nvars - 1; v >= 0; --v )
9602 if( tmpdata ==
NULL || (tmpdata->
cons != andconss[
c] && tmpdata->
origcons != andconss[
c]))
9606 SCIPwarningMessage(
scip,
"Another and-constraint with the same variables but different and-resultant is added to the global and-constraint hashtable of pseudoboolean constraint handler.\n");
9610 if( conshdlrdata->nallconsanddatas == conshdlrdata->sallconsanddatas )
9615 conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas] = newdata;
9616 ++(conshdlrdata->nallconsanddatas);
9622 memisinvalid =
TRUE;
9641 newdata->noriguses = 1;
9651 memisinvalid =
FALSE;
9695 indvar, weight, issoftcons, lhs, rhs, check,
FALSE) );
9699 SCIP_CALL(
SCIPcreateCons(
scip, cons, name, conshdlr, consdata, initial,
separate, enforce, check,
propagate,
9700 local, modifiable, dynamic, removable, stickingatnode) );
9776 if( conshdlr ==
NULL )
9782 if( isnan(lhs) || isnan(rhs) )
9784 SCIPerrorMessage(
"%s hand side of pseudo boolean constraint <%s> is nan\n",
9785 isnan(lhs) ?
"left" :
"right", name);
9793 SCIPerrorMessage(
"soft pseudo boolean constraint <%s> must not be modifiable because the implemented formulation requires finite activity bounds\n", name);
9799 SCIPerrorMessage(
"weight of pseudo boolean constraint <%s> is nan\n", name);
9804 for(
c = 0;
c < nlinvars; ++
c )
9818 SCIPerrorMessage(
"pseudo boolean term with coefficient %lf without variables\n", termvals[
c]);
9846 initial, enforce, check, local, modifiable, dynamic, stickingatnode,
9847 andconss, andcoefs, andnegs, &nandconss) );
9851 for(
c = nandconss - 1;
c >= 0; --
c )
9870 &lhs, &rhs, issoftcons, initial,
separate, enforce,
FALSE,
propagate, local, modifiable, dynamic,
9871 removable, stickingatnode, &lincons, &linconstype) );
9878 indvar, weight, issoftcons, lhs, rhs, check,
FALSE) );
9888 SCIP_CALL(
SCIPcreateCons(
scip, cons, name, conshdlr, consdata, initial,
separate, enforce, check,
propagate,
9889 local, modifiable, dynamic, removable, stickingatnode) );
9921 termvals, indvar, weight, issoftcons, lhs, rhs,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
9962 switch( consdata->linconstype )
9985#ifdef WITHEQKNAPSACK
9986 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
9999 consdata->propagated =
FALSE;
10000 consdata->presolved =
FALSE;
10001 consdata->cliquesadded =
FALSE;
10029 SCIPerrorMessage(
"pseudo boolean term with coefficient %lf without variables\n", val);
10061 return consdata->indvar;
10080 return consdata->lincons;
10099 return consdata->linconstype;
10120 return consdata->nlinvars;
10149 if( *nlinvars < consdata->nlinvars )
10151 *nlinvars = consdata->nlinvars;
10166 SCIP_CALL(
getLinVarsAndAndRess(
scip, cons,
vars, coefs,
nvars, linvars, lincoefs, nlinvars,
NULL,
NULL,
NULL,
NULL) );
10182 int*
const nandconss
10201 if( *nandconss < consdata->nconsanddatas )
10203 *nandconss = consdata->nconsanddatas;
10207 *nandconss = consdata->nconsanddatas;
10208 assert(consdata->consanddatas !=
NULL || *nandconss == 0);
10212 for(
c = *nandconss - 1;
c >= 0; --
c )
10215 assert(consdata->consanddatas[
c]->istransformed ? (consdata->consanddatas[
c]->cons !=
NULL) :
TRUE);
10216 assert(consdata->consanddatas[
c]->isoriginal ? (consdata->consanddatas[
c]->origcons !=
NULL) :
TRUE);
10217 assert(consdata->consanddatas[
c]->cons !=
NULL || consdata->consanddatas[
c]->origcons !=
NULL);
10218 assert(isorig ? consdata->consanddatas[
c]->origcons !=
NULL : consdata->consanddatas[
c]->cons !=
NULL);
10220 andconss[
c] = (isorig ? consdata->consanddatas[
c]->origcons : consdata->consanddatas[
c]->cons);
10223 andcoefs[
c] = consdata->andcoefs[
c];
10247 return consdata->nconsanddatas;
10275 switch( consdata->linconstype )
10283#ifdef WITHEQKNAPSACK
10284 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
10286 SCIPerrorMessage(
"changing left hand side only allowed on standard linear constraint \n");
10319 switch( consdata->linconstype )
10327#ifdef WITHEQKNAPSACK
10328 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
10330 SCIPerrorMessage(
"changing right hand side only allowed on standard linear constraint \n");
10358 return consdata->lhs;
10378 return consdata->rhs;
#define CONSHDLR_NEEDSCONS
#define CONSHDLR_CHECKPRIORITY
#define CONSHDLR_MAXPREROUNDS
#define CONSHDLR_PRESOLTIMING
#define CONSHDLR_EAGERFREQ
#define CONSHDLR_ENFOPRIORITY
Constraint handler for AND constraints, .
constraint handler for indicator constraints
Constraint handler for knapsack constraints of the form , x binary and .
#define NONLINCONSUPGD_PRIORITY
Constraint handler for linear constraints in their most general form, .
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
constraint handler for nonlinear constraints specified by algebraic expressions
static SCIP_RETCODE checkAndConss(SCIP *const scip, SCIP_CONSHDLR *const conshdlr, SCIP_SOL *const sol, SCIP_Bool *const violated)
static SCIP_RETCODE getLinVarsAndAndRess(SCIP *const scip, SCIP_CONS *const cons, SCIP_VAR **const vars, SCIP_Real *const coefs, int const nvars, SCIP_VAR **const linvars, SCIP_Real *const lincoefs, int *const nlinvars, SCIP_VAR **const andress, SCIP_Real *const andcoefs, SCIP_Bool *const andnegs, int *const nandress)
#define HASHSIZE_PSEUDOBOOLEANNONLINEARTERMS
static SCIP_RETCODE conshdlrdataCreate(SCIP *const scip, SCIP_CONSHDLRDATA **conshdlrdata)
static SCIP_RETCODE lockRoundingAndCons(SCIP *const scip, SCIP_CONS *const cons, CONSANDDATA *const consanddata, SCIP_Real const coef, SCIP_Real const lhs, SCIP_Real const rhs)
static SCIP_RETCODE copyConsPseudoboolean(SCIP *const targetscip, SCIP_CONS **targetcons, SCIP *const sourcescip, SCIP_CONS *const sourcecons, const char *name, SCIP_HASHMAP *const varmap, SCIP_HASHMAP *const consmap, SCIP_Bool const initial, SCIP_Bool const separate, SCIP_Bool const enforce, SCIP_Bool const check, SCIP_Bool const propagate, SCIP_Bool const local, SCIP_Bool const modifiable, SCIP_Bool const dynamic, SCIP_Bool const removable, SCIP_Bool const stickingatnode, SCIP_Bool const global, SCIP_Bool *const valid)
static SCIP_RETCODE getLinearConsNVars(SCIP *const scip, SCIP_CONS *const cons, SCIP_LINEARCONSTYPE const constype, int *const nvars)
static SCIP_RETCODE checkLocksAndRes(SCIP *const scip, SCIP_VAR *res)
static SCIP_RETCODE propagateCons(SCIP *const scip, SCIP_CONS *const cons, SCIP_Bool *const cutoff, int *const ndelconss)
static SCIP_RETCODE getLinearConsSides(SCIP *const scip, SCIP_CONS *const cons, SCIP_LINEARCONSTYPE const constype, SCIP_Real *const lhs, SCIP_Real *const rhs)
#define DEFAULT_DECOMPOSEINDICATORPBCONS
static SCIP_RETCODE conshdlrdataFree(SCIP *const scip, SCIP_CONSHDLRDATA **conshdlrdata)
struct ConsAndData CONSANDDATA
static SCIP_RETCODE chgRhsLinearCons(SCIP *const scip, SCIP_CONS *const cons, SCIP_LINEARCONSTYPE const constype, SCIP_Real const rhs)
static SCIP_RETCODE computeConsAndDataChanges(SCIP *const scip, SCIP_CONSHDLRDATA *const conshdlrdata)
static SCIP_RETCODE getLinearConsVarsData(SCIP *const scip, SCIP_CONS *const cons, SCIP_LINEARCONSTYPE const constype, SCIP_VAR **const vars, SCIP_Real *const coefs, int *const nvars)
#define checkConsConsistency(scip, cons)
static SCIP_RETCODE tryUpgradingLogicor(SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss, int *const naddconss, int *const nfixedvars, int *const nchgcoefs, int *const nchgsides, SCIP_Bool *const cutoff)
static SCIP_RETCODE unlockRoundingAndCons(SCIP *const scip, SCIP_CONS *const cons, CONSANDDATA *const consanddata, SCIP_Real const coef, SCIP_Real const lhs, SCIP_Real const rhs)
static SCIP_RETCODE addCoefTerm(SCIP *const scip, SCIP_CONS *const cons, SCIP_VAR **const vars, int const nvars, SCIP_Real const val)
static SCIP_RETCODE addSymmetryInformation(SCIP *scip, SYM_SYMTYPE symtype, SCIP_CONS *cons, SYM_GRAPH *graph, SCIP_Bool *success)
static SCIP_RETCODE consdataCreate(SCIP *const scip, SCIP_CONSHDLR *const conshdlr, SCIP_CONSDATA **consdata, SCIP_CONS *const lincons, SCIP_LINEARCONSTYPE const linconstype, SCIP_CONS **const andconss, SCIP_Real *const andcoefs, SCIP_Bool *const andnegs, int const nandconss, SCIP_VAR *const indvar, SCIP_Real const weight, SCIP_Bool const issoftcons, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool check, SCIP_Bool transforming)
#define DEFAULT_PROPAGATENONLINEAR
static SCIP_RETCODE inithashmapandtable(SCIP *const scip, SCIP_CONSHDLRDATA **conshdlrdata)
static SCIP_RETCODE createAndAddAndCons(SCIP *const scip, SCIP_CONSHDLR *const conshdlr, SCIP_VAR **const vars, int const nvars, SCIP_Bool const initial, SCIP_Bool const enforce, SCIP_Bool const check, SCIP_Bool const local, SCIP_Bool const modifiable, SCIP_Bool const dynamic, SCIP_Bool const stickingatnode, SCIP_CONS **const andcons)
static SCIP_RETCODE consdataPrint(SCIP *const scip, SCIP_CONS *const cons, FILE *const file)
static SCIP_RETCODE addNewLocks(SCIP *const scip, SCIP_CONS *const cons, CONSANDDATA *const consanddata, SCIP_Real const coef, SCIP_Real const lhs, SCIP_Real const rhs)
static SCIP_RETCODE transformToOrig(SCIP *const scip, CONSANDDATA *consanddata, SCIP_CONSHDLRDATA *conshdlrdata)
static SCIP_RETCODE addCliques(SCIP *const scip, SCIP_CONS *const cons, SCIP_Bool *const cutoff, int *const naggrvars, int *const nchgbds)
static SCIP_RETCODE chgLhs(SCIP *const scip, SCIP_CONS *const cons, SCIP_Real lhs)
#define DEFAULT_REMOVABLENONLINEAR
static SCIP_RETCODE updateConsanddataUses(SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss)
#define DEFAULT_SEPARATENONLINEAR
static SCIP_RETCODE createAndAddLinearCons(SCIP *const scip, SCIP_CONSHDLR *const conshdlr, SCIP_VAR **const linvars, int const nlinvars, SCIP_Real *const linvals, SCIP_VAR **const andress, int const nandress, SCIP_Real const *const andvals, SCIP_Bool *const andnegs, SCIP_Real *const lhs, SCIP_Real *const rhs, SCIP_Bool const issoftcons, SCIP_Bool const initial, SCIP_Bool const separate, SCIP_Bool const enforce, SCIP_Bool const check, SCIP_Bool const propagate, SCIP_Bool const local, SCIP_Bool const modifiable, SCIP_Bool const dynamic, SCIP_Bool const removable, SCIP_Bool const stickingatnode, SCIP_CONS **const lincons, SCIP_LINEARCONSTYPE *const linconstype)
static SCIP_RETCODE findAggregation(SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss, int *const naggrvars, SCIP_Bool *const cutoff)
static SCIP_RETCODE createAndAddAnds(SCIP *const scip, SCIP_CONSHDLR *const conshdlr, SCIP_VAR **const *const terms, SCIP_Real *const termcoefs, int const nterms, int const *const ntermvars, SCIP_Bool const initial, SCIP_Bool const enforce, SCIP_Bool const check, SCIP_Bool const local, SCIP_Bool const modifiable, SCIP_Bool const dynamic, SCIP_Bool const stickingatnode, SCIP_CONS **const andconss, SCIP_Real *const andvals, SCIP_Bool *const andnegs, int *const nandconss)
static SCIP_RETCODE tryUpgrading(SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss, int *const naddconss, int *const nfixedvars, int *const nchgcoefs, int *const nchgsides, SCIP_Bool *const cutoff)
static SCIP_RETCODE chgLhsLinearCons(SCIP *const scip, SCIP_CONS *const cons, SCIP_LINEARCONSTYPE const constype, SCIP_Real const lhs)
#define DEFAULT_DECOMPOSENORMALPBCONS
static SCIP_RETCODE correctConshdlrdata(SCIP *const scip, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss)
static SCIP_RETCODE tryUpgradingSetppc(SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss, int *const naddconss, int *const nfixedvars, int *const nchgcoefs, int *const nchgsides, SCIP_Bool *const cutoff)
static SCIP_RETCODE checkSolution(SCIP *const scip, SCIP_VAR **const vars, int const nvars, SCIP_Bool *const values, SCIP_VAR **const linvars, SCIP_Real *const lincoefs, int const nlinvars, SCIP_Real const constant, SCIP_Real const side, CONSANDDATA **const consanddatas, SCIP_Real *const consanddatacoefs, SCIP_Bool *const consanddatanegs, int const nconsanddatas, int const cnt, int *const xortype)
static SCIP_RETCODE checkOrigPbCons(SCIP *const scip, SCIP_CONS *const cons, SCIP_SOL *const sol, SCIP_Bool *const violated, SCIP_Bool const printreason)
static SCIP_RETCODE tryUpgradingXor(SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss, int *const naddconss, int *const nfixedvars, int *const nchgcoefs, int *const nchgsides, SCIP_Bool *const cutoff)
static SCIP_RETCODE chgRhs(SCIP *const scip, SCIP_CONS *const cons, SCIP_Real rhs)
static SCIP_RETCODE updateAndConss(SCIP *const scip, SCIP_CONS *const cons)
static SCIP_RETCODE consdataFree(SCIP *const scip, SCIP_CONSDATA **consdata, SCIP_Bool isorig, SCIP_CONSHDLRDATA *conshdlrdata)
static SCIP_RETCODE removeOldLocks(SCIP *const scip, SCIP_CONS *const cons, CONSANDDATA *const consanddata, SCIP_Real const coef, SCIP_Real const lhs, SCIP_Real const rhs)
static SCIP_RETCODE correctLocksAndCaptures(SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, SCIP_Real const newlhs, SCIP_Real const newrhs, SCIP_VAR **const andress, SCIP_Real *const andcoefs, SCIP_Bool *const andnegs, int const nandress)
constraint handler for pseudoboolean constraints
#define ARTIFICIALVARNAMEPREFIX
Constraint handler for the set partitioning / packing / covering constraints .
Constraint handler for XOR constraints, .
#define SCIPdebugGetSolVal(scip, var, val)
#define SCIPdebugAddSolVal(scip, var, val)
#define SCIP_STRINGEQ(name, reference, retcode)
#define SCIP_CALL_ABORT(x)
SCIP_RETCODE SCIPchgLhsPseudoboolean(SCIP *const scip, SCIP_CONS *const cons, SCIP_Real const lhs)
int SCIPgetNVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsBasicPseudoboolean(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR **linvars, int nlinvars, SCIP_Real *linvals, SCIP_VAR ***terms, int nterms, int *ntermvars, SCIP_Real *termvals, SCIP_VAR *indvar, SCIP_Real weight, SCIP_Bool issoftcons, SCIP_Real lhs, SCIP_Real rhs)
#define SCIP_DECL_NONLINCONSUPGD(x)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsPseudobooleanWithConss(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_CONS *lincons, SCIP_LINEARCONSTYPE linconstype, SCIP_CONS **andconss, SCIP_Real *andcoefs, int nandconss, SCIP_VAR *indvar, SCIP_Real weight, SCIP_Bool issoftcons, 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_VAR ** SCIPgetVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPchgRhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real rhs)
SCIP_LINEARCONSTYPE SCIPgetLinearConsTypePseudoboolean(SCIP *const scip, SCIP_CONS *const cons)
SCIP_RETCODE SCIPaddCoefPseudoboolean(SCIP *const scip, SCIP_CONS *const cons, SCIP_VAR *const var, SCIP_Real const val)
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
SCIP_RETCODE SCIPcreateConsAnd(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *resvar, int nvars, SCIP_VAR **vars, 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 SCIPaddCoefKnapsack(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Longint weight)
SCIP_Real SCIPgetLhsLinear(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNVarsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR * SCIPgetResultantAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsIndicator(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *binvar, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
int SCIPgetNAndsPseudoboolean(SCIP *const scip, SCIP_CONS *const cons)
int SCIPgetNLinVarsWithoutAndPseudoboolean(SCIP *const scip, SCIP_CONS *const cons)
int SCIPgetNVarsAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPgetLinDatasWithoutAndPseudoboolean(SCIP *const scip, SCIP_CONS *const cons, SCIP_VAR **const linvars, SCIP_Real *const lincoefs, int *const nlinvars)
SCIP_Real * SCIPgetValsLinear(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetLhsPseudoboolean(SCIP *const scip, SCIP_CONS *const cons)
int SCIPgetNVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsSetpack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, 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 SCIPcreateConsXor(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_Bool rhs, int nvars, SCIP_VAR **vars, 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_VAR * SCIPgetIndVarPseudoboolean(SCIP *const scip, SCIP_CONS *const cons)
SCIP_RETCODE SCIPcreateConsPseudoboolean(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR **linvars, int nlinvars, SCIP_Real *linvals, SCIP_VAR ***terms, int nterms, int *ntermvars, SCIP_Real *termvals, SCIP_VAR *indvar, SCIP_Real weight, SCIP_Bool issoftcons, 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_VAR ** SCIPgetVarsSetppc(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsortAndCons(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisAndConsSorted(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsNonlinear(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddTermPseudoboolean(SCIP *const scip, SCIP_CONS *const cons, SCIP_VAR **const vars, int const nvars, SCIP_Real const val)
SCIP_RETCODE SCIPchgRhsPseudoboolean(SCIP *const scip, SCIP_CONS *const cons, SCIP_Real const rhs)
SCIP_RETCODE SCIPaddCoefSetppc(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
enum SCIP_SetppcType SCIP_SETPPCTYPE
SCIP_RETCODE SCIPcreateConsKnapsack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Longint *weights, SCIP_Longint capacity, 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_Longint * SCIPgetWeightsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_Longint SCIPgetCapacityKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_SETPPCTYPE SCIPgetTypeSetppc(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 SCIPcreateConsSetpart(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, 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_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsKnapsack(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsLogicor(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, 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 SCIPcreateConsSetcover(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, 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 SCIPgetAndDatasPseudoboolean(SCIP *const scip, SCIP_CONS *const cons, SCIP_CONS **const andconss, SCIP_Real *const andcoefs, int *const nandconss)
SCIP_CONS * SCIPgetLinearConsPseudoboolean(SCIP *const scip, SCIP_CONS *const cons)
enum SCIP_LinearConsType SCIP_LINEARCONSTYPE
SCIP_RETCODE SCIPchgLhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs)
SCIP_Real SCIPgetLhsNonlinear(SCIP_CONS *cons)
SCIP_Real SCIPgetRhsPseudoboolean(SCIP *const scip, SCIP_CONS *const cons)
SCIP_RETCODE SCIPaddCoefLogicor(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
@ SCIP_LINEARCONSTYPE_LINEAR
@ SCIP_LINEARCONSTYPE_INVALIDCONS
@ SCIP_LINEARCONSTYPE_LOGICOR
@ SCIP_LINEARCONSTYPE_KNAPSACK
@ SCIP_LINEARCONSTYPE_SETPPC
@ SCIP_SETPPCTYPE_PARTITIONING
@ SCIP_SETPPCTYPE_COVERING
@ SCIP_SETPPCTYPE_PACKING
SCIP_RETCODE SCIPincludeConshdlrPseudoboolean(SCIP *scip)
SCIP_RETCODE SCIPgetConsCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_CONS *sourcecons, SCIP_CONS **targetcons, SCIP_CONSHDLR *sourceconshdlr, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *name, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool global, SCIP_Bool *valid)
SCIP_Bool SCIPisConsCompressionEnabled(SCIP *scip)
SCIP_RETCODE SCIPgetVarCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR *sourcevar, SCIP_VAR **targetvar, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *success)
SCIP_Bool SCIPisTransformed(SCIP *scip)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
int SCIPgetNVars(SCIP *scip)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
int SCIPgetNFixedVars(SCIP *scip)
SCIP_VAR ** SCIPgetFixedVars(SCIP *scip)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapRemove(SCIP_HASHMAP *hashmap, void *origin)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
SCIP_Bool SCIPhashtableExists(SCIP_HASHTABLE *hashtable, void *element)
#define SCIPhashFour(a, b, c, d)
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPgetBoolParam(SCIP *scip, const char *name, SCIP_Bool *value)
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)
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
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_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrGetSignedPermsymGraph(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)),)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetConshdlrInit(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrGetPermsymGraph(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
void SCIPconsAddUpgradeLocks(SCIP_CONS *cons, int nlocks)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_Bool SCIPconsIsOriginal(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConsInitial(SCIP *scip, SCIP_CONS *cons, SCIP_Bool initial)
SCIP_Bool SCIPconsIsLockedType(SCIP_CONS *cons, SCIP_LOCKTYPE locktype)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateCons(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA *consdata, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsLocked(SCIP_CONS *cons)
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsAdded(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_RETCODE SCIPtransformCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
SCIP_RETCODE SCIPsetConsChecked(SCIP *scip, SCIP_CONS *cons, SCIP_Bool check)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPincConsAge(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
#define SCIPensureBlockMemoryArray(scip, ptr, arraysizeptr, minsize)
#define SCIPallocClearBlockMemoryArray(scip, ptr, num)
#define SCIPallocClearBufferArray(scip, ptr, num)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
#define SCIPfreeBufferArrayNull(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
void SCIPupdateSolConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_Real SCIPinfinity(SCIP *scip)
SCIP_Bool SCIPisIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPfeasFloor(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPisFeasPositive(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPparseReal(SCIP *scip, const char *str, SCIP_Real *value, char **endptr)
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
SCIP_RETCODE SCIPremoveVarFromGlobalStructures(SCIP *scip, SCIP_VAR *var)
SCIP_VAR * SCIPvarGetNegatedVar(SCIP_VAR *var)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_RETCODE SCIPaddClique(SCIP *scip, SCIP_VAR **vars, SCIP_Bool *values, int nvars, SCIP_Bool isequation, SCIP_Bool *infeasible, int *nbdchgs)
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
int SCIPvarGetNLocksUpType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_RETCODE SCIPgetBinvarRepresentatives(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **repvars, SCIP_Bool *negated)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
SCIP_RETCODE SCIPaggregateVars(SCIP *scip, SCIP_VAR *varx, SCIP_VAR *vary, SCIP_Real scalarx, SCIP_Real scalary, SCIP_Real rhs, SCIP_Bool *infeasible, SCIP_Bool *redundant, SCIP_Bool *aggregated)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_RETCODE SCIPaddVarLocksType(SCIP *scip, SCIP_VAR *var, SCIP_LOCKTYPE locktype, int nlocksdown, int nlocksup)
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
SCIP_RETCODE SCIPcreateVarImpl(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_IMPLINTTYPE impltype, 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)
int SCIPvarGetProbindex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
void SCIPfreeParseVarsPolynomialData(SCIP *scip, SCIP_VAR ****monomialvars, SCIP_Real ***monomialexps, SCIP_Real **monomialcoefs, int **monomialnvars, int nmonomials)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize)
SCIP_Bool SCIPvarIsTransformedOrigvar(SCIP_VAR *var)
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
SCIP_RETCODE SCIPwriteVarsPolynomial(SCIP *scip, FILE *file, SCIP_VAR ***monomialvars, SCIP_Real **monomialexps, SCIP_Real *monomialcoefs, int *monomialnvars, int nmonomials, SCIP_Bool type)
SCIP_VAR * SCIPvarGetNegationVar(SCIP_VAR *var)
SCIP_Bool SCIPvarIsOriginal(SCIP_VAR *var)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
SCIP_IMPLINTTYPE SCIPvarGetImplType(SCIP_VAR *var)
SCIP_RETCODE SCIPparseVarsPolynomial(SCIP *scip, const char *str, SCIP_VAR ****monomialvars, SCIP_Real ***monomialexps, SCIP_Real **monomialcoefs, int **monomialnvars, int *nmonomials, char **endptr, SCIP_Bool *success)
int SCIPvarCompare(SCIP_VAR *var1, SCIP_VAR *var2)
SCIP_RETCODE SCIPwriteVarName(SCIP *scip, FILE *file, SCIP_VAR *var, SCIP_Bool type)
SCIP_Bool SCIPvarsHaveCommonClique(SCIP_VAR *var1, SCIP_Bool value1, SCIP_VAR *var2, SCIP_Bool value2, SCIP_Bool regardimplics)
int SCIPvarGetNLocksDownType(SCIP_VAR *var, SCIP_LOCKTYPE locktype)
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPsortedvecFindPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), void *val, int len, int *pos)
void SCIPsortPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
void SCIPsortPtrBool(void **ptrarray, SCIP_Bool *boolarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
void SCIPsortPtrRealBool(void **ptrarray, SCIP_Real *realarray, SCIP_Bool *boolarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
void SCIPsortPtrPtrRealBool(void **ptrarray1, void **ptrarray2, SCIP_Real *realarray, SCIP_Bool *boolarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_RETCODE SCIPskipSpace(char **s)
int SCIPstrncpy(char *t, const char *s, int size)
SCIP_RETCODE SCIPaddSymgraphEdge(SCIP *scip, SYM_GRAPH *graph, int first, int second, SCIP_Bool hasval, SCIP_Real val)
SCIP_RETCODE SCIPaddSymgraphOpnode(SCIP *scip, SYM_GRAPH *graph, int op, int *nodeidx)
SCIP_RETCODE SCIPgetSymActiveVariables(SCIP *scip, SYM_SYMTYPE symtype, SCIP_VAR ***vars, SCIP_Real **scalars, int *nvars, SCIP_Real *constant, SCIP_Bool transformed)
SCIP_RETCODE SCIPaddSymgraphConsnode(SCIP *scip, SYM_GRAPH *graph, SCIP_CONS *cons, SCIP_Real lhs, SCIP_Real rhs, int *nodeidx)
SCIP_RETCODE SCIPaddSymgraphVarAggregation(SCIP *scip, SYM_GRAPH *graph, int rootidx, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Real constant)
assert(minobj< SCIPgetCutoffbound(scip))
static SCIP_Bool propagate
static volatile int nterms
memory allocation routines
#define BMScopyMemoryArray(ptr, source, num)
#define BMSclearMemoryArray(ptr, num)
public methods for managing constraints
public methods for message output
#define SCIPdebugPrintCons(x, y, z)
public data structures and miscellaneous methods
methods for sorting joint arrays of various types
public methods for problem variables
public methods for constraint handler plugins and constraints
public methods for problem copies
public methods for memory management
public methods for message handling
public methods for numerical tolerances
public methods for SCIP parameter handling
public methods for global and local (sub)problems
public methods for solutions
public methods for SCIP variables
static SCIP_RETCODE separate(SCIP *scip, SCIP_SEPA *sepa, SCIP_SOL *sol, SCIP_RESULT *result)
Main separation function.
unsigned int istransformed
methods for dealing with symmetry detection graphs
#define SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH(x)
#define SCIP_DECL_CONSGETPERMSYMGRAPH(x)
#define SCIP_DECL_CONSENFOLP(x)
#define SCIP_DECL_CONSINITPRE(x)
#define SCIP_DECL_CONSDELETE(x)
struct SCIP_Cons SCIP_CONS
#define SCIP_DECL_CONSGETVARS(x)
#define SCIP_DECL_CONSPRINT(x)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
struct SYM_Graph SYM_GRAPH
#define SCIP_DECL_CONSENFORELAX(x)
#define SCIP_DECL_CONSGETNVARS(x)
#define SCIP_DECL_CONSENFOPS(x)
#define SCIP_DECL_CONSPARSE(x)
#define SCIP_DECL_CONSTRANS(x)
#define SCIP_DECL_CONSPRESOL(x)
#define SCIP_DECL_CONSLOCK(x)
struct SCIP_Conshdlr SCIP_CONSHDLR
#define SCIP_DECL_CONSCOPY(x)
#define SCIP_DECL_CONSINIT(x)
struct SCIP_ConsData SCIP_CONSDATA
#define SCIP_DECL_CONSCHECK(x)
#define SCIP_DECL_CONSHDLRCOPY(x)
#define SCIP_DECL_CONSFREE(x)
struct SCIP_HashMap SCIP_HASHMAP
#define SCIP_DECL_SORTPTRCOMP(x)
#define SCIP_DECL_HASHKEYEQ(x)
#define SCIP_DECL_HASHGETKEY(x)
#define SCIP_DECL_HASHKEYVAL(x)
struct SCIP_HashTable SCIP_HASHTABLE
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_STAGE_TRANSFORMING
enum SYM_Symtype SYM_SYMTYPE
@ SYM_CONSOPTYPE_PB_LINEAR
enum SCIP_ImplintType SCIP_IMPLINTTYPE
@ SCIP_IMPLINTTYPE_STRONG
@ SCIP_VARTYPE_CONTINUOUS
enum SCIP_Varstatus SCIP_VARSTATUS