73#include "scip/cons_eqknapsack.h"
77#define CONSHDLR_NAME "pseudoboolean"
78#define CONSHDLR_DESC "constraint handler dealing with pseudo Boolean constraints"
79#define CONSHDLR_ENFOPRIORITY -1000000
80#define CONSHDLR_CHECKPRIORITY -5000000
81#define CONSHDLR_EAGERFREQ 100
83#define CONSHDLR_MAXPREROUNDS -1
84#define CONSHDLR_NEEDSCONS TRUE
86#define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_MEDIUM
88#define DEFAULT_DECOMPOSENORMALPBCONS FALSE
89#define DEFAULT_DECOMPOSEINDICATORPBCONS TRUE
91#define DEFAULT_SEPARATENONLINEAR TRUE
92#define DEFAULT_PROPAGATENONLINEAR TRUE
93#define DEFAULT_REMOVABLENONLINEAR TRUE
94#define NONLINCONSUPGD_PRIORITY 60000
97#undef NONLINCONSUPGD_PRIORITY
102#define HASHSIZE_PSEUDOBOOLEANNONLINEARTERMS 500
197 unsigned int issoftcons:1;
198 unsigned int changed:1;
199 unsigned int propagated:1;
200 unsigned int presolved:1;
201 unsigned int cliquesadded:1;
202 unsigned int upgradetried:1;
206struct SCIP_ConshdlrData
210 int nallconsanddatas;
212 int sallconsanddatas;
255 if( varind1 == -1 && varind2 == -1 )
261 if( varind1 < varind2 )
263 if( varind1 > varind2 )
266 if( varneg1 && !varneg2 )
268 if( !varneg1 && varneg2 )
297 consand1 = consanddata1->
cons;
298 consand2 = consanddata2->
cons;
356 for( v = cdata1->
nvars - 1; v > 0; --v )
359 for( v = cdata2->
nvars - 1; v > 0; --v )
372 for( v = cdata1->
nvars - 1; v >= 0; --v )
378 if( cdata1->
vars[v] != cdata2->
vars[v] )
408 for( v = cdata->
nvars - 1; v > 0; --v )
416 assert(minidx >= 0 && minidx <= maxidx);
430 if( ((*conshdlrdata)->inithashmapandtable) )
444 hashGetKeyAndConsDatas, hashKeyEqAndConsDatas, hashKeyValAndConsDatas, (
void*)
scip) );
450 (*conshdlrdata)->inithashmapandtable =
TRUE;
467 (*conshdlrdata)->allconsanddatas =
NULL;
468 (*conshdlrdata)->nallconsanddatas = 0;
469 (*conshdlrdata)->sallconsanddatas = 10;
474 (*conshdlrdata)->inithashmapandtable =
FALSE;
475 (*conshdlrdata)->hashtable =
NULL;
476 (*conshdlrdata)->hashtablesize = 0;
477 (*conshdlrdata)->hashmap =
NULL;
478 (*conshdlrdata)->hashmapsize = 0;
481 (*conshdlrdata)->nlinconss = 0;
484 (*conshdlrdata)->noriguses = 0;
500 assert((*conshdlrdata)->nallconsanddatas == 0);
503 if( (*conshdlrdata)->inithashmapandtable )
506 (*conshdlrdata)->hashmapsize = 0;
508 (*conshdlrdata)->hashtablesize = 0;
515 (*conshdlrdata)->inithashmapandtable =
FALSE;
520 (*conshdlrdata)->allconsanddatas =
NULL;
521 (*conshdlrdata)->nallconsanddatas = 0;
522 (*conshdlrdata)->sallconsanddatas = 0;
558 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
559 *
nvars = SCIPgetNVarsEQKnapsack(
scip, cons);
621 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
622 *lhs = SCIPgetCapacityEQKnapsack(
scip, cons);
668 for( v = 0; v < *
nvars; ++v )
670 vars[v] = linvars[v];
671 coefs[v] = lincoefs[v];
676 for( v = 0; v < *
nvars; ++v )
677 vars[v] = linvars[v];
689 for( v = 0; v < *
nvars; ++v )
691 vars[v] = linvars[v];
697 for( v = 0; v < *
nvars; ++v )
698 vars[v] = linvars[v];
714 for( v = 0; v < *
nvars; ++v )
716 vars[v] = linvars[v];
722 for( v = 0; v < *
nvars; ++v )
723 vars[v] = linvars[v];
735 for( v = 0; v < *
nvars; ++v )
737 vars[v] = linvars[v];
743 for( v = 0; v < *
nvars; ++v )
744 vars[v] = linvars[v];
749 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
753 *
nvars = SCIPgetNVarsEQKnapsack(
scip, cons);
754 linvars = SCIPgetVarsEQKnapsack(
scip, cons);
759 weights = SCIPgetWeightsEQKnapsack(
scip, cons);
761 for( v = 0; v < *
nvars; ++v )
763 vars[v] = linvars[v];
769 for( v = 0; v < *
nvars; ++v )
770 vars[v] = linvars[v];
818 if( nlinvars !=
NULL )
820 if( nandress !=
NULL )
830 for( v = 0; v <
nvars; ++v )
842 hashmapentryexists =
SCIPhashmapExists(conshdlrdata->hashmap, (
void*)(hashmapvar));
845 hashmapvar =
vars[v];
850 if( hashmapentryexists )
859 if( hashmapentryexists )
867 if( !hashmapentryexists && linvars !=
NULL && nlinvars !=
NULL )
869 linvars[*nlinvars] =
vars[v];
870 if( lincoefs !=
NULL )
873 lincoefs[*nlinvars] = coefs[v];
877 else if( hashmapentryexists && nandress !=
NULL )
879 if( andress !=
NULL )
881 andress[*nandress] = hashmapvar;
883 if( andcoefs !=
NULL )
887 andcoefs[*nandress] = coefs[v];
888 andnegs[*nandress] = (
vars[v] != hashmapvar);
899#ifdef CHECK_CONSISTENCY
939 assert(consdata->nconsanddatas > 0);
940 assert(consdata->nconsanddatas <= consdata->sconsanddatas);
952 assert(
nvars == consdata->nlinvars + consdata->nconsanddatas);
970 andress, andcoefs, andnegs, &nandress) );
971 assert(nlinvars == consdata->nlinvars);
972 assert(nandress == consdata->nconsanddatas);
974 for( v = nandress - 1; v >= 0; --v )
976 SCIP_VAR* andresultant = andress[v];
979 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
982 if( consdata->consanddatas[
c]->cons !=
NULL )
987 if( res == andresultant && consdata->andnegs[
c] == andnegs[v] && consdata->andcoefs[
c] == andcoefs[v] )
994 alreadyfound[
c] =
TRUE;
1003 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
1019#define checkConsConsistency(scip, cons)
1044 tmpvars = consanddata->
vars;
1045 ntmpvars = consanddata->
nvars;
1048 for( v = ntmpvars - 1; v >= 0; --v )
1058 tmpvars = consanddata->
newvars;
1062 for( v = ntmpvars - 1; v >= 0; --v )
1073 if( !origdata || consanddata->
nvars == 0 )
1078 consanddata->
nuses = 0;
1079 consanddata->
nvars = 0;
1080 consanddata->
svars = 0;
1095 if( consanddata->
nvars > 0 )
1106 if( conshdlrdata->inithashmapandtable )
1138 if( conshdlrdata->inithashmapandtable )
1167 int const nandconss,
1203 SCIPerrorMessage(
"left hand side of pseudo boolean constraint greater than right hand side\n");
1214 (*consdata)->issoftcons = issoftcons;
1217 (*consdata)->weight = weight;
1223 (*consdata)->indvar = indvar;
1226 (*consdata)->indvar =
NULL;
1229 (*consdata)->lincons = lincons;
1230 (*consdata)->linconstype = linconstype;
1242 if( transforming || transformed )
1252 (*consdata)->nlinvars =
nvars - nandconss;
1263 if( andnegs !=
NULL )
1271 (*consdata)->nconsanddatas = nandconss;
1272 (*consdata)->sconsanddatas = nandconss;
1282 for(
c = nandconss - 1;
c >= 0; --
c )
1291 assert((*consdata)->consanddatas[
c]->origcons == andconss[
c] || (*consdata)->consanddatas[
c]->cons == andconss[
c]);
1296 if( (*consdata)->consanddatas[
c]->origcons !=
NULL && (*consdata)->consanddatas[
c]->cons ==
NULL )
1306 assert((*consdata)->consanddatas[
c]->cons !=
NULL);
1307 assert((*consdata)->consanddatas[
c]->newvars ==
NULL);
1308 assert((*consdata)->consanddatas[
c]->isoriginal);
1310 (*consdata)->consanddatas[
c]->istransformed =
TRUE;
1315 vars = (*consdata)->consanddatas[
c]->vars;
1316 ncvars = (*consdata)->consanddatas[
c]->nvars;
1326 for( v = ncvars - 1; v >= 0; --v )
1331 else if( (*consdata)->consanddatas[
c]->cons !=
NULL )
1332 assert((*consdata)->consanddatas[
c]->istransformed);
1334 ++((*consdata)->consanddatas[
c]->nuses);
1336 else if( transformed )
1338 assert((*consdata)->consanddatas[
c]->cons == andconss[
c]);
1340 assert((*consdata)->consanddatas[
c]->istransformed);
1345 SCIPsortPtrPtrRealBool((
void**)andress, (
void**)((*consdata)->consanddatas), (*consdata)->andcoefs, (*consdata)->andnegs, resvarComp, nandconss);
1352 (*consdata)->consanddatas =
NULL;
1353 (*consdata)->andcoefs =
NULL;
1354 (*consdata)->andnegs =
NULL;
1355 (*consdata)->nconsanddatas = 0;
1356 (*consdata)->sconsanddatas = 0;
1360 (*consdata)->lhs = lhs;
1361 (*consdata)->rhs = rhs;
1363 (*consdata)->changed =
TRUE;
1364 (*consdata)->propagated =
FALSE;
1365 (*consdata)->presolved =
FALSE;
1366 (*consdata)->cliquesadded =
FALSE;
1367 (*consdata)->upgradetried =
TRUE;
1376 conshdlrdata->noriguses += (*consdata)->nconsanddatas;
1398 assert((*consdata)->consanddatas !=
NULL || (*consdata)->nconsanddatas == 0);
1402 if( (*consdata)->lincons !=
NULL )
1407 nconsanddatas = (*consdata)->nconsanddatas;
1408 consanddatas = (*consdata)->consanddatas;
1411 for(
c = nconsanddatas - 1;
c >= 0; --
c )
1413 assert((consanddatas[
c]->origcons ==
NULL) == (consanddatas[
c]->noriguses == 0));
1414 assert((consanddatas[
c]->cons ==
NULL) == (consanddatas[
c]->nuses == 0));
1415 assert(consanddatas[
c]->nuses >= 0);
1416 assert(consanddatas[
c]->noriguses >= 0);
1420 if( !isorig && consanddatas[
c]->cons !=
NULL )
1424 --(consanddatas[
c]->
nuses);
1427 if( consanddatas[
c]->nuses == 0 )
1429 if( conshdlrdata->inithashmapandtable )
1435 if( consanddatas[
c]->origcons ==
NULL )
1451 if( consanddatas[
c]->origcons ==
NULL )
1455 assert(conshdlrdata->nallconsanddatas > 0);
1457 for( d = conshdlrdata->nallconsanddatas - 1; d >= 0; --d )
1459 if( conshdlrdata->allconsanddatas[d] == consanddatas[
c] )
1461 --conshdlrdata->nallconsanddatas;
1465 conshdlrdata->allconsanddatas[d] = conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas];
1475 else if( isorig && consanddatas[
c]->origcons !=
NULL )
1478 assert(consanddatas[
c]->nuses == 0);
1479 assert(consanddatas[
c]->nnewvars == 0);
1480 assert(consanddatas[
c]->snewvars == 0);
1486 if( consanddatas[
c]->noriguses == 0 )
1490 if( conshdlrdata->inithashmapandtable )
1505 assert(consanddatas[
c]->svars > 0);
1509 consanddatas[
c]->
nvars = 0;
1510 consanddatas[
c]->
svars = 0;
1515 assert(consanddatas[
c]->svars == 0);
1523 assert(conshdlrdata->nallconsanddatas > 0);
1524 for( d = conshdlrdata->nallconsanddatas - 1; d >= 0; --d )
1526 if( conshdlrdata->allconsanddatas[d] == consanddatas[
c] )
1528 --conshdlrdata->nallconsanddatas;
1532 conshdlrdata->allconsanddatas[d] = conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas];
1543 assert(!consanddatas[
c]->istransformed);
1548 if( consanddatas[
c]->nuses == 0 && consanddatas[
c]->istransformed )
1553 else if( consanddatas[
c]->nuses == 0 )
1559 assert(consanddatas[
c]->nnewvars == 0);
1560 assert(consanddatas[
c]->snewvars == 0);
1563 tmpvars = consanddatas[
c]->
vars;
1564 ntmpvars = consanddatas[
c]->
nvars;
1567 for( v = ntmpvars - 1; v >= 0; --v )
1576 if( !consanddatas[
c]->istransformed && consanddatas[
c]->noriguses > 0 )
1579 assert(consanddatas[
c]->nuses == 0);
1580 assert(consanddatas[
c]->nnewvars == 0);
1581 assert(consanddatas[
c]->snewvars == 0);
1584 assert(consanddatas[
c]->svars > 0);
1587 assert(consanddatas[
c]->isoriginal);
1593 if( conshdlrdata->inithashmapandtable )
1688 for( v =
nvars - 1; v >= 0; --v )
1695 for( v =
nvars - 1; v >= 0; --v )
1752 for( v =
nvars - 1; v >= 0; --v )
1759 for( v =
nvars - 1; v >= 0; --v )
1812 assert(consdata->nlinvars + consdata->nconsanddatas >=
nvars);
1840 for( v = 0; v <
nvars; ++v )
1853 assert(!consdata->issoftcons ||
var != consdata->indvar);
1856 if( consanddata !=
NULL )
1870 if( consanddata ==
NULL )
1874 monomialvars[nmonomials] =
vars + v;
1875 monomialnvars[nmonomials] = 1;
1882 if( fixed != negated )
1898 monomialvars[nmonomials] = andvars;
1900 monomialnvars[nmonomials] = nandvars;
1904 monomialcoefs[nmonomials] = coefs[v];
1933 if( consdata->issoftcons )
2019 if( tmpdata !=
NULL )
2027 *andcons = tmpdata->
cons;
2060 for( v = 0; v <
nvars; ++v )
2078#ifdef SCIP_DISABLED_CODE
2079#ifdef WITH_DEBUG_SOLUTION
2080 if( SCIPdebugIsMainscip(
scip) )
2086 for( v =
nvars - 1; v >= 0; --v )
2094 val = ((val < 0.5) ? 0.0 : 1.0);
2099 SCIPerrorMessage(
"computed solution value %g for resultant <%s> violates debug solution value %g\n", val,
SCIPvarGetName(resultant), debugsolval);
2121 local, modifiable, dynamic, removable, stickingatnode) );
2129 if( conshdlrdata->nallconsanddatas == conshdlrdata->sallconsanddatas )
2135 conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas] = newdata;
2136 ++(conshdlrdata->nallconsanddatas);
2140 newdata->
cons = newcons;
2150 for( v = newdata->
nvars - 1; v >= 0; --v )
2227 if( consdata->nconsanddatas == consdata->sconsanddatas )
2237 ++(consdata->nconsanddatas);
2240 switch( consdata->linconstype )
2263#ifdef WITHEQKNAPSACK
2264 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
2281 consdata->changed =
TRUE;
2282 consdata->propagated =
FALSE;
2283 consdata->presolved =
FALSE;
2284 consdata->cliquesadded =
FALSE;
2285 consdata->upgradetried =
FALSE;
2307 SCIPerrorMessage(
"changing left hand side only allowed on standard lienar constraint \n");
2309#ifdef WITHEQKNAPSACK
2310 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
2338 SCIPerrorMessage(
"changing left hand side only allowed on standard lienar constraint \n");
2340#ifdef WITHEQKNAPSACK
2341 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
2413 SCIP_CALL(
getLinVarsAndAndRess(
scip, cons,
vars, coefs,
nvars, linvars, lincoefs, &nlinvars, andress, andcoefs, andnegs, &nandress) );
2414 assert(consdata->nconsanddatas == nandress);
2430 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2435 consanddata = consdata->consanddatas[
c];
2438 andcons = consanddata->
cons;
2443 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2448 for( v = nandvars - 1; v >= 0; --v )
2455 for( v = nandvars - 1; v >= 0; --v )
2465 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2470 consanddata = consdata->consanddatas[
c];
2473 andcons = consanddata->
cons;
2478 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2483 for( v = nandvars - 1; v >= 0; --v )
2490 for( v = nandvars - 1; v >= 0; --v )
2502 consdata->propagated =
FALSE;
2507 consdata->lhs = lhs;
2508 consdata->presolved =
FALSE;
2509 consdata->changed =
TRUE;
2584 SCIP_CALL(
getLinVarsAndAndRess(
scip, cons,
vars, coefs,
nvars, linvars, lincoefs, &nlinvars, andress, andcoefs, andnegs, &nandress) );
2585 assert(consdata->nconsanddatas == nandress);
2601 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2606 consanddata = consdata->consanddatas[
c];
2609 andcons = consanddata->
cons;
2614 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2619 for( v = nandvars - 1; v >= 0; --v )
2626 for( v = nandvars - 1; v >= 0; --v )
2636 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2641 consanddata = consdata->consanddatas[
c];
2644 andcons = consanddata->
cons;
2649 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2654 for( v = nandvars - 1; v >= 0; --v )
2661 for( v = nandvars - 1; v >= 0; --v )
2673 consdata->propagated =
FALSE;
2678 consdata->rhs = rhs;
2679 consdata->presolved =
FALSE;
2680 consdata->changed =
TRUE;
2702 int const*
const ntermvars,
2743 for( t = 0; t <
nterms; ++t )
2748 initial, enforce, check, local, modifiable, dynamic, stickingatnode,
2749 &(andconss[*nandconss])) );
2751 andvals[*nandconss] = termcoefs[t];
2752 andnegs[*nandconss] =
FALSE;
2830 assert(nlinvars > 0 || nandress > 0);
2840 ++(conshdlrdata->nlinconss);
2856 nvars = nlinvars + nandress;
2859 for( v = nlinvars - 1; v >= 0; --v )
2889 for( v = nandress - 1; v >= 0; --v )
2917 SCIPdebugMsg(
scip,
"While creating the linear constraint of the pseudoboolean constraint we found %d zero coefficients that were removed\n", nzero);
2935 if( upgrconshdlr !=
NULL &&
nvars > 2 && ncoeffspone + ncoeffsnone ==
nvars
2951 for( v = 0; v < nlinvars; ++v )
2953 if( mult * linvals[v] > 0.0 )
2954 transvars[v] = linvars[v];
2963 for( v = 0; v < nandress; ++v )
2965 if( mult * andvals[v] > 0.0 )
2966 transvars[nlinvars + v] = andress[v];
2978 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3007 if( upgrconshdlr !=
NULL && !created && ncoeffspone + ncoeffsnone ==
nvars )
3014 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a set partitioning constraint\n");
3017 mult =
SCIPisEQ(
scip, *lhs, 1.0 - ncoeffsnone) ? +1 : -1;
3023 for( v = 0; v < nlinvars; ++v )
3025 if( mult * linvals[v] > 0.0 )
3026 transvars[v] = linvars[v];
3035 for( v = 0; v < nandress; ++v )
3037 if( mult * andvals[v] > 0.0 )
3038 transvars[nlinvars + v] = andress[v];
3050 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3064 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a set packing constraint\n");
3073 for( v = 0; v < nlinvars; ++v )
3075 if( mult * linvals[v] > 0.0 )
3076 transvars[v] = linvars[v];
3085 for( v = 0; v < nandress; ++v )
3087 if( mult * andvals[v] > 0.0 )
3088 transvars[nlinvars + v] = andress[v];
3100 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3118 SCIPwarningMessage(
scip,
"Does not expect this, because this constraint should be a set packing constraint.\n");
3122 SCIPwarningMessage(
scip,
"Does not expect this, because this constraint should be a logicor constraint.\n");
3125 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a set covering constraint\n");
3134 for( v = 0; v < nlinvars; ++v )
3136 if( mult * linvals[v] > 0.0 )
3137 transvars[v] = linvars[v];
3146 for( v = 0; v < nandress; ++v )
3148 if( mult * andvals[v] > 0.0 )
3149 transvars[nlinvars + v] = andress[v];
3161 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3189 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a knapsack constraint\n");
3210 for( v = 0; v < nlinvars; ++v )
3216 transvars[v] = linvars[v];
3217 weights[v] = weight;
3222 weights[v] = -weight;
3228 for( v = 0; v < nandress; ++v )
3234 transvars[nlinvars + v] = andress[v];
3235 weights[nlinvars + v] = weight;
3241 weights[nlinvars + v] = -weight;
3249 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3261#ifdef WITHEQKNAPSACK
3270 if( upgrconshdlr !=
NULL && !created && (ncoeffspone + ncoeffsnone + ncoeffspint + ncoeffsnint ==
nvars) &&
SCIPisEQ(
scip, *lhs, *rhs) )
3280 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a equality-knapsack constraint\n");
3298 for( v = 0; v < nlinvars; ++v )
3304 transvars[v] = linvars[v];
3305 weights[v] = weight;
3310 weights[v] = -weight;
3316 for( v = 0; v < nandress; ++v )
3322 transvars[nlinvars + v] = andress[v];
3323 weights[nlinvars + v] = weight;
3329 weights[nlinvars + v] = -weight;
3336 SCIP_CALL( SCIPcreateConsEqKnapsack(
scip, &cons, name,
nvars, transvars, weights, capacity,
3337 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3340 (*linconstype) = SCIP_LINEARCONSTYPE_EQKNAPSACK;
3359 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3364 for( v = 0; v < nandress; ++v )
3454 assert(consdata->nlinvars + consdata->nconsanddatas >=
nvars);
3466 for( v = 0; v <
nvars; ++v )
3477 if( consanddata !=
NULL )
3485 if( consanddata ==
NULL )
3496 if( andcons ==
NULL )
3497 andcons = consanddata->
cons;
3507 for(
i = 0;
i < nandvars; ++
i )
3511 solval = 1.0 - solval;
3515 activity += coefs[v] * solval;
3518 SCIPdebugMsg(
scip,
"lhs = %g, activity = %g, rhs = %g\n", lhs, activity, rhs);
3521 lhsviol = lhs - activity;
3522 rhsviol = activity - rhs;
3524 if(lhsviol > rhsviol)
3603 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
3610 if( !conshdlrdata->allconsanddatas[
c]->istransformed )
3613 andcons = conshdlrdata->allconsanddatas[
c]->cons;
3616 if( andcons ==
NULL )
3629 for( v =
nvars - 1; v >= 0; --v )
3633 if( solval < minsolval )
3636 sumsolval += solval;
3643 viol =
MAX3(0.0, solval - minsolval, sumsolval - (
nvars - 1.0 + solval));
3668 SCIP*
const targetscip,
3670 SCIP*
const sourcescip,
3708 sourcelincons = sourceconsdata->lincons;
3718 int ntargetandconss;
3721 targetlinconstype = sourceconsdata->linconstype;
3723 switch( targetlinconstype )
3741#ifdef WITHEQKNAPSACK
3742 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
3753 if( conshdlrlinear ==
NULL )
3759 targetlincons =
NULL;
3779 targetandconss =
NULL;
3780 targetandcoefs =
NULL;
3781 ntargetandconss = 0;
3787 int nsourceandconss;
3796 nsourceandconss = sourceconsdata->nconsanddatas;
3811 targetlinvars, targetlincoefs, &ntargetlinvars) );
3818 SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL) );
3820 for(
c = 0 ;
c < ntargetlinvars; ++
c )
3829 for(
c = 0 ;
c < nsourceandconss; ++
c )
3836 consanddata = sourceconsdata->consanddatas[
c];
3849 targetandconss[ntargetandconss] =
NULL;
3861 targetandcoefs[ntargetandconss] = sourceconsdata->andcoefs[
c];
3867 assert(ntargetandconss <= ntargetlinvars);
3876 const char* consname;
3879 assert(sourceconsdata->issoftcons == (sourceconsdata->indvar !=
NULL));
3880 indvar = sourceconsdata->indvar;
3883 if( indvar !=
NULL )
3907 targetlinconstype, targetandconss, targetandcoefs, ntargetandconss, indvar, sourceconsdata->weight,
3908 sourceconsdata->issoftcons, targetlhs, targetrhs, initial,
separate, enforce, check,
propagate,
3909 local, modifiable, dynamic, removable, stickingatnode) );
3919 if( targetlincons !=
NULL )
3925 if( targetandconss !=
NULL )
3929 assert(ntargetandconss <= sourceconsdata->nconsanddatas);
3931 for(
c = 0 ;
c < ntargetandconss; ++
c )
3933 if( targetandconss[
c] !=
NULL )
3964 allconsanddatas = conshdlrdata->allconsanddatas;
3966 assert(conshdlrdata->nallconsanddatas >= 0);
3967 assert(conshdlrdata->nallconsanddatas <= conshdlrdata->sallconsanddatas);
3969 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
3978 consanddata = allconsanddatas[
c];
3983 if( consanddata->
nuses == 0 )
4001 cons = consanddata->
cons;
4024 for( v =
nvars - 1; v > 0; --v )
4027 for( v = nnewvars - 1; v > 0; --v )
4032 if(
nvars == nnewvars )
4039 for( v =
nvars - 1; v >= 0; --v )
4041 if(
vars[v] != newvars[v] )
4053 if( nnewvars > consanddata->
snewvars )
4063 for( v = consanddata->
nnewvars - 1; v >= 0; --v )
4145 int nnewconsanddatas;
4146 int snewconsanddatas;
4172 SCIPsortPtrRealBool((
void**)(consdata->consanddatas), consdata->andcoefs, consdata->andnegs, resvarCompWithInactive, consdata->nconsanddatas);
4177 consanddatas = consdata->consanddatas;
4178 oldandcoefs = consdata->andcoefs;
4179 oldandnegs = consdata->andnegs;
4180 nconsanddatas = consdata->nconsanddatas;
4181 assert(consanddatas !=
NULL || nconsanddatas == 0);
4182 assert(oldandcoefs !=
NULL || nconsanddatas == 0);
4184 snewconsanddatas = nconsanddatas + nandress;
4191 nnewconsanddatas = 0;
4194 for(
c = 0, c1 = 0;
c < nconsanddatas && c1 < nandress; )
4204 if( !consanddatas[
c]->istransformed )
4207 consdata->changed =
TRUE;
4208 consdata->upgradetried =
FALSE;
4212 andcons = consanddatas[
c]->
cons;
4215 if( andcons ==
NULL )
4218 consdata->changed =
TRUE;
4219 consdata->upgradetried =
FALSE;
4226 oldandnegs[
c] ? -oldandcoefs[
c] : oldandcoefs[
c], consdata->lhs, consdata->rhs) );
4228 consdata->changed =
TRUE;
4229 consdata->upgradetried =
FALSE;
4245 compval = resvarComp((
void*)res1, (
void*)res2);
4251 assert(consanddatas[
c]->nuses > 0);
4252 --(consanddatas[
c]->
nuses);
4256 consdata->lhs, consdata->rhs) );
4258 consdata->changed =
TRUE;
4259 consdata->upgradetried =
FALSE;
4260 consdata->propagated =
FALSE;
4261 consdata->presolved =
FALSE;
4263 else if( compval == +1 )
4268 newandcoefs[nnewconsanddatas] = andcoefs[c1];
4269 newandnegs[nnewconsanddatas] = andnegs[c1];
4270 ++(newconsanddatas[nnewconsanddatas]->
nuses);
4274 -newandcoefs[nnewconsanddatas] : newandcoefs[nnewconsanddatas], newlhs, newrhs) );
4276 consdata->changed =
TRUE;
4277 consdata->upgradetried =
FALSE;
4278 consdata->cliquesadded =
FALSE;
4279 consdata->propagated =
FALSE;
4280 consdata->presolved =
FALSE;
4295 newconsanddatas[nnewconsanddatas] = consanddatas[
c];
4297 newandcoefs[nnewconsanddatas] = andcoefs[c1];
4298 newandnegs[nnewconsanddatas] = andnegs[c1];
4300 if( ((oldandnegs[
c] == andnegs[c1]) && !
SCIPisEQ(
scip, oldandcoefs[
c], newandcoefs[c1]))
4301 || ((oldandnegs[
c] != newandnegs[c1]) && !
SCIPisEQ(
scip, oldandcoefs[
c], -newandcoefs[c1])) )
4302 consdata->upgradetried =
FALSE;
4304 coefsignchanged = (oldandnegs[
c] == andnegs[c1]) &&
4305 ((oldandcoefs[
c] < 0 && andcoefs[c1] > 0) || (oldandcoefs[
c] > 0 && andcoefs[c1] < 0));
4306 coefsignchanged = coefsignchanged || ((oldandnegs[
c] != andnegs[c1]) &&
4307 ((oldandcoefs[
c] < 0 && andcoefs[c1] < 0) || (oldandcoefs[
c] > 0 && andcoefs[c1] > 0)));
4309 || (consdata->lhs < 0 && newlhs > 0) || (consdata->lhs > 0 && newlhs < 0);
4311 || (consdata->rhs < 0 && newrhs > 0) || (consdata->rhs > 0 && newrhs < 0);
4314 if( coefsignchanged || lhschanged || rhschanged || newconsanddatas[nnewconsanddatas]->nnewvars > 0)
4318 -oldandcoefs[
c] : oldandcoefs[
c], consdata->lhs, consdata->rhs) );
4320 -newandcoefs[nnewconsanddatas] : newandcoefs[nnewconsanddatas], newlhs, newrhs) );
4322 consdata->changed =
TRUE;
4323 consdata->upgradetried =
FALSE;
4324 consdata->cliquesadded =
FALSE;
4325 consdata->propagated =
FALSE;
4326 consdata->presolved =
FALSE;
4336 if(
c < nconsanddatas )
4340 for( ;
c < nconsanddatas; ++
c )
4348 andcons = consanddatas[
c]->
cons;
4350 if( andcons !=
NULL )
4357 if( andcons ==
NULL )
4359 consdata->changed =
TRUE;
4360 consdata->upgradetried =
FALSE;
4364 assert(consanddatas[
c]->nuses > 0);
4365 --(consanddatas[
c]->
nuses);
4369 consdata->lhs, consdata->rhs) );
4370 consdata->changed =
TRUE;
4371 consdata->upgradetried =
FALSE;
4372 consdata->propagated =
FALSE;
4373 consdata->presolved =
FALSE;
4376 else if( c1 < nandress )
4378 for( ; c1 < nandress; ++c1 )
4386 newandcoefs[nnewconsanddatas] = andcoefs[c1];
4387 newandnegs[nnewconsanddatas] = andnegs[c1];
4388 ++(newconsanddatas[nnewconsanddatas]->
nuses);
4392 -newandcoefs[nnewconsanddatas] : newandcoefs[nnewconsanddatas], newlhs, newrhs) );
4395 consdata->changed =
TRUE;
4396 consdata->upgradetried =
FALSE;
4397 consdata->cliquesadded =
FALSE;
4398 consdata->propagated =
FALSE;
4399 consdata->presolved =
FALSE;
4402 assert(
c == nconsanddatas && c1 == nandress);
4411 consdata->upgradetried =
FALSE;
4412 consdata->lhs = newlhs;
4413 consdata->rhs = newrhs;
4416 consdata->consanddatas = newconsanddatas;
4417 consdata->andcoefs = newandcoefs;
4418 consdata->andnegs = newandnegs;
4419 consdata->nconsanddatas = nnewconsanddatas;
4420 consdata->sconsanddatas = snewconsanddatas;
4422 oldnvars = consdata->nlinvars;
4425 consdata->nlinvars -= nnewconsanddatas;
4427 if( oldnvars != consdata->nlinvars )
4429 consdata->changed =
TRUE;
4430 consdata->upgradetried =
FALSE;
4431 consdata->cliquesadded =
FALSE;
4432 consdata->propagated =
FALSE;
4433 consdata->presolved =
FALSE;
4437 consanddatas = consdata->consanddatas;
4438 nconsanddatas = consdata->nconsanddatas;
4439 assert(consanddatas !=
NULL || nconsanddatas == 0);
4442 for(
c = nconsanddatas - 1;
c > 0; --
c )
4473 if( resind1 == -1 && resind2 == -1 )
4479 if( resind1 <= resind2 )
4481 assert(resind1 == resind2);
4497 int*
const naggrvars,
4526 assert(consdata->nconsanddatas > 0);
4529 if( consdata->cliquesadded )
4532 consdata->cliquesadded =
TRUE;
4541 assert(consdata->nconsanddatas > 0);
4542 assert(consdata->nconsanddatas <= consdata->sconsanddatas);
4546 assert(
nvars == consdata->nlinvars + consdata->nconsanddatas);
4561 assert(nandress == consdata->nconsanddatas);
4565 for(
c = nandress - 1;
c >= 0; --
c )
4571 consanddata = consdata->consanddatas[
c];
4579 andvars = consanddata->
newvars;
4584 andvars = consanddata->
vars;
4585 nandvars = consanddata->
nvars;
4588 for( v1 = nandvars - 1; v1 >= 0; --v1 )
4606 for( v2 = nlinvars - 1; v2 >= 0; --v2 )
4636 if( values[0] != values[1] && var1 == var2 )
4642 clqvars[0] = andres;
4653 *nchgbds += nchgbdslocal;
4685 clqvars[0] = andres;
4696 *nchgbds += nchgbdslocal;
4716 for(
c = nandress - 1;
c > 0; --
c )
4725 consanddata1 = consdata->consanddatas[
c];
4727 consanddata2 = consdata->consanddatas[
c - 1];
4736 andvars1 = consanddata1->
newvars;
4737 nandvars1 = consanddata1->
nnewvars;
4741 andvars1 = consanddata1->
vars;
4742 nandvars1 = consanddata1->
nvars;
4748 andvars2 = consanddata2->
newvars;
4749 nandvars2 = consanddata2->
nnewvars;
4753 andvars2 = consanddata2->
vars;
4754 nandvars2 = consanddata2->
nvars;
4758 for( v1 = nandvars1 - 1; v1 >= 0; --v1 )
4763 var1 = andvars1[v1];
4776 for( v2 = nandvars2 - 1; v2 >= 0; --v2 )
4780 var2 = andvars2[v2];
4806 if( values[0] != values[1] && var1 == var2 )
4812 clqvars[0] = andres;
4813 clqvars[1] = andres2;
4822 *nchgbds += nchgbdslocal;
4855 clqvars[0] = andres;
4866 *nchgbds += nchgbdslocal;
4923 if( consdata->propagated )
4927 consdata->propagated =
TRUE;
4950 consanddatas = consdata->consanddatas;
4951 nconsanddatas = consdata->nconsanddatas;
4952 assert(consanddatas !=
NULL || nconsanddatas == 0);
4958 for(
c = nconsanddatas - 1;
c >= 0; --
c )
4964 if( !consanddatas[
c]->istransformed )
4967 andcons = consanddatas[
c]->
cons;
4998 if( conshdlrdata->nallconsanddatas == 0 )
5001 allconsanddatas = conshdlrdata->allconsanddatas;
5003 assert(conshdlrdata->nallconsanddatas >= 1);
5004 assert(conshdlrdata->nallconsanddatas <= conshdlrdata->sallconsanddatas);
5006 if( nfixedvars >= 1 &&
nvars >= 1 )
5014 activescalars =
NULL;
5017 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
5024 consanddata = allconsanddatas[
c];
5042 if( consanddata->
nvars == 0 )
5057 consanddata->
nuses = 0;
5078 if( consanddata->
nuses == 0 )
5115 for(
w = 0;
w < nfixedvars && del; ++
w )
5124 activevars[0] = fixedvars[
w];
5125 activescalars[0] = 1.0;
5126 activeconstant = 0.0;
5129 assert(requiredsize == nactivevars);
5131 for(
i = 0;
i < nactivevars && del; ++
i )
5135 if( activevars[
i] == resvar )
5149 if( !looseorcolumn )
5175 cons = consanddata->
cons;
5189 consanddata->
nuses = 0;
5213 tmpvars = consanddata->
vars;
5215 for( v = consanddata->
nvars - 1; v >= 0; --v )
5223 tmpvars = consanddata->
vars;
5224 stmpvars = consanddata->
svars;
5228 consanddata->
newvars = tmpvars;
5234 if( activevars !=
NULL )
5270 consanddatas = consdata->consanddatas;
5271 nconsanddatas = consdata->nconsanddatas;
5272 assert(nconsanddatas > 0 && consanddatas !=
NULL);
5276 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5280 consanddata = consanddatas[
c];
5290 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5294 consanddata = consanddatas[
c];
5296 assert(consanddatas[
c]->istransformed);
5300 if( consanddata->
nuses > 0 )
5301 --(consanddata->
nuses);
5304 if( consanddata->
nuses == 0 )
5339 if( !looseorcolumn )
5364 consdata->nconsanddatas = 0;
5394 int const nconsanddatas,
5421 assert(nconsanddatas > 0);
5422 assert(*xortype >= -1 && *xortype <= 1);
5425 SCIPsortPtr((
void**)linvars, SCIPvarCompActiveAndNegated, nlinvars);
5429 for( v = nlinvars - 1; v >= 0; --v )
5434 value += lincoefs[v];
5449 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5453 consanddata = consanddatas[
c];
5460 termvars = consanddata->
newvars;
5465 termvars = consanddata->
vars;
5466 ntermvars = consanddata->
nvars;
5474 SCIPsortPtrBool((
void**)repvars, negated, SCIPvarCompActiveAndNegated, ntermvars);
5476 for( v = ntermvars - 1; v >= 0; --v )
5485 if( (negated[v] && values[pos]) || (!negated[v] && !values[pos]) )
5501 if( val != consanddatanegs[
c] )
5502 value += consanddatacoefs[
c];
5508 if( *xortype == -1 )
5516 else if( *xortype == 1 && cnt % 2 == 0 )
5518 else if( *xortype == 0 && cnt % 2 == 1 )
5524 if( *xortype == -1 )
5532 else if( *xortype == 1 && cnt % 2 == 1 )
5534 else if( *xortype == 0 && cnt % 2 == 0 )
5555 int*
const ndelconss,
5556 int*
const naddconss,
5557 int*
const nfixedvars,
5558 int*
const nchgcoefs,
5559 int*
const nchgsides,
5607 consanddatas = consdata->consanddatas;
5608 andcoefs = consdata->andcoefs;
5609 andnegs = consdata->andnegs;
5610 nconsanddatas = consdata->nconsanddatas;
5611 assert(nconsanddatas > 0 && consanddatas !=
NULL);
5623 lincons = consdata->lincons;
5627 assert(nallvars - nconsanddatas == consdata->nlinvars);
5628 nlinvars = consdata->nlinvars;
5650 assert(nlinvars == consdata->nlinvars);
5651 assert(nandress == nallvars-nlinvars);
5657 assert(requiredsize == nlinvars);
5663 firstnlinvars = nlinvars;
5666 SCIPsortPtr((
void**)linvars, SCIPvarCompActiveAndNegated, nlinvars);
5668 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5670 consanddata = consanddatas[
c];
5696 oldnlinvars = nlinvars;
5699 for( v =
nvars - 1, v1 = nlinvars - 1; v >= 0 && v1 >= 0; )
5719 linvars[nlinvars] =
var;
5741 for( ; v >= 0; --v )
5756 linvars[nlinvars] =
var;
5765 if( nlinvars > oldnlinvars )
5768 SCIPsortPtr((
void**)linvars, SCIPvarCompActiveAndNegated, nlinvars);
5776 for( v = (1 << nlinvars) - 1; v >= 0; --v )
5779 for( v1 = nlinvars - 1; v1 >= 0; --v1 )
5792 consdata->lhs, consanddatas, andcoefs, andnegs, nconsanddatas, cnt, &xortype) );
5799 assert(xortype >= -1 && xortype <= 1);
5847 int*
const ndelconss,
5848 int*
const naddconss,
5849 int*
const nfixedvars,
5850 int*
const nchgcoefs,
5851 int*
const nchgsides,
5879 consanddatas = consdata->consanddatas;
5880 nconsanddatas = consdata->nconsanddatas;
5881 assert(nconsanddatas > 0 && consanddatas !=
NULL);
5889 if( nconsanddatas == 1 )
5909 if( consdata->nlinvars == 0 )
5921 lincons = consdata->lincons;
5923 consanddata = consanddatas[0];
5952 assert(nallvars == consdata->nlinvars + 1);
5954 nlinvars = consdata->nlinvars;
5969 assert(nlinvars == consdata->nlinvars);
5972 for( v = 0; v < nlinvars; ++v )
5978 for( v = 0; v <
nvars; ++v )
6010 c = nconsanddatas - 1;
6011 assert(consanddatas[
c]->istransformed);
6014 if( consanddatas[
c]->nnewvars > 0 )
6022 neqvars = consanddatas[
c]->
nvars;
6032 for( v = neqvars - 1; v > 0; --v )
6036 for( --
c ;
c >= 0; --
c )
6043 consanddata = consanddatas[
c];
6045 assert(consanddatas[
c]->istransformed);
6062 for( v =
nvars - 1; v > 0; --v )
6067 if(
nvars < nminvars )
6070 else if(
nvars > nmaxvars )
6073 assert(nminvars <= nmaxvars);
6076 for( v = 0, v2 = 0; v < neqvars && v2 <
nvars; )
6087 if( index1 < index2 )
6089 else if( index1 > index2 )
6093 assert(index1 == index2);
6096 if( nneweqvars < v )
6097 eqvars[nneweqvars] = eqvars[v];
6103 neqvars = nneweqvars;
6108 if( nminvars > neqvars + 1 )
6150 if( neqvars > 0 && consdata->nlinvars == 0 )
6156 for( v = 0; v < neqvars; ++v )
6173 if( nminvars == neqvars )
6185 if( neqvars > 0 && nminvars == nmaxvars && nminvars == neqvars + 1 )
6196 lincons = consdata->lincons;
6208 for(
c = nconsanddatas - 1;
c >= 0; --
c )
6214 consanddata = consanddatas[
c];
6216 assert(consanddatas[
c]->istransformed);
6231 for( v = 0, v2 = 0; v < neqvars && v2 <
nvars; )
6242 assert(index1 >= index2);
6244 if( index1 > index2 )
6251 assert(index1 == index2);
6261 for( ; v2 <
nvars; ++v2)
6273 if( consdata->nlinvars > 0 )
6283 for( v = 0; v < neqvars; ++v )
6290 assert(
nvars == consdata->nlinvars + consdata->nconsanddatas);
6304 for( v = 0; v <
nvars; ++v )
6310 assert(nlinvars == consdata->nlinvars);
6313 for( v = 0; v < nlinvars; ++v )
6359 int*
const ndelconss,
6360 int*
const naddconss,
6361 int*
const nfixedvars,
6362 int*
const nchgcoefs,
6363 int*
const nchgsides,
6392 consanddatas = consdata->consanddatas;
6393 nconsanddatas = consdata->nconsanddatas;
6394 assert(nconsanddatas > 0 && consanddatas !=
NULL);
6416 if( nconsanddatas == 1 )
6419 if( consdata->nlinvars == 0 )
6448 if( consdata->nlinvars > 0 )
6453 assert(consdata->nlinvars == 0 && nconsanddatas > 1);
6455 c = nconsanddatas - 1;
6456 assert(consanddatas[
c]->istransformed);
6459 if( consanddatas[
c]->nnewvars > 0 )
6467 neqvars = consanddatas[
c]->
nvars;
6477 for( v = neqvars - 1; v > 0; --v )
6481 for( --
c ;
c >= 0; --
c )
6488 consanddata = consanddatas[
c];
6490 assert(consanddatas[
c]->istransformed);
6507 for( v =
nvars - 1; v > 0; --v )
6512 if(
nvars < nminvars )
6515 else if(
nvars > nmaxvars )
6518 assert(nminvars <= nmaxvars);
6521 for( v = 0, v2 = 0; v < neqvars && v2 <
nvars; )
6532 if( index1 < index2 )
6534 else if( index1 > index2 )
6538 assert(index1 == index2);
6541 if( nneweqvars < v )
6542 eqvars[nneweqvars] = eqvars[v];
6548 neqvars = nneweqvars;
6590 if( neqvars > 0 && ((nminvars == nmaxvars && nminvars == neqvars + 1) || (nminvars == neqvars) || (type ==
SCIP_SETPPCTYPE_PARTITIONING)) )
6620 if( neqvars == nminvars )
6623 createcons = (
SCIPisLE(
scip, lhs, rhs) && ((nminvars == nmaxvars && nminvars == neqvars + 1) || (nminvars == neqvars)));
6628 lincons = consdata->lincons;
6646 for(
c = nconsanddatas - 1;
c >= 0; --
c )
6652 consanddata = consanddatas[
c];
6654 assert(consanddatas[
c]->istransformed);
6670 if( deletecons && neqvars + 1 <
nvars )
6689 for( v = 0, v2 = 0; v < neqvars && v2 <
nvars; )
6700 assert(index1 >= index2);
6702 if( index1 > index2 )
6709 else if( deletecons )
6726 assert(index1 == index2);
6737 for( ; v2 <
nvars; ++v2)
6743 else if( deletecons )
6764 for( v = 0; v < neqvars; ++v )
6835 int*
const ndelconss,
6836 int*
const naddconss,
6837 int*
const nfixedvars,
6838 int*
const nchgcoefs,
6839 int*
const nchgsides,
6861 if( consdata->nconsanddatas == 0 )
6878 assert(consdata->nlinvars + consdata->nconsanddatas ==
nvars);
6880 switch( consdata->linconstype )
6897#ifdef WITHEQKNAPSACK
6898 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
6915 consdata->upgradetried =
TRUE;
6926 int*
const ndelconss,
6927 int*
const naggrvars,
6963 consanddatas = consdata->consanddatas;
6964 nconsanddatas = consdata->nconsanddatas;
6965 assert(consanddatas !=
NULL || nconsanddatas == 0);
6974 if( nconsanddatas < 2 || nconsanddatas > 3 )
6980 assert(consdata->nlinvars + nconsanddatas ==
nvars);
6983 if( consdata->nlinvars != 1 )
6987 if( consanddatas[0]->nnewvars > 0 )
6992 if( consanddatas[1]->nnewvars > 0 )
6994 if(
nvars != consanddatas[1]->nnewvars )
7012 if( consanddatas[nconsanddatas - 1]->nnewvars > 0 )
7015 vars = consanddatas[nconsanddatas - 1]->
vars;
7023 for( v = 1; v <
nvars; ++v )
7048 for( v =
nvars - 1; v >= 0; --v )
7059 ++(varcount[negated[v]][v]);
7062 for(
c = nconsanddatas - 2;
c >= 0; --
c )
7067 if( consanddatas[nconsanddatas - 1]->nnewvars > 0 )
7081 for( v = 1; v <
nvars; ++v )
7106 for( v =
nvars - 1; v >= 0; --v )
7120 ++(varcount[negated[v]][pos]);
7133 for(
i = 1;
i >= 0; --
i )
7135 for( v =
nvars - 1; v >= 0; --v )
7139 if( varcount[
i][v] == 0 )
7141 else if( varcount[
i][v] == 1 )
7143 else if( varcount[
i][v] == 2 )
7151 if( othercount == 0 )
7156 if( nconsanddatas == 2 && twocount ==
nvars - 1 && onecount == 2 && zerocount == 1 )
7171 assert(nconsvars == consdata->nlinvars + nconsanddatas);
7176 for( v = 0; v < nconsvars; ++v )
7203 for(
i = 1;
i >= 0; --
i )
7205 for( v =
nvars - 1; v >= 0; --v )
7208 if( varcount[
i][v] == 2 )
7257 else if(
nvars == 2 && nconsanddatas == 3 && twocount == 2 && onecount == 2 && zerocount == 0)
7276 assert(nconsvars == consdata->nlinvars + nconsanddatas);
7281 for( v = 0; v < nconsvars; ++v )
7295 newandvars[0] =
NULL;
7296 newandvars[1] =
NULL;
7300 for(
i = 1;
i >= 0; --
i )
7302 for( v =
nvars - 1; v >= 0; --v )
7305 if( varcount[
i][v] == 1 )
7307 if( newandvars[0] ==
NULL )
7430 for(
i = 0;
i < tmpnvars; ++
i )
7431 vals[
i] = tmpvals[
i];
7436 for(
i = 0;
i < tmpnvars; ++
i )
7442 for(
i = 0;
i < tmpnvars; ++
i )
7448 for(
i = 0;
i < tmpnvars; ++
i )
7459 for(
i = 0;
i < tmpnvars; ++
i )
7472 for(
c = 0;
c < consdata->nconsanddatas; ++
c )
7479 tmpnvars = consdata->consanddatas[
c]->nvars;
7480 for(
i = 0;
i < tmpnvars; ++
i )
7481 vars[
i] = consdata->consanddatas[
c]->vars[
i];
7482 for(
i = 0;
i < tmpnvars; ++
i )
7504#ifdef NONLINCONSUPGD_PRIORITY
7510 SCIP_EXPRGRAPH* exprgraph;
7511 SCIP_EXPRGRAPHNODE* node;
7530 node = SCIPgetExprgraphNodeNonlinear(
scip, cons);
7536 switch( SCIPexprgraphGetNodeOperator(node) )
7538 case SCIP_EXPR_VARIDX:
7539 case SCIP_EXPR_CONST:
7540 case SCIP_EXPR_PLUS:
7541 case SCIP_EXPR_MINUS:
7543 case SCIP_EXPR_LINEAR:
7549 case SCIP_EXPR_SQUARE:
7550 case SCIP_EXPR_SQRT:
7551 case SCIP_EXPR_REALPOWER:
7552 case SCIP_EXPR_INTPOWER:
7553 case SCIP_EXPR_SIGNPOWER:
7564 case SCIP_EXPR_SIGN:
7565 case SCIP_EXPR_PRODUCT:
7566 case SCIP_EXPR_USER:
7570 case SCIP_EXPR_QUADRATIC:
7573 case SCIP_EXPR_POLYNOMIAL:
7577 case SCIP_EXPR_PARAM:
7578 case SCIP_EXPR_LAST:
7588 for(
i = 0;
i < SCIPgetNLinearVarsNonlinear(
scip, cons); ++
i )
7590 var = SCIPgetLinearVarsNonlinear(
scip, cons)[
i];
7602 for(
i = 0;
i < SCIPexprgraphGetNodeNChildren(node); ++
i )
7604 SCIP_EXPRGRAPHNODE* child;
7606 child = SCIPexprgraphGetNodeChildren(node)[
i];
7608 if( SCIPexprgraphGetNodeOperator(child) != SCIP_EXPR_VARIDX )
7610 SCIPdebugMsg(
scip,
"not pseudoboolean because child %d is not a variable\n",
i);
7614 var = (
SCIP_VAR*)SCIPexprgraphGetNodeVar(exprgraph, child);
7625 if( upgdconsssize < 1 )
7635 lhs -= SCIPexprgraphGetNodePolynomialConstant(node);
7637 rhs -= SCIPexprgraphGetNodePolynomialConstant(node);
7640 if( objvar !=
NULL )
7644 for(
i = 0;
i < SCIPgetNLinearVarsNonlinear(
scip, cons); ++
i )
7646 var = SCIPgetLinearVarsNonlinear(
scip, cons)[
i];
7648 linvars[nlinvars++] =
var;
7652 nlinvars = SCIPgetNLinearVarsNonlinear(
scip, cons);
7655 nterms = SCIPexprgraphGetNodePolynomialNMonomials(node);
7662 SCIP_EXPRDATA_MONOMIAL* monomial;
7664 monomial = SCIPexprgraphGetNodePolynomialMonomials(node)[
i];
7667 ntermvars[
i] = SCIPexprGetMonomialNFactors(monomial);
7670 for( j = 0; j < SCIPexprGetMonomialNFactors(monomial); ++j )
7672 terms[
i][j] = (
SCIP_VAR*)SCIPexprgraphGetNodeVar(exprgraph, SCIPexprgraphGetNodeChildren(node)[SCIPexprGetMonomialChildIndices(monomial)[j]]);
7673 assert(SCIPexprGetMonomialExponents(monomial)[j] > 0.0);
7676 termvals[
i] = SCIPexprGetMonomialCoef(monomial);
7681 objvar !=
NULL ? linvars : SCIPgetLinearVarsNonlinear(
scip, cons), nlinvars, SCIPgetLinearCoefsNonlinear(
scip, cons),
7753 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
7763 assert(conshdlrdata->allconsanddatas[
c]->newvars ==
NULL);
7765 vars = conshdlrdata->allconsanddatas[
c]->vars;
7766 nvars = conshdlrdata->allconsanddatas[
c]->nvars;
7770 for( v =
nvars - 1; v > 0; --v )
7778 andcons = conshdlrdata->allconsanddatas[
c]->cons;
7789 SCIPconsGetName(conshdlrdata->allconsanddatas[
c]->cons), (
void*)(conshdlrdata->allconsanddatas[
c]),
7790 (
void*)(conshdlrdata->allconsanddatas[
c]->cons));
7811 for(
c = 0;
c < nconss; ++
c )
7830 if( !conshdlrdata->decomposenormalpbcons && !consdata->issoftcons )
7845 if( !consdata->issoftcons )
7866 assert(consdata->weight != 0);
7882 updateandconss =
FALSE;
7885 if( conshdlrdata->decomposeindicatorpbcons )
7907 updateandconss =
TRUE;
7920 for( v =
nvars - 1; v >= 0; --v )
7930 if( !updateandconss )
7954 for( v =
nvars - 1; v >= 0; --v )
7988 updateandconss =
TRUE;
8000 ub = lhs - maxact - 1;
8031 if( !updateandconss )
8047 lb = rhs - minact + 1;
8108 for(
c = (*consdata)->nconsanddatas - 1;
c >= 0; --
c )
8110 assert((*consdata)->consanddatas[
c]->nuses == 0);
8111 assert((*consdata)->consanddatas[
c]->cons ==
NULL);
8112 assert((*consdata)->consanddatas[
c]->noriguses == 0 || ((*consdata)->consanddatas[
c]->origcons !=
NULL &&
SCIPconsIsOriginal((*consdata)->consanddatas[
c]->origcons)));
8115 conshdlrdata->noriguses -= (*consdata)->nconsanddatas;
8117 assert(conshdlrdata->noriguses >= 0);
8142 assert(sourcedata->consanddatas !=
NULL || sourcedata->nconsanddatas == 0);
8148 for(
c = sourcedata->nconsanddatas - 1;
c >= 0; --
c )
8151 andconss[
c] = sourcedata->consanddatas[
c]->origcons;
8158 sourcedata->andcoefs, sourcedata->andnegs, sourcedata->nconsanddatas, sourcedata->indvar, sourcedata->weight,
8275 if( consdata->issoftcons )
8308 int firstupgradetry;
8324 oldnfixedvars = *nfixedvars;
8325 oldnaggrvars = *naggrvars;
8326 oldnchgbds = *nchgbds;
8327 oldndelconss = *ndelconss;
8328 oldnupgdconss = *nupgdconss;
8329 oldnchgcoefs = *nchgcoefs;
8330 oldnchgsides = *nchgsides;
8338 firstchange = INT_MAX;
8339 firstupgradetry = INT_MAX;
8391 andress, andcoefs, andnegs, &nandress) );
8416 if( firstchange == INT_MAX && consdata->changed )
8429 if( consdata->changed )
8442 if( firstupgradetry == INT_MAX && !consdata->upgradetried )
8443 firstupgradetry =
c;
8448 consdata->presolved =
TRUE;
8466 consdata->changed =
FALSE;
8485 else if( *nfixedvars > oldnfixedvars || *naggrvars > oldnaggrvars || *nchgbds > oldnchgbds || *ndelconss > oldndelconss
8486 || *nupgdconss > oldnupgdconss || *nchgcoefs > oldnchgcoefs || *nchgsides > oldnchgsides )
8515 lhs = consdata->lhs;
8516 rhs = consdata->rhs;
8524 SCIPdebugMsg(
scip,
"%socking constraint <%s> by [%d;%d].\n", (nlocksneg < 0) || (nlockspos < 0) ?
"Unl" :
"L",
SCIPconsGetName(cons), nlocksneg, nlockspos);
8527 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
8536 consanddata = consdata->consanddatas[
c];
8542 andcons = consanddata->
cons;
8544 if( andcons ==
NULL )
8553 consanddata->
nvars = 0;
8554 consanddata->
svars = 0;
8564 andvars = consanddata->
newvars;
8569 andvars = consanddata->
vars;
8570 nandvars = consanddata->
nvars;
8578 val = consdata->andnegs[
c] ? -consdata->andcoefs[
c] : consdata->andcoefs[
c];
8585 for( v = nandvars - 1; v >= 0; --v )
8595 for( v = nandvars - 1; v >= 0; --v )
8612 for( v = nandvars - 1; v >= 0; --v )
8622 for( v = nandvars - 1; v >= 0; --v )
8661 const char* consname;
8673 initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode, global,
8700 const char* firstcomp;
8701 const char* secondcomp;
8702 const char* lhsstrptr;
8703 const char* rhsstrptr;
8704 const char* varstrptr;
8705 char* polynomialstr;
8750 if( endptr[1] ==
'=' )
8759 if( strncmp(endptr,
"[free]", 6) == 0 )
8774 if( firstcomp ==
NULL )
8780 if( secondcomp !=
NULL )
8785 else if( strncmp(firstcomp,
"<=", 2) != 0 )
8790 else if( strncmp(endptr,
"<=", 2) != 0 )
8792 SCIPerrorMessage(
"Bad second comparator, expected ranged specification: %s", str);
8796 secondcomp = endptr;
8800 endptr += increment;
8804 if( firstcomp ==
NULL )
8816 switch( *firstcomp )
8819 assert(firstcomp[1] ==
'=');
8821 if( secondcomp !=
NULL )
8823 assert(secondcomp[0] ==
'<' && secondcomp[1] ==
'=');
8825 rhsstrptr = secondcomp + 2;
8826 varstrptr = firstcomp + 2;
8830 rhsstrptr = firstcomp + 2;
8833 assert(firstcomp[1] ==
'=');
8836 lhsstrptr = firstcomp + 2;
8839 assert(firstcomp[1] ==
'=');
8842 rhsstrptr = firstcomp + 2;
8843 lhsstrptr = firstcomp + 2;
8846 assert(strncmp(firstcomp,
"[free]", 6) == 0);
8849 endptr = firstcomp + 6;
8853 SCIPerrorMessage(
"Parsing has wrong comparator character '%c', should be one of <=>[", *firstcomp);
8862 if( lhsstrptr !=
NULL )
8866 SCIPerrorMessage(
"error parsing left hand side number from <%s>\n", lhsstrptr);
8871 if( rhsstrptr == lhsstrptr )
8876 if( rhsstrptr !=
NULL && rhsstrptr != lhsstrptr )
8880 SCIPerrorMessage(
"error parsing right hand side number from <%s>\n", lhsstrptr);
8895 if( *endptr ==
'(' )
8897 endptr = strchr(endptr + 1,
'=');
8899 if( endptr ==
NULL )
8908 if( indvar ==
NULL )
8915 endptr = strchr(endptr,
')');
8917 if( endptr ==
NULL )
8928 polynomialsize = (int)(
MAX(firstcomp, secondcomp) + 1 - varstrptr);
8930 (void)
SCIPstrncpy(polynomialstr, varstrptr, polynomialsize);
8936 polynomialsize -= (int)(endptr + 1 - polynomialstr);
8942 SCIPerrorMessage(
"no luck in parsing pseudoboolean polynomial '%s'\n", varstrptr);
8945 else if( polynomialsize >= 1 )
8947 SCIPerrorMessage(
"no completion of parsing pseudoboolean polynomial '%s'\n", varstrptr);
8964 for(
i = 0;
i < nmonomials; ++
i )
8972 for( j = 0; j < monomialnvars[
i]; ++j )
8974 if( monomialexps[
i][j] < 0.0 )
8976 SCIPerrorMessage(
"invalid exponent '%f' on variable <%s> in pseudoboolean polynomial '%s'\n", monomialexps[
i][j],
SCIPvarGetName(monomialvars[
i][j]), varstrptr);
8980 if( monomialexps[
i][j] == 0.0 )
8983 monomialvars[
i][ntermvars[
nterms]++] = monomialvars[
i][j];
8986 if( ntermvars[
nterms] > 1 )
8988 terms[
nterms] = monomialvars[
i];
8989 termvals[
nterms] = monomialcoefs[
i];
8992 else if( ntermvars[
nterms] == 1 )
8994 if( issoftcons && ( monomialvars[
i][0] == indvar ||
SCIPvarGetNegatedVar(monomialvars[
i][0]) == indvar ) )
9000 linvars[nlinvars] = monomialvars[
i][0];
9001 linvals[nlinvars] = monomialcoefs[
i];
9009 lhs -= monomialcoefs[
i];
9012 rhs -= monomialcoefs[
i];
9018 termvals, indvar, weight, issoftcons, lhs, rhs, initial,
separate, enforce, check,
propagate, local,
9019 modifiable, dynamic, removable, stickingatnode) );
9086 assert(nlinconsvars >= 0);
9089 if( nlinconsvars == 0 )
9096 else if( varssize < nlinconsvars )
9114 assert(nlinconsvars == nlinvars + nandress);
9136 for(
r = nandress - 1;
r >= 0; --
r )
9148 andcons = consanddata->
cons;
9155 if( varssize <=
nvars )
9174 if( varssize <
nvars + noperands )
9247 assert(nlinconsvars >= 0);
9250 if( nlinconsvars == 0 )
9268 assert(nlinconsvars == nlinvars + nandress);
9284 for(
r = nandress - 1;
r >= 0; --
r )
9296 andcons = consanddata->
cons;
9359 consEnfolpPseudoboolean, consEnfopsPseudoboolean, consCheckPseudoboolean, consLockPseudoboolean,
9383 "decompose every normal pseudo boolean constraint into a \"linear\" constraint and \"and\" constraints",
9387 "decompose every soft pseudo boolean constraint into \"indicator\" constraints and \"and\" constraints",
9390 "constraints/" CONSHDLR_NAME "/nlcseparate",
"should the nonlinear constraints be separated during LP processing?",
9393 "constraints/" CONSHDLR_NAME "/nlcpropagate",
"should the nonlinear constraints be propagated during node processing?",
9396 "constraints/" CONSHDLR_NAME "/nlcremovable",
"should the nonlinear constraints be removable?",
9399#ifdef NONLINCONSUPGD_PRIORITY
9469 if( conshdlr ==
NULL )
9475 if( isnan(lhs) || isnan(rhs) )
9477 SCIPerrorMessage(
"%s hand side of pseudo boolean constraint <%s> is nan\n",
9478 isnan(lhs) ?
"left" :
"right", name);
9486 SCIPerrorMessage(
"soft pseudo boolean constraint <%s> must not be modifiable because the implemented formulation requires finite activity bounds\n", name);
9492 SCIPerrorMessage(
"weight of pseudo boolean constraint <%s> is nan\n", name);
9506 assert(conshdlrdata->allconsanddatas !=
NULL);
9507 assert(conshdlrdata->nallconsanddatas <= conshdlrdata->sallconsanddatas);
9509 memisinvalid =
TRUE;
9515 for(
c = nandconss - 1;
c >= 0; --
c )
9570 newdata->
cons = andconss[
c];
9573 for( v = newdata->
nvars - 1; v >= 0; --v )
9589 if( tmpdata ==
NULL || (tmpdata->
cons != andconss[
c] && tmpdata->
origcons != andconss[
c]))
9593 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");
9597 if( conshdlrdata->nallconsanddatas == conshdlrdata->sallconsanddatas )
9602 conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas] = newdata;
9603 ++(conshdlrdata->nallconsanddatas);
9609 memisinvalid =
TRUE;
9628 newdata->noriguses = 1;
9638 memisinvalid =
FALSE;
9682 indvar, weight, issoftcons, lhs, rhs, check,
FALSE) );
9686 SCIP_CALL(
SCIPcreateCons(
scip, cons, name, conshdlr, consdata, initial,
separate, enforce, check,
propagate,
9687 local, modifiable, dynamic, removable, stickingatnode) );
9763 if( conshdlr ==
NULL )
9769 if( isnan(lhs) || isnan(rhs) )
9771 SCIPerrorMessage(
"%s hand side of pseudo boolean constraint <%s> is nan\n",
9772 isnan(lhs) ?
"left" :
"right", name);
9780 SCIPerrorMessage(
"soft pseudo boolean constraint <%s> must not be modifiable because the implemented formulation requires finite activity bounds\n", name);
9786 SCIPerrorMessage(
"weight of pseudo boolean constraint <%s> is nan\n", name);
9791 for(
c = 0;
c < nlinvars; ++
c )
9805 SCIPerrorMessage(
"pseudo boolean term with coefficient %lf without variables\n", termvals[
c]);
9833 initial, enforce, check, local, modifiable, dynamic, stickingatnode,
9834 andconss, andcoefs, andnegs, &nandconss) );
9838 for(
c = nandconss - 1;
c >= 0; --
c )
9857 &lhs, &rhs, issoftcons, initial,
separate, enforce,
FALSE,
propagate, local, modifiable, dynamic,
9858 removable, stickingatnode, &lincons, &linconstype) );
9865 indvar, weight, issoftcons, lhs, rhs, check,
FALSE) );
9875 SCIP_CALL(
SCIPcreateCons(
scip, cons, name, conshdlr, consdata, initial,
separate, enforce, check,
propagate,
9876 local, modifiable, dynamic, removable, stickingatnode) );
9908 termvals, indvar, weight, issoftcons, lhs, rhs,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
FALSE,
FALSE,
FALSE,
FALSE,
9954 switch( consdata->linconstype )
9977#ifdef WITHEQKNAPSACK
9978 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
9991 consdata->propagated =
FALSE;
9992 consdata->presolved =
FALSE;
9993 consdata->cliquesadded =
FALSE;
10026 SCIPerrorMessage(
"pseudo boolean term with coefficient %lf without variables\n", val);
10063 return consdata->indvar;
10087 return consdata->lincons;
10111 return consdata->linconstype;
10137 return consdata->nlinvars;
10171 if( *nlinvars < consdata->nlinvars )
10173 *nlinvars = consdata->nlinvars;
10188 SCIP_CALL(
getLinVarsAndAndRess(
scip, cons,
vars, coefs,
nvars, linvars, lincoefs, nlinvars,
NULL,
NULL,
NULL,
NULL) );
10204 int*
const nandconss
10228 if( *nandconss < consdata->nconsanddatas )
10230 *nandconss = consdata->nconsanddatas;
10234 *nandconss = consdata->nconsanddatas;
10235 assert(consdata->consanddatas !=
NULL || *nandconss == 0);
10239 for(
c = *nandconss - 1;
c >= 0; --
c )
10242 assert(consdata->consanddatas[
c]->istransformed ? (consdata->consanddatas[
c]->cons !=
NULL) :
TRUE);
10243 assert(consdata->consanddatas[
c]->isoriginal ? (consdata->consanddatas[
c]->origcons !=
NULL) :
TRUE);
10244 assert(consdata->consanddatas[
c]->cons !=
NULL || consdata->consanddatas[
c]->origcons !=
NULL);
10245 assert(isorig ? consdata->consanddatas[
c]->origcons !=
NULL : consdata->consanddatas[
c]->cons !=
NULL);
10247 andconss[
c] = (isorig ? consdata->consanddatas[
c]->origcons : consdata->consanddatas[
c]->cons);
10250 andcoefs[
c] = consdata->andcoefs[
c];
10279 return consdata->nconsanddatas;
10311 switch( consdata->linconstype )
10319#ifdef WITHEQKNAPSACK
10320 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
10322 SCIPerrorMessage(
"changing left hand side only allowed on standard linear constraint \n");
10359 switch( consdata->linconstype )
10367#ifdef WITHEQKNAPSACK
10368 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
10370 SCIPerrorMessage(
"changing right hand side only allowed on standard linear constraint \n");
10403 return consdata->lhs;
10428 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_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