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] )
498 (*implics)->size[varfixing] = newsize;
500 assert(num <= (*implics)->size[varfixing]);
523 assert(implics !=
NULL);
524 assert(poslower !=
NULL);
525 assert(posupper !=
NULL);
526 assert(posadd !=
NULL);
528 if( implics->
nimpls[varfixing] == 0 )
536 right = implics->
nimpls[varfixing] - 1;
540 found =
SCIPsortedvecFindPtr((
void**)(&(implics->
vars[varfixing][0])), SCIPvarComp, (
void*)implvar, right + 1, &pos);
545 assert(pos >= right || compVars((
void*)implics->
vars[varfixing][pos], (
void*)implvar) > 0);
546 assert(pos == 0 || compVars((
void*)implics->
vars[varfixing][pos-1], (
void*)implvar) < 0);
554 assert(implvar == implics->
vars[varfixing][pos]);
561 if( pos + 1 < implics->
nimpls[varfixing] && implics->
vars[varfixing][pos+1] == implvar )
574 if( pos - 1 >= 0 && implics->
vars[varfixing][pos-1] == implvar )
603 assert(implics !=
NULL);
604 assert(poslower !=
NULL);
605 assert(posupper !=
NULL);
606 assert(posadd !=
NULL);
609 assert(*poslower == -1 || *posupper == -1 || *posupper == (*poslower)+1);
610 assert(*poslower == -1 || *posadd == *poslower);
611 assert(*poslower >= 0 || *posupper == -1 || *posadd == *posupper);
612 assert(0 <= *posadd && *posadd <= implics->nimpls[varfixing]);
615 return (*poslower >= 0);
620 assert(*posadd == *poslower);
623 return (*posupper >= 0);
652 assert(implics !=
NULL);
653 assert(*implics ==
NULL || 0 <= (*implics)->nimpls[varfixing]);
654 assert(stat !=
NULL);
659 assert(conflict !=
NULL);
660 assert(added !=
NULL);
662 SCIPsetDebugMsg(
set,
"adding implication to implics %p [%u]: <%s> %s %g\n",
671 if( *implics !=
NULL )
673 found =
implicsSearchImplic(*implics, varfixing, implvar, impltype, &poslower, &posupper, &posadd);
674 assert(-1 <= poslower && poslower < (*implics)->nimpls[varfixing]);
675 assert(-1 <= posupper && posupper < (*implics)->nimpls[varfixing]);
676 assert(0 <= posadd && posadd <= (*implics)->nimpls[varfixing]);
690 assert(found == (poslower >= 0));
693 if( poslower >= 0 &&
SCIPsetIsFeasLE(
set, implbound, (*implics)->bounds[varfixing][poslower]) )
700 if( posupper >= 0 &&
SCIPsetIsFeasGT(
set, implbound, (*implics)->bounds[varfixing][posupper]) )
712 assert(poslower >= 0);
713 assert(posadd == poslower);
716 assert((*implics)->vars[varfixing][poslower] == implvar);
717 assert(
SCIPsetIsFeasGT(
set, implbound, (*implics)->bounds[varfixing][poslower]));
718 (*implics)->bounds[varfixing][poslower] = implbound;
722 assert(poslower == -1);
726 *implics !=
NULL ? (*implics)->nimpls[varfixing]+1 : 1) );
727 assert(*implics !=
NULL);
729 if( (*implics)->nimpls[varfixing] - posadd > 0 )
731 int amount = ((*implics)->nimpls[varfixing] - posadd);
734 for( k = (*implics)->nimpls[varfixing]; k > posadd; k-- )
736 assert(compVars((
void*)(*implics)->vars[varfixing][k-1], (
void*)implvar) >= 0);
739 BMSmoveMemoryArray(&((*implics)->types[varfixing][posadd+1]), &((*implics)->types[varfixing][posadd]), amount);
740 BMSmoveMemoryArray(&((*implics)->ids[varfixing][posadd+1]), &((*implics)->ids[varfixing][posadd]), amount);
741 BMSmoveMemoryArray(&((*implics)->vars[varfixing][posadd+1]), &((*implics)->vars[varfixing][posadd]), amount);
742 BMSmoveMemoryArray(&((*implics)->bounds[varfixing][posadd+1]), &((*implics)->bounds[varfixing][posadd]), amount);
745 (*implics)->vars[varfixing][posadd] = implvar;
746 (*implics)->types[varfixing][posadd] = impltype;
747 (*implics)->bounds[varfixing][posadd] = implbound;
749 (*implics)->nimpls[varfixing]++;
751 for( k = posadd-1; k >= 0; k-- )
752 assert(compVars((
void*)(*implics)->vars[varfixing][k], (
void*)implvar) <= 0);
759 assert(found == (posupper >= 0));
762 if( posupper >= 0 &&
SCIPsetIsFeasGE(
set, implbound, (*implics)->bounds[varfixing][posupper]) )
769 if( poslower >= 0 &&
SCIPsetIsFeasLT(
set, implbound, (*implics)->bounds[varfixing][poslower]) )
781 assert(posupper >= 0);
782 assert(posadd == posupper);
785 assert((*implics)->vars[varfixing][posupper] == implvar);
786 assert(
SCIPsetIsFeasLT(
set, implbound,(*implics)->bounds[varfixing][posupper]));
787 (*implics)->bounds[varfixing][posupper] = implbound;
792 assert(posupper == -1);
795 *implics !=
NULL ? (*implics)->nimpls[varfixing]+1 : 1) );
796 assert(*implics !=
NULL);
798 if( (*implics)->nimpls[varfixing] - posadd > 0 )
800 int amount = ((*implics)->nimpls[varfixing] - posadd);
803 for( k = (*implics)->nimpls[varfixing]; k > posadd; k-- )
805 assert(compVars((
void*)(*implics)->vars[varfixing][k-1], (
void*)implvar) >= 0);
808 BMSmoveMemoryArray(&((*implics)->types[varfixing][posadd+1]), &((*implics)->types[varfixing][posadd]), amount);
809 BMSmoveMemoryArray(&((*implics)->ids[varfixing][posadd+1]), &((*implics)->ids[varfixing][posadd]), amount);
810 BMSmoveMemoryArray(&((*implics)->vars[varfixing][posadd+1]), &((*implics)->vars[varfixing][posadd]), amount);
811 BMSmoveMemoryArray(&((*implics)->bounds[varfixing][posadd+1]), &((*implics)->bounds[varfixing][posadd]), amount);
814 (*implics)->vars[varfixing][posadd] = implvar;
815 (*implics)->types[varfixing][posadd] = impltype;
816 (*implics)->bounds[varfixing][posadd] = implbound;
818 (*implics)->nimpls[varfixing]++;
820 for( k = posadd-1; k >= 0; k-- )
821 assert(compVars((
void*)(*implics)->vars[varfixing][k], (
void*)implvar) <= 0);
847 assert(implics !=
NULL);
848 assert(*implics !=
NULL);
849 assert(implvar !=
NULL);
851 SCIPsetDebugMsg(
set,
"deleting implication from implics %p [%u]: <%s> %s x\n",
857 found =
implicsSearchImplic(*implics, varfixing, implvar, impltype, &poslower, &posupper, &posadd);
866 assert(0 <= posadd && posadd < (*implics)->nimpls[varfixing]);
867 assert((*implics)->vars[varfixing][posadd] == implvar);
868 assert((*implics)->types[varfixing][posadd] == impltype);
871 if( (*implics)->nimpls[varfixing] - posadd > 1 )
873 int amount = ((*implics)->nimpls[varfixing] - posadd - 1);
875 BMSmoveMemoryArray(&((*implics)->types[varfixing][posadd]), &((*implics)->types[varfixing][posadd+1]), amount);
876 BMSmoveMemoryArray(&((*implics)->vars[varfixing][posadd]), &((*implics)->vars[varfixing][posadd+1]), amount);
877 BMSmoveMemoryArray(&((*implics)->bounds[varfixing][posadd]), &((*implics)->bounds[varfixing][posadd+1]), amount);
879 (*implics)->nimpls[varfixing]--;
882 if( (*implics)->nimpls[0] == 0 && (*implics)->nimpls[1] == 0 )
903 assert(haslowerimplic !=
NULL);
904 assert(hasupperimplic !=
NULL);
906 implicsSearchVar(implics, varfixing, implvar, &poslower, &posupper, &posadd);
908 *haslowerimplic = (poslower >= 0);
909 *hasupperimplic = (posupper >= 0);
924 return implicsSearchImplic(implics, varfixing, implvar, impltype, &poslower, &posupper, &posadd);
943 if( first != second )
947 tmp = cliquetable->
cliques[first];
948 assert(tmp->
index == first);
952 cliquetable->
cliques[second] = tmp;
996 assert(clique !=
NULL);
997 assert(blkmem !=
NULL);
998 assert(size >= nvars && nvars > 0);
999 assert(vars !=
NULL);
1000 assert(values !=
NULL);
1005 (*clique)->nvars = nvars;
1006 (*clique)->size = size;
1007 (*clique)->startcleanup = -1;
1008 (*clique)->id = (
unsigned int)
id;
1009 (*clique)->eventsissued =
FALSE;
1010 (*clique)->equation = isequation;
1011 (*clique)->index = -1;
1023 assert(clique !=
NULL);
1025 if( *clique !=
NULL )
1042 assert(clique !=
NULL);
1044 if( num > clique->
size )
1051 clique->
size = newsize;
1053 assert(num <= clique->size);
1071 assert(clique !=
NULL);
1075 right = clique->
nvars;
1076 while( left < right-1 )
1081 middle = (left+right)/2;
1086 else if( varidx > idx )
1090 assert(var == clique->
vars[middle]);
1093 if( clique->
values[middle] < value )
1096 for( i = middle+1; i < clique->
nvars && clique->
vars[i] == var; ++i )
1098 if( clique->
values[i] == value )
1103 if( clique->
values[middle] > value )
1106 for( i = middle-1; i >= 0 && clique->
vars[i] == var; --i )
1108 if( clique->
values[i] == value )
1144 assert(clique !=
NULL);
1147 assert(doubleentry !=
NULL);
1148 assert(oppositeentry !=
NULL);
1152 *doubleentry =
FALSE;
1153 *oppositeentry =
FALSE;
1163 assert(pos >= 0 && pos <= clique->nvars);
1167 if( pos < clique->nvars )
1169 const int amount = clique->
nvars - pos;
1180 for( ; pos < clique->
nvars - 1 && clique->
vars[pos + 1] == var && clique->
values[pos + 1] == value; ++pos );
1183 if( pos < clique->nvars - 1 && clique->
vars[pos + 1] == var )
1185 assert(clique->
values[pos + 1] != value);
1186 *oppositeentry =
TRUE;
1191 *doubleentry =
TRUE;
1195 for( ; pos > 0 && clique->
vars[pos - 1] == var && clique->
values[pos - 1] != value; --pos );
1198 if( pos > 0 && clique->
vars[pos - 1] == var )
1200 assert(clique->
values[pos - 1] == value);
1202 *doubleentry =
TRUE;
1207 assert(clique->
vars[pos] == var);
1208 assert(clique->
values[pos] != value);
1210 clique->
values[pos] = value;
1219 for( ; pos < clique->
nvars - 1 && clique->
vars[pos + 1] == var && clique->
values[pos + 1] != value; ++pos );
1222 if( pos < clique->nvars - 1 && clique->
vars[pos + 1] == var )
1224 assert(clique->
values[pos + 1] == value);
1225 *doubleentry =
TRUE;
1231 *oppositeentry =
TRUE;
1234 assert(clique->
vars[pos] == var);
1235 assert(clique->
values[pos] != value);
1237 clique->
values[pos] = value;
1243 for( ; pos > 0 && clique->
vars[pos - 1] == var && clique->
values[pos - 1] == value; --pos );
1246 *doubleentry =
TRUE;
1249 if( pos > 0 && clique->
vars[pos - 1] == var && clique->
values[pos - 1] != value )
1250 *oppositeentry =
TRUE;
1257 clique->
vars[i] = var;
1258 clique->
values[i] = value;
1274 assert(clique !=
NULL);
1276 assert(cliquetable !=
NULL);
1287 assert(0 <= pos && pos < clique->nvars);
1288 assert(clique->
vars[pos] == var);
1289 assert(clique->
values[pos] == value);
1295 if( clique->
startcleanup == -1 || pos < clique->startcleanup )
1298 #ifdef SCIP_MORE_DEBUG 1319 unsigned int cliqueid;
1323 assert(cliques !=
NULL || ncliques == 0);
1324 assert(clique !=
NULL);
1326 cliqueid = clique->
id;
1329 while( left < right-1 )
1334 assert(cliques !=
NULL);
1335 middle = (left+right)/2;
1336 id = cliques[middle]->
id;
1339 else if( cliqueid >
id )
1343 assert(clique == cliques[middle]);
1360 assert(clique !=
NULL);
1362 for( i = 0; i < clique->
nvars; ++i )
1369 var = clique->
vars[i];
1371 assert(i == 0 || clique->
vars[i-1] != var || clique->
values[i-1] <= clique->
values[i]);
1388 assert(0 <= pos && pos < ncliques);
1389 assert(cliques[pos] == clique);
1394 assert(clique->
index >= 0);
1397 #define cliqueCheck(clique) 1407 assert(cliquelist !=
NULL);
1410 (*cliquelist)->cliques[0] =
NULL;
1411 (*cliquelist)->cliques[1] =
NULL;
1412 (*cliquelist)->ncliques[0] = 0;
1413 (*cliquelist)->ncliques[1] = 0;
1414 (*cliquelist)->size[0] = 0;
1415 (*cliquelist)->size[1] = 0;
1426 assert(cliquelist !=
NULL);
1428 if( *cliquelist !=
NULL )
1446 assert(cliquelist !=
NULL);
1448 if( num > cliquelist->
size[value] )
1454 cliquelist->
size[value] = newsize;
1456 assert(num <= cliquelist->size[value]);
1473 assert(cliquelist !=
NULL);
1479 if( *cliquelist ==
NULL )
1485 if( (*cliquelist)->cliques[value] !=
NULL )
1487 for( i = (*cliquelist)->ncliques[value]; i > 0 && (*cliquelist)->cliques[value][i - 1]->id >
id; --i );
1489 if( i > 0 && (*cliquelist)->cliques[value][i - 1]->id ==
id )
1495 SCIPsetDebugMsg(
set,
"adding clique %u to cliquelist %p value %u (length: %d)\n",
1496 clique->
id, (
void*)*cliquelist, value, (*cliquelist)->
ncliques[value]);
1498 BMSmoveMemoryArray(&((*cliquelist)->cliques[value][i+1]), &((*cliquelist)->cliques[value][i]), (*cliquelist)->ncliques[value] - i);
1500 (*cliquelist)->cliques[value][i] = clique;
1501 (*cliquelist)->ncliques[value]++;
1516 assert(cliquelist !=
NULL);
1520 if( *cliquelist ==
NULL )
1523 SCIPdebugMessage(
"deleting clique %u from cliquelist %p value %u (length: %d)\n",
1524 clique->
id, (
void*)*cliquelist, value, (*cliquelist)->
ncliques[value]);
1526 pos =
cliquesSearchClique((*cliquelist)->cliques[value], (*cliquelist)->ncliques[value], clique);
1531 #ifdef SCIP_MORE_DEBUG 1537 assert(nclqvars >= 2);
1547 for( v = nclqvars - 1; v > 0; --v )
1549 if( clqvars[v] == clqvars[v - 1] )
1551 if( clqvalues[v] == clqvalues[v - 1] || (v > 1 && clqvars[v] == clqvars[v - 2]) )
1563 assert(0 <= pos && pos < (*cliquelist)->ncliques[value]);
1564 assert((*cliquelist)->cliques[value][pos] == clique);
1568 (*cliquelist)->ncliques[value]--;
1569 if( pos < (*cliquelist)->ncliques[value] )
1571 BMSmoveMemoryArray(&((*cliquelist)->cliques[value][pos]), &((*cliquelist)->cliques[value][pos+1]),
1572 (*cliquelist)->ncliques[value] - pos);
1576 if( (*cliquelist)->ncliques[0] == 0 && (*cliquelist)->ncliques[1] == 0 )
1599 if( cliquelist1 ==
NULL || cliquelist2 ==
NULL )
1602 ncliques1 = cliquelist1->
ncliques[value1];
1603 cliques1 = cliquelist1->
cliques[value1];
1604 ncliques2 = cliquelist2->
ncliques[value2];
1605 cliques2 = cliquelist2->
cliques[value2];
1610 if( i1 < ncliques1 && i2 < ncliques2 )
1615 if( ncliques2 > ncliques1 )
1622 cliques1 = cliques2;
1623 ncliques1 = ncliques2;
1641 assert(i1 < ncliques1);
1653 assert(i2 < ncliques2);
1673 if( cliquelist !=
NULL )
1677 SCIPdebugMessage(
"removing variable <%s> from cliques (%d with value 0, %d with value 1)\n",
1680 for( value = 0; value < 2; ++value )
1690 for( i = cliquelist->
ncliques[value] - 1; i >= 0; --i )
1694 clique = cliquelist->
cliques[value][i];
1695 assert(clique !=
NULL);
1697 SCIPdebugMessage(
" -> removing variable <%s> == %d from clique %u (size %d)\n",
1734 assert(clique1 !=
NULL);
1735 assert(clique2 !=
NULL);
1741 for( i = 0; i < clique1->
nvars; ++i )
1765 #define HASHTABLE_CLIQUETABLE_SIZE 100 1776 assert(cliquetable !=
NULL);
1784 hashgetkeyClique, hashkeyeqClique, hashkeyvalClique,
NULL) );
1786 (*cliquetable)->cliques =
NULL;
1787 (*cliquetable)->ncliques = 0;
1788 (*cliquetable)->size = 0;
1789 (*cliquetable)->ncreatedcliques = 0;
1790 (*cliquetable)->ncleanupfixedvars = 0;
1791 (*cliquetable)->ncleanupaggrvars = 0;
1792 (*cliquetable)->ndirtycliques = 0;
1793 (*cliquetable)->nentries = 0;
1794 (*cliquetable)->incleanup =
FALSE;
1795 (*cliquetable)->componentupdate =
FALSE;
1796 (*cliquetable)->ncliquecomponents = -1;
1809 assert(cliquetable !=
NULL);
1810 assert(*cliquetable !=
NULL);
1813 for( i = (*cliquetable)->ncliques - 1; i >= 0; --i )
1815 cliqueFree(&(*cliquetable)->cliques[i], blkmem);
1837 assert(cliquetable !=
NULL);
1839 if( num > cliquetable->
size )
1845 cliquetable->
size = newsize;
1847 assert(num <= cliquetable->size);
1879 assert(nclqvars !=
NULL);
1881 SCIPsetDebugMsg(
set,
"starting merging %d variables in clique %d\n", *nclqvars, (clique ==
NULL) ? -1 : (
int) clique->
id);
1883 if( *nclqvars <= 1 )
1886 assert(clqvars !=
NULL);
1887 assert(clqvalues !=
NULL);
1888 assert(blkmem !=
NULL);
1889 assert(
set !=
NULL);
1890 assert(stat !=
NULL);
1891 assert(transprob !=
NULL);
1892 assert(origprob !=
NULL);
1893 assert(tree !=
NULL);
1894 assert(eventqueue !=
NULL);
1895 assert(nbdchgs !=
NULL);
1896 assert(infeasible !=
NULL);
1902 noldbdchgs = *nbdchgs;
1905 startidx = *nclqvars - 1;
1906 while( startidx >= 0 )
1912 var = clqvars[startidx];
1918 if( clqvalues[startidx] )
1928 curr = startidx - 1;
1933 if( clqvars[curr] == var )
1935 if( clqvalues[curr] )
1946 assert(nzeros + nones <= *nclqvars);
1949 if( nones + nzeros == 1 )
1955 if( nones >= 2 && nzeros >= 2 )
1962 if( nones >= 2 || nzeros >= 2 )
1967 assert(nones <= 1 || nzeros <= 1);
1970 if( clique !=
NULL )
1986 SCIP_CALL(
SCIPvarFixBinary(var, blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand, eventqueue,
1987 cliquetable, fixvalue, infeasible, nbdchgs) );
1990 fixvalue ? 1 : 0, *infeasible ?
"infeasible" :
"feasible");
1997 if( nones >= 1 && nzeros >= 1 )
2002 if( nzeros + nones < *nclqvars )
2017 assert(clqvars[w] != var);
2023 while( w > 0 && clqvars[w-1] == clqvars[w] )
2025 if( clqvalues[w-1] != clqvalues[w] )
2036 if( clique !=
NULL )
2041 branchcand, eventqueue, cliquetable, !clqvalues[w], infeasible, nbdchgs) );
2044 clqvalues[w] ? 0 : 1, *infeasible ?
"infeasible" :
"feasible");
2053 if( clique !=
NULL )
2059 *isequation =
FALSE;
2066 assert(curr < startidx);
2072 if( *infeasible || *nclqvars == 0 )
2080 if( *nbdchgs > noldbdchgs )
2087 onefixedvalue =
TRUE;
2093 while( startidx < *nclqvars )
2095 var = clqvars[startidx];
2103 if( onefixedvar !=
NULL )
2107 SCIPsetDebugMsg(
set,
"two variables in clique %d fixed to one %s%s and %s%s\n", (clique !=
NULL) ? (
int) clique->
id : -1,
2112 onefixedvalue = clqvalues[startidx];
2120 clqvars[w] = clqvars[startidx];
2121 clqvalues[w] = clqvalues[startidx];
2130 if( clique !=
NULL )
2142 if( onefixedvar !=
NULL )
2144 SCIPsetDebugMsg(
set,
"variable %s%s in clique %d fixed to one, fixing all other variables to zero\n",
2145 onefixedvalue ?
"" :
"~",
SCIPvarGetName(onefixedvar), (clique !=
NULL) ? (
int) clique->
id : -1);
2148 for( startidx = *nclqvars; startidx >= 0; --startidx )
2154 if( onefixedvalue != clqvalues[startidx] || clqvars[startidx] != onefixedvar )
2156 if( clique !=
NULL )
2165 while( startidx > 0 && clqvars[startidx - 1] == clqvars[startidx] )
2167 if( clqvalues[startidx - 1] != clqvalues[startidx] )
2176 clqvalues[startidx] ? 0 : 1);
2180 branchcand, eventqueue, cliquetable, !clqvalues[startidx], infeasible, nbdchgs) );
2188 if( clique !=
NULL )
2194 *isequation =
FALSE;
2198 assert(!(*infeasible));
2202 if( *nclqvars == 0 )
2204 SCIPsetDebugMsg(
set,
"empty equation clique left over -> infeasible\n");
2208 else if( *nclqvars == 1 )
2213 if( clique !=
NULL )
2217 SCIP_CALL(
SCIPvarFixBinary(clqvars[0], blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand,
2218 eventqueue, cliquetable, clqvalues[0], infeasible, nbdchgs) );
2221 clqvalues[0] ? 1 : 0, *infeasible ?
"infeasible" :
"feasible");
2224 *isequation =
FALSE;
2239 assert(cliquetable !=
NULL);
2240 assert(clique !=
NULL);
2289 int nlocalbdchgs = 0;
2293 assert(cliquetable !=
NULL);
2294 assert(vars !=
NULL);
2301 *infeasible =
FALSE;
2305 if( values ==
NULL )
2310 for( v = nvars - 1; v >= 0; --v )
2311 clqvalues[v] =
TRUE;
2323 for( v = nvars - 1; v >= 0; --v )
2337 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);
2339 for( w = nvars - 1; w >= 0; --w )
2367 #ifdef SCIP_DISABLED_CODE 2372 while( w > 0 && clqvars[w - 1] == clqvars[w] )
2374 if( clqvalues[w - 1] != clqvalues[w] )
2385 branchcand, eventqueue, cliquetable, !clqval, infeasible, &nlocalbdchgs) );
2388 clqval ? 0 : 1, *infeasible ?
"infeasible" :
"feasible");
2405 clqvars[v] = clqvars[nvars];
2406 clqvalues[v] = clqvalues[nvars];
2411 if( nbdchgs !=
NULL )
2412 *nbdchgs += nlocalbdchgs;
2418 assert(!*infeasible);
2421 if( v < 0 && nvars <= 1)
2430 branchcand, eventqueue, cliquetable, clqvalues[0], infeasible, &nlocalbdchgs) );
2433 clqvalues[0] ? 1 : 0, *infeasible ?
"infeasible" :
"feasible");
2435 if( nbdchgs !=
NULL )
2436 *nbdchgs += nlocalbdchgs;
2438 else if( nvars == 0 )
2440 SCIPsetDebugMsg(
set,
"empty equation clique left over -> infeasible\n");
2452 SCIP_CALL(
sortAndMergeClique(clqvars, clqvalues, &nvars, &isequation,
NULL, blkmem,
set, stat, transprob, origprob, tree,
2453 reopt, lp, branchcand, eventqueue, cliquetable, &nlocalbdchgs, infeasible) );
2455 if( nbdchgs !=
NULL )
2456 *nbdchgs += nlocalbdchgs;
2459 if( nvars == 0 || *infeasible )
2474 if( sameclique ==
NULL )
2476 SCIPsetDebugMsg(
set,
"adding clique %u with %d vars to clique table\n", clique->
id, nvars);
2495 SCIPsetDebugMsg(
set,
"same clique %p (id: %d) already found in cliquetable -> discard new one\n", (
void*) sameclique, sameclique->
id);
2501 if( !sameclique->equation && clique->
equation )
2502 sameclique->equation =
TRUE;
2511 assert(!isequation);
2544 assert(clique !=
NULL);
2545 assert(blkmem !=
NULL);
2546 assert(
set !=
NULL);
2547 assert(nchgbds !=
NULL);
2548 assert(infeasible !=
NULL);
2561 SCIPsetDebugMsg(
set,
"Starting clean up of clique %u (size %d) from position %d\n", clique->
id, clique->
nvars, w);
2564 for( v = w; v < clique->
nvars; ++v )
2568 addvartoclique =
FALSE;
2587 addvartoclique =
TRUE;
2607 if( onefixedvar !=
NULL )
2611 SCIPsetDebugMsg(
set,
"two variables in clique %u fixed to one %s%s and %s%s\n", clique->
id,
2616 onefixedvar = clique->
vars[v];
2617 onefixedvalue = clique->
values[v];
2631 if( addvartoclique )
2642 if( onefixedvar !=
NULL )
2644 SCIPsetDebugMsg(
set,
"variable %s%s in clique %u fixed to one, fixing all other variables to zero\n",
2647 for( v = 0; v < clique->
nvars ; ++v )
2655 if( onefixedvalue != clqval || clqvar != onefixedvar )
2669 assert(clqvar != onefixedvar);
2682 #ifdef SCIP_DISABLED_CODE 2687 while( v < clique->nvars - 1 && clique->
vars[v + 1] == clqvar )
2699 SCIP_CALL(
SCIPvarFixBinary(clqvar, blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand,
2700 eventqueue, cliquetable, !clqval, infeasible, nchgbds) );
2722 if( clique->
nvars == 0 )
2727 else if( clique->
nvars == 1 )
2736 clique->
values[0] ? 1 : 0);
2739 branchcand, eventqueue, cliquetable, clique->
values[0], infeasible, nchgbds) );
2755 transprob, origprob, tree, reopt, lp, branchcand, eventqueue, cliquetable, nchgbds, infeasible) );
2769 #ifdef SCIP_MORE_DEBUG 2779 assert(cliquetable !=
NULL);
2781 for( c = cliquetable->
ncliques - 1; c >= 0; --c )
2784 return (nentries == cliquetable->
nentries);
2787 #define checkNEntries(cliquetable) TRUE 2812 assert(cliquetable !=
NULL);
2813 assert(stat !=
NULL);
2814 assert(infeasible !=
NULL);
2816 *infeasible =
FALSE;
2824 SCIPsetDebugMsg(
set,
"cleaning up clique table with %d cliques (with %" SCIP_LONGINT_FORMAT
" entries)\n", cliquetable->
ncliques, cliquetable->
nentries);
2835 clique = cliquetable->
cliques[0];
2841 cliquetable->
nentries -= clique->nvars;
2842 assert(cliquetable->
nentries >= 0);
2844 SCIP_CALL(
cliqueCleanup(clique, blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand, eventqueue,
2845 cliquetable, nchgbds, infeasible) );
2868 printf(
"aggr vars, clique %d\n", clique->id);
2872 var0 = clique->vars[0];
2873 var1 = clique->vars[1];
2875 if( !clique->values[0] )
2883 if( !clique->values[1] )
2893 var0 = clique->vars[1];
2894 var1 = clique->vars[0];
2896 if( !clique->values[0] )
2904 if( !clique->values[1] )
2918 tree, lp, cliquetable, branchcand, eventfilter, eventqueue,
2919 var0, var1, scalarx, scalary, rhs, infeasible, &aggregated) );
2921 assert(aggregated || *infeasible);
2928 if( clique->nvars <= 1 || sameclique !=
NULL )
2933 assert(clique->nvars > 1 || !clique->equation);
2938 if( clique->nvars > 1 && clique->equation && !sameclique->
equation )
2940 assert(sameclique->
nvars >= 2);
2949 for( j = 0; j < clique->nvars; ++j )
2967 cliquetable->
nentries += clique->nvars;
2970 if( !clique->eventsissued )
2975 for( j = 0; j < clique->nvars; ++j )
2982 clique->eventsissued =
TRUE;
2995 SCIPsetDebugMsg(
set,
"cleaned up clique table has %d cliques left (with %" SCIP_LONGINT_FORMAT
" entries)\n", cliquetable->
ncliques, cliquetable->
nentries);
3012 assert(binvar !=
NULL);
3031 assert(nodeindex >= 0);
3062 assert(cliquetable !=
NULL);
3063 assert(vars !=
NULL);
3067 ndiscvars = nbinvars + nintvars + nimplvars;
3070 for( v = nbinvars; v < ndiscvars; ++v )
3077 nbinvarstotal = nbinvars + nimplbinvars;
3080 if( nbinvarstotal == 0 )
3082 SCIPsetDebugMsg(
set,
"0 binary variables in total --> 0 connected components in the clique graph");
3090 SCIPsetDebugMsg(
set,
"0 cliques --> Clique graph has %d isolated nodes", nbinvarstotal);
3099 for( v = 0; v < nbinvars; ++v )
3106 for( v = nbinvars; v < nbinvars + nintvars + nimplvars; ++v )
3123 cliques = cliquetable->
cliques;
3126 for( c = 0; c < cliquetable->
ncliques; ++c )
3132 int lastactiveindex = -1;
3134 clique = cliques[c];
3137 assert(nclqvars > 0);
3140 for( cv = 0; cv < nclqvars; ++cv )
3144 assert(nodeindex < ndiscvars);
3146 if( nodeindex >= 0 )
3149 if( lastactiveindex >= 0 )
3154 lastactiveindex = nodeindex;
3170 for( v = 0; v < ndiscvars; ++v )
3190 #undef SCIPvboundsGetNVbds 3191 #undef SCIPvboundsGetVars 3192 #undef SCIPvboundsGetCoefs 3193 #undef SCIPvboundsGetConstants 3194 #undef SCIPimplicsGetNImpls 3195 #undef SCIPimplicsGetVars 3196 #undef SCIPimplicsGetTypes 3197 #undef SCIPimplicsGetBounds 3198 #undef SCIPimplicsGetIds 3199 #undef SCIPcliqueGetNVars 3200 #undef SCIPcliqueGetVars 3201 #undef SCIPcliqueGetValues 3202 #undef SCIPcliqueGetId 3203 #undef SCIPcliqueIsCleanedUp 3204 #undef SCIPcliqueIsEquation 3205 #undef SCIPcliquelistGetNCliques 3206 #undef SCIPcliquelistGetCliques 3207 #undef SCIPcliquelistCheck 3208 #undef SCIPcliquetableGetNCliques 3209 #undef SCIPcliquetableGetCliques 3210 #undef SCIPcliquetableGetNEntries 3211 #undef SCIPcliquetableGetNCliqueComponents 3212 #undef SCIPcliquetableNeedsComponentUpdate 3219 return vbounds !=
NULL ? vbounds->
len : 0;
3252 return implics !=
NULL ? implics->
nimpls[varfixing] : 0;
3261 return implics !=
NULL ? implics->
vars[varfixing] :
NULL;
3291 return implics !=
NULL ? implics->
ids[varfixing] :
NULL;
3299 assert(clique !=
NULL);
3301 return clique->
nvars;
3309 assert(clique !=
NULL);
3311 return clique->
vars;
3321 assert(clique !=
NULL);
3331 assert(clique !=
NULL);
3333 return (
int) clique->
id;
3341 assert(clique !=
NULL);
3351 assert(clique !=
NULL);
3362 return cliquelist !=
NULL ? cliquelist->
ncliques[value] : 0;
3391 for( value = 0; value < 2; ++value )
3399 for( i = 0; i < ncliques; ++i )
3404 clique = cliques[i];
3405 assert(clique !=
NULL);
3408 assert(0 <= pos && pos < clique->nvars);
3409 assert(clique->
vars[pos] == var);
3421 assert(cliquetable !=
NULL);
3431 assert(cliquetable !=
NULL);
3441 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)
static void cliqueCheck(SCIP_CLIQUE *clique)
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]
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)