53 assert(vbounds !=
NULL);
56 (*vbounds)->vars =
NULL;
57 (*vbounds)->coefs =
NULL;
58 (*vbounds)->constants =
NULL;
71 assert(vbounds !=
NULL);
73 if( *vbounds !=
NULL )
91 assert(vbounds !=
NULL);
94 if( *vbounds ==
NULL )
98 assert(*vbounds !=
NULL);
99 assert((*vbounds)->len <= (*vbounds)->size);
101 if( num > (*vbounds)->size )
109 (*vbounds)->size = newsize;
111 assert(num <= (*vbounds)->size);
129 assert(insertpos !=
NULL);
130 assert(found !=
NULL);
133 if( vbounds ==
NULL )
139 assert(vbounds->
len >= 0);
147 assert(var == vbounds->
vars[pos]);
148 if( (vbounds->
coefs[pos] < 0.0) == negativecoef )
154 else if( negativecoef )
156 assert(vbounds->
coefs[pos] > 0.0);
157 if( pos+1 < vbounds->
len && vbounds->
vars[pos+1] == var )
160 assert(vbounds->
coefs[pos+1] < 0.0);
173 assert(vbounds->
coefs[pos] < 0.0);
174 if( pos-1 >= 0 && vbounds->
vars[pos-1] == var )
177 assert(vbounds->
coefs[pos-1] > 0.0);
213 assert(vbounds !=
NULL);
217 assert(added !=
NULL);
227 assert(*vbounds !=
NULL);
228 assert(0 <= insertpos && insertpos < (*vbounds)->len);
229 assert((*vbounds)->vars[insertpos] == var);
230 assert(((*vbounds)->coefs[insertpos] < 0.0) == (coef < 0.0));
234 if( constant +
MIN(coef, 0.0) < (*vbounds)->constants[insertpos] +
MIN((*vbounds)->coefs[insertpos], 0.0) )
236 (*vbounds)->coefs[insertpos] = coef;
237 (*vbounds)->constants[insertpos] = constant;
243 if( constant +
MAX(coef, 0.0) > (*vbounds)->constants[insertpos] +
MAX((*vbounds)->coefs[insertpos], 0.0) )
245 (*vbounds)->coefs[insertpos] = coef;
246 (*vbounds)->constants[insertpos] = constant;
257 assert(*vbounds !=
NULL);
258 assert(0 <= insertpos && insertpos <= (*vbounds)->len);
259 assert(0 <= insertpos && insertpos < (*vbounds)->size);
262 for( i = (*vbounds)->len; i > insertpos; --i )
265 (*vbounds)->vars[i] = (*vbounds)->vars[i-1];
266 (*vbounds)->coefs[i] = (*vbounds)->coefs[i-1];
267 (*vbounds)->constants[i] = (*vbounds)->constants[i-1];
270 (*vbounds)->vars[insertpos] = var;
271 (*vbounds)->coefs[insertpos] = coef;
272 (*vbounds)->constants[insertpos] = constant;
292 assert(vbounds !=
NULL);
293 assert(*vbounds !=
NULL);
300 assert(0 <= pos && pos < (*vbounds)->len);
301 assert((*vbounds)->vars[pos] == vbdvar);
302 assert(((*vbounds)->coefs[pos] < 0.0) == negativecoef);
305 for( i = pos; i < (*vbounds)->len - 1; i++ )
307 (*vbounds)->vars[i] = (*vbounds)->vars[i+1];
308 (*vbounds)->coefs[i] = (*vbounds)->coefs[i+1];
309 (*vbounds)->constants[i] = (*vbounds)->constants[i+1];
319 if( (*vbounds)->len == 0 )
332 assert(vbounds !=
NULL);
333 assert(*vbounds !=
NULL);
334 assert(newnvbds <= (*vbounds)->len);
339 (*vbounds)->len = newnvbds;
361 assert(var1 !=
NULL);
362 assert(var2 !=
NULL);
366 if( var1idx < var2idx )
368 else if( var1idx > var2idx )
382 if( implics ==
NULL )
393 vars = implics->
vars[varfixing];
394 types = implics->
types[varfixing];
395 nimpls = implics->
nimpls[varfixing];
397 assert(0 <= nimpls && nimpls <= implics->size[varfixing]);
398 for( i = 1; i < nimpls; ++i )
402 cmp = compVars(vars[i-1], vars[i]);
404 assert((cmp == 0) == (vars[i-1] == vars[i]));
408 varfixing = !varfixing;
410 while( varfixing ==
TRUE );
413 #define checkImplics(implics) 423 assert(implics !=
NULL);
427 (*implics)->vars[0] =
NULL;
428 (*implics)->types[0] =
NULL;
429 (*implics)->bounds[0] =
NULL;
430 (*implics)->ids[0] =
NULL;
431 (*implics)->size[0] = 0;
432 (*implics)->nimpls[0] = 0;
433 (*implics)->vars[1] =
NULL;
434 (*implics)->types[1] =
NULL;
435 (*implics)->bounds[1] =
NULL;
436 (*implics)->ids[1] =
NULL;
437 (*implics)->size[1] = 0;
438 (*implics)->nimpls[1] = 0;
449 assert(implics !=
NULL);
451 if( *implics !=
NULL )
475 assert(implics !=
NULL);
478 if( *implics ==
NULL )
482 assert(*implics !=
NULL);
483 assert((*implics)->nimpls[varfixing] <= (*implics)->size[varfixing]);
485 if( num > (*implics)->size[varfixing] )
494 (*implics)->size[varfixing] = newsize;
496 assert(num <= (*implics)->size[varfixing]);
519 assert(implics !=
NULL);
520 assert(poslower !=
NULL);
521 assert(posupper !=
NULL);
522 assert(posadd !=
NULL);
524 if( implics->
nimpls[varfixing] == 0 )
532 right = implics->
nimpls[varfixing] - 1;
536 found =
SCIPsortedvecFindPtr((
void**)(&(implics->
vars[varfixing][0])), SCIPvarComp, (
void*)implvar, right + 1, &pos);
541 assert(pos >= right || compVars((
void*)implics->
vars[varfixing][pos], (
void*)implvar) > 0);
542 assert(pos == 0 || compVars((
void*)implics->
vars[varfixing][pos-1], (
void*)implvar) < 0);
550 assert(implvar == implics->
vars[varfixing][pos]);
557 if( pos + 1 < implics->
nimpls[varfixing] && implics->
vars[varfixing][pos+1] == implvar )
570 if( pos - 1 >= 0 && implics->
vars[varfixing][pos-1] == implvar )
599 assert(implics !=
NULL);
600 assert(poslower !=
NULL);
601 assert(posupper !=
NULL);
602 assert(posadd !=
NULL);
605 assert(*poslower == -1 || *posupper == -1 || *posupper == (*poslower)+1);
606 assert(*poslower == -1 || *posadd == *poslower);
607 assert(*poslower >= 0 || *posupper == -1 || *posadd == *posupper);
608 assert(0 <= *posadd && *posadd <= implics->nimpls[varfixing]);
611 return (*poslower >= 0);
616 assert(*posadd == *poslower);
619 return (*posupper >= 0);
648 assert(implics !=
NULL);
649 assert(*implics ==
NULL || 0 <= (*implics)->nimpls[varfixing]);
650 assert(stat !=
NULL);
655 assert(conflict !=
NULL);
656 assert(added !=
NULL);
658 SCIPsetDebugMsg(
set,
"adding implication to implics %p [%u]: <%s> %s %g\n",
667 if( *implics !=
NULL )
669 found =
implicsSearchImplic(*implics, varfixing, implvar, impltype, &poslower, &posupper, &posadd);
670 assert(-1 <= poslower && poslower < (*implics)->nimpls[varfixing]);
671 assert(-1 <= posupper && posupper < (*implics)->nimpls[varfixing]);
672 assert(0 <= posadd && posadd <= (*implics)->nimpls[varfixing]);
686 assert(found == (poslower >= 0));
689 if( poslower >= 0 &&
SCIPsetIsFeasLE(
set, implbound, (*implics)->bounds[varfixing][poslower]) )
696 if( posupper >= 0 &&
SCIPsetIsFeasGT(
set, implbound, (*implics)->bounds[varfixing][posupper]) )
708 assert(poslower >= 0);
709 assert(posadd == poslower);
712 assert((*implics)->vars[varfixing][poslower] == implvar);
713 assert(
SCIPsetIsFeasGT(
set, implbound, (*implics)->bounds[varfixing][poslower]));
714 (*implics)->bounds[varfixing][poslower] = implbound;
718 assert(poslower == -1);
722 *implics !=
NULL ? (*implics)->nimpls[varfixing]+1 : 1) );
723 assert(*implics !=
NULL);
725 if( (*implics)->nimpls[varfixing] - posadd > 0 )
727 int amount = ((*implics)->nimpls[varfixing] - posadd);
730 for( k = (*implics)->nimpls[varfixing]; k > posadd; k-- )
732 assert(compVars((
void*)(*implics)->vars[varfixing][k-1], (
void*)implvar) >= 0);
735 BMSmoveMemoryArray(&((*implics)->types[varfixing][posadd+1]), &((*implics)->types[varfixing][posadd]), amount);
736 BMSmoveMemoryArray(&((*implics)->ids[varfixing][posadd+1]), &((*implics)->ids[varfixing][posadd]), amount);
737 BMSmoveMemoryArray(&((*implics)->vars[varfixing][posadd+1]), &((*implics)->vars[varfixing][posadd]), amount);
738 BMSmoveMemoryArray(&((*implics)->bounds[varfixing][posadd+1]), &((*implics)->bounds[varfixing][posadd]), amount);
741 (*implics)->vars[varfixing][posadd] = implvar;
742 (*implics)->types[varfixing][posadd] = impltype;
743 (*implics)->bounds[varfixing][posadd] = implbound;
745 (*implics)->nimpls[varfixing]++;
747 for( k = posadd-1; k >= 0; k-- )
748 assert(compVars((
void*)(*implics)->vars[varfixing][k], (
void*)implvar) <= 0);
755 assert(found == (posupper >= 0));
758 if( posupper >= 0 &&
SCIPsetIsFeasGE(
set, implbound, (*implics)->bounds[varfixing][posupper]) )
765 if( poslower >= 0 &&
SCIPsetIsFeasLT(
set, implbound, (*implics)->bounds[varfixing][poslower]) )
777 assert(posupper >= 0);
778 assert(posadd == posupper);
781 assert((*implics)->vars[varfixing][posupper] == implvar);
782 assert(
SCIPsetIsFeasLT(
set, implbound,(*implics)->bounds[varfixing][posupper]));
783 (*implics)->bounds[varfixing][posupper] = implbound;
788 assert(posupper == -1);
791 *implics !=
NULL ? (*implics)->nimpls[varfixing]+1 : 1) );
792 assert(*implics !=
NULL);
794 if( (*implics)->nimpls[varfixing] - posadd > 0 )
796 int amount = ((*implics)->nimpls[varfixing] - posadd);
799 for( k = (*implics)->nimpls[varfixing]; k > posadd; k-- )
801 assert(compVars((
void*)(*implics)->vars[varfixing][k-1], (
void*)implvar) >= 0);
804 BMSmoveMemoryArray(&((*implics)->types[varfixing][posadd+1]), &((*implics)->types[varfixing][posadd]), amount);
805 BMSmoveMemoryArray(&((*implics)->ids[varfixing][posadd+1]), &((*implics)->ids[varfixing][posadd]), amount);
806 BMSmoveMemoryArray(&((*implics)->vars[varfixing][posadd+1]), &((*implics)->vars[varfixing][posadd]), amount);
807 BMSmoveMemoryArray(&((*implics)->bounds[varfixing][posadd+1]), &((*implics)->bounds[varfixing][posadd]), amount);
810 (*implics)->vars[varfixing][posadd] = implvar;
811 (*implics)->types[varfixing][posadd] = impltype;
812 (*implics)->bounds[varfixing][posadd] = implbound;
814 (*implics)->nimpls[varfixing]++;
816 for( k = posadd-1; k >= 0; k-- )
817 assert(compVars((
void*)(*implics)->vars[varfixing][k], (
void*)implvar) <= 0);
843 assert(implics !=
NULL);
844 assert(*implics !=
NULL);
845 assert(implvar !=
NULL);
847 SCIPsetDebugMsg(
set,
"deleting implication from implics %p [%u]: <%s> %s x\n",
853 found =
implicsSearchImplic(*implics, varfixing, implvar, impltype, &poslower, &posupper, &posadd);
862 assert(0 <= posadd && posadd < (*implics)->nimpls[varfixing]);
863 assert((*implics)->vars[varfixing][posadd] == implvar);
864 assert((*implics)->types[varfixing][posadd] == impltype);
867 if( (*implics)->nimpls[varfixing] - posadd > 1 )
869 int amount = ((*implics)->nimpls[varfixing] - posadd - 1);
871 BMSmoveMemoryArray(&((*implics)->types[varfixing][posadd]), &((*implics)->types[varfixing][posadd+1]), amount);
872 BMSmoveMemoryArray(&((*implics)->vars[varfixing][posadd]), &((*implics)->vars[varfixing][posadd+1]), amount);
873 BMSmoveMemoryArray(&((*implics)->bounds[varfixing][posadd]), &((*implics)->bounds[varfixing][posadd+1]), amount);
875 (*implics)->nimpls[varfixing]--;
878 if( (*implics)->nimpls[0] == 0 && (*implics)->nimpls[1] == 0 )
899 assert(haslowerimplic !=
NULL);
900 assert(hasupperimplic !=
NULL);
902 implicsSearchVar(implics, varfixing, implvar, &poslower, &posupper, &posadd);
904 *haslowerimplic = (poslower >= 0);
905 *hasupperimplic = (posupper >= 0);
920 return implicsSearchImplic(implics, varfixing, implvar, impltype, &poslower, &posupper, &posadd);
939 if( first != second )
943 tmp = cliquetable->
cliques[first];
944 assert(tmp->
index == first);
948 cliquetable->
cliques[second] = tmp;
992 assert(clique !=
NULL);
993 assert(blkmem !=
NULL);
994 assert(size >= nvars && nvars > 0);
995 assert(vars !=
NULL);
996 assert(values !=
NULL);
1001 (*clique)->nvars = nvars;
1002 (*clique)->size = size;
1003 (*clique)->startcleanup = -1;
1004 (*clique)->id = (
unsigned int)
id;
1005 (*clique)->eventsissued =
FALSE;
1006 (*clique)->equation = isequation;
1007 (*clique)->index = -1;
1019 assert(clique !=
NULL);
1021 if( *clique !=
NULL )
1038 assert(clique !=
NULL);
1040 if( num > clique->
size )
1047 clique->
size = newsize;
1049 assert(num <= clique->size);
1067 assert(clique !=
NULL);
1071 right = clique->
nvars;
1072 while( left < right-1 )
1077 middle = (left+right)/2;
1082 else if( varidx > idx )
1086 assert(var == clique->
vars[middle]);
1089 if( clique->
values[middle] < value )
1092 for( i = middle+1; i < clique->
nvars && clique->
vars[i] == var; ++i )
1094 if( clique->
values[i] == value )
1099 if( clique->
values[middle] > value )
1102 for( i = middle-1; i >= 0 && clique->
vars[i] == var; --i )
1104 if( clique->
values[i] == value )
1140 assert(clique !=
NULL);
1143 assert(doubleentry !=
NULL);
1144 assert(oppositeentry !=
NULL);
1148 *doubleentry =
FALSE;
1149 *oppositeentry =
FALSE;
1159 assert(pos >= 0 && pos <= clique->nvars);
1163 if( pos < clique->nvars )
1165 const int amount = clique->
nvars - pos;
1176 for( ; pos < clique->
nvars - 1 && clique->
vars[pos + 1] == var && clique->
values[pos + 1] == value; ++pos );
1179 if( pos < clique->nvars - 1 && clique->
vars[pos + 1] == var )
1181 assert(clique->
values[pos + 1] != value);
1182 *oppositeentry =
TRUE;
1187 *doubleentry =
TRUE;
1191 for( ; pos > 0 && clique->
vars[pos - 1] == var && clique->
values[pos - 1] != value; --pos );
1194 if( pos > 0 && clique->
vars[pos - 1] == var )
1196 assert(clique->
values[pos - 1] == value);
1198 *doubleentry =
TRUE;
1203 assert(clique->
vars[pos] == var);
1204 assert(clique->
values[pos] != value);
1206 clique->
values[pos] = value;
1215 for( ; pos < clique->
nvars - 1 && clique->
vars[pos + 1] == var && clique->
values[pos + 1] != value; ++pos );
1218 if( pos < clique->nvars - 1 && clique->
vars[pos + 1] == var )
1220 assert(clique->
values[pos + 1] == value);
1221 *doubleentry =
TRUE;
1227 *oppositeentry =
TRUE;
1230 assert(clique->
vars[pos] == var);
1231 assert(clique->
values[pos] != value);
1233 clique->
values[pos] = value;
1239 for( ; pos > 0 && clique->
vars[pos - 1] == var && clique->
values[pos - 1] == value; --pos );
1242 *doubleentry =
TRUE;
1245 if( pos > 0 && clique->
vars[pos - 1] == var && clique->
values[pos - 1] != value )
1246 *oppositeentry =
TRUE;
1253 clique->
vars[i] = var;
1254 clique->
values[i] = value;
1270 assert(clique !=
NULL);
1272 assert(cliquetable !=
NULL);
1283 assert(0 <= pos && pos < clique->nvars);
1284 assert(clique->
vars[pos] == var);
1285 assert(clique->
values[pos] == value);
1291 if( clique->
startcleanup == -1 || pos < clique->startcleanup )
1294 #ifdef SCIP_MORE_DEBUG 1315 unsigned int cliqueid;
1319 assert(cliques !=
NULL || ncliques == 0);
1320 assert(clique !=
NULL);
1322 cliqueid = clique->
id;
1325 while( left < right-1 )
1330 assert(cliques !=
NULL);
1331 middle = (left+right)/2;
1332 id = cliques[middle]->
id;
1335 else if( cliqueid >
id )
1339 assert(clique == cliques[middle]);
1347 #ifdef SCIP_MORE_DEBUG 1356 assert(clique !=
NULL);
1358 for( i = 0; i < clique->
nvars; ++i )
1365 var = clique->
vars[i];
1367 assert(i == 0 || clique->
vars[i-1] != var || clique->
values[i-1] <= clique->
values[i]);
1384 assert(0 <= pos && pos < ncliques);
1385 assert(cliques[pos] == clique);
1390 assert(clique->
index >= 0);
1393 #define cliqueCheck(clique) 1403 assert(cliquelist !=
NULL);
1406 (*cliquelist)->cliques[0] =
NULL;
1407 (*cliquelist)->cliques[1] =
NULL;
1408 (*cliquelist)->ncliques[0] = 0;
1409 (*cliquelist)->ncliques[1] = 0;
1410 (*cliquelist)->size[0] = 0;
1411 (*cliquelist)->size[1] = 0;
1422 assert(cliquelist !=
NULL);
1424 if( *cliquelist !=
NULL )
1442 assert(cliquelist !=
NULL);
1444 if( num > cliquelist->
size[value] )
1450 cliquelist->
size[value] = newsize;
1452 assert(num <= cliquelist->size[value]);
1469 assert(cliquelist !=
NULL);
1475 if( *cliquelist ==
NULL )
1481 if( (*cliquelist)->cliques[value] !=
NULL )
1483 for( i = (*cliquelist)->ncliques[value]; i > 0 && (*cliquelist)->cliques[value][i - 1]->id >
id; --i );
1485 if( i > 0 && (*cliquelist)->cliques[value][i - 1]->id ==
id )
1491 SCIPsetDebugMsg(
set,
"adding clique %u to cliquelist %p value %u (length: %d)\n",
1492 clique->
id, (
void*)*cliquelist, value, (*cliquelist)->
ncliques[value]);
1494 BMSmoveMemoryArray(&((*cliquelist)->cliques[value][i+1]), &((*cliquelist)->cliques[value][i]), (*cliquelist)->ncliques[value] - i);
1496 (*cliquelist)->cliques[value][i] = clique;
1497 (*cliquelist)->ncliques[value]++;
1512 assert(cliquelist !=
NULL);
1516 if( *cliquelist ==
NULL )
1519 SCIPdebugMessage(
"deleting clique %u from cliquelist %p value %u (length: %d)\n",
1520 clique->
id, (
void*)*cliquelist, value, (*cliquelist)->
ncliques[value]);
1522 pos =
cliquesSearchClique((*cliquelist)->cliques[value], (*cliquelist)->ncliques[value], clique);
1527 #ifdef SCIP_MORE_DEBUG 1533 assert(nclqvars >= 2);
1543 for( v = nclqvars - 1; v > 0; --v )
1545 if( clqvars[v] == clqvars[v - 1] )
1547 if( clqvalues[v] == clqvalues[v - 1] || (v > 1 && clqvars[v] == clqvars[v - 2]) )
1559 assert(0 <= pos && pos < (*cliquelist)->ncliques[value]);
1560 assert((*cliquelist)->cliques[value][pos] == clique);
1564 (*cliquelist)->ncliques[value]--;
1565 if( pos < (*cliquelist)->ncliques[value] )
1567 BMSmoveMemoryArray(&((*cliquelist)->cliques[value][pos]), &((*cliquelist)->cliques[value][pos+1]),
1568 (*cliquelist)->ncliques[value] - pos);
1572 if( (*cliquelist)->ncliques[0] == 0 && (*cliquelist)->ncliques[1] == 0 )
1595 if( cliquelist1 ==
NULL || cliquelist2 ==
NULL )
1598 ncliques1 = cliquelist1->
ncliques[value1];
1599 cliques1 = cliquelist1->
cliques[value1];
1600 ncliques2 = cliquelist2->
ncliques[value2];
1601 cliques2 = cliquelist2->
cliques[value2];
1606 if( i1 < ncliques1 && i2 < ncliques2 )
1611 if( ncliques2 > ncliques1 )
1618 cliques1 = cliques2;
1619 ncliques1 = ncliques2;
1637 assert(i1 < ncliques1);
1649 assert(i2 < ncliques2);
1669 if( cliquelist !=
NULL )
1673 SCIPdebugMessage(
"removing variable <%s> from cliques (%d with value 0, %d with value 1)\n",
1676 for( value = 0; value < 2; ++value )
1686 for( i = cliquelist->
ncliques[value] - 1; i >= 0; --i )
1690 clique = cliquelist->
cliques[value][i];
1691 assert(clique !=
NULL);
1693 SCIPdebugMessage(
" -> removing variable <%s> == %d from clique %u (size %d)\n",
1701 #ifdef SCIP_MORE_DEBUG 1730 assert(clique1 !=
NULL);
1731 assert(clique2 !=
NULL);
1737 for( i = 0; i < clique1->
nvars; ++i )
1761 #define HASHTABLE_CLIQUETABLE_SIZE 100 1772 assert(cliquetable !=
NULL);
1780 hashgetkeyClique, hashkeyeqClique, hashkeyvalClique,
NULL) );
1782 (*cliquetable)->cliques =
NULL;
1783 (*cliquetable)->ncliques = 0;
1784 (*cliquetable)->size = 0;
1785 (*cliquetable)->ncreatedcliques = 0;
1786 (*cliquetable)->ncleanupfixedvars = 0;
1787 (*cliquetable)->ncleanupaggrvars = 0;
1788 (*cliquetable)->ndirtycliques = 0;
1789 (*cliquetable)->nentries = 0;
1790 (*cliquetable)->incleanup =
FALSE;
1791 (*cliquetable)->componentupdate =
FALSE;
1792 (*cliquetable)->ncliquecomponents = -1;
1805 assert(cliquetable !=
NULL);
1806 assert(*cliquetable !=
NULL);
1809 for( i = (*cliquetable)->ncliques - 1; i >= 0; --i )
1811 cliqueFree(&(*cliquetable)->cliques[i], blkmem);
1833 assert(cliquetable !=
NULL);
1835 if( num > cliquetable->
size )
1841 cliquetable->
size = newsize;
1843 assert(num <= cliquetable->size);
1875 assert(nclqvars !=
NULL);
1877 SCIPsetDebugMsg(
set,
"starting merging %d variables in clique %d\n", *nclqvars, (clique ==
NULL) ? -1 : (
int) clique->
id);
1879 if( *nclqvars <= 1 )
1882 assert(clqvars !=
NULL);
1883 assert(clqvalues !=
NULL);
1884 assert(blkmem !=
NULL);
1885 assert(
set !=
NULL);
1886 assert(stat !=
NULL);
1887 assert(transprob !=
NULL);
1888 assert(origprob !=
NULL);
1889 assert(tree !=
NULL);
1890 assert(eventqueue !=
NULL);
1891 assert(nbdchgs !=
NULL);
1892 assert(infeasible !=
NULL);
1898 noldbdchgs = *nbdchgs;
1901 startidx = *nclqvars - 1;
1902 while( startidx >= 0 )
1908 var = clqvars[startidx];
1914 if( clqvalues[startidx] )
1924 curr = startidx - 1;
1929 if( clqvars[curr] == var )
1931 if( clqvalues[curr] )
1942 assert(nzeros + nones <= *nclqvars);
1945 if( nones + nzeros == 1 )
1951 if( nones >= 2 && nzeros >= 2 )
1958 if( nones >= 2 || nzeros >= 2 )
1963 assert(nones <= 1 || nzeros <= 1);
1966 if( clique !=
NULL )
1982 SCIP_CALL(
SCIPvarFixBinary(var, blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand, eventqueue,
1983 cliquetable, fixvalue, infeasible, nbdchgs) );
1986 fixvalue ? 1 : 0, *infeasible ?
"infeasible" :
"feasible");
1993 if( nones >= 1 && nzeros >= 1 )
1998 if( nzeros + nones < *nclqvars )
2013 assert(clqvars[w] != var);
2019 while( w > 0 && clqvars[w-1] == clqvars[w] )
2021 if( clqvalues[w-1] != clqvalues[w] )
2032 if( clique !=
NULL )
2037 branchcand, eventqueue, cliquetable, !clqvalues[w], infeasible, nbdchgs) );
2040 clqvalues[w] ? 0 : 1, *infeasible ?
"infeasible" :
"feasible");
2049 if( clique !=
NULL )
2055 *isequation =
FALSE;
2062 assert(curr < startidx);
2068 if( *infeasible || *nclqvars == 0 )
2076 if( *nbdchgs > noldbdchgs )
2083 onefixedvalue =
TRUE;
2089 while( startidx < *nclqvars )
2091 var = clqvars[startidx];
2099 if( onefixedvar !=
NULL )
2103 SCIPsetDebugMsg(
set,
"two variables in clique %d fixed to one %s%s and %s%s\n", (clique !=
NULL) ? (
int) clique->
id : -1,
2108 onefixedvalue = clqvalues[startidx];
2116 clqvars[w] = clqvars[startidx];
2117 clqvalues[w] = clqvalues[startidx];
2126 if( clique !=
NULL )
2138 if( onefixedvar !=
NULL )
2140 SCIPsetDebugMsg(
set,
"variable %s%s in clique %d fixed to one, fixing all other variables to zero\n",
2141 onefixedvalue ?
"" :
"~",
SCIPvarGetName(onefixedvar), (clique !=
NULL) ? (
int) clique->
id : -1);
2144 for( startidx = *nclqvars; startidx >= 0; --startidx )
2150 if( onefixedvalue != clqvalues[startidx] || clqvars[startidx] != onefixedvar )
2152 if( clique !=
NULL )
2161 while( startidx > 0 && clqvars[startidx - 1] == clqvars[startidx] )
2163 if( clqvalues[startidx - 1] != clqvalues[startidx] )
2172 clqvalues[startidx] ? 0 : 1);
2176 branchcand, eventqueue, cliquetable, !clqvalues[startidx], infeasible, nbdchgs) );
2184 if( clique !=
NULL )
2190 *isequation =
FALSE;
2194 assert(!(*infeasible));
2198 if( *nclqvars == 0 )
2200 SCIPsetDebugMsg(
set,
"empty equation clique left over -> infeasible\n");
2204 else if( *nclqvars == 1 )
2209 if( clique !=
NULL )
2213 SCIP_CALL(
SCIPvarFixBinary(clqvars[0], blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand,
2214 eventqueue, cliquetable, clqvalues[0], infeasible, nbdchgs) );
2217 clqvalues[0] ? 1 : 0, *infeasible ?
"infeasible" :
"feasible");
2220 *isequation =
FALSE;
2235 assert(cliquetable !=
NULL);
2236 assert(clique !=
NULL);
2285 int nlocalbdchgs = 0;
2289 assert(cliquetable !=
NULL);
2290 assert(vars !=
NULL);
2297 *infeasible =
FALSE;
2301 if( values ==
NULL )
2306 for( v = nvars - 1; v >= 0; --v )
2307 clqvalues[v] =
TRUE;
2319 for( v = nvars - 1; v >= 0; --v )
2333 SCIPsetDebugMsg(
set,
"in a clique var %s with value %u is fixed to %d -> fix the rest\n",
SCIPvarGetName(var), clqvalues[v], clqvalues[v] ? 1 : 0);
2335 for( w = nvars - 1; w >= 0; --w )
2363 #ifdef SCIP_DISABLED_CODE 2368 while( w > 0 && clqvars[w - 1] == clqvars[w] )
2370 if( clqvalues[w - 1] != clqvalues[w] )
2381 branchcand, eventqueue, cliquetable, !clqval, infeasible, &nlocalbdchgs) );
2384 clqval ? 0 : 1, *infeasible ?
"infeasible" :
"feasible");
2401 clqvars[v] = clqvars[nvars];
2402 clqvalues[v] = clqvalues[nvars];
2407 if( nbdchgs !=
NULL )
2408 *nbdchgs += nlocalbdchgs;
2414 assert(!*infeasible);
2417 if( v < 0 && nvars <= 1)
2426 branchcand, eventqueue, cliquetable, clqvalues[0], infeasible, &nlocalbdchgs) );
2429 clqvalues[0] ? 1 : 0, *infeasible ?
"infeasible" :
"feasible");
2431 if( nbdchgs !=
NULL )
2432 *nbdchgs += nlocalbdchgs;
2434 else if( nvars == 0 )
2436 SCIPsetDebugMsg(
set,
"empty equation clique left over -> infeasible\n");
2448 SCIP_CALL(
sortAndMergeClique(clqvars, clqvalues, &nvars, &isequation,
NULL, blkmem,
set, stat, transprob, origprob, tree,
2449 reopt, lp, branchcand, eventqueue, cliquetable, &nlocalbdchgs, infeasible) );
2451 if( nbdchgs !=
NULL )
2452 *nbdchgs += nlocalbdchgs;
2455 if( nvars == 0 || *infeasible )
2470 if( sameclique ==
NULL )
2472 SCIPsetDebugMsg(
set,
"adding clique %u with %d vars to clique table\n", clique->
id, nvars);
2491 SCIPsetDebugMsg(
set,
"same clique %p (id: %d) already found in cliquetable -> discard new one\n", (
void*) sameclique, sameclique->
id);
2497 if( !sameclique->equation && clique->
equation )
2498 sameclique->equation =
TRUE;
2507 assert(!isequation);
2540 assert(clique !=
NULL);
2541 assert(blkmem !=
NULL);
2542 assert(
set !=
NULL);
2543 assert(nchgbds !=
NULL);
2544 assert(infeasible !=
NULL);
2557 SCIPsetDebugMsg(
set,
"Starting clean up of clique %u (size %d) from position %d\n", clique->
id, clique->
nvars, w);
2560 for( v = w; v < clique->
nvars; ++v )
2564 addvartoclique =
FALSE;
2583 addvartoclique =
TRUE;
2606 if( onefixedvar !=
NULL )
2610 SCIPsetDebugMsg(
set,
"two variables in clique %u fixed to one %s%s and %s%s\n", clique->
id,
2615 onefixedvar = clique->
vars[v];
2616 onefixedvalue = clique->
values[v];
2630 if( addvartoclique )
2641 if( onefixedvar !=
NULL )
2643 SCIPsetDebugMsg(
set,
"variable %s%s in clique %u fixed to one, fixing all other variables to zero\n",
2646 for( v = 0; v < clique->
nvars ; ++v )
2654 if( onefixedvalue != clqval || clqvar != onefixedvar )
2668 assert(clqvar != onefixedvar);
2681 #ifdef SCIP_DISABLED_CODE 2686 while( v < clique->nvars - 1 && clique->
vars[v + 1] == clqvar )
2698 SCIP_CALL(
SCIPvarFixBinary(clqvar, blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand,
2699 eventqueue, cliquetable, !clqval, infeasible, nchgbds) );
2721 if( clique->
nvars == 0 )
2726 else if( clique->
nvars == 1 )
2735 clique->
values[0] ? 1 : 0);
2738 branchcand, eventqueue, cliquetable, clique->
values[0], infeasible, nchgbds) );
2754 transprob, origprob, tree, reopt, lp, branchcand, eventqueue, cliquetable, nchgbds, infeasible) );
2768 #ifdef SCIP_MORE_DEBUG 2778 assert(cliquetable !=
NULL);
2780 for( c = cliquetable->
ncliques - 1; c >= 0; --c )
2783 return (nentries == cliquetable->
nentries);
2786 #define checkNEntries(cliquetable) TRUE 2811 assert(cliquetable !=
NULL);
2812 assert(stat !=
NULL);
2813 assert(infeasible !=
NULL);
2815 *infeasible =
FALSE;
2823 SCIPsetDebugMsg(
set,
"cleaning up clique table with %d cliques (with %" SCIP_LONGINT_FORMAT
" entries)\n", cliquetable->
ncliques, cliquetable->
nentries);
2834 clique = cliquetable->
cliques[0];
2840 cliquetable->
nentries -= clique->nvars;
2841 assert(cliquetable->
nentries >= 0);
2843 SCIP_CALL(
cliqueCleanup(clique, blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand, eventqueue,
2844 cliquetable, nchgbds, infeasible) );
2867 printf(
"aggr vars, clique %d\n", clique->id);
2871 var0 = clique->vars[0];
2872 var1 = clique->vars[1];
2874 if( !clique->values[0] )
2882 if( !clique->values[1] )
2892 var0 = clique->vars[1];
2893 var1 = clique->vars[0];
2895 if( !clique->values[0] )
2903 if( !clique->values[1] )
2917 tree, lp, cliquetable, branchcand, eventfilter, eventqueue,
2918 var0, var1, scalarx, scalary, rhs, infeasible, &aggregated) );
2920 assert(aggregated || *infeasible);
2927 if( clique->nvars <= 1 || sameclique !=
NULL )
2932 assert(clique->nvars > 1 || !clique->equation);
2937 if( clique->nvars > 1 && clique->equation && !sameclique->
equation )
2939 assert(sameclique->
nvars >= 2);
2948 for( j = 0; j < clique->nvars; ++j )
2966 cliquetable->
nentries += clique->nvars;
2969 if( !clique->eventsissued )
2974 for( j = 0; j < clique->nvars; ++j )
2981 clique->eventsissued =
TRUE;
2994 SCIPsetDebugMsg(
set,
"cleaned up clique table has %d cliques left (with %" SCIP_LONGINT_FORMAT
" entries)\n", cliquetable->
ncliques, cliquetable->
nentries);
3011 assert(binvar !=
NULL);
3030 assert(nodeindex >= 0);
3061 assert(cliquetable !=
NULL);
3062 assert(vars !=
NULL);
3066 ndiscvars = nbinvars + nintvars + nimplvars;
3069 for( v = nbinvars; v < ndiscvars; ++v )
3076 nbinvarstotal = nbinvars + nimplbinvars;
3079 if( nbinvarstotal == 0 )
3081 SCIPsetDebugMsg(
set,
"0 binary variables in total --> 0 connected components in the clique graph");
3089 SCIPsetDebugMsg(
set,
"0 cliques --> Clique graph has %d isolated nodes", nbinvarstotal);
3098 for( v = 0; v < nbinvars; ++v )
3105 for( v = nbinvars; v < nbinvars + nintvars + nimplvars; ++v )
3122 cliques = cliquetable->
cliques;
3125 for( c = 0; c < cliquetable->
ncliques; ++c )
3131 int lastactiveindex = -1;
3133 clique = cliques[c];
3136 assert(nclqvars > 0);
3139 for( cv = 0; cv < nclqvars; ++cv )
3143 assert(nodeindex < ndiscvars);
3145 if( nodeindex >= 0 )
3148 if( lastactiveindex >= 0 )
3153 lastactiveindex = nodeindex;
3169 for( v = 0; v < ndiscvars; ++v )
3189 #undef SCIPvboundsGetNVbds 3190 #undef SCIPvboundsGetVars 3191 #undef SCIPvboundsGetCoefs 3192 #undef SCIPvboundsGetConstants 3193 #undef SCIPimplicsGetNImpls 3194 #undef SCIPimplicsGetVars 3195 #undef SCIPimplicsGetTypes 3196 #undef SCIPimplicsGetBounds 3197 #undef SCIPimplicsGetIds 3198 #undef SCIPcliqueGetNVars 3199 #undef SCIPcliqueGetVars 3200 #undef SCIPcliqueGetValues 3201 #undef SCIPcliqueGetId 3202 #undef SCIPcliqueIsCleanedUp 3203 #undef SCIPcliqueIsEquation 3204 #undef SCIPcliquelistGetNCliques 3205 #undef SCIPcliquelistGetCliques 3206 #undef SCIPcliquelistCheck 3207 #undef SCIPcliquetableGetNCliques 3208 #undef SCIPcliquetableGetCliques 3209 #undef SCIPcliquetableGetNEntries 3210 #undef SCIPcliquetableGetNCliqueComponents 3211 #undef SCIPcliquetableNeedsComponentUpdate 3218 return vbounds !=
NULL ? vbounds->
len : 0;
3251 return implics !=
NULL ? implics->
nimpls[varfixing] : 0;
3260 return implics !=
NULL ? implics->
vars[varfixing] :
NULL;
3290 return implics !=
NULL ? implics->
ids[varfixing] :
NULL;
3298 assert(clique !=
NULL);
3300 return clique->
nvars;
3308 assert(clique !=
NULL);
3310 return clique->
vars;
3320 assert(clique !=
NULL);
3330 assert(clique !=
NULL);
3332 return (
int) clique->
id;
3340 assert(clique !=
NULL);
3350 assert(clique !=
NULL);
3361 return cliquelist !=
NULL ? cliquelist->
ncliques[value] : 0;
3390 for( value = 0; value < 2; ++value )
3398 for( i = 0; i < ncliques; ++i )
3403 clique = cliques[i];
3404 assert(clique !=
NULL);
3407 assert(0 <= pos && pos < clique->nvars);
3408 assert(clique->
vars[pos] == var);
3420 assert(cliquetable !=
NULL);
3430 assert(cliquetable !=
NULL);
3440 assert(cliquetable !=
NULL);
SCIP_Bool componentupdate
enum SCIP_BoundType SCIP_BOUNDTYPE
void SCIPcliquelistRemoveFromCliques(SCIP_CLIQUELIST *cliquelist, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_Bool irrelevantvar)
#define HASHTABLE_CLIQUETABLE_SIZE
#define BMSfreeBlockMemoryArrayNull(mem, ptr, num)
internal methods for managing events
SCIP_VAR ** SCIPcliqueGetVars(SCIP_CLIQUE *clique)
static SCIP_Bool implicsSearchImplic(SCIP_IMPLICS *implics, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype, int *poslower, int *posupper, int *posadd)
#define BMSfreeMemoryArrayNull(ptr)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
void SCIPimplicsGetVarImplics(SCIP_IMPLICS *implics, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_Bool *haslowerimplic, SCIP_Bool *hasupperimplic)
SCIP_RETCODE SCIPeventqueueProcess(SCIP_EVENTQUEUE *eventqueue, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_PRIMAL *primal, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTFILTER *eventfilter)
SCIP_HASHTABLE * hashtable
SCIP_Longint SCIPcliquetableGetNEntries(SCIP_CLIQUETABLE *cliquetable)
SCIP_RETCODE SCIPcliqueAddVar(SCIP_CLIQUE *clique, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_VAR *var, SCIP_Bool value, SCIP_Bool *doubleentry, SCIP_Bool *oppositeentry)
static void cliquetableCheckComponentUpdate(SCIP_CLIQUETABLE *cliquetable, SCIP_CLIQUE *clique)
#define SCIPsetDuplicateBufferArray(set, ptr, source, num)
methods for implications, variable bounds, and cliques
SCIP_RETCODE SCIPeventqueueAdd(SCIP_EVENTQUEUE *eventqueue, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_PRIMAL *primal, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTFILTER *eventfilter, SCIP_EVENT **event)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPvarGetProbvarBinary(SCIP_VAR **var, SCIP_Bool *negated)
#define SCIP_HASHSIZE_CLIQUES_SMALL
SCIP_RETCODE SCIPeventCreateImplAdded(SCIP_EVENT **event, BMS_BLKMEM *blkmem, SCIP_VAR *var)
SCIP_VAR ** SCIPimplicsGetVars(SCIP_IMPLICS *implics, SCIP_Bool varfixing)
SCIP_RETCODE SCIPdigraphComputeUndirectedComponents(SCIP_DIGRAPH *digraph, int minsize, int *components, int *ncomponents)
SCIP_CLIQUE ** SCIPvarGetCliques(SCIP_VAR *var, SCIP_Bool varfixing)
static SCIP_RETCODE cliquetableEnsureSize(SCIP_CLIQUETABLE *cliquetable, SCIP_SET *set, int num)
int SCIPcliquelistGetNCliques(SCIP_CLIQUELIST *cliquelist, SCIP_Bool value)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_VAR ** SCIPvboundsGetVars(SCIP_VBOUNDS *vbounds)
#define SCIPdebugCheckClique(set, vars, values, nvars)
SCIP_Bool SCIPcliqueHasVar(SCIP_CLIQUE *clique, SCIP_VAR *var, SCIP_Bool value)
static SCIP_RETCODE cliqueCleanup(SCIP_CLIQUE *clique, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, int *nchgbds, SCIP_Bool *infeasible)
static SCIP_RETCODE implicsEnsureSize(SCIP_IMPLICS **implics, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Bool varfixing, int num)
static SCIP_DECL_HASHKEYVAL(hashkeyvalClique)
SCIP_Bool SCIPsetIsZero(SCIP_SET *set, SCIP_Real val)
SCIP_RETCODE SCIPeventqueueDelay(SCIP_EVENTQUEUE *eventqueue)
SCIP_RETCODE SCIPvboundsDel(SCIP_VBOUNDS **vbounds, BMS_BLKMEM *blkmem, SCIP_VAR *vbdvar, SCIP_Bool negativecoef)
enum SCIP_Retcode SCIP_RETCODE
SCIP_Bool SCIPcliqueIsEquation(SCIP_CLIQUE *clique)
SCIP_RETCODE SCIPdigraphSetSizes(SCIP_DIGRAPH *digraph, int *sizes)
SCIP_RETCODE SCIPcliquetableCreate(SCIP_CLIQUETABLE **cliquetable, SCIP_SET *set, BMS_BLKMEM *blkmem)
#define SCIPsetAllocBufferArray(set, ptr, num)
#define checkNEntries(cliquetable)
static SCIP_RETCODE cliquelistCreate(SCIP_CLIQUELIST **cliquelist, BMS_BLKMEM *blkmem)
int SCIPvarGetProbindex(SCIP_VAR *var)
SCIP_RETCODE SCIPcliquetableCleanup(SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, int *nchgbds, SCIP_Bool *infeasible)
int SCIPsetCalcMemGrowSize(SCIP_SET *set, int num)
unsigned int eventsissued
SCIP_RETCODE SCIPimplicsDel(SCIP_IMPLICS **implics, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype)
SCIP_RETCODE SCIPcliquetableFree(SCIP_CLIQUETABLE **cliquetable, BMS_BLKMEM *blkmem)
SCIP_CLIQUE ** SCIPcliquelistGetCliques(SCIP_CLIQUELIST *cliquelist, SCIP_Bool value)
SCIP_RETCODE SCIPcliquelistAdd(SCIP_CLIQUELIST **cliquelist, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Bool value, SCIP_CLIQUE *clique)
#define SCIPsetFreeBufferArray(set, ptr)
#define BMSfreeMemory(ptr)
SCIP_VAR * SCIPvarGetNegationVar(SCIP_VAR *var)
static void implicsSearchVar(SCIP_IMPLICS *implics, SCIP_Bool varfixing, SCIP_VAR *implvar, int *poslower, int *posupper, int *posadd)
int SCIPvarGetNCliques(SCIP_VAR *var, SCIP_Bool varfixing)
static int getNodeIndexBinvar(SCIP_VAR *binvar)
static void cliquetableSwapCliques(SCIP_CLIQUETABLE *cliquetable, int first, int second)
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)
static void cliquetableMarkCliqueForCleanup(SCIP_CLIQUETABLE *cliquetable, SCIP_CLIQUE *clique)
SCIP_RETCODE SCIPvboundsAdd(SCIP_VBOUNDS **vbounds, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_BOUNDTYPE vboundtype, SCIP_VAR *var, SCIP_Real coef, SCIP_Real constant, SCIP_Bool *added)
static SCIP_RETCODE cliqueCreateWithData(SCIP_CLIQUE **clique, BMS_BLKMEM *blkmem, int size, SCIP_VAR **vars, SCIP_Bool *values, int nvars, int id, SCIP_Bool isequation)
#define SCIP_HASHSIZE_CLIQUES
void SCIPcliquelistFree(SCIP_CLIQUELIST **cliquelist, BMS_BLKMEM *blkmem)
void SCIPvarSetCliqueComponentIdx(SCIP_VAR *var, int idx)
SCIP_RETCODE SCIPdigraphCreate(SCIP_DIGRAPH **digraph, int nnodes)
int SCIPcliqueSearchVar(SCIP_CLIQUE *clique, SCIP_VAR *var, SCIP_Bool value)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_VAR * SCIPvarGetProbvar(SCIP_VAR *var)
int SCIPcliquetableGetNCliques(SCIP_CLIQUETABLE *cliquetable)
#define BMSduplicateBlockMemoryArray(mem, ptr, source, num)
SCIP_BOUNDTYPE * SCIPimplicsGetTypes(SCIP_IMPLICS *implics, SCIP_Bool varfixing)
void SCIPcliqueDelVar(SCIP_CLIQUE *clique, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_Bool value)
SCIP_Bool SCIPimplicsContainsImpl(SCIP_IMPLICS *implics, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype)
SCIP_RETCODE SCIPimplicsAdd(SCIP_IMPLICS **implics, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype, SCIP_Real implbound, SCIP_Bool isshortcut, SCIP_Bool *conflict, SCIP_Bool *added)
void SCIPsortPtrBool(void **ptrarray, SCIP_Bool *boolarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
static SCIP_DECL_HASHGETKEY(hashgetkeyClique)
#define SCIPcombineThreeInt(a, b, c)
#define BMSmoveMemoryArray(ptr, source, num)
SCIP_Bool SCIPsortedvecFindPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), void *val, int len, int *pos)
static int cliquesSearchClique(SCIP_CLIQUE **cliques, int ncliques, SCIP_CLIQUE *clique)
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_Real * SCIPvboundsGetCoefs(SCIP_VBOUNDS *vbounds)
internal methods for global SCIP settings
#define SCIPhashTwo(a, b)
static void checkImplics(SCIP_IMPLICS *implics)
SCIP_Bool SCIPsetIsFeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
SCIP_Real * SCIPvboundsGetConstants(SCIP_VBOUNDS *vbounds)
SCIP_RETCODE SCIPdigraphAddArc(SCIP_DIGRAPH *digraph, int startnode, int endnode, void *data)
SCIP_Bool SCIPcliquelistsHaveCommonClique(SCIP_CLIQUELIST *cliquelist1, SCIP_Bool value1, SCIP_CLIQUELIST *cliquelist2, SCIP_Bool value2)
SCIP_Bool SCIPsetIsFeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
int SCIPcliquetableGetNCliqueComponents(SCIP_CLIQUETABLE *cliquetable)
void SCIPvboundsShrink(SCIP_VBOUNDS **vbounds, BMS_BLKMEM *blkmem, int newnvbds)
#define BMSfreeBlockMemory(mem, ptr)
internal methods for problem variables
SCIP_RETCODE SCIPvarTryAggregateVars(SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_PRIMAL *primal, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_CLIQUETABLE *cliquetable, SCIP_BRANCHCAND *branchcand, SCIP_EVENTFILTER *eventfilter, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR *varx, SCIP_VAR *vary, SCIP_Real scalarx, SCIP_Real scalary, SCIP_Real rhs, SCIP_Bool *infeasible, SCIP_Bool *aggregated)
datastructures for implications, variable bounds, and cliques
public data structures and miscellaneous methods
SCIP_Bool SCIPcliquetableNeedsComponentUpdate(SCIP_CLIQUETABLE *cliquetable)
int SCIPvarGetCliqueComponentIdx(SCIP_VAR *var)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
int * SCIPimplicsGetIds(SCIP_IMPLICS *implics, SCIP_Bool varfixing)
int SCIPimplicsGetNImpls(SCIP_IMPLICS *implics, SCIP_Bool varfixing)
SCIP_Bool * SCIPcliqueGetValues(SCIP_CLIQUE *clique)
SCIP_RETCODE SCIPvarAddCliqueToList(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Bool value, SCIP_CLIQUE *clique)
static SCIP_DECL_HASHKEYEQ(hashkeyeqClique)
SCIP_BOUNDTYPE * types[2]
#define cliqueCheck(clique)
SCIP_RETCODE SCIPvarFixBinary(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, SCIP_Bool value, SCIP_Bool *infeasible, int *nbdchgs)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
SCIP_Bool SCIPsetIsFeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPcliquetableAdd(SCIP_CLIQUETABLE *cliquetable, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_VAR **vars, SCIP_Bool *values, int nvars, SCIP_Bool isequation, SCIP_Bool *infeasible, int *nbdchgs)
static SCIP_RETCODE vboundsCreate(SCIP_VBOUNDS **vbounds, BMS_BLKMEM *blkmem)
int SCIPvboundsGetNVbds(SCIP_VBOUNDS *vbounds)
static void cliqueFree(SCIP_CLIQUE **clique, BMS_BLKMEM *blkmem)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
static SCIP_RETCODE cliqueEnsureSize(SCIP_CLIQUE *clique, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
static SCIP_RETCODE vboundsSearchPos(SCIP_VBOUNDS *vbounds, SCIP_VAR *var, SCIP_Bool negativecoef, int *insertpos, SCIP_Bool *found)
static SCIP_RETCODE sortAndMergeClique(SCIP_VAR **clqvars, SCIP_Bool *clqvalues, int *nclqvars, SCIP_Bool *isequation, SCIP_CLIQUE *clique, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_STAT *stat, SCIP_PROB *transprob, SCIP_PROB *origprob, SCIP_TREE *tree, SCIP_REOPT *reopt, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTQUEUE *eventqueue, SCIP_CLIQUETABLE *cliquetable, int *nbdchgs, SCIP_Bool *infeasible)
static SCIP_DECL_SORTPTRCOMP(compVars)
static SCIP_RETCODE vboundsEnsureSize(SCIP_VBOUNDS **vbounds, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
public methods for message output
void SCIPcliquelistCheck(SCIP_CLIQUELIST *cliquelist, SCIP_VAR *var)
SCIP_CLIQUE ** cliques[2]
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
internal methods for problem statistics
SCIP_RETCODE SCIPvarsGetProbvarBinary(SCIP_VAR ***vars, SCIP_Bool **negatedarr, int nvars)
SCIP_RETCODE SCIPcliquetableComputeCliqueComponents(SCIP_CLIQUETABLE *cliquetable, SCIP_SET *set, SCIP_VAR **vars, int nbinvars, int nintvars, int nimplvars)
#define BMSallocMemory(ptr)
#define BMSreallocMemoryArray(ptr, num)
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_Bool SCIPsetIsFeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
static SCIP_RETCODE cliquelistEnsureSize(SCIP_CLIQUELIST *cliquelist, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Bool value, int num)
SCIP_STAGE SCIPsetGetStage(SCIP_SET *set)
SCIP_Bool SCIPvarIsMarkedDeleteGlobalStructures(SCIP_VAR *var)
SCIP_Bool SCIPcliqueIsCleanedUp(SCIP_CLIQUE *clique)
int SCIPcliqueGetNVars(SCIP_CLIQUE *clique)
#define BMSallocBlockMemory(mem, ptr)
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
void SCIPdigraphFree(SCIP_DIGRAPH **digraph)
SCIP_Real * SCIPimplicsGetBounds(SCIP_IMPLICS *implics, SCIP_Bool varfixing)
#define SCIPcombineTwoInt(a, b)
static SCIP_RETCODE implicsCreate(SCIP_IMPLICS **implics, BMS_BLKMEM *blkmem)
void SCIPvboundsFree(SCIP_VBOUNDS **vbounds, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPvarsAddClique(SCIP_VAR **vars, SCIP_Bool *values, int nvars, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_CLIQUE *clique)
#define BMSreallocBlockMemoryArray(mem, ptr, oldnum, newnum)
SCIP_CLIQUE ** SCIPcliquetableGetCliques(SCIP_CLIQUETABLE *cliquetable)
void SCIPimplicsFree(SCIP_IMPLICS **implics, BMS_BLKMEM *blkmem)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
SCIP_RETCODE SCIPcliquelistDel(SCIP_CLIQUELIST **cliquelist, BMS_BLKMEM *blkmem, SCIP_Bool value, SCIP_CLIQUE *clique)
int SCIPcliqueGetId(SCIP_CLIQUE *clique)
SCIP_RETCODE SCIPvarDelCliqueFromList(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_Bool value, SCIP_CLIQUE *clique)