72#include "scip/cons_eqknapsack.h"
76#define CONSHDLR_NAME "pseudoboolean"
77#define CONSHDLR_DESC "constraint handler dealing with pseudo Boolean constraints"
78#define CONSHDLR_ENFOPRIORITY -1000000
79#define CONSHDLR_CHECKPRIORITY -5000000
80#define CONSHDLR_EAGERFREQ 100
82#define CONSHDLR_MAXPREROUNDS -1
83#define CONSHDLR_NEEDSCONS TRUE
85#define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_MEDIUM
87#define DEFAULT_DECOMPOSENORMALPBCONS FALSE
88#define DEFAULT_DECOMPOSEINDICATORPBCONS TRUE
90#define DEFAULT_SEPARATENONLINEAR TRUE
91#define DEFAULT_PROPAGATENONLINEAR TRUE
92#define DEFAULT_REMOVABLENONLINEAR TRUE
93#define USEINDICATOR 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;
336 for( v =
cdata1->nvars - 1; v > 0; --v )
339 for( v =
cdata2->nvars - 1; v > 0; --v )
352 for( v =
cdata1->nvars - 1; v >= 0; --v )
388 for( v =
cdata->nvars - 1; v > 0; --v )
396 assert(minidx >= 0 && minidx <= maxidx);
410 if( ((*conshdlrdata)->inithashmapandtable) )
430 (*conshdlrdata)->inithashmapandtable =
TRUE;
447 (*conshdlrdata)->allconsanddatas =
NULL;
448 (*conshdlrdata)->nallconsanddatas = 0;
449 (*conshdlrdata)->sallconsanddatas = 10;
454 (*conshdlrdata)->inithashmapandtable =
FALSE;
455 (*conshdlrdata)->hashtable =
NULL;
456 (*conshdlrdata)->hashtablesize = 0;
457 (*conshdlrdata)->hashmap =
NULL;
458 (*conshdlrdata)->hashmapsize = 0;
461 (*conshdlrdata)->nlinconss = 0;
464 (*conshdlrdata)->noriguses = 0;
480 assert((*conshdlrdata)->nallconsanddatas == 0);
483 if( (*conshdlrdata)->inithashmapandtable )
486 (*conshdlrdata)->hashmapsize = 0;
488 (*conshdlrdata)->hashtablesize = 0;
495 (*conshdlrdata)->inithashmapandtable =
FALSE;
500 (*conshdlrdata)->allconsanddatas =
NULL;
501 (*conshdlrdata)->nallconsanddatas = 0;
502 (*conshdlrdata)->sallconsanddatas = 0;
622 SCIP_Real*
const coefs,
648 for( v = 0; v < *
nvars; ++v )
650 vars[v] = linvars[v];
651 coefs[v] = lincoefs[v];
656 for( v = 0; v < *
nvars; ++v )
657 vars[v] = linvars[v];
669 for( v = 0; v < *
nvars; ++v )
671 vars[v] = linvars[v];
677 for( v = 0; v < *
nvars; ++v )
678 vars[v] = linvars[v];
684 SCIP_Longint* weights;
694 for( v = 0; v < *
nvars; ++v )
696 vars[v] = linvars[v];
702 for( v = 0; v < *
nvars; ++v )
703 vars[v] = linvars[v];
715 for( v = 0; v < *
nvars; ++v )
717 vars[v] = linvars[v];
723 for( v = 0; v < *
nvars; ++v )
724 vars[v] = linvars[v];
731 SCIP_Longint* weights;
741 for( v = 0; v < *
nvars; ++v )
743 vars[v] = linvars[v];
749 for( v = 0; v < *
nvars; ++v )
750 vars[v] = linvars[v];
784 SCIP_Real*
const coefs,
787 SCIP_Real*
const lincoefs,
791 SCIP_Real*
const andcoefs,
793 SCIP_Bool*
const andnegs,
811 if( nlinvars !=
NULL )
828 for( v =
nvars - 1; v > 0; --v )
833 for( v = 0; v <
nvars; ++v )
872 linvars[*nlinvars] =
vars[v];
873 if( lincoefs !=
NULL )
876 lincoefs[*nlinvars] = coefs[v];
886 if( andcoefs !=
NULL )
902 if( andcoefs !=
NULL )
917#ifdef CHECK_CONSISTENCY
957 assert(consdata->nconsanddatas > 0);
958 assert(consdata->nconsanddatas <= consdata->sconsanddatas);
970 assert(
nvars == consdata->nlinvars + consdata->nconsanddatas);
989 assert(nlinvars == consdata->nlinvars);
992 for( v =
nandress - 1; v >= 0; --v )
997 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
1000 if( consdata->consanddatas[
c]->cons !=
NULL )
1005 if(
res ==
andresultant && consdata->andnegs[
c] == andnegs[v] && consdata->andcoefs[
c] == andcoefs[v] )
1021 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
1037#define checkConsConsistency(scip, cons)
1066 for( v =
ntmpvars - 1; v >= 0; --v )
1080 for( v =
ntmpvars - 1; v >= 0; --v )
1124 if( conshdlrdata->inithashmapandtable )
1156 if( conshdlrdata->inithashmapandtable )
1183 SCIP_Real*
const andcoefs,
1184 SCIP_Bool*
const andnegs,
1187 SCIP_Real
const weight,
1188 SCIP_Bool
const issoftcons,
1198 SCIP_Bool transformed;
1223 SCIPerrorMessage(
"left hand side of pseudo boolean constraint greater than right hand side\n");
1234 (*consdata)->issoftcons = issoftcons;
1237 (*consdata)->weight = weight;
1243 (*consdata)->indvar = indvar;
1246 (*consdata)->indvar =
NULL;
1249 if( intvar !=
NULL )
1256 (*consdata)->intvar = intvar;
1259 (*consdata)->intvar =
NULL;
1262 (*consdata)->lincons = lincons;
1263 (*consdata)->linconstype = linconstype;
1296 if( andnegs !=
NULL )
1329 if( (*consdata)->consanddatas[
c]->origcons !=
NULL && (*consdata)->consanddatas[
c]->cons ==
NULL )
1339 assert((*consdata)->consanddatas[
c]->cons !=
NULL);
1340 assert((*consdata)->consanddatas[
c]->newvars ==
NULL);
1341 assert((*consdata)->consanddatas[
c]->isoriginal);
1343 (*consdata)->consanddatas[
c]->istransformed =
TRUE;
1345 vars = (*consdata)->consanddatas[
c]->vars;
1346 ncvars = (*consdata)->consanddatas[
c]->nvars;
1356 for( v =
ncvars - 1; v >= 0; --v )
1361 else if( (*consdata)->consanddatas[
c]->cons !=
NULL )
1362 assert((*consdata)->consanddatas[
c]->istransformed);
1364 ++((*consdata)->consanddatas[
c]->nuses);
1366 else if( transformed )
1370 assert((*consdata)->consanddatas[
c]->istransformed);
1382 (*consdata)->consanddatas =
NULL;
1383 (*consdata)->andcoefs =
NULL;
1384 (*consdata)->andnegs =
NULL;
1385 (*consdata)->nconsanddatas = 0;
1386 (*consdata)->sconsanddatas = 0;
1390 (*consdata)->lhs = lhs;
1391 (*consdata)->rhs = rhs;
1393 (*consdata)->changed =
TRUE;
1394 (*consdata)->propagated =
FALSE;
1395 (*consdata)->presolved =
FALSE;
1396 (*consdata)->cliquesadded =
FALSE;
1397 (*consdata)->upgradetried =
TRUE;
1406 conshdlrdata->noriguses += (*consdata)->nconsanddatas;
1428 assert((*consdata)->nconsanddatas == 0 || (*consdata)->consanddatas !=
NULL);
1432 if( (*consdata)->lincons !=
NULL )
1437 nconsanddatas = (*consdata)->nconsanddatas;
1438 consanddatas = (*consdata)->consanddatas;
1441 for(
c = nconsanddatas - 1;
c >= 0; --
c )
1443 assert((consanddatas[
c]->origcons ==
NULL) == (consanddatas[
c]->noriguses == 0));
1444 assert((consanddatas[
c]->cons ==
NULL) == (consanddatas[
c]->nuses == 0));
1445 assert(consanddatas[
c]->nuses >= 0);
1446 assert(consanddatas[
c]->noriguses >= 0);
1454 --(consanddatas[
c]->
nuses);
1457 if( consanddatas[
c]->nuses == 0 )
1459 if( conshdlrdata->inithashmapandtable )
1465 if( consanddatas[
c]->origcons ==
NULL )
1477 if( consanddatas[
c]->origcons ==
NULL )
1481 assert(conshdlrdata->nallconsanddatas > 0);
1483 for(
d = conshdlrdata->nallconsanddatas - 1;
d >= 0; --
d )
1485 if( conshdlrdata->allconsanddatas[
d] == consanddatas[
c] )
1487 --conshdlrdata->nallconsanddatas;
1491 conshdlrdata->allconsanddatas[
d] = conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas];
1501 else if(
isorig && consanddatas[
c]->origcons !=
NULL )
1504 assert(consanddatas[
c]->nuses == 0);
1505 assert(consanddatas[
c]->nnewvars == 0);
1506 assert(consanddatas[
c]->snewvars == 0);
1512 if( consanddatas[
c]->noriguses == 0 )
1516 if( conshdlrdata->inithashmapandtable )
1531 assert(consanddatas[
c]->svars > 0);
1535 consanddatas[
c]->
nvars = 0;
1536 consanddatas[
c]->
svars = 0;
1541 assert(consanddatas[
c]->svars == 0);
1548 assert(conshdlrdata->nallconsanddatas > 0);
1549 for(
d = conshdlrdata->nallconsanddatas - 1;
d >= 0; --
d )
1551 if( conshdlrdata->allconsanddatas[
d] == consanddatas[
c] )
1553 --conshdlrdata->nallconsanddatas;
1557 conshdlrdata->allconsanddatas[
d] = conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas];
1568 assert(!consanddatas[
c]->istransformed);
1573 if( consanddatas[
c]->nuses == 0 && consanddatas[
c]->istransformed )
1578 else if( consanddatas[
c]->nuses == 0 )
1584 assert(consanddatas[
c]->nnewvars == 0);
1585 assert(consanddatas[
c]->snewvars == 0);
1588 tmpvars = consanddatas[
c]->
vars;
1592 for( v =
ntmpvars - 1; v >= 0; --v )
1601 if( !consanddatas[
c]->istransformed && consanddatas[
c]->noriguses > 0 )
1604 assert(consanddatas[
c]->nuses == 0);
1605 assert(consanddatas[
c]->nnewvars == 0);
1606 assert(consanddatas[
c]->snewvars == 0);
1609 assert(consanddatas[
c]->svars > 0);
1612 assert(consanddatas[
c]->isoriginal);
1618 if( conshdlrdata->inithashmapandtable )
1667 SCIP_Real
const coef,
1668 SCIP_Real
const lhs,
1712 for( v =
nvars - 1; v >= 0; --v )
1719 for( v =
nvars - 1; v >= 0; --v )
1736 SCIP_Real
const coef,
1737 SCIP_Real
const lhs,
1775 for( v =
nvars - 1; v >= 0; --v )
1782 for( v =
nvars - 1; v >= 0; --v )
1818 SCIP_Real* lincoefs;
1823 SCIP_Real* andcoefs;
1832#ifdef WITHEQKNAPSACK
1841 assert(consdata->nconsanddatas >= 0);
1876 assert(consdata->nlinvars + consdata->nconsanddatas ==
nvars);
1900 for( v =
nandress - 1; v >= 0; --v )
1995 SCIP_Bool
const initial,
1997 SCIP_Bool
const enforce,
2000 SCIP_Bool
const check,
2003 SCIP_Bool
const local,
2006 SCIP_Bool
const modifiable,
2009 SCIP_Bool
const dynamic,
2012 SCIP_Bool
const stickingatnode,
2025 SCIP_Bool removable;
2026 SCIP_Bool transformed;
2050 newdata->istransformed = transformed;
2051 newdata->isoriginal = !transformed;
2116#ifdef WITH_DEBUG_SOLUTION
2123 for( v =
nvars - 1; v >= 0; --v )
2131 val = ((val < 0.5) ? 0.0 : 1.0);
2158 local, modifiable, dynamic, removable, stickingatnode) );
2170 if( conshdlrdata->nallconsanddatas == conshdlrdata->sallconsanddatas )
2176 conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas] =
newdata;
2177 ++(conshdlrdata->nallconsanddatas);
2190 for( v =
newdata->nvars - 1; v >= 0; --v )
2265 if( consdata->nconsanddatas == consdata->sconsanddatas )
2275 ++(consdata->nconsanddatas);
2278 switch( consdata->linconstype )
2301#ifdef WITHEQKNAPSACK
2319 consdata->changed =
TRUE;
2320 consdata->propagated =
FALSE;
2321 consdata->presolved =
FALSE;
2322 consdata->cliquesadded =
FALSE;
2323 consdata->upgradetried =
FALSE;
2345 SCIPerrorMessage(
"changing left hand side only allowed on standard lienar constraint \n");
2347#ifdef WITHEQKNAPSACK
2376 SCIPerrorMessage(
"changing left hand side only allowed on standard lienar constraint \n");
2378#ifdef WITHEQKNAPSACK
2403 SCIP_Real* lincoefs;
2406 SCIP_Real* andcoefs;
2454 SCIP_CALL(
getLinVarsAndAndRess(
scip, cons,
vars, coefs,
nvars, linvars, lincoefs, &nlinvars,
andress, andcoefs, andnegs, &
nandress) );
2471 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2484 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2489 for( v =
nandvars - 1; v >= 0; --v )
2496 for( v =
nandvars - 1; v >= 0; --v )
2506 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2519 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2524 for( v =
nandvars - 1; v >= 0; --v )
2531 for( v =
nandvars - 1; v >= 0; --v )
2543 consdata->propagated =
FALSE;
2548 consdata->lhs = lhs;
2549 consdata->presolved =
FALSE;
2550 consdata->changed =
TRUE;
2577 SCIP_Real* lincoefs;
2580 SCIP_Real* andcoefs;
2628 SCIP_CALL(
getLinVarsAndAndRess(
scip, cons,
vars, coefs,
nvars, linvars, lincoefs, &nlinvars,
andress, andcoefs, andnegs, &
nandress) );
2645 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2658 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2663 for( v =
nandvars - 1; v >= 0; --v )
2670 for( v =
nandvars - 1; v >= 0; --v )
2680 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
2693 val = andnegs[
c] ? -andcoefs[
c] : andcoefs[
c];
2698 for( v =
nandvars - 1; v >= 0; --v )
2705 for( v =
nandvars - 1; v >= 0; --v )
2717 consdata->propagated =
FALSE;
2722 consdata->rhs = rhs;
2723 consdata->presolved =
FALSE;
2724 consdata->changed =
TRUE;
2744 SCIP_Real*
const termcoefs,
2747 SCIP_Bool
const initial,
2749 SCIP_Bool
const enforce,
2752 SCIP_Bool
const check,
2755 SCIP_Bool
const local,
2758 SCIP_Bool
const modifiable,
2761 SCIP_Bool
const dynamic,
2764 SCIP_Bool
const stickingatnode,
2770 SCIP_Bool*
const andnegs,
2789 for( t = 0; t <
nterms; ++t )
2794 initial, enforce, check, local, modifiable, dynamic, stickingatnode,
2816 SCIP_Real
const*
const andvals,
2817 SCIP_Bool*
const andnegs,
2818 SCIP_Real*
const lhs,
2819 SCIP_Real*
const rhs,
2820 SCIP_Bool
const initial,
2822 SCIP_Bool
const separate,
2824 SCIP_Bool
const enforce,
2827 SCIP_Bool
const check,
2832 SCIP_Bool
const local,
2835 SCIP_Bool
const modifiable,
2838 SCIP_Bool
const dynamic,
2841 SCIP_Bool
const removable,
2844 SCIP_Bool
const stickingatnode,
2883 ++(conshdlrdata->nlinconss);
2902 for( v = nlinvars - 1; v >= 0; --v )
2932 for( v =
nandress - 1; v >= 0; --v )
2960 SCIPdebugMsg(
scip,
"While creating the linear constraint of the pseudoboolean constraint we found %d zero coefficients that were removed\n",
nzero);
2994 for( v = 0; v < nlinvars; ++v )
3021 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3057 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a set partitioning constraint\n");
3066 for( v = 0; v < nlinvars; ++v )
3093 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3107 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a set packing constraint\n");
3116 for( v = 0; v < nlinvars; ++v )
3143 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3161 SCIPwarningMessage(
scip,
"Does not expect this, because this constraint should be a set packing constraint.\n");
3165 SCIPwarningMessage(
scip,
"Does not expect this, because this constraint should be a logicor constraint.\n");
3168 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a set covering constraint\n");
3177 for( v = 0; v < nlinvars; ++v )
3204 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3227 SCIP_Longint* weights;
3228 SCIP_Longint capacity;
3229 SCIP_Longint weight;
3232 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a knapsack constraint\n");
3253 for( v = 0; v < nlinvars; ++v )
3260 weights[v] = weight;
3265 weights[v] = -weight;
3278 weights[nlinvars + v] = weight;
3284 weights[nlinvars + v] = -weight;
3292 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3304#ifdef WITHEQKNAPSACK
3316 SCIP_Longint* weights;
3317 SCIP_Longint capacity;
3318 SCIP_Longint weight;
3323 SCIPdebugMsg(
scip,
"linear pseudoboolean constraint will be a equality-knapsack constraint\n");
3341 for( v = 0; v < nlinvars; ++v )
3348 weights[v] = weight;
3353 weights[v] = -weight;
3366 weights[nlinvars + v] = weight;
3372 weights[nlinvars + v] = -weight;
3380 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3402 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
3438 SCIP_Bool*
const violated,
3453 SCIP_Real* lincoefs;
3458 SCIP_Real* andcoefs;
3511 assert(consdata->nlinvars + consdata->nconsanddatas ==
nvars);
3528 for( v = 0; v <
nvars; ++v )
3554 linvars[nlinvars] =
vars[v];
3555 lincoefs[nlinvars] = coefs[v];
3583 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
3590 andcons = consdata->consanddatas[
c]->origcons;
3597 andcons = consdata->consanddatas[
c]->cons;
3612 for( v =
nandvars - 1; v >= 0; --v )
3620 SCIPdebugMsg(
scip,
"lhs = %g, overall activity = %g, rhs = %g\n", lhs, activity, rhs);
3623 lhsviol = lhs - activity;
3624 rhsviol = activity - rhs;
3626 if(lhsviol > rhsviol)
3689 SCIP_Bool*
const violated
3709 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
3716 if( !conshdlrdata->allconsanddatas[
c]->istransformed )
3719 andcons = conshdlrdata->allconsanddatas[
c]->cons;
3733 for( v =
nvars - 1; v >= 0; --v )
3774 SCIP*
const sourcescip,
3781 SCIP_Bool
const initial,
3782 SCIP_Bool
const separate,
3783 SCIP_Bool
const enforce,
3784 SCIP_Bool
const check,
3786 SCIP_Bool
const local,
3787 SCIP_Bool
const modifiable,
3788 SCIP_Bool
const dynamic,
3789 SCIP_Bool
const removable,
3790 SCIP_Bool
const stickingatnode,
3792 SCIP_Bool
const global,
3793 SCIP_Bool*
const valid
3845#ifdef WITHEQKNAPSACK
3857 if( conshdlrlinear ==
NULL )
3992 const char* consname;
4000 if( indvar !=
NULL )
4031 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode) );
4086 allconsanddatas = conshdlrdata->allconsanddatas;
4088 assert(conshdlrdata->nallconsanddatas > 0);
4089 assert(conshdlrdata->nallconsanddatas <= conshdlrdata->sallconsanddatas);
4091 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
4146 for( v =
nvars - 1; v > 0; --v )
4149 for( v = nnewvars - 1; v > 0; --v )
4154 if(
nvars == nnewvars )
4161 for( v =
nvars - 1; v >= 0; --v )
4163 if(
vars[v] != newvars[v] )
4203 SCIP_Real
const coef,
4204 SCIP_Real
const lhs,
4231 SCIP_Real
const coef,
4232 SCIP_Real
const lhs,
4261 SCIP_Real*
const andcoefs,
4262 SCIP_Bool*
const andnegs,
4295 consanddatas = consdata->consanddatas;
4298 nconsanddatas = consdata->nconsanddatas;
4311 for(
c = nconsanddatas - 1;
c > 0; --
c )
4318 if( !consanddatas[
c]->istransformed )
4324 if( !consanddatas[
c - 1]->istransformed )
4362 if( !consanddatas[
c]->istransformed )
4365 consdata->changed =
TRUE;
4366 consdata->upgradetried =
FALSE;
4376 consdata->changed =
TRUE;
4377 consdata->upgradetried =
FALSE;
4386 consdata->changed =
TRUE;
4387 consdata->upgradetried =
FALSE;
4405 assert(consanddatas[
c]->nuses > 0);
4406 --(consanddatas[
c]->
nuses);
4410 consdata->lhs, consdata->rhs) );
4412 consdata->changed =
TRUE;
4413 consdata->upgradetried =
FALSE;
4414 consdata->propagated =
FALSE;
4415 consdata->presolved =
FALSE;
4429 consdata->changed =
TRUE;
4430 consdata->upgradetried =
FALSE;
4431 consdata->cliquesadded =
FALSE;
4432 consdata->propagated =
FALSE;
4433 consdata->presolved =
FALSE;
4440 SCIP_Bool lhschanged;
4441 SCIP_Bool rhschanged;
4453 consdata->upgradetried =
FALSE;
4460 || (consdata->lhs < 0 &&
newlhs > 0) || (consdata->lhs > 0 &&
newlhs < 0);
4462 || (consdata->rhs < 0 &&
newrhs > 0) || (consdata->rhs > 0 &&
newrhs < 0);
4473 consdata->changed =
TRUE;
4474 consdata->upgradetried =
FALSE;
4475 consdata->cliquesadded =
FALSE;
4476 consdata->propagated =
FALSE;
4477 consdata->presolved =
FALSE;
4487 if(
c < nconsanddatas )
4491 for( ;
c < nconsanddatas; ++
c )
4510 consdata->changed =
TRUE;
4511 consdata->upgradetried =
FALSE;
4515 assert(consanddatas[
c]->nuses > 0);
4516 --(consanddatas[
c]->
nuses);
4520 consdata->lhs, consdata->rhs) );
4521 consdata->changed =
TRUE;
4522 consdata->upgradetried =
FALSE;
4523 consdata->propagated =
FALSE;
4524 consdata->presolved =
FALSE;
4546 consdata->changed =
TRUE;
4547 consdata->upgradetried =
FALSE;
4548 consdata->cliquesadded =
FALSE;
4549 consdata->propagated =
FALSE;
4550 consdata->presolved =
FALSE;
4562 consdata->upgradetried =
FALSE;
4578 if(
oldnvars != consdata->nlinvars )
4580 consdata->changed =
TRUE;
4581 consdata->upgradetried =
FALSE;
4582 consdata->cliquesadded =
FALSE;
4583 consdata->propagated =
FALSE;
4584 consdata->presolved =
FALSE;
4593 consanddatas = consdata->consanddatas;
4594 nconsanddatas = consdata->nconsanddatas;
4595 assert(nconsanddatas == 0 || consanddatas !=
NULL);
4598 for(
c = nconsanddatas - 1;
c > 0; --
c )
4625 int*
const naggrvars,
4654 assert(consdata->nconsanddatas > 0);
4657 if( consdata->cliquesadded )
4660 consdata->cliquesadded =
TRUE;
4669 assert(consdata->nconsanddatas > 0);
4670 assert(consdata->nconsanddatas <= consdata->sconsanddatas);
4674 assert(
nvars == consdata->nlinvars + consdata->nconsanddatas);
4721 SCIP_Bool values[2];
4736 for(
v2 = nlinvars - 1;
v2 >= 0; --
v2 )
4766 if( values[0] != values[1] &&
var1 ==
var2 )
4891 SCIP_Bool values[2];
4936 if( values[0] != values[1] &&
var1 ==
var2 )
5053 if( consdata->propagated )
5057 consdata->propagated =
TRUE;
5080 consanddatas = consdata->consanddatas;
5081 nconsanddatas = consdata->nconsanddatas;
5082 assert(nconsanddatas == 0 || consanddatas !=
NULL);
5088 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5094 if( !consanddatas[
c]->istransformed )
5122 allconsanddatas = conshdlrdata->allconsanddatas;
5124 assert(conshdlrdata->nallconsanddatas > 0);
5125 assert(conshdlrdata->nallconsanddatas <= conshdlrdata->sallconsanddatas);
5127 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
5218 if( nfixedvars > 0 )
5239 for(
w = nfixedvars - 1;
w >= 0; --
w )
5263 fixedvars[
w] = fixedvars[nfixedvars];
5420 consanddatas = consdata->consanddatas;
5421 nconsanddatas = consdata->nconsanddatas;
5422 assert(nconsanddatas > 0 && consanddatas !=
NULL);
5426 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5440 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5446 assert(consanddatas[
c]->istransformed);
5479 if( nfixedvars > 0 )
5496 for(
w = nfixedvars - 1;
w >= 0; --
w )
5572 consdata->nconsanddatas = 0;
5591 SCIP_Bool*
const values,
5595 SCIP_Real*
const lincoefs,
5597 SCIP_Real
const constant,
5598 SCIP_Real
const side,
5602 int const nconsanddatas,
5629 assert(nconsanddatas > 0);
5637 for( v = nlinvars - 1; v >= 0; --v )
5642 value += lincoefs[v];
5657 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5659 SCIP_Bool val =
TRUE;
5693 if( (
negated[v] && values[pos]) || (!
negated[v] && !values[pos]) )
5724 else if( *
xortype == 1 && cnt % 2 == 0 )
5726 else if( *
xortype == 0 && cnt % 2 == 1 )
5740 else if( *
xortype == 1 && cnt % 2 == 1 )
5742 else if( *
xortype == 0 && cnt % 2 == 0 )
5763 int*
const ndelconss,
5764 int*
const naddconss,
5765 int*
const nfixedvars,
5766 int*
const nchgcoefs,
5767 int*
const nchgsides,
5779 SCIP_Real* lincoefs;
5781 SCIP_Real* andcoefs;
5815 consanddatas = consdata->consanddatas;
5816 andcoefs = consdata->andcoefs;
5817 andnegs = consdata->andnegs;
5818 nconsanddatas = consdata->nconsanddatas;
5819 assert(nconsanddatas > 0 && consanddatas !=
NULL);
5831 lincons = consdata->lincons;
5835 assert(nallvars - nconsanddatas == consdata->nlinvars);
5836 nlinvars = consdata->nlinvars;
5858 assert(nlinvars == consdata->nlinvars);
5875 for(
c = nconsanddatas - 1;
c >= 0; --
c )
5906 for( v =
nvars - 1,
v1 = nlinvars - 1; v >= 0 &&
v1 >= 0; )
5930 linvars[nlinvars] =
var;
5952 for( ; v >= 0; --v )
5971 linvars[nlinvars] =
var;
5991 for( v = (1 << nlinvars) - 1; v >= 0; --v )
5994 for(
v1 = nlinvars - 1;
v1 >= 0; --
v1 )
6007 consdata->lhs, consanddatas, andcoefs, andnegs, nconsanddatas, cnt, &
xortype) );
6062 int*
const ndelconss,
6063 int*
const naddconss,
6064 int*
const nfixedvars,
6065 int*
const nchgcoefs,
6066 int*
const nchgsides,
6094 consanddatas = consdata->consanddatas;
6095 nconsanddatas = consdata->nconsanddatas;
6096 assert(nconsanddatas > 0 && consanddatas !=
NULL);
6104 if( nconsanddatas == 1 )
6111 SCIP_Real* lincoefs;
6124 if( consdata->nlinvars == 0 )
6136 lincons = consdata->lincons;
6167 assert(nallvars == consdata->nlinvars + 1);
6169 nlinvars = consdata->nlinvars;
6184 assert(nlinvars == consdata->nlinvars);
6187 for( v = 0; v < nlinvars; ++v )
6193 for( v = 0; v <
nvars; ++v )
6225 c = nconsanddatas - 1;
6226 assert(consanddatas[
c]->istransformed);
6229 if( consanddatas[
c]->nnewvars > 0 )
6247 for( v =
neqvars - 1; v > 0; --v )
6251 for( --
c ;
c >= 0; --
c )
6260 assert(consanddatas[
c]->istransformed);
6277 for( v =
nvars - 1; v > 0; --v )
6365 if(
neqvars > 0 && consdata->nlinvars == 0 )
6367 SCIP_Bool infeasible;
6371 for( v = 0; v <
neqvars; ++v )
6411 lincons = consdata->lincons;
6423 for(
c = nconsanddatas - 1;
c >= 0; --
c )
6431 assert(consanddatas[
c]->istransformed);
6488 if( consdata->nlinvars > 0 )
6494 SCIP_Real* lincoefs;
6498 for( v = 0; v <
neqvars; ++v )
6505 assert(
nvars == consdata->nlinvars + consdata->nconsanddatas);
6519 for( v = 0; v <
nvars; ++v )
6525 assert(nlinvars == consdata->nlinvars);
6528 for( v = 0; v < nlinvars; ++v )
6574 int*
const ndelconss,
6575 int*
const naddconss,
6576 int*
const nfixedvars,
6577 int*
const nchgcoefs,
6578 int*
const nchgsides,
6607 consanddatas = consdata->consanddatas;
6608 nconsanddatas = consdata->nconsanddatas;
6609 assert(nconsanddatas > 0 && consanddatas !=
NULL);
6631 if( nconsanddatas == 1 )
6634 if( consdata->nlinvars == 0 )
6663 if( consdata->nlinvars > 0 )
6668 assert(consdata->nlinvars == 0 && nconsanddatas > 1);
6670 c = nconsanddatas - 1;
6671 assert(consanddatas[
c]->istransformed);
6674 if( consanddatas[
c]->nnewvars > 0 )
6692 for( v =
neqvars - 1; v > 0; --v )
6696 for( --
c ;
c >= 0; --
c )
6705 assert(consanddatas[
c]->istransformed);
6722 for( v =
nvars - 1; v > 0; --v )
6812 SCIP_Bool infeasible;
6843 lincons = consdata->lincons;
6861 for(
c = nconsanddatas - 1;
c >= 0; --
c )
6869 assert(consanddatas[
c]->istransformed);
6979 for( v = 0; v <
neqvars; ++v )
7050 int*
const ndelconss,
7051 int*
const naddconss,
7052 int*
const nfixedvars,
7053 int*
const nchgcoefs,
7054 int*
const nchgsides,
7079 consanddatas = consdata->consanddatas;
7080 assert(consdata->nconsanddatas == 0 || consanddatas !=
NULL);
7084 if( consdata->nconsanddatas == 0 )
7100 assert(consdata->nlinvars + consdata->nconsanddatas ==
nvars);
7102 switch( consdata->linconstype )
7119#ifdef WITHEQKNAPSACK
7137 consdata->upgradetried =
TRUE;
7148 int*
const ndelconss,
7149 int*
const naggrvars,
7185 consanddatas = consdata->consanddatas;
7186 nconsanddatas = consdata->nconsanddatas;
7187 assert(nconsanddatas == 0 || consanddatas !=
NULL);
7202 assert(consdata->nlinvars + nconsanddatas ==
nvars);
7205 if( consdata->nlinvars != 1 )
7209 if( consanddatas[0]->nnewvars > 0 )
7214 if( consanddatas[1]->nnewvars > 0 )
7216 if(
nvars != consanddatas[1]->nnewvars )
7234 if( consanddatas[nconsanddatas - 1]->nnewvars > 0 )
7237 vars = consanddatas[nconsanddatas - 1]->
vars;
7245 for( v = 1; v <
nvars; ++v )
7270 for( v =
nvars - 1; v >= 0; --v )
7284 for(
c = nconsanddatas - 2;
c >= 0; --
c )
7289 if( consanddatas[nconsanddatas - 1]->nnewvars > 0 )
7303 for( v = 1; v <
nvars; ++v )
7328 for( v =
nvars - 1; v >= 0; --v )
7355 for(
i = 1;
i >= 0; --
i )
7357 for( v =
nvars - 1; v >= 0; --v )
7393 assert(nconsvars == consdata->nlinvars + nconsanddatas);
7398 for( v = 0; v < nconsvars; ++v )
7417 SCIP_Bool redundant;
7418 SCIP_Bool infeasible;
7425 for(
i = 1;
i >= 0; --
i )
7427 for( v =
nvars - 1; v >= 0; --v )
7505 assert(nconsvars == consdata->nlinvars + nconsanddatas);
7510 for( v = 0; v < nconsvars; ++v )
7529 for(
i = 1;
i >= 0; --
i )
7531 for( v =
nvars - 1; v >= 0; --v )
7592#ifdef NONLINCONSUPGD_PRIORITY
7684#ifdef SCIP_DISABLED_CODE
7711 SCIPdebugMsg(
scip,
"not pseudoboolean because child %d is not a variable\n",
i);
7741 if( objvar !=
NULL )
7749 linvars[nlinvars++] =
var;
7854 for(
c = conshdlrdata->nallconsanddatas - 1;
c >= 0; --
c )
7864 assert(conshdlrdata->allconsanddatas[
c]->newvars ==
NULL);
7866 vars = conshdlrdata->allconsanddatas[
c]->vars;
7867 nvars = conshdlrdata->allconsanddatas[
c]->nvars;
7871 for( v =
nvars - 1; v > 0; --v )
7879 andcons = conshdlrdata->allconsanddatas[
c]->cons;
7890 SCIPconsGetName(conshdlrdata->allconsanddatas[
c]->cons), (
void*)(conshdlrdata->allconsanddatas[
c]),
7891 (
void*)(conshdlrdata->allconsanddatas[
c]->cons));
7912 if( conshdlrdata->decomposeindicatorpbcons || conshdlrdata->decomposenormalpbcons )
7914 for(
c = 0;
c < nconss; ++
c )
7943 if( consdata->issoftcons && conshdlrdata->decomposeindicatorpbcons )
7952#if USEINDICATOR == FALSE
7962 assert(consdata->weight != 0);
7980#if USEINDICATOR == FALSE
7985 for( v =
nvars - 1; v >= 0; --v )
8126 for( v =
nvars - 1; v >= 0; --v )
8154 else if( !consdata->issoftcons && conshdlrdata->decomposenormalpbcons )
8165 if( consdata->intvar !=
NULL )
8210 for(
c = (*consdata)->nconsanddatas - 1;
c >= 0; --
c )
8212 assert((*consdata)->consanddatas[
c]->nuses == 0);
8213 assert((*consdata)->consanddatas[
c]->cons ==
NULL);
8214 assert((*consdata)->consanddatas[
c]->noriguses == 0 || ((*consdata)->consanddatas[
c]->origcons !=
NULL &&
SCIPconsIsOriginal((*consdata)->consanddatas[
c]->origcons)));
8217 conshdlrdata->noriguses -= (*consdata)->nconsanddatas;
8219 assert(conshdlrdata->noriguses >= 0);
8380 if( consdata->issoftcons )
8455 SCIP_Real* lincoefs;
8458 SCIP_Real* andcoefs;
8536 if( consdata->changed )
8555 consdata->presolved =
TRUE;
8573 consdata->changed =
FALSE;
8622 lhs = consdata->lhs;
8623 rhs = consdata->rhs;
8631 SCIPdebugMsg(
scip,
"%socking constraint <%s> by [%d;%d].\n", (nlocksneg < 0) || (nlockspos < 0) ?
"Unl" :
"L",
SCIPconsGetName(cons), nlocksneg, nlockspos);
8634 for(
c = consdata->nconsanddatas - 1;
c >= 0; --
c )
8684 val = consdata->andnegs[
c] ? -consdata->andcoefs[
c] : consdata->andcoefs[
c];
8691 for( v =
nandvars - 1; v >= 0; --v )
8701 for( v =
nandvars - 1; v >= 0; --v )
8718 for( v =
nandvars - 1; v >= 0; --v )
8728 for( v =
nandvars - 1; v >= 0; --v )
8764 const char* consname;
8776 initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode, global,
8796 SCIP_Bool transformed;
8906 if( varssize <=
nvars )
8965 SCIP_Bool transformed;
9116 "decompose all normal pseudo boolean constraint into a \"linear\" constraint and \"and\" constraints",
9120 "decompose all indicator pseudo boolean constraint into a \"linear\" constraint and \"and\" constraints",
9123 "constraints/" CONSHDLR_NAME "/nlcseparate",
"should the nonlinear constraints be separated during LP processing?",
9126 "constraints/" CONSHDLR_NAME "/nlcpropagate",
"should the nonlinear constraints be propagated during node processing?",
9129 "constraints/" CONSHDLR_NAME "/nlcremovable",
"should the nonlinear constraints be removable?",
9132#ifdef NONLINCONSUPGD_PRIORITY
9151 SCIP_Real* andcoefs,
9155 SCIP_Bool issoftcons,
9173 SCIP_Bool modifiable,
9179 SCIP_Bool removable,
9181 SCIP_Bool stickingatnode
9194 SCIP_Bool transformed;
9207 if( intvar !=
NULL )
9210 SCIPerrorMessage(
"intvar currently not supported by pseudo boolean constraint handler\n");
9216 if( conshdlr ==
NULL )
9231 assert(conshdlrdata->allconsanddatas !=
NULL);
9232 assert(conshdlrdata->nallconsanddatas <= conshdlrdata->sallconsanddatas);
9263 newdata->istransformed = transformed;
9264 newdata->isoriginal = !transformed;
9298 for( v =
newdata->nvars - 1; v >= 0; --v )
9318 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");
9322 if( conshdlrdata->nallconsanddatas == conshdlrdata->sallconsanddatas )
9327 conshdlrdata->allconsanddatas[conshdlrdata->nallconsanddatas] =
newdata;
9328 ++(conshdlrdata->nallconsanddatas);
9404 indvar, weight, issoftcons, intvar, lhs, rhs, check,
FALSE) );
9408 SCIP_CALL(
SCIPcreateCons(
scip, cons, name, conshdlr, consdata, initial, separate, enforce, check,
propagate,
9409 local, modifiable, dynamic, removable, stickingatnode) );
9436 SCIP_Bool issoftcons,
9454 SCIP_Bool modifiable,
9460 SCIP_Bool removable,
9462 SCIP_Bool stickingatnode
9472 SCIP_Real* andcoefs;
9485 if( intvar !=
NULL )
9488 SCIPerrorMessage(
"intvar currently not supported by pseudo boolean constraint handler\n");
9494 if( conshdlr ==
NULL )
9500#if USEINDICATOR == TRUE
9501 if( issoftcons && modifiable )
9503 SCIPerrorMessage(
"Indicator constraint handler can't work with modifiable constraints\n");
9524 initial, enforce, check, local, modifiable, dynamic, stickingatnode,
9548 &lhs, &rhs, initial, separate, enforce,
FALSE,
propagate, local, modifiable, dynamic, removable,
9549 stickingatnode, &lincons, &linconstype) );
9556 indvar, weight, issoftcons, intvar, lhs, rhs, check,
FALSE) );
9566 SCIP_CALL(
SCIPcreateCons(
scip, cons, name, conshdlr, consdata, initial, separate, enforce, check,
propagate,
9567 local, modifiable, dynamic, removable, stickingatnode) );
9592 SCIP_Bool issoftcons,
9601 terms,
nterms,
ntermvars,
termvals, indvar, weight, issoftcons, intvar, lhs, rhs,
9640 switch( consdata->linconstype )
9663#ifdef WITHEQKNAPSACK
9677 consdata->propagated =
FALSE;
9678 consdata->presolved =
FALSE;
9679 consdata->cliquesadded =
FALSE;
9736 return consdata->indvar;
9760 return consdata->lincons;
9784 return consdata->linconstype;
9810 return consdata->nlinvars;
9818 SCIP_Real*
const lincoefs,
9848 *nlinvars = consdata->nlinvars;
9863 SCIP_CALL(
getLinVarsAndAndRess(
scip, cons,
vars, coefs,
nvars, linvars, lincoefs, nlinvars,
NULL,
NULL,
NULL,
NULL) );
9878 SCIP_Real*
const andcoefs,
9919 assert(consdata->consanddatas[
c]->istransformed ? (consdata->consanddatas[
c]->cons !=
NULL) :
TRUE);
9920 assert(consdata->consanddatas[
c]->isoriginal ? (consdata->consanddatas[
c]->origcons !=
NULL) :
TRUE);
9921 assert(consdata->consanddatas[
c]->cons !=
NULL || consdata->consanddatas[
c]->origcons !=
NULL);
9924 andconss[
c] = (
isorig ? consdata->consanddatas[
c]->origcons : consdata->consanddatas[
c]->cons);
9927 andcoefs[
c] = consdata->andcoefs[
c];
9956 return consdata->nconsanddatas;
9988 switch( consdata->linconstype )
9996#ifdef WITHEQKNAPSACK
9999 SCIPerrorMessage(
"changing left hand side only allowed on standard linear constraint \n");
10020 SCIP_Real
const rhs
10036 switch( consdata->linconstype )
10044#ifdef WITHEQKNAPSACK
10047 SCIPerrorMessage(
"changing right hand side only allowed on standard linear constraint \n");
10080 return consdata->lhs;
10105 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
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 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)
#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)
#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 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 SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrPrint(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 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_RETCODE SCIPsetConsSeparated(SCIP *scip, SCIP_CONS *cons, SCIP_Bool separate)
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 SCIPreallocBufferArray(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_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)
void SCIPvarsGetProbvar(SCIP_VAR **vars, int nvars)
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_Real SCIPvarGetUbLocal(SCIP_VAR *var)
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_VARTYPE SCIPvarGetType(SCIP_VAR *var)
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)
const char * SCIPvarGetName(SCIP_VAR *var)
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_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
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)
int SCIPvarCompare(SCIP_VAR *var1, SCIP_VAR *var2)
SCIP_RETCODE SCIPgetBinvarRepresentative(SCIP *scip, SCIP_VAR *var, SCIP_VAR **repvar, SCIP_Bool *negated)
SCIP_RETCODE SCIPwriteVarsList(SCIP *scip, FILE *file, SCIP_VAR **vars, int nvars, SCIP_Bool type, char delimiter)
SCIP_RETCODE SCIPwriteVarsLinearsum(SCIP *scip, FILE *file, SCIP_VAR **vars, SCIP_Real *vals, int nvars, 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 SCIPsortPtrReal(void **ptrarray, SCIP_Real *realarray, 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,...)
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
#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_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
@ SCIP_VARSTATUS_MULTAGGR
@ SCIP_VARSTATUS_AGGREGATED
enum SCIP_Varstatus SCIP_VARSTATUS