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
201 unsigned int issoftcons:1;
202 unsigned int changed:1;
203 unsigned int propagated:1;
204 unsigned int presolved:1;
205 unsigned int cliquesadded:1;
206 unsigned int upgradetried:1;
210struct SCIP_ConshdlrData
214 int nallconsanddatas;
216 int sallconsanddatas;
224 SCIP_Bool decomposenormalpbcons;
225 SCIP_Bool decomposeindicatorpbcons;
259 if( varind1 == -1 && varind2 == -1 )
265 if( varind1 < varind2 )
267 if( varind1 > varind2 )
270 if( varneg1 && !varneg2 )
272 if( !varneg1 && varneg2 )
301 consand1 = consanddata1->
cons;
302 consand2 = consanddata2->
cons;
360 for( v = cdata1->
nvars - 1; v > 0; --v )
363 for( v = cdata2->
nvars - 1; v > 0; --v )
376 for( v = cdata1->
nvars - 1; v >= 0; --v )
382 if( cdata1->
vars[v] != cdata2->
vars[v] )
412 for( v = cdata->
nvars - 1; v > 0; --v )
420 assert(minidx >= 0 && minidx <= maxidx);
434 if( ((*conshdlrdata)->inithashmapandtable) )
448 hashGetKeyAndConsDatas, hashKeyEqAndConsDatas, hashKeyValAndConsDatas, (
void*)
scip) );
454 (*conshdlrdata)->inithashmapandtable =
TRUE;
471 (*conshdlrdata)->allconsanddatas =
NULL;
472 (*conshdlrdata)->nallconsanddatas = 0;
473 (*conshdlrdata)->sallconsanddatas = 10;
478 (*conshdlrdata)->inithashmapandtable =
FALSE;
479 (*conshdlrdata)->hashtable =
NULL;
480 (*conshdlrdata)->hashtablesize = 0;
481 (*conshdlrdata)->hashmap =
NULL;
482 (*conshdlrdata)->hashmapsize = 0;
485 (*conshdlrdata)->nlinconss = 0;
488 (*conshdlrdata)->noriguses = 0;
504 assert((*conshdlrdata)->nallconsanddatas == 0);
507 if( (*conshdlrdata)->inithashmapandtable )
510 (*conshdlrdata)->hashmapsize = 0;
512 (*conshdlrdata)->hashtablesize = 0;
519 (*conshdlrdata)->inithashmapandtable =
FALSE;
524 (*conshdlrdata)->allconsanddatas =
NULL;
525 (*conshdlrdata)->nallconsanddatas = 0;
526 (*conshdlrdata)->sallconsanddatas = 0;
562 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
563 *
nvars = SCIPgetNVarsEQKnapsack(
scip, cons);
625 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
626 *lhs = SCIPgetCapacityEQKnapsack(
scip, cons);
646 SCIP_Real*
const coefs,
672 for( v = 0; v < *
nvars; ++v )
674 vars[v] = linvars[v];
675 coefs[v] = lincoefs[v];
680 for( v = 0; v < *
nvars; ++v )
681 vars[v] = linvars[v];
693 for( v = 0; v < *
nvars; ++v )
695 vars[v] = linvars[v];
701 for( v = 0; v < *
nvars; ++v )
702 vars[v] = linvars[v];
708 SCIP_Longint* weights;
718 for( v = 0; v < *
nvars; ++v )
720 vars[v] = linvars[v];
726 for( v = 0; v < *
nvars; ++v )
727 vars[v] = linvars[v];
739 for( v = 0; v < *
nvars; ++v )
741 vars[v] = linvars[v];
747 for( v = 0; v < *
nvars; ++v )
748 vars[v] = linvars[v];
753 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
755 SCIP_Longint* weights;
757 *
nvars = SCIPgetNVarsEQKnapsack(
scip, cons);
758 linvars = SCIPgetVarsEQKnapsack(
scip, cons);
763 weights = SCIPgetWeightsEQKnapsack(
scip, cons);
765 for( v = 0; v < *
nvars; ++v )
767 vars[v] = linvars[v];
773 for( v = 0; v < *
nvars; ++v )
774 vars[v] = linvars[v];
795 SCIP_Real*
const coefs,
798 SCIP_Real*
const lincoefs,
802 SCIP_Real*
const andcoefs,
804 SCIP_Bool*
const andnegs,
822 if( nlinvars !=
NULL )
824 if( nandress !=
NULL )
834 for( v = 0; v <
nvars; ++v )
836 SCIP_Bool hashmapentryexists;
846 hashmapentryexists =
SCIPhashmapExists(conshdlrdata->hashmap, (
void*)(hashmapvar));
849 hashmapvar =
vars[v];
854 if( hashmapentryexists )
863 if( hashmapentryexists )
871 if( !hashmapentryexists && linvars !=
NULL && nlinvars !=
NULL )
873 linvars[*nlinvars] =
vars[v];
874 if( lincoefs !=
NULL )
877 lincoefs[*nlinvars] = coefs[v];
881 else if( hashmapentryexists && nandress !=
NULL )
883 if( andress !=
NULL )
885 andress[*nandress] = hashmapvar;
887 if( andcoefs !=
NULL )
891 andcoefs[*nandress] = coefs[v];
892 andnegs[*nandress] = (
vars[v] != hashmapvar);
903#ifdef CHECK_CONSISTENCY
922 SCIP_Bool* alreadyfound;
943 assert(consdata->nconsanddatas > 0);
944 assert(consdata->nconsanddatas <= consdata->sconsanddatas);
956 assert(
nvars == consdata->nlinvars + consdata->nconsanddatas);
974 andress, andcoefs, andnegs, &nandress) );
975 assert(nlinvars == consdata->nlinvars);
976 assert(nandress == consdata->nconsanddatas);
978 for( v = nandress - 1; v >= 0; --v )
980 SCIP_VAR* andresultant = andress[v];
983 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
986 if( consdata->consanddatas[
c]->cons !=
NULL )
991 if( res == andresultant && consdata->andnegs[
c] == andnegs[v] && consdata->andcoefs[
c] == andcoefs[v] )
998 alreadyfound[
c] =
TRUE;
1007 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
1023#define checkConsConsistency(scip, cons)
1048 tmpvars = consanddata->
vars;
1049 ntmpvars = consanddata->
nvars;
1052 for( v = ntmpvars - 1; v >= 0; --v )
1062 tmpvars = consanddata->
newvars;
1066 for( v = ntmpvars - 1; v >= 0; --v )
1077 if( !origdata || consanddata->
nvars == 0 )
1082 consanddata->
nuses = 0;
1083 consanddata->
nvars = 0;
1084 consanddata->
svars = 0;
1099 if( consanddata->
nvars > 0 )
1110 if( conshdlrdata->inithashmapandtable )
1142 if( conshdlrdata->inithashmapandtable )
1169 SCIP_Real*
const andcoefs,
1170 SCIP_Bool*
const andnegs,
1171 int const nandconss,
1173 SCIP_Real
const weight,
1174 SCIP_Bool
const issoftcons,
1181 SCIP_Bool transforming
1184 SCIP_Bool transformed;
1191 assert(nandconss == 0 || (andconss !=
NULL && andcoefs !=
NULL));
1209 SCIPerrorMessage(
"left hand side of pseudo boolean constraint greater than right hand side\n");
1220 (*consdata)->issoftcons = issoftcons;
1223 (*consdata)->weight = weight;
1229 (*consdata)->indvar = indvar;
1232 (*consdata)->indvar =
NULL;
1235 if( intvar !=
NULL )
1242 (*consdata)->intvar = intvar;
1245 (*consdata)->intvar =
NULL;
1248 (*consdata)->lincons = lincons;
1249 (*consdata)->linconstype = linconstype;
1261 if( transforming || transformed )
1271 (*consdata)->nlinvars =
nvars - nandconss;
1282 if( andnegs !=
NULL )
1290 (*consdata)->nconsanddatas = nandconss;
1291 (*consdata)->sconsanddatas = nandconss;
1301 for(
c = nandconss - 1;
c >= 0; --
c )
1310 assert((*consdata)->consanddatas[
c]->origcons == andconss[
c] || (*consdata)->consanddatas[
c]->cons == andconss[
c]);
1315 if( (*consdata)->consanddatas[
c]->origcons !=
NULL && (*consdata)->consanddatas[
c]->cons ==
NULL )
1325 assert((*consdata)->consanddatas[
c]->cons !=
NULL);
1326 assert((*consdata)->consanddatas[
c]->newvars ==
NULL);
1327 assert((*consdata)->consanddatas[
c]->isoriginal);
1329 (*consdata)->consanddatas[
c]->istransformed =
TRUE;
1331 vars = (*consdata)->consanddatas[
c]->vars;
1332 ncvars = (*consdata)->consanddatas[
c]->nvars;
1342 for( v = ncvars - 1; v >= 0; --v )
1347 else if( (*consdata)->consanddatas[
c]->cons !=
NULL )
1348 assert((*consdata)->consanddatas[
c]->istransformed);
1350 ++((*consdata)->consanddatas[
c]->nuses);
1352 else if( transformed )
1354 assert((*consdata)->consanddatas[
c]->cons == andconss[
c]);
1356 assert((*consdata)->consanddatas[
c]->istransformed);
1361 SCIPsortPtrPtrRealBool((
void**)andress, (
void**)((*consdata)->consanddatas), (*consdata)->andcoefs, (*consdata)->andnegs, resvarComp, nandconss);
1368 (*consdata)->consanddatas =
NULL;
1369 (*consdata)->andcoefs =
NULL;
1370 (*consdata)->andnegs =
NULL;
1371 (*consdata)->nconsanddatas = 0;
1372 (*consdata)->sconsanddatas = 0;
1376 (*consdata)->lhs = lhs;
1377 (*consdata)->rhs = rhs;
1379 (*consdata)->changed =
TRUE;
1380 (*consdata)->propagated =
FALSE;
1381 (*consdata)->presolved =
FALSE;
1382 (*consdata)->cliquesadded =
FALSE;
1383 (*consdata)->upgradetried =
TRUE;
1392 conshdlrdata->noriguses += (*consdata)->nconsanddatas;
1414 assert((*consdata)->nconsanddatas == 0 || (*consdata)->consanddatas !=
NULL);
1418 if( (*consdata)->lincons !=
NULL )
1423 nconsanddatas = (*consdata)->nconsanddatas;
1424 consanddatas = (*consdata)->consanddatas;
1427 for(
c = nconsanddatas - 1;
c >= 0; --
c )
1429 assert((consanddatas[
c]->origcons ==
NULL) == (consanddatas[
c]->noriguses == 0));
1430 assert((consanddatas[
c]->cons ==
NULL) == (consanddatas[
c]->nuses == 0));
1431 assert(consanddatas[
c]->nuses >= 0);
1432 assert(consanddatas[
c]->noriguses >= 0);
1436 if( !isorig && consanddatas[
c]->cons !=
NULL )
1440 --(consanddatas[
c]->
nuses);
1443 if( consanddatas[
c]->nuses == 0 )
1445 if( conshdlrdata->inithashmapandtable )
1451 if( consanddatas[
c]->origcons ==
NULL )
1463 if( consanddatas[
c]->origcons ==
NULL )
1467 assert(conshdlrdata->nallconsanddatas > 0);
1469 for( d = conshdlrdata->nallconsanddatas - 1; d >= 0; --d )
1471 if( conshdlrdata->allconsanddatas[d] == consanddatas[
c] )
1473 --conshdlrdata->nallconsanddatas;
1477 conshdlrdata->allconsanddatas[d] = conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas];
1487 else if( isorig && consanddatas[
c]->origcons !=
NULL )
1490 assert(consanddatas[
c]->nuses == 0);
1491 assert(consanddatas[
c]->nnewvars == 0);
1492 assert(consanddatas[
c]->snewvars == 0);
1498 if( consanddatas[
c]->noriguses == 0 )
1502 if( conshdlrdata->inithashmapandtable )
1517 assert(consanddatas[
c]->svars > 0);
1521 consanddatas[
c]->
nvars = 0;
1522 consanddatas[
c]->
svars = 0;
1527 assert(consanddatas[
c]->svars == 0);
1534 assert(conshdlrdata->nallconsanddatas > 0);
1535 for( d = conshdlrdata->nallconsanddatas - 1; d >= 0; --d )
1537 if( conshdlrdata->allconsanddatas[d] == consanddatas[
c] )
1539 --conshdlrdata->nallconsanddatas;
1543 conshdlrdata->allconsanddatas[d] = conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas];
1554 assert(!consanddatas[
c]->istransformed);
1559 if( consanddatas[
c]->nuses == 0 && consanddatas[
c]->istransformed )
1564 else if( consanddatas[
c]->nuses == 0 )
1570 assert(consanddatas[
c]->nnewvars == 0);
1571 assert(consanddatas[
c]->snewvars == 0);
1574 tmpvars = consanddatas[
c]->
vars;
1575 ntmpvars = consanddatas[
c]->
nvars;
1578 for( v = ntmpvars - 1; v >= 0; --v )
1587 if( !consanddatas[
c]->istransformed && consanddatas[
c]->noriguses > 0 )
1590 assert(consanddatas[
c]->nuses == 0);
1591 assert(consanddatas[
c]->nnewvars == 0);
1592 assert(consanddatas[
c]->snewvars == 0);
1595 assert(consanddatas[
c]->svars > 0);
1598 assert(consanddatas[
c]->isoriginal);
1604 if( conshdlrdata->inithashmapandtable )
1653 SCIP_Real
const coef,
1654 SCIP_Real
const lhs,
1698 for( v =
nvars - 1; v >= 0; --v )
1705 for( v =
nvars - 1; v >= 0; --v )
1722 SCIP_Real
const coef,
1723 SCIP_Real
const lhs,
1761 for( v =
nvars - 1; v >= 0; --v )
1768 for( v =
nvars - 1; v >= 0; --v )
1799 SCIP_Real* monomialcoefs;
1822 assert(consdata->nlinvars + consdata->nconsanddatas >=
nvars);
1850 for( v = 0; v <
nvars; ++v )
1863 assert(!consdata->issoftcons ||
var != consdata->indvar);
1866 if( consanddata !=
NULL )
1880 if( consanddata ==
NULL )
1884 monomialvars[nmonomials] =
vars + v;
1885 monomialnvars[nmonomials] = 1;
1889 SCIP_Bool fixed = nandvars == 0;
1890 SCIP_Bool negated =
var !=
vars[v];
1892 if( fixed != negated )
1908 monomialvars[nmonomials] = andvars;
1910 monomialnvars[nmonomials] = nandvars;
1914 monomialcoefs[nmonomials] = coefs[v];
1943 if( consdata->issoftcons )
1961 SCIP_Bool
const initial,
1963 SCIP_Bool
const enforce,
1966 SCIP_Bool
const check,
1969 SCIP_Bool
const local,
1972 SCIP_Bool
const modifiable,
1975 SCIP_Bool
const dynamic,
1978 SCIP_Bool
const stickingatnode,
1991 SCIP_Bool removable;
1992 SCIP_Bool transformed;
2028 if( tmpdata !=
NULL )
2036 *andcons = tmpdata->
cons;
2080#ifdef SCIP_DISABLED_CODE
2081#ifdef WITH_DEBUG_SOLUTION
2082 if( SCIPdebugIsMainscip(
scip) )
2085 SCIP_Real debugsolval;
2088 for( v =
nvars - 1; v >= 0; --v )
2096 val = ((val < 0.5) ? 0.0 : 1.0);
2101 SCIPerrorMessage(
"computed solution value %g for resultant <%s> violates debug solution value %g\n", val,
SCIPvarGetName(resultant), debugsolval);
2123 local, modifiable, dynamic, removable, stickingatnode) );
2135 if( conshdlrdata->nallconsanddatas == conshdlrdata->sallconsanddatas )
2141 conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas] = newdata;
2142 ++(conshdlrdata->nallconsanddatas);
2148 newdata->
cons = newcons;
2155 for( v = newdata->
nvars - 1; v >= 0; --v )
2230 if( consdata->nconsanddatas == consdata->sconsanddatas )
2240 ++(consdata->nconsanddatas);
2243 switch( consdata->linconstype )
2266#ifdef WITHEQKNAPSACK
2267 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
2271 SCIP_CALL( SCIPaddCoefEQKnapsack(
scip, consdata->lincons, res, (SCIP_Longint) val) );
2284 consdata->changed =
TRUE;
2285 consdata->propagated =
FALSE;
2286 consdata->presolved =
FALSE;
2287 consdata->cliquesadded =
FALSE;
2288 consdata->upgradetried =
FALSE;
2310 SCIPerrorMessage(
"changing left hand side only allowed on standard lienar constraint \n");
2312#ifdef WITHEQKNAPSACK
2313 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
2341 SCIPerrorMessage(
"changing left hand side only allowed on standard lienar constraint \n");
2343#ifdef WITHEQKNAPSACK
2344 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
2368 SCIP_Real* lincoefs;
2371 SCIP_Real* andcoefs;
2416 SCIP_CALL(
getLinVarsAndAndRess(
scip, cons,
vars, coefs,
nvars, linvars, lincoefs, &nlinvars, andress, andcoefs, andnegs, &nandress) );
2417 assert(consdata->nconsanddatas == nandress);
2433 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2438 consanddata = consdata->consanddatas[
c];
2441 andcons = consanddata->
cons;
2446 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2451 for( v = nandvars - 1; v >= 0; --v )
2458 for( v = nandvars - 1; v >= 0; --v )
2468 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2473 consanddata = consdata->consanddatas[
c];
2476 andcons = consanddata->
cons;
2481 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2486 for( v = nandvars - 1; v >= 0; --v )
2493 for( v = nandvars - 1; v >= 0; --v )
2505 consdata->propagated =
FALSE;
2510 consdata->lhs = lhs;
2511 consdata->presolved =
FALSE;
2512 consdata->changed =
TRUE;
2539 SCIP_Real* lincoefs;
2542 SCIP_Real* andcoefs;
2587 SCIP_CALL(
getLinVarsAndAndRess(
scip, cons,
vars, coefs,
nvars, linvars, lincoefs, &nlinvars, andress, andcoefs, andnegs, &nandress) );
2588 assert(consdata->nconsanddatas == nandress);
2604 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2609 consanddata = consdata->consanddatas[
c];
2612 andcons = consanddata->
cons;
2617 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2622 for( v = nandvars - 1; v >= 0; --v )
2629 for( v = nandvars - 1; v >= 0; --v )
2639 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2644 consanddata = consdata->consanddatas[
c];
2647 andcons = consanddata->
cons;
2652 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2657 for( v = nandvars - 1; v >= 0; --v )
2664 for( v = nandvars - 1; v >= 0; --v )
2676 consdata->propagated =
FALSE;
2681 consdata->rhs = rhs;
2682 consdata->presolved =
FALSE;
2683 consdata->changed =
TRUE;
2703 SCIP_Real*
const termcoefs,
2705 int const*
const ntermvars,
2706 SCIP_Bool
const initial,
2708 SCIP_Bool
const enforce,
2711 SCIP_Bool
const check,
2714 SCIP_Bool
const local,
2717 SCIP_Bool
const modifiable,
2720 SCIP_Bool
const dynamic,
2723 SCIP_Bool
const stickingatnode,
2728 SCIP_Real*
const andvals,
2729 SCIP_Bool*
const andnegs,
2748 for( t = 0; t <
nterms; ++t )
2753 initial, enforce, check, local, modifiable, dynamic, stickingatnode,
2754 &(andconss[*nandconss])) );
2756 andvals[*nandconss] = termcoefs[t];
2757 andnegs[*nandconss] =
FALSE;
2772 SCIP_Real*
const linvals,
2775 SCIP_Real
const*
const andvals,
2776 SCIP_Bool*
const andnegs,
2777 SCIP_Real*
const lhs,
2778 SCIP_Real*
const rhs,
2779 SCIP_Bool
const issoftcons,
2780 SCIP_Bool
const initial,
2782 SCIP_Bool
const separate,
2784 SCIP_Bool
const enforce,
2787 SCIP_Bool
const check,
2792 SCIP_Bool
const local,
2795 SCIP_Bool
const modifiable,
2798 SCIP_Bool
const dynamic,
2801 SCIP_Bool
const removable,
2804 SCIP_Bool
const stickingatnode,
2833 assert(nlinvars > 0 || nandress > 0);
2843 ++(conshdlrdata->nlinconss);
2859 nvars = nlinvars + nandress;
2862 for( v = nlinvars - 1; v >= 0; --v )
2892 for( v = nandress - 1; v >= 0; --v )
2920 SCIPdebugMsg(
scip,
"While creating the linear constraint of the pseudoboolean constraint we found %d zero coefficients that were removed\n", nzero);
2938 if( upgrconshdlr !=
NULL &&
nvars > 2 && ncoeffspone + ncoeffsnone ==
nvars
2954 for( v = 0; v < nlinvars; ++v )
2956 if( mult * linvals[v] > 0.0 )
2957 transvars[v] = linvars[v];
2966 for( v = 0; v < nandress; ++v )
2968 if( mult * andvals[v] > 0.0 )
2969 transvars[nlinvars + v] = andress[v];
2981 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3010 if( upgrconshdlr !=
NULL && !created && ncoeffspone + ncoeffsnone ==
nvars )
3017 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a set partitioning constraint\n");
3020 mult =
SCIPisEQ(
scip, *lhs, 1.0 - ncoeffsnone) ? +1 : -1;
3026 for( v = 0; v < nlinvars; ++v )
3028 if( mult * linvals[v] > 0.0 )
3029 transvars[v] = linvars[v];
3038 for( v = 0; v < nandress; ++v )
3040 if( mult * andvals[v] > 0.0 )
3041 transvars[nlinvars + v] = andress[v];
3053 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3067 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a set packing constraint\n");
3076 for( v = 0; v < nlinvars; ++v )
3078 if( mult * linvals[v] > 0.0 )
3079 transvars[v] = linvars[v];
3088 for( v = 0; v < nandress; ++v )
3090 if( mult * andvals[v] > 0.0 )
3091 transvars[nlinvars + v] = andress[v];
3103 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3121 SCIPwarningMessage(
scip,
"Does not expect this, because this constraint should be a set packing constraint.\n");
3125 SCIPwarningMessage(
scip,
"Does not expect this, because this constraint should be a logicor constraint.\n");
3128 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a set covering constraint\n");
3137 for( v = 0; v < nlinvars; ++v )
3139 if( mult * linvals[v] > 0.0 )
3140 transvars[v] = linvars[v];
3149 for( v = 0; v < nandress; ++v )
3151 if( mult * andvals[v] > 0.0 )
3152 transvars[nlinvars + v] = andress[v];
3164 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3187 SCIP_Longint* weights;
3188 SCIP_Longint capacity;
3189 SCIP_Longint weight;
3192 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a knapsack constraint\n");
3213 for( v = 0; v < nlinvars; ++v )
3219 transvars[v] = linvars[v];
3220 weights[v] = weight;
3225 weights[v] = -weight;
3231 for( v = 0; v < nandress; ++v )
3237 transvars[nlinvars + v] = andress[v];
3238 weights[nlinvars + v] = weight;
3244 weights[nlinvars + v] = -weight;
3252 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3264#ifdef WITHEQKNAPSACK
3273 if( upgrconshdlr !=
NULL && !created && (ncoeffspone + ncoeffsnone + ncoeffspint + ncoeffsnint ==
nvars) &&
SCIPisEQ(
scip, *lhs, *rhs) )
3276 SCIP_Longint* weights;
3277 SCIP_Longint capacity;
3278 SCIP_Longint weight;
3283 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a equality-knapsack constraint\n");
3301 for( v = 0; v < nlinvars; ++v )
3307 transvars[v] = linvars[v];
3308 weights[v] = weight;
3313 weights[v] = -weight;
3319 for( v = 0; v < nandress; ++v )
3325 transvars[nlinvars + v] = andress[v];
3326 weights[nlinvars + v] = weight;
3332 weights[nlinvars + v] = -weight;
3339 SCIP_CALL( SCIPcreateConsEqKnapsack(
scip, &cons, name,
nvars, transvars, weights, capacity,
3340 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3343 (*linconstype) = SCIP_LINEARCONSTYPE_EQKNAPSACK;
3362 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3367 for( v = 0; v < nandress; ++v )
3401 SCIP_Bool*
const violated,
3402 SCIP_Bool
const printreason
3459 assert(consdata->nlinvars + consdata->nconsanddatas >=
nvars);
3471 for( v = 0; v <
nvars; ++v )
3482 if( consanddata !=
NULL )
3490 if( consanddata ==
NULL )
3501 if( andcons ==
NULL )
3502 andcons = consanddata->
cons;
3512 for(
i = 0;
i < nandvars; ++
i )
3516 solval = 1.0 - solval;
3520 activity += coefs[v] * solval;
3523 SCIPdebugMsg(
scip,
"lhs = %g, activity = %g, rhs = %g\n", lhs, activity, rhs);
3526 lhsviol = lhs - activity;
3527 rhsviol = activity - rhs;
3529 if(lhsviol > rhsviol)
3588 SCIP_Bool*
const violated
3608 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
3611 SCIP_Real minsolval;
3612 SCIP_Real sumsolval;
3615 if( !conshdlrdata->allconsanddatas[
c]->istransformed )
3618 andcons = conshdlrdata->allconsanddatas[
c]->cons;
3621 if( andcons ==
NULL )
3632 for( v =
nvars - 1; v >= 0; --v )
3636 if( solval < minsolval )
3639 sumsolval += solval;
3646 viol =
MAX3(0.0, solval - minsolval, sumsolval - (
nvars - 1.0 + solval));
3671 SCIP*
const targetscip,
3673 SCIP*
const sourcescip,
3680 SCIP_Bool
const initial,
3681 SCIP_Bool
const separate,
3682 SCIP_Bool
const enforce,
3683 SCIP_Bool
const check,
3685 SCIP_Bool
const local,
3686 SCIP_Bool
const modifiable,
3687 SCIP_Bool
const dynamic,
3688 SCIP_Bool
const removable,
3689 SCIP_Bool
const stickingatnode,
3691 SCIP_Bool
const global,
3692 SCIP_Bool*
const valid
3711 sourcelincons = sourceconsdata->lincons;
3720 SCIP_Real* targetandcoefs;
3721 int ntargetandconss;
3724 targetlinconstype = sourceconsdata->linconstype;
3726 switch( targetlinconstype )
3744#ifdef WITHEQKNAPSACK
3745 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
3756 if( conshdlrlinear ==
NULL )
3762 targetlincons =
NULL;
3782 targetandconss =
NULL;
3783 targetandcoefs =
NULL;
3784 ntargetandconss = 0;
3790 int nsourceandconss;
3793 SCIP_Real* targetlincoefs;
3799 nsourceandconss = sourceconsdata->nconsanddatas;
3814 targetlinvars, targetlincoefs, &ntargetlinvars) );
3821 SCIPvarIsHashkeyEq, SCIPvarGetHashkeyVal,
NULL) );
3823 for(
c = 0 ;
c < ntargetlinvars; ++
c )
3832 for(
c = 0 ;
c < nsourceandconss; ++
c )
3839 consanddata = sourceconsdata->consanddatas[
c];
3853 targetandconss[ntargetandconss] =
NULL;
3865 targetandcoefs[ntargetandconss] = sourceconsdata->andcoefs[
c];
3871 assert(ntargetandconss <= ntargetlinvars);
3876 SCIP_Real targetrhs;
3877 SCIP_Real targetlhs;
3881 const char* consname;
3884 assert(sourceconsdata->issoftcons == (sourceconsdata->indvar !=
NULL));
3885 indvar = sourceconsdata->indvar;
3886 intvar = sourceconsdata->intvar;
3889 if( indvar !=
NULL )
3919 targetlincons, targetlinconstype, targetandconss, targetandcoefs, ntargetandconss,
3920 indvar, sourceconsdata->weight, sourceconsdata->issoftcons, intvar, targetlhs, targetrhs,
3921 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3931 if( targetlincons !=
NULL )
3937 if( targetandconss !=
NULL )
3941 assert(ntargetandconss <= sourceconsdata->nconsanddatas);
3943 for(
c = 0 ;
c < ntargetandconss; ++
c )
3945 if( targetandconss[
c] !=
NULL )
3976 allconsanddatas = conshdlrdata->allconsanddatas;
3978 assert(conshdlrdata->nallconsanddatas >= 0);
3979 assert(conshdlrdata->nallconsanddatas <= conshdlrdata->sallconsanddatas);
3981 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
3990 consanddata = allconsanddatas[
c];
3995 if( consanddata->
nuses == 0 )
4013 cons = consanddata->
cons;
4036 for( v =
nvars - 1; v > 0; --v )
4039 for( v = nnewvars - 1; v > 0; --v )
4044 if(
nvars == nnewvars )
4051 for( v =
nvars - 1; v >= 0; --v )
4053 if(
vars[v] != newvars[v] )
4065 if( nnewvars > consanddata->
snewvars )
4075 for( v = consanddata->
nnewvars - 1; v >= 0; --v )
4093 SCIP_Real
const coef,
4094 SCIP_Real
const lhs,
4121 SCIP_Real
const coef,
4122 SCIP_Real
const lhs,
4148 SCIP_Real
const newlhs,
4149 SCIP_Real
const newrhs,
4151 SCIP_Real*
const andcoefs,
4152 SCIP_Bool*
const andnegs,
4157 int nnewconsanddatas;
4158 int snewconsanddatas;
4159 SCIP_Real* newandcoefs;
4160 SCIP_Real* oldandcoefs;
4161 SCIP_Bool* newandnegs;
4162 SCIP_Bool* oldandnegs;
4183 SCIPsortPtrRealBool((
void**)(consdata->consanddatas), consdata->andcoefs, consdata->andnegs, resvarCompWithInactive, consdata->nconsanddatas);
4188 consanddatas = consdata->consanddatas;
4189 oldandcoefs = consdata->andcoefs;
4190 oldandnegs = consdata->andnegs;
4191 nconsanddatas = consdata->nconsanddatas;
4192 assert(nconsanddatas == 0 || (consanddatas !=
NULL && oldandcoefs !=
NULL));
4194 snewconsanddatas = nconsanddatas + nandress;
4201 nnewconsanddatas = 0;
4204 for(
c = 0, c1 = 0;
c < nconsanddatas && c1 < nandress; )
4214 if( !consanddatas[
c]->istransformed )
4217 consdata->changed =
TRUE;
4218 consdata->upgradetried =
FALSE;
4222 andcons = consanddatas[
c]->
cons;
4225 if( andcons ==
NULL )
4228 consdata->changed =
TRUE;
4229 consdata->upgradetried =
FALSE;
4236 oldandnegs[
c] ? -oldandcoefs[
c] : oldandcoefs[
c], consdata->lhs, consdata->rhs) );
4238 consdata->changed =
TRUE;
4239 consdata->upgradetried =
FALSE;
4255 compval = resvarComp((
void*)res1, (
void*)res2);
4261 assert(consanddatas[
c]->nuses > 0);
4262 --(consanddatas[
c]->
nuses);
4266 consdata->lhs, consdata->rhs) );
4268 consdata->changed =
TRUE;
4269 consdata->upgradetried =
FALSE;
4270 consdata->propagated =
FALSE;
4271 consdata->presolved =
FALSE;
4273 else if( compval == +1 )
4278 newandcoefs[nnewconsanddatas] = andcoefs[c1];
4279 newandnegs[nnewconsanddatas] = andnegs[c1];
4280 ++(newconsanddatas[nnewconsanddatas]->
nuses);
4284 -newandcoefs[nnewconsanddatas] : newandcoefs[nnewconsanddatas], newlhs, newrhs) );
4286 consdata->changed =
TRUE;
4287 consdata->upgradetried =
FALSE;
4288 consdata->cliquesadded =
FALSE;
4289 consdata->propagated =
FALSE;
4290 consdata->presolved =
FALSE;
4296 SCIP_Bool coefsignchanged;
4297 SCIP_Bool lhschanged;
4298 SCIP_Bool rhschanged;
4305 newconsanddatas[nnewconsanddatas] = consanddatas[
c];
4307 newandcoefs[nnewconsanddatas] = andcoefs[c1];
4308 newandnegs[nnewconsanddatas] = andnegs[c1];
4310 if( ((oldandnegs[
c] == andnegs[c1]) && !
SCIPisEQ(
scip, oldandcoefs[
c], newandcoefs[c1]))
4311 || ((oldandnegs[
c] != newandnegs[c1]) && !
SCIPisEQ(
scip, oldandcoefs[
c], -newandcoefs[c1])) )
4312 consdata->upgradetried =
FALSE;
4314 coefsignchanged = (oldandnegs[
c] == andnegs[c1]) &&
4315 ((oldandcoefs[
c] < 0 && andcoefs[c1] > 0) || (oldandcoefs[
c] > 0 && andcoefs[c1] < 0));
4316 coefsignchanged = coefsignchanged || ((oldandnegs[
c] != andnegs[c1]) &&
4317 ((oldandcoefs[
c] < 0 && andcoefs[c1] < 0) || (oldandcoefs[
c] > 0 && andcoefs[c1] > 0)));
4319 || (consdata->lhs < 0 && newlhs > 0) || (consdata->lhs > 0 && newlhs < 0);
4321 || (consdata->rhs < 0 && newrhs > 0) || (consdata->rhs > 0 && newrhs < 0);
4324 if( coefsignchanged || lhschanged || rhschanged || newconsanddatas[nnewconsanddatas]->nnewvars > 0)
4328 -oldandcoefs[
c] : oldandcoefs[
c], consdata->lhs, consdata->rhs) );
4330 -newandcoefs[nnewconsanddatas] : newandcoefs[nnewconsanddatas], newlhs, newrhs) );
4332 consdata->changed =
TRUE;
4333 consdata->upgradetried =
FALSE;
4334 consdata->cliquesadded =
FALSE;
4335 consdata->propagated =
FALSE;
4336 consdata->presolved =
FALSE;
4346 if(
c < nconsanddatas )
4350 for( ;
c < nconsanddatas; ++
c )
4358 andcons = consanddatas[
c]->
cons;
4360 if( andcons !=
NULL )
4367 if( andcons ==
NULL )
4369 consdata->changed =
TRUE;
4370 consdata->upgradetried =
FALSE;
4374 assert(consanddatas[
c]->nuses > 0);
4375 --(consanddatas[
c]->
nuses);
4379 consdata->lhs, consdata->rhs) );
4380 consdata->changed =
TRUE;
4381 consdata->upgradetried =
FALSE;
4382 consdata->propagated =
FALSE;
4383 consdata->presolved =
FALSE;
4386 else if( c1 < nandress )
4388 for( ; c1 < nandress; ++c1 )
4396 newandcoefs[nnewconsanddatas] = andcoefs[c1];
4397 newandnegs[nnewconsanddatas] = andnegs[c1];
4398 ++(newconsanddatas[nnewconsanddatas]->
nuses);
4402 -newandcoefs[nnewconsanddatas] : newandcoefs[nnewconsanddatas], newlhs, newrhs) );
4405 consdata->changed =
TRUE;
4406 consdata->upgradetried =
FALSE;
4407 consdata->cliquesadded =
FALSE;
4408 consdata->propagated =
FALSE;
4409 consdata->presolved =
FALSE;
4412 assert(
c == nconsanddatas && c1 == nandress);
4421 consdata->upgradetried =
FALSE;
4422 consdata->lhs = newlhs;
4423 consdata->rhs = newrhs;
4426 consdata->consanddatas = newconsanddatas;
4427 consdata->andcoefs = newandcoefs;
4428 consdata->andnegs = newandnegs;
4429 consdata->nconsanddatas = nnewconsanddatas;
4430 consdata->sconsanddatas = snewconsanddatas;
4432 oldnvars = consdata->nlinvars;
4435 consdata->nlinvars -= nnewconsanddatas;
4437 if( oldnvars != consdata->nlinvars )
4439 consdata->changed =
TRUE;
4440 consdata->upgradetried =
FALSE;
4441 consdata->cliquesadded =
FALSE;
4442 consdata->propagated =
FALSE;
4443 consdata->presolved =
FALSE;
4447 consanddatas = consdata->consanddatas;
4448 nconsanddatas = consdata->nconsanddatas;
4449 assert(nconsanddatas == 0 || consanddatas !=
NULL);
4452 for(
c = nconsanddatas - 1;
c > 0; --
c )
4483 if( resind1 == -1 && resind2 == -1 )
4489 if( resind1 <= resind2 )
4491 assert(resind1 == resind2);
4507 int*
const naggrvars,
4536 assert(consdata->nconsanddatas > 0);
4539 if( consdata->cliquesadded )
4542 consdata->cliquesadded =
TRUE;
4551 assert(consdata->nconsanddatas > 0);
4552 assert(consdata->nconsanddatas <= consdata->sconsanddatas);
4556 assert(
nvars == consdata->nlinvars + consdata->nconsanddatas);
4571 assert(nandress == consdata->nconsanddatas);
4575 for(
c = nandress - 1;
c >= 0; --
c )
4581 consanddata = consdata->consanddatas[
c];
4589 andvars = consanddata->
newvars;
4594 andvars = consanddata->
vars;
4595 nandvars = consanddata->
nvars;
4598 for( v1 = nandvars - 1; v1 >= 0; --v1 )
4601 SCIP_Bool values[2];
4616 for( v2 = nlinvars - 1; v2 >= 0; --v2 )
4646 if( values[0] != values[1] && var1 == var2 )
4652 clqvars[0] = andres;
4663 *nchgbds += nchgbdslocal;
4695 clqvars[0] = andres;
4706 *nchgbds += nchgbdslocal;
4726 for(
c = nandress - 1;
c > 0; --
c )
4735 consanddata1 = consdata->consanddatas[
c];
4737 consanddata2 = consdata->consanddatas[
c - 1];
4746 andvars1 = consanddata1->
newvars;
4747 nandvars1 = consanddata1->
nnewvars;
4751 andvars1 = consanddata1->
vars;
4752 nandvars1 = consanddata1->
nvars;
4758 andvars2 = consanddata2->
newvars;
4759 nandvars2 = consanddata2->
nnewvars;
4763 andvars2 = consanddata2->
vars;
4764 nandvars2 = consanddata2->
nvars;
4768 for( v1 = nandvars1 - 1; v1 >= 0; --v1 )
4771 SCIP_Bool values[2];
4773 var1 = andvars1[v1];
4786 for( v2 = nandvars2 - 1; v2 >= 0; --v2 )
4790 var2 = andvars2[v2];
4816 if( values[0] != values[1] && var1 == var2 )
4822 clqvars[0] = andres;
4823 clqvars[1] = andres2;
4832 *nchgbds += nchgbdslocal;
4865 clqvars[0] = andres;
4876 *nchgbds += nchgbdslocal;
4933 if( consdata->propagated )
4937 consdata->propagated =
TRUE;
4960 consanddatas = consdata->consanddatas;
4961 nconsanddatas = consdata->nconsanddatas;
4962 assert(nconsanddatas == 0 || consanddatas !=
NULL);
4968 for(
c = nconsanddatas - 1;
c >= 0; --
c )
4974 if( !consanddatas[
c]->istransformed )
4977 andcons = consanddatas[
c]->
cons;
4998 SCIP_Real* activescalars;
4999 SCIP_Real activeconstant;
5008 if( conshdlrdata->nallconsanddatas == 0 )
5011 allconsanddatas = conshdlrdata->allconsanddatas;
5013 assert(conshdlrdata->nallconsanddatas >= 1);
5014 assert(conshdlrdata->nallconsanddatas <= conshdlrdata->sallconsanddatas);
5016 if( nfixedvars >= 1 &&
nvars >= 1 )
5024 activescalars =
NULL;
5027 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
5034 consanddata = allconsanddatas[
c];
5052 if( consanddata->
nvars == 0 )
5069 consanddata->
nuses = 0;
5084 if( consanddata->
nuses == 0 )
5086 SCIP_Bool looseorcolumn;
5115 SCIP_Bool del =
TRUE;
5121 for(
w = 0;
w < nfixedvars && del; ++
w )
5130 activevars[0] = fixedvars[
w];
5131 activescalars[0] = 1.0;
5132 activeconstant = 0.0;
5135 &activeconstant, &requiredsize,
TRUE) );
5138 for(
i = 0;
i < nactivevars && del; ++
i )
5142 if( activevars[
i] == resvar )
5156 if( !looseorcolumn )
5178 cons = consanddata->
cons;
5193 consanddata->
nuses = 0;
5211 tmpvars = consanddata->
vars;
5213 for( v = consanddata->
nvars - 1; v >= 0; --v )
5221 tmpvars = consanddata->
vars;
5222 stmpvars = consanddata->
svars;
5226 consanddata->
newvars = tmpvars;
5232 if( activevars !=
NULL )
5268 consanddatas = consdata->consanddatas;
5269 nconsanddatas = consdata->nconsanddatas;
5270 assert(nconsanddatas > 0 && consanddatas !=
NULL);
5274 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5278 consanddata = consanddatas[
c];
5288 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5292 consanddata = consanddatas[
c];
5294 assert(consanddatas[
c]->istransformed);
5298 if( consanddata->
nuses > 0 )
5299 --(consanddata->
nuses);
5302 if( consanddata->
nuses == 0 )
5306 SCIP_Bool looseorcolumn;
5337 if( !looseorcolumn )
5358 consdata->nconsanddatas = 0;
5377 SCIP_Bool*
const values,
5381 SCIP_Real*
const lincoefs,
5383 SCIP_Real
const constant,
5384 SCIP_Real
const side,
5386 SCIP_Real*
const consanddatacoefs,
5387 SCIP_Bool*
const consanddatanegs,
5388 int const nconsanddatas,
5415 assert(nconsanddatas > 0);
5416 assert(*xortype >= -1 && *xortype <= 1);
5419 SCIPsortPtr((
void**)linvars, SCIPvarCompActiveAndNegated, nlinvars);
5423 for( v = nlinvars - 1; v >= 0; --v )
5428 value += lincoefs[v];
5443 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5445 SCIP_Bool val =
TRUE;
5447 consanddata = consanddatas[
c];
5454 termvars = consanddata->
newvars;
5459 termvars = consanddata->
vars;
5460 ntermvars = consanddata->
nvars;
5468 SCIPsortPtrBool((
void**)repvars, negated, SCIPvarCompActiveAndNegated, ntermvars);
5470 for( v = ntermvars - 1; v >= 0; --v )
5479 if( (negated[v] && values[pos]) || (!negated[v] && !values[pos]) )
5495 if( val != consanddatanegs[
c] )
5496 value += consanddatacoefs[
c];
5502 if( *xortype == -1 )
5510 else if( *xortype == 1 && cnt % 2 == 0 )
5512 else if( *xortype == 0 && cnt % 2 == 1 )
5518 if( *xortype == -1 )
5526 else if( *xortype == 1 && cnt % 2 == 1 )
5528 else if( *xortype == 0 && cnt % 2 == 0 )
5549 int*
const ndelconss,
5550 int*
const naddconss,
5551 int*
const nfixedvars,
5552 int*
const nchgcoefs,
5553 int*
const nchgsides,
5562 SCIP_Real* allcoefs;
5565 SCIP_Real* lincoefs;
5567 SCIP_Real* andcoefs;
5601 consanddatas = consdata->consanddatas;
5602 andcoefs = consdata->andcoefs;
5603 andnegs = consdata->andnegs;
5604 nconsanddatas = consdata->nconsanddatas;
5605 assert(nconsanddatas > 0 && consanddatas !=
NULL);
5617 lincons = consdata->lincons;
5621 assert(nallvars - nconsanddatas == consdata->nlinvars);
5622 nlinvars = consdata->nlinvars;
5644 assert(nlinvars == consdata->nlinvars);
5645 assert(nandress == nallvars-nlinvars);
5656 firstnlinvars = nlinvars;
5659 SCIPsortPtr((
void**)linvars, SCIPvarCompActiveAndNegated, nlinvars);
5661 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5663 consanddata = consanddatas[
c];
5689 oldnlinvars = nlinvars;
5692 for( v =
nvars - 1, v1 = nlinvars - 1; v >= 0 && v1 >= 0; )
5712 linvars[nlinvars] =
var;
5734 for( ; v >= 0; --v )
5749 linvars[nlinvars] =
var;
5758 if( nlinvars > oldnlinvars )
5761 SCIPsortPtr((
void**)linvars, SCIPvarCompActiveAndNegated, nlinvars);
5769 for( v = (1 << nlinvars) - 1; v >= 0; --v )
5772 for( v1 = nlinvars - 1; v1 >= 0; --v1 )
5785 consdata->lhs, consanddatas, andcoefs, andnegs, nconsanddatas, cnt, &xortype) );
5792 assert(xortype >= -1 && xortype <= 1);
5840 int*
const ndelconss,
5841 int*
const naddconss,
5842 int*
const nfixedvars,
5843 int*
const nchgcoefs,
5844 int*
const nchgsides,
5872 consanddatas = consdata->consanddatas;
5873 nconsanddatas = consdata->nconsanddatas;
5874 assert(nconsanddatas > 0 && consanddatas !=
NULL);
5882 if( nconsanddatas == 1 )
5886 SCIP_Real* allcoefs;
5889 SCIP_Real* lincoefs;
5902 if( consdata->nlinvars == 0 )
5914 lincons = consdata->lincons;
5916 consanddata = consanddatas[0];
5945 assert(nallvars == consdata->nlinvars + 1);
5947 nlinvars = consdata->nlinvars;
5962 assert(nlinvars == consdata->nlinvars);
5965 for( v = 0; v < nlinvars; ++v )
5971 for( v = 0; v <
nvars; ++v )
6003 c = nconsanddatas - 1;
6004 assert(consanddatas[
c]->istransformed);
6007 if( consanddatas[
c]->nnewvars > 0 )
6015 neqvars = consanddatas[
c]->
nvars;
6025 for( v = neqvars - 1; v > 0; --v )
6029 for( --
c ;
c >= 0; --
c )
6036 consanddata = consanddatas[
c];
6038 assert(consanddatas[
c]->istransformed);
6055 for( v =
nvars - 1; v > 0; --v )
6060 if(
nvars < nminvars )
6063 else if(
nvars > nmaxvars )
6066 assert(nminvars <= nmaxvars);
6069 for( v = 0, v2 = 0; v < neqvars && v2 <
nvars; )
6080 if( index1 < index2 )
6082 else if( index1 > index2 )
6086 assert(index1 == index2);
6089 if( nneweqvars < v )
6090 eqvars[nneweqvars] = eqvars[v];
6096 neqvars = nneweqvars;
6101 if( nminvars > neqvars + 1 )
6143 if( neqvars > 0 && consdata->nlinvars == 0 )
6145 SCIP_Bool infeasible;
6149 for( v = 0; v < neqvars; ++v )
6166 if( nminvars == neqvars )
6178 if( neqvars > 0 && nminvars == nmaxvars && nminvars == neqvars + 1 )
6189 lincons = consdata->lincons;
6201 for(
c = nconsanddatas - 1;
c >= 0; --
c )
6207 consanddata = consanddatas[
c];
6209 assert(consanddatas[
c]->istransformed);
6224 for( v = 0, v2 = 0; v < neqvars && v2 <
nvars; )
6235 assert(index1 >= index2);
6237 if( index1 > index2 )
6244 assert(index1 == index2);
6254 for( ; v2 <
nvars; ++v2)
6266 if( consdata->nlinvars > 0 )
6272 SCIP_Real* lincoefs;
6276 for( v = 0; v < neqvars; ++v )
6283 assert(
nvars == consdata->nlinvars + consdata->nconsanddatas);
6297 for( v = 0; v <
nvars; ++v )
6303 assert(nlinvars == consdata->nlinvars);
6306 for( v = 0; v < nlinvars; ++v )
6352 int*
const ndelconss,
6353 int*
const naddconss,
6354 int*
const nfixedvars,
6355 int*
const nchgcoefs,
6356 int*
const nchgsides,
6385 consanddatas = consdata->consanddatas;
6386 nconsanddatas = consdata->nconsanddatas;
6387 assert(nconsanddatas > 0 && consanddatas !=
NULL);
6409 if( nconsanddatas == 1 )
6412 if( consdata->nlinvars == 0 )
6441 if( consdata->nlinvars > 0 )
6446 assert(consdata->nlinvars == 0 && nconsanddatas > 1);
6448 c = nconsanddatas - 1;
6449 assert(consanddatas[
c]->istransformed);
6452 if( consanddatas[
c]->nnewvars > 0 )
6460 neqvars = consanddatas[
c]->
nvars;
6470 for( v = neqvars - 1; v > 0; --v )
6474 for( --
c ;
c >= 0; --
c )
6481 consanddata = consanddatas[
c];
6483 assert(consanddatas[
c]->istransformed);
6500 for( v =
nvars - 1; v > 0; --v )
6505 if(
nvars < nminvars )
6508 else if(
nvars > nmaxvars )
6511 assert(nminvars <= nmaxvars);
6514 for( v = 0, v2 = 0; v < neqvars && v2 <
nvars; )
6525 if( index1 < index2 )
6527 else if( index1 > index2 )
6531 assert(index1 == index2);
6534 if( nneweqvars < v )
6535 eqvars[nneweqvars] = eqvars[v];
6541 neqvars = nneweqvars;
6583 if( neqvars > 0 && ((nminvars == nmaxvars && nminvars == neqvars + 1) || (nminvars == neqvars) || (type ==
SCIP_SETPPCTYPE_PARTITIONING)) )
6590 SCIP_Bool infeasible;
6592 SCIP_Bool createcons;
6593 SCIP_Bool deletecons;
6613 if( neqvars == nminvars )
6616 createcons = (
SCIPisLE(
scip, lhs, rhs) && ((nminvars == nmaxvars && nminvars == neqvars + 1) || (nminvars == neqvars)));
6621 lincons = consdata->lincons;
6639 for(
c = nconsanddatas - 1;
c >= 0; --
c )
6645 consanddata = consanddatas[
c];
6647 assert(consanddatas[
c]->istransformed);
6663 if( deletecons && neqvars + 1 <
nvars )
6682 for( v = 0, v2 = 0; v < neqvars && v2 <
nvars; )
6693 assert(index1 >= index2);
6695 if( index1 > index2 )
6702 else if( deletecons )
6719 assert(index1 == index2);
6730 for( ; v2 <
nvars; ++v2)
6736 else if( deletecons )
6757 for( v = 0; v < neqvars; ++v )
6828 int*
const ndelconss,
6829 int*
const naddconss,
6830 int*
const nfixedvars,
6831 int*
const nchgcoefs,
6832 int*
const nchgsides,
6857 consanddatas = consdata->consanddatas;
6858 assert(consdata->nconsanddatas == 0 || consanddatas !=
NULL);
6862 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(nconsanddatas == 0 || consanddatas !=
NULL);
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 )
7159 SCIP_Real* conscoefs;
7171 assert(nconsvars == consdata->nlinvars + nconsanddatas);
7176 for( v = 0; v < nconsvars; ++v )
7195 SCIP_Bool redundant;
7196 SCIP_Bool infeasible;
7197 SCIP_Bool aggregated;
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)
7260 SCIP_Real* conscoefs;
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 )
7373 SCIP_Real* tmpvals =
NULL;
7375 SCIP_Real constant = 0.0;
7418 if( consdata->intvar !=
NULL )
7420 vars[0] = consdata->intvar;
7444 for(
i = 0;
i < tmpnvars; ++
i )
7445 vals[
i] = tmpvals[
i];
7450 for(
i = 0;
i < tmpnvars; ++
i )
7456 for(
i = 0;
i < tmpnvars; ++
i )
7462 for(
i = 0;
i < tmpnvars; ++
i )
7473 for(
i = 0;
i < tmpnvars; ++
i )
7486 for(
c = 0;
c < consdata->nconsanddatas; ++
c )
7493 tmpnvars = consdata->consanddatas[
c]->nvars;
7494 for(
i = 0;
i < tmpnvars; ++
i )
7495 vars[
i] = consdata->consanddatas[
c]->vars[
i];
7496 for(
i = 0;
i < tmpnvars; ++
i )
7518#ifdef NONLINCONSUPGD_PRIORITY
7524 SCIP_EXPRGRAPH* exprgraph;
7525 SCIP_EXPRGRAPHNODE* node;
7535 SCIP_Real* termvals;
7544 node = SCIPgetExprgraphNodeNonlinear(
scip, cons);
7550 switch( SCIPexprgraphGetNodeOperator(node) )
7552 case SCIP_EXPR_VARIDX:
7553 case SCIP_EXPR_CONST:
7554 case SCIP_EXPR_PLUS:
7555 case SCIP_EXPR_MINUS:
7557 case SCIP_EXPR_LINEAR:
7563 case SCIP_EXPR_SQUARE:
7564 case SCIP_EXPR_SQRT:
7565 case SCIP_EXPR_REALPOWER:
7566 case SCIP_EXPR_INTPOWER:
7567 case SCIP_EXPR_SIGNPOWER:
7578 case SCIP_EXPR_SIGN:
7579 case SCIP_EXPR_PRODUCT:
7580 case SCIP_EXPR_USER:
7584 case SCIP_EXPR_QUADRATIC:
7587 case SCIP_EXPR_POLYNOMIAL:
7591 case SCIP_EXPR_PARAM:
7592 case SCIP_EXPR_LAST:
7602 for(
i = 0;
i < SCIPgetNLinearVarsNonlinear(
scip, cons); ++
i )
7604 var = SCIPgetLinearVarsNonlinear(
scip, cons)[
i];
7616 for(
i = 0;
i < SCIPexprgraphGetNodeNChildren(node); ++
i )
7618 SCIP_EXPRGRAPHNODE* child;
7620 child = SCIPexprgraphGetNodeChildren(node)[
i];
7622 if( SCIPexprgraphGetNodeOperator(child) != SCIP_EXPR_VARIDX )
7624 SCIPdebugMsg(
scip,
"not pseudoboolean because child %d is not a variable\n",
i);
7628 var = (
SCIP_VAR*)SCIPexprgraphGetNodeVar(exprgraph, child);
7639 if( upgdconsssize < 1 )
7649 lhs -= SCIPexprgraphGetNodePolynomialConstant(node);
7651 rhs -= SCIPexprgraphGetNodePolynomialConstant(node);
7654 if( objvar !=
NULL )
7658 for(
i = 0;
i < SCIPgetNLinearVarsNonlinear(
scip, cons); ++
i )
7660 var = SCIPgetLinearVarsNonlinear(
scip, cons)[
i];
7662 linvars[nlinvars++] =
var;
7666 nlinvars = SCIPgetNLinearVarsNonlinear(
scip, cons);
7669 nterms = SCIPexprgraphGetNodePolynomialNMonomials(node);
7676 SCIP_EXPRDATA_MONOMIAL* monomial;
7678 monomial = SCIPexprgraphGetNodePolynomialMonomials(node)[
i];
7681 ntermvars[
i] = SCIPexprGetMonomialNFactors(monomial);
7684 for( j = 0; j < SCIPexprGetMonomialNFactors(monomial); ++j )
7686 terms[
i][j] = (
SCIP_VAR*)SCIPexprgraphGetNodeVar(exprgraph, SCIPexprgraphGetNodeChildren(node)[SCIPexprGetMonomialChildIndices(monomial)[j]]);
7687 assert(SCIPexprGetMonomialExponents(monomial)[j] > 0.0);
7690 termvals[
i] = SCIPexprGetMonomialCoef(monomial);
7695 objvar !=
NULL ? linvars : SCIPgetLinearVarsNonlinear(
scip, cons), nlinvars, SCIPgetLinearCoefsNonlinear(
scip, cons),
7767 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
7777 assert(conshdlrdata->allconsanddatas[
c]->newvars ==
NULL);
7779 vars = conshdlrdata->allconsanddatas[
c]->vars;
7780 nvars = conshdlrdata->allconsanddatas[
c]->nvars;
7784 for( v =
nvars - 1; v > 0; --v )
7792 andcons = conshdlrdata->allconsanddatas[
c]->cons;
7803 SCIPconsGetName(conshdlrdata->allconsanddatas[
c]->cons), (
void*)(conshdlrdata->allconsanddatas[
c]),
7804 (
void*)(conshdlrdata->allconsanddatas[
c]->cons));
7825 for(
c = 0;
c < nconss; ++
c )
7845 if( !conshdlrdata->decomposenormalpbcons && !consdata->issoftcons )
7860 if( !consdata->issoftcons )
7878 SCIP_Bool updateandconss;
7881 assert(consdata->weight != 0);
7897 updateandconss =
FALSE;
7900 if( conshdlrdata->decomposeindicatorpbcons )
7922 updateandconss =
TRUE;
7935 for( v =
nvars - 1; v >= 0; --v )
7945 if( !updateandconss )
7969 for( v =
nvars - 1; v >= 0; --v )
8003 updateandconss =
TRUE;
8015 ub = lhs - maxact - 1;
8046 if( !updateandconss )
8062 lb = rhs - minact + 1;
8123 for(
c = (*consdata)->nconsanddatas - 1;
c >= 0; --
c )
8125 assert((*consdata)->consanddatas[
c]->nuses == 0);
8126 assert((*consdata)->consanddatas[
c]->cons ==
NULL);
8127 assert((*consdata)->consanddatas[
c]->noriguses == 0 || ((*consdata)->consanddatas[
c]->origcons !=
NULL &&
SCIPconsIsOriginal((*consdata)->consanddatas[
c]->origcons)));
8130 conshdlrdata->noriguses -= (*consdata)->nconsanddatas;
8132 assert(conshdlrdata->noriguses >= 0);
8159 assert(sourcedata->nconsanddatas == 0 || sourcedata->consanddatas !=
NULL);
8165 for(
c = sourcedata->nconsanddatas - 1;
c >= 0; --
c )
8168 andconss[
c] = sourcedata->consanddatas[
c]->origcons;
8175 andconss, sourcedata->andcoefs, sourcedata->andnegs, sourcedata->nconsanddatas, sourcedata->indvar, sourcedata->weight,
8176 sourcedata->issoftcons, sourcedata->intvar, sourcedata->lhs, sourcedata->rhs,
SCIPconsIsChecked(sourcecons),
8293 if( consdata->issoftcons )
8326 int firstupgradetry;
8342 oldnfixedvars = *nfixedvars;
8343 oldnaggrvars = *naggrvars;
8344 oldnchgbds = *nchgbds;
8345 oldndelconss = *ndelconss;
8346 oldnupgdconss = *nupgdconss;
8347 oldnchgcoefs = *nchgcoefs;
8348 oldnchgsides = *nchgsides;
8356 firstchange = INT_MAX;
8357 firstupgradetry = INT_MAX;
8368 SCIP_Real* lincoefs;
8371 SCIP_Real* andcoefs;
8409 andress, andcoefs, andnegs, &nandress) );
8434 if( firstchange == INT_MAX && consdata->changed )
8447 if( consdata->changed )
8460 if( firstupgradetry == INT_MAX && !consdata->upgradetried )
8461 firstupgradetry =
c;
8466 consdata->presolved =
TRUE;
8484 consdata->changed =
FALSE;
8503 else if( *nfixedvars > oldnfixedvars || *naggrvars > oldnaggrvars || *nchgbds > oldnchgbds || *ndelconss > oldndelconss
8504 || *nupgdconss > oldnupgdconss || *nchgcoefs > oldnchgcoefs || *nchgsides > oldnchgsides )
8533 lhs = consdata->lhs;
8534 rhs = consdata->rhs;
8542 SCIPdebugMsg(
scip,
"%socking constraint <%s> by [%d;%d].\n", (nlocksneg < 0) || (nlockspos < 0) ?
"Unl" :
"L",
SCIPconsGetName(cons), nlocksneg, nlockspos);
8545 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
8554 consanddata = consdata->consanddatas[
c];
8560 andcons = consanddata->
cons;
8562 if( andcons ==
NULL )
8571 consanddata->
nvars = 0;
8572 consanddata->
svars = 0;
8582 andvars = consanddata->
newvars;
8587 andvars = consanddata->
vars;
8588 nandvars = consanddata->
nvars;
8595 val = consdata->andnegs[
c] ? -consdata->andcoefs[
c] : consdata->andcoefs[
c];
8602 for( v = nandvars - 1; v >= 0; --v )
8612 for( v = nandvars - 1; v >= 0; --v )
8629 for( v = nandvars - 1; v >= 0; --v )
8639 for( v = nandvars - 1; v >= 0; --v )
8678 const char* consname;
8690 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode, global,
8708 SCIP_Real** monomialexps;
8709 SCIP_Real* monomialcoefs;
8710 SCIP_Real* termvals;
8715 SCIP_Bool issoftcons;
8717 const char* firstcomp;
8718 const char* secondcomp;
8719 const char* lhsstrptr;
8720 const char* rhsstrptr;
8721 const char* varstrptr;
8722 char* polynomialstr;
8757 SCIP_Bool found =
FALSE;
8767 if( endptr[1] ==
'=' )
8776 if( strncmp(endptr,
"[free]", 6) == 0 )
8791 if( firstcomp ==
NULL )
8797 if( secondcomp !=
NULL )
8802 else if( strncmp(firstcomp,
"<=", 2) != 0 )
8807 else if( strncmp(endptr,
"<=", 2) != 0 )
8809 SCIPerrorMessage(
"Bad second comparator, expected ranged specification: %s", str);
8813 secondcomp = endptr;
8817 endptr += increment;
8821 if( firstcomp ==
NULL )
8833 switch( *firstcomp )
8836 assert(firstcomp[1] ==
'=');
8838 if( secondcomp !=
NULL )
8840 assert(secondcomp[0] ==
'<' && secondcomp[1] ==
'=');
8842 rhsstrptr = secondcomp + 2;
8843 varstrptr = firstcomp + 2;
8847 rhsstrptr = firstcomp + 2;
8850 assert(firstcomp[1] ==
'=');
8853 lhsstrptr = firstcomp + 2;
8856 assert(firstcomp[1] ==
'=');
8859 rhsstrptr = firstcomp + 2;
8860 lhsstrptr = firstcomp + 2;
8863 assert(strncmp(firstcomp,
"[free]", 6) == 0);
8866 endptr = firstcomp + 6;
8870 SCIPerrorMessage(
"Parsing has wrong comparator character '%c', should be one of <=>[", *firstcomp);
8879 if( lhsstrptr !=
NULL )
8883 SCIPerrorMessage(
"error parsing left hand side number from <%s>\n", lhsstrptr);
8888 if( rhsstrptr == lhsstrptr )
8893 if( rhsstrptr !=
NULL && rhsstrptr != lhsstrptr )
8897 SCIPerrorMessage(
"error parsing right hand side number from <%s>\n", lhsstrptr);
8912 if( *endptr ==
'(' )
8914 endptr = strchr(endptr + 1,
'=');
8916 if( endptr ==
NULL )
8925 if( indvar ==
NULL )
8932 endptr = strchr(endptr,
')');
8934 if( endptr ==
NULL )
8945 polynomialsize = (int)(
MAX(firstcomp, secondcomp) + 1 - varstrptr);
8947 (void)
SCIPstrncpy(polynomialstr, varstrptr, polynomialsize);
8953 polynomialsize -= (int)(endptr + 1 - polynomialstr);
8959 SCIPerrorMessage(
"no luck in parsing pseudoboolean polynomial '%s'\n", varstrptr);
8962 else if( polynomialsize >= 1 )
8964 SCIPerrorMessage(
"no completion of parsing pseudoboolean polynomial '%s'\n", varstrptr);
8981 for(
i = 0;
i < nmonomials; ++
i )
8989 for( j = 0; j < monomialnvars[
i]; ++j )
8991 if( monomialexps[
i][j] < 0.0 )
8993 SCIPerrorMessage(
"invalid exponent '%f' on variable <%s> in pseudoboolean polynomial '%s'\n", monomialexps[
i][j],
SCIPvarGetName(monomialvars[
i][j]), varstrptr);
8997 if( monomialexps[
i][j] == 0.0 )
9000 monomialvars[
i][ntermvars[
nterms]++] = monomialvars[
i][j];
9003 if( ntermvars[
nterms] > 1 )
9005 terms[
nterms] = monomialvars[
i];
9006 termvals[
nterms] = monomialcoefs[
i];
9009 else if( ntermvars[
nterms] == 1 )
9011 if( issoftcons && ( monomialvars[
i][0] == indvar ||
SCIPvarGetNegatedVar(monomialvars[
i][0]) == indvar ) )
9017 linvars[nlinvars] = monomialvars[
i][0];
9018 linvals[nlinvars] = monomialcoefs[
i];
9026 lhs -= monomialcoefs[
i];
9029 rhs -= monomialcoefs[
i];
9034 SCIP_CALL(
SCIPcreateConsPseudoboolean(
scip, cons, name, linvars, nlinvars, linvals, terms,
nterms, ntermvars, termvals, indvar, weight, issoftcons,
NULL, lhs, rhs, initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
9063 SCIP_Bool transformed;
9101 assert(nlinconsvars >= 0);
9104 if( nlinconsvars == 0 )
9111 else if( varssize < nlinconsvars )
9129 assert(nlinconsvars == nlinvars + nandress);
9151 for(
r = nandress - 1;
r >= 0; --
r )
9163 andcons = consanddata->
cons;
9170 if( varssize <=
nvars )
9189 if( varssize <
nvars + noperands )
9229 SCIP_Bool transformed;
9262 assert(nlinconsvars >= 0);
9265 if( nlinconsvars == 0 )
9283 assert(nlinconsvars == nlinvars + nandress);
9299 for(
r = nandress - 1;
r >= 0; --
r )
9311 andcons = consanddata->
cons;
9374 consEnfolpPseudoboolean, consEnfopsPseudoboolean, consCheckPseudoboolean, consLockPseudoboolean,
9398 "decompose every normal pseudo boolean constraint into a \"linear\" constraint and \"and\" constraints",
9402 "decompose every soft pseudo boolean constraint into \"indicator\" constraints and \"and\" constraints",
9405 "constraints/" CONSHDLR_NAME "/nlcseparate",
"should the nonlinear constraints be separated during LP processing?",
9408 "constraints/" CONSHDLR_NAME "/nlcpropagate",
"should the nonlinear constraints be propagated during node processing?",
9411 "constraints/" CONSHDLR_NAME "/nlcremovable",
"should the nonlinear constraints be removable?",
9414#ifdef NONLINCONSUPGD_PRIORITY
9433 SCIP_Real* andcoefs,
9437 SCIP_Bool issoftcons,
9455 SCIP_Bool modifiable,
9461 SCIP_Bool removable,
9463 SCIP_Bool stickingatnode
9475 SCIP_Bool memisinvalid;
9476 SCIP_Bool transformed;
9484 assert(nandconss == 0 || (andconss !=
NULL && andcoefs !=
NULL));
9487 if( intvar !=
NULL )
9490 SCIPerrorMessage(
"intvar currently not supported by pseudo boolean constraint handler\n");
9496 if( conshdlr ==
NULL )
9511 assert(conshdlrdata->allconsanddatas !=
NULL);
9512 assert(conshdlrdata->nallconsanddatas <= conshdlrdata->sallconsanddatas);
9514 memisinvalid =
TRUE;
9520 for(
c = nandconss - 1;
c >= 0; --
c )
9575 newdata->
cons = andconss[
c];
9578 for( v = newdata->
nvars - 1; v >= 0; --v )
9594 if( tmpdata ==
NULL || (tmpdata->
cons != andconss[
c] && tmpdata->
origcons != andconss[
c]))
9598 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");
9602 if( conshdlrdata->nallconsanddatas == conshdlrdata->sallconsanddatas )
9607 conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas] = newdata;
9608 ++(conshdlrdata->nallconsanddatas);
9614 memisinvalid =
TRUE;
9630 newdata->noriguses = 1;
9640 memisinvalid =
FALSE;
9684 indvar, weight, issoftcons, intvar, lhs, rhs, check,
FALSE) );
9688 SCIP_CALL(
SCIPcreateCons(
scip, cons, name, conshdlr, consdata, initial, separate, enforce, check,
propagate,
9689 local, modifiable, dynamic, removable, stickingatnode) );
9713 SCIP_Real* termvals,
9716 SCIP_Bool issoftcons,
9734 SCIP_Bool modifiable,
9740 SCIP_Bool removable,
9742 SCIP_Bool stickingatnode
9752 SCIP_Real* andcoefs;
9765 if( intvar !=
NULL )
9768 SCIPerrorMessage(
"intvar currently not supported by pseudo boolean constraint handler\n");
9774 if( conshdlr ==
NULL )
9780 if( modifiable && issoftcons )
9802 initial, enforce, check, local, modifiable, dynamic, stickingatnode,
9803 andconss, andcoefs, andnegs, &nandconss) );
9807 for(
c = nandconss - 1;
c >= 0; --
c )
9826 &lhs, &rhs, issoftcons, initial, separate, enforce,
FALSE,
propagate, local, modifiable, dynamic,
9827 removable, stickingatnode, &lincons, &linconstype) );
9834 indvar, weight, issoftcons, intvar, lhs, rhs, check,
FALSE) );
9844 SCIP_CALL(
SCIPcreateCons(
scip, cons, name, conshdlr, consdata, initial, separate, enforce, check,
propagate,
9845 local, modifiable, dynamic, removable, stickingatnode) );
9870 SCIP_Real* termvals,
9873 SCIP_Bool issoftcons,
9882 terms,
nterms, ntermvars, termvals, indvar, weight, issoftcons, intvar, lhs, rhs,
9921 switch( consdata->linconstype )
9944#ifdef WITHEQKNAPSACK
9945 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
9949 SCIP_CALL( SCIPaddCoefEQKnapsack(
scip, consdata->lincons,
var, (SCIP_Longint) val) );
9958 consdata->propagated =
FALSE;
9959 consdata->presolved =
FALSE;
9960 consdata->cliquesadded =
FALSE;
10017 return consdata->indvar;
10041 return consdata->lincons;
10065 return consdata->linconstype;
10091 return consdata->nlinvars;
10099 SCIP_Real*
const lincoefs,
10127 if( *nlinvars < consdata->nlinvars )
10129 *nlinvars = consdata->nlinvars;
10144 SCIP_CALL(
getLinVarsAndAndRess(
scip, cons,
vars, coefs,
nvars, linvars, lincoefs, nlinvars,
NULL,
NULL,
NULL,
NULL) );
10159 SCIP_Real*
const andcoefs,
10160 int*
const nandconss
10171 assert(*nandconss == 0 || andconss !=
NULL);
10172 assert(*nandconss == 0 || andcoefs !=
NULL);
10186 if( *nandconss < consdata->nconsanddatas )
10188 *nandconss = consdata->nconsanddatas;
10192 *nandconss = consdata->nconsanddatas;
10193 assert(*nandconss == 0 || consdata->consanddatas !=
NULL);
10197 for(
c = *nandconss - 1;
c >= 0; --
c )
10200 assert(consdata->consanddatas[
c]->istransformed ? (consdata->consanddatas[
c]->cons !=
NULL) :
TRUE);
10201 assert(consdata->consanddatas[
c]->isoriginal ? (consdata->consanddatas[
c]->origcons !=
NULL) :
TRUE);
10202 assert(consdata->consanddatas[
c]->cons !=
NULL || consdata->consanddatas[
c]->origcons !=
NULL);
10203 assert(isorig ? consdata->consanddatas[
c]->origcons !=
NULL : consdata->consanddatas[
c]->cons !=
NULL);
10205 andconss[
c] = (isorig ? consdata->consanddatas[
c]->origcons : consdata->consanddatas[
c]->cons);
10208 andcoefs[
c] = consdata->andcoefs[
c];
10237 return consdata->nconsanddatas;
10250 SCIP_Real
const lhs
10269 switch( consdata->linconstype )
10277#ifdef WITHEQKNAPSACK
10278 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
10280 SCIPerrorMessage(
"changing left hand side only allowed on standard linear constraint \n");
10301 SCIP_Real
const rhs
10317 switch( consdata->linconstype )
10325#ifdef WITHEQKNAPSACK
10326 case SCIP_LINEARCONSTYPE_EQKNAPSACK:
10328 SCIPerrorMessage(
"changing right hand side only allowed on standard linear constraint \n");
10361 return consdata->lhs;
10386 return consdata->rhs;
Constraint handler for AND constraints, .
constraint handler for indicator constraints
Constraint handler for knapsack constraints of the form , x binary and .
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
#define CONSHDLR_NEEDSCONS
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)
#define CONSHDLR_CHECKPRIORITY
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)
static SCIP_RETCODE chgRhsLinearCons(SCIP *const scip, SCIP_CONS *const cons, SCIP_LINEARCONSTYPE const constype, SCIP_Real const rhs)
#define CONSHDLR_MAXPREROUNDS
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)
#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)
#define NONLINCONSUPGD_PRIORITY
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 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_VAR *const intvar, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool check, SCIP_Bool transforming)
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)
#define CONSHDLR_PRESOLTIMING
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)
#define CONSHDLR_EAGERFREQ
static SCIP_RETCODE chgLhsLinearCons(SCIP *const scip, SCIP_CONS *const cons, SCIP_LINEARCONSTYPE const constype, SCIP_Real const lhs)
#define CONSHDLR_ENFOPRIORITY
#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)
#define SCIP_DECL_NONLINCONSUPGD(x)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetRhsLinear(SCIP *scip, SCIP_CONS *cons)
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)
SCIP_RETCODE SCIPchgAndConsCheckFlagWhenUpgr(SCIP *scip, SCIP_CONS *cons, SCIP_Bool flag)
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_RETCODE SCIPchgAndConsRemovableFlagWhenUpgr(SCIP *scip, SCIP_CONS *cons, SCIP_Bool flag)
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_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 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_VAR *intvar, SCIP_Real lhs, SCIP_Real rhs)
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 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_VAR *intvar, 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 SCIPchgLhsLinear(SCIP *scip, SCIP_CONS *cons, SCIP_Real lhs)
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_VAR *intvar, 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_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)
int SCIPconsGetNUpgradeLocks(SCIP_CONS *cons)
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)
#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 SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
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 SCIPchgVarBranchPriority(SCIP *scip, SCIP_VAR *var, int branchpriority)
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
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_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_RETCODE SCIPcreateVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
SCIP_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_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)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
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
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)
#define SCIP_DECL_CONSGETVARS(x)
#define SCIP_DECL_CONSPRINT(x)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
#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)
#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)
#define SCIP_DECL_SORTPTRCOMP(x)
#define SCIP_DECL_HASHKEYEQ(x)
#define SCIP_DECL_HASHGETKEY(x)
#define SCIP_DECL_HASHKEYVAL(x)
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_STAGE_TRANSFORMING
enum SYM_Symtype SYM_SYMTYPE
@ SYM_CONSOPTYPE_PB_LINEAR
enum SCIP_Varstatus SCIP_VARSTATUS