55 assert(vbounds != NULL);
58 (*vbounds)->vars = NULL;
59 (*vbounds)->coefs = NULL;
60 (*vbounds)->constants = NULL;
73 assert(vbounds != NULL);
75 if( *vbounds != NULL )
93 assert(vbounds != NULL);
96 if( *vbounds == NULL )
100 assert(*vbounds != NULL);
101 assert((*vbounds)->len <= (*vbounds)->size);
103 if( num > (*vbounds)->size )
111 (*vbounds)->size = newsize;
113 assert(num <= (*vbounds)->size);
131 assert(insertpos != NULL);
132 assert(found != NULL);
135 if( vbounds == NULL )
141 assert(vbounds->
len >= 0);
149 assert(var == vbounds->
vars[pos]);
150 if( (vbounds->
coefs[pos] < 0.0) == negativecoef )
156 else if( negativecoef )
158 assert(vbounds->
coefs[pos] > 0.0);
159 if( pos+1 < vbounds->
len && vbounds->
vars[pos+1] == var )
162 assert(vbounds->
coefs[pos+1] < 0.0);
175 assert(vbounds->
coefs[pos] < 0.0);
176 if( pos-1 >= 0 && vbounds->
vars[pos-1] == var )
179 assert(vbounds->
coefs[pos-1] > 0.0);
215 assert(vbounds != NULL);
219 assert(added != NULL);
229 assert(*vbounds != NULL);
230 assert(0 <= insertpos && insertpos < (*vbounds)->len);
231 assert((*vbounds)->vars[insertpos] == var);
232 assert(((*vbounds)->coefs[insertpos] < 0.0) == (coef < 0.0));
236 if( constant + MIN(coef, 0.0) < (*vbounds)->constants[insertpos] + MIN((*vbounds)->coefs[insertpos], 0.0) )
238 (*vbounds)->coefs[insertpos] = coef;
239 (*vbounds)->constants[insertpos] = constant;
245 if( constant +
MAX(coef, 0.0) > (*vbounds)->constants[insertpos] +
MAX((*vbounds)->coefs[insertpos], 0.0) )
247 (*vbounds)->coefs[insertpos] = coef;
248 (*vbounds)->constants[insertpos] = constant;
259 assert(*vbounds != NULL);
260 assert(0 <= insertpos && insertpos <= (*vbounds)->len);
261 assert(0 <= insertpos && insertpos < (*vbounds)->size);
264 for( i = (*vbounds)->len; i > insertpos; --i )
267 (*vbounds)->vars[i] = (*vbounds)->vars[i-1];
268 (*vbounds)->coefs[i] = (*vbounds)->coefs[i-1];
269 (*vbounds)->constants[i] = (*vbounds)->constants[i-1];
272 (*vbounds)->vars[insertpos] = var;
273 (*vbounds)->coefs[insertpos] = coef;
274 (*vbounds)->constants[insertpos] = constant;
294 assert(vbounds != NULL);
295 assert(*vbounds != NULL);
302 assert(0 <= pos && pos < (*vbounds)->len);
303 assert((*vbounds)->vars[pos] == vbdvar);
304 assert(((*vbounds)->coefs[pos] < 0.0) == negativecoef);
307 for( i = pos; i < (*vbounds)->len - 1; i++ )
309 (*vbounds)->vars[i] = (*vbounds)->vars[i+1];
310 (*vbounds)->coefs[i] = (*vbounds)->coefs[i+1];
311 (*vbounds)->constants[i] = (*vbounds)->constants[i+1];
321 if( (*vbounds)->len == 0 )
334 assert(vbounds != NULL);
335 assert(*vbounds != NULL);
336 assert(newnvbds <= (*vbounds)->len);
341 (*vbounds)->len = newnvbds;
363 assert(var1 != NULL);
364 assert(var2 != NULL);
368 if( var1idx < var2idx )
370 else if( var1idx > var2idx )
384 if( implics == NULL )
395 vars = implics->
vars[varfixing];
396 types = implics->
types[varfixing];
397 nimpls = implics->
nimpls[varfixing];
399 assert(0 <= nimpls && nimpls <= implics->size[varfixing]);
400 for( i = 1; i < nimpls; ++i )
404 cmp = compVars(vars[i-1], vars[i]);
406 assert((cmp == 0) == (vars[i-1] == vars[i]));
410 varfixing = !varfixing;
412 while( varfixing ==
TRUE );
415 #define checkImplics(implics) 425 assert(implics != NULL);
429 (*implics)->vars[0] = NULL;
430 (*implics)->types[0] = NULL;
431 (*implics)->bounds[0] = NULL;
432 (*implics)->ids[0] = NULL;
433 (*implics)->size[0] = 0;
434 (*implics)->nimpls[0] = 0;
435 (*implics)->vars[1] = NULL;
436 (*implics)->types[1] = NULL;
437 (*implics)->bounds[1] = NULL;
438 (*implics)->ids[1] = NULL;
439 (*implics)->size[1] = 0;
440 (*implics)->nimpls[1] = 0;
451 assert(implics != NULL);
453 if( *implics != NULL )
477 assert(implics != NULL);
480 if( *implics == NULL )
484 assert(*implics != NULL);
485 assert((*implics)->nimpls[varfixing] <= (*implics)->size[varfixing]);
487 if( num > (*implics)->size[varfixing] )
496 (*implics)->size[varfixing] = newsize;
498 assert(num <= (*implics)->size[varfixing]);
521 assert(implics != NULL);
522 assert(poslower != NULL);
523 assert(posupper != NULL);
524 assert(posadd != NULL);
526 if( implics->
nimpls[varfixing] == 0 )
534 right = implics->
nimpls[varfixing] - 1;
538 found =
SCIPsortedvecFindPtr((
void**)(&(implics->
vars[varfixing][0])), SCIPvarComp, (
void*)implvar, right + 1, &pos);
543 assert(pos >= right || compVars((
void*)implics->
vars[varfixing][pos], (
void*)implvar) > 0);
544 assert(pos == 0 || compVars((
void*)implics->
vars[varfixing][pos-1], (
void*)implvar) < 0);
552 assert(implvar == implics->
vars[varfixing][pos]);
559 if( pos + 1 < implics->
nimpls[varfixing] && implics->
vars[varfixing][pos+1] == implvar )
572 if( pos - 1 >= 0 && implics->
vars[varfixing][pos-1] == implvar )
601 assert(implics != NULL);
602 assert(poslower != NULL);
603 assert(posupper != NULL);
604 assert(posadd != NULL);
607 assert(*poslower == -1 || *posupper == -1 || *posupper == (*poslower)+1);
608 assert(*poslower == -1 || *posadd == *poslower);
609 assert(*poslower >= 0 || *posupper == -1 || *posadd == *posupper);
610 assert(0 <= *posadd && *posadd <= implics->nimpls[varfixing]);
613 return (*poslower >= 0);
618 assert(*posadd == *poslower);
621 return (*posupper >= 0);
650 assert(implics != NULL);
651 assert(*implics == NULL || 0 <= (*implics)->
nimpls[varfixing]);
652 assert(stat != NULL);
657 assert(conflict != NULL);
658 assert(added != NULL);
660 SCIPsetDebugMsg(
set,
"adding implication to implics %p [%u]: <%s> %s %g\n",
669 if( *implics != NULL )
671 found =
implicsSearchImplic(*implics, varfixing, implvar, impltype, &poslower, &posupper, &posadd);
672 assert(-1 <= poslower && poslower < (*implics)->nimpls[varfixing]);
673 assert(-1 <= posupper && posupper < (*implics)->nimpls[varfixing]);
674 assert(0 <= posadd && posadd <= (*implics)->nimpls[varfixing]);
688 assert(found == (poslower >= 0));
691 if( poslower >= 0 &&
SCIPsetIsFeasLE(
set, implbound, (*implics)->bounds[varfixing][poslower]) )
698 if( posupper >= 0 &&
SCIPsetIsFeasGT(
set, implbound, (*implics)->bounds[varfixing][posupper]) )
710 assert(poslower >= 0);
711 assert(posadd == poslower);
714 assert((*implics)->vars[varfixing][poslower] == implvar);
715 assert(
SCIPsetIsFeasGT(
set, implbound, (*implics)->bounds[varfixing][poslower]));
716 (*implics)->bounds[varfixing][poslower] = implbound;
720 assert(poslower == -1);
724 *implics != NULL ? (*implics)->nimpls[varfixing]+1 : 1) );
725 assert(*implics != NULL);
727 if( (*implics)->nimpls[varfixing] - posadd > 0 )
729 int amount = ((*implics)->nimpls[varfixing] - posadd);
732 for( k = (*implics)->nimpls[varfixing]; k > posadd; k-- )
734 assert(compVars((
void*)(*implics)->vars[varfixing][k-1], (
void*)implvar) >= 0);
737 BMSmoveMemoryArray(&((*implics)->types[varfixing][posadd+1]), &((*implics)->types[varfixing][posadd]), amount);
738 BMSmoveMemoryArray(&((*implics)->ids[varfixing][posadd+1]), &((*implics)->ids[varfixing][posadd]), amount);
739 BMSmoveMemoryArray(&((*implics)->vars[varfixing][posadd+1]), &((*implics)->vars[varfixing][posadd]), amount);
740 BMSmoveMemoryArray(&((*implics)->bounds[varfixing][posadd+1]), &((*implics)->bounds[varfixing][posadd]), amount);
743 (*implics)->vars[varfixing][posadd] = implvar;
744 (*implics)->types[varfixing][posadd] = impltype;
745 (*implics)->bounds[varfixing][posadd] = implbound;
747 (*implics)->nimpls[varfixing]++;
749 for( k = posadd-1; k >= 0; k-- )
750 assert(compVars((
void*)(*implics)->vars[varfixing][k], (
void*)implvar) <= 0);
757 assert(found == (posupper >= 0));
760 if( posupper >= 0 &&
SCIPsetIsFeasGE(
set, implbound, (*implics)->bounds[varfixing][posupper]) )
767 if( poslower >= 0 &&
SCIPsetIsFeasLT(
set, implbound, (*implics)->bounds[varfixing][poslower]) )
779 assert(posupper >= 0);
780 assert(posadd == posupper);
783 assert((*implics)->vars[varfixing][posupper] == implvar);
784 assert(
SCIPsetIsFeasLT(
set, implbound,(*implics)->bounds[varfixing][posupper]));
785 (*implics)->bounds[varfixing][posupper] = implbound;
790 assert(posupper == -1);
793 *implics != NULL ? (*implics)->nimpls[varfixing]+1 : 1) );
794 assert(*implics != NULL);
796 if( (*implics)->nimpls[varfixing] - posadd > 0 )
798 int amount = ((*implics)->nimpls[varfixing] - posadd);
801 for( k = (*implics)->nimpls[varfixing]; k > posadd; k-- )
803 assert(compVars((
void*)(*implics)->vars[varfixing][k-1], (
void*)implvar) >= 0);
806 BMSmoveMemoryArray(&((*implics)->types[varfixing][posadd+1]), &((*implics)->types[varfixing][posadd]), amount);
807 BMSmoveMemoryArray(&((*implics)->ids[varfixing][posadd+1]), &((*implics)->ids[varfixing][posadd]), amount);
808 BMSmoveMemoryArray(&((*implics)->vars[varfixing][posadd+1]), &((*implics)->vars[varfixing][posadd]), amount);
809 BMSmoveMemoryArray(&((*implics)->bounds[varfixing][posadd+1]), &((*implics)->bounds[varfixing][posadd]), amount);
812 (*implics)->vars[varfixing][posadd] = implvar;
813 (*implics)->types[varfixing][posadd] = impltype;
814 (*implics)->bounds[varfixing][posadd] = implbound;
816 (*implics)->nimpls[varfixing]++;
818 for( k = posadd-1; k >= 0; k-- )
819 assert(compVars((
void*)(*implics)->vars[varfixing][k], (
void*)implvar) <= 0);
845 assert(implics != NULL);
846 assert(*implics != NULL);
847 assert(implvar != NULL);
849 SCIPsetDebugMsg(
set,
"deleting implication from implics %p [%u]: <%s> %s x\n",
855 found =
implicsSearchImplic(*implics, varfixing, implvar, impltype, &poslower, &posupper, &posadd);
864 assert(0 <= posadd && posadd < (*implics)->nimpls[varfixing]);
865 assert((*implics)->vars[varfixing][posadd] == implvar);
866 assert((*implics)->types[varfixing][posadd] == impltype);
869 if( (*implics)->nimpls[varfixing] - posadd > 1 )
871 int amount = ((*implics)->nimpls[varfixing] - posadd - 1);
873 BMSmoveMemoryArray(&((*implics)->types[varfixing][posadd]), &((*implics)->types[varfixing][posadd+1]), amount);
874 BMSmoveMemoryArray(&((*implics)->vars[varfixing][posadd]), &((*implics)->vars[varfixing][posadd+1]), amount);
875 BMSmoveMemoryArray(&((*implics)->bounds[varfixing][posadd]), &((*implics)->bounds[varfixing][posadd+1]), amount);
877 (*implics)->nimpls[varfixing]--;
880 if( (*implics)->nimpls[0] == 0 && (*implics)->nimpls[1] == 0 )
901 assert(haslowerimplic != NULL);
902 assert(hasupperimplic != NULL);
904 implicsSearchVar(implics, varfixing, implvar, &poslower, &posupper, &posadd);
906 *haslowerimplic = (poslower >= 0);
907 *hasupperimplic = (posupper >= 0);
922 return implicsSearchImplic(implics, varfixing, implvar, impltype, &poslower, &posupper, &posadd);
941 if( first != second )
945 tmp = cliquetable->
cliques[first];
946 assert(tmp->
index == first);
950 cliquetable->
cliques[second] = tmp;
994 assert(clique != NULL);
995 assert(blkmem != NULL);
996 assert(size >= nvars && nvars > 0);
997 assert(vars != NULL);
998 assert(values != NULL);
1003 (*clique)->nvars = nvars;
1004 (*clique)->size = size;
1005 (*clique)->startcleanup = -1;
1006 (*clique)->id = (
unsigned int)
id;
1007 (*clique)->eventsissued =
FALSE;
1008 (*clique)->equation = isequation;
1009 (*clique)->index = -1;
1021 assert(clique != NULL);
1023 if( *clique != NULL )
1040 assert(clique != NULL);
1042 if( num > clique->
size )
1049 clique->
size = newsize;
1051 assert(num <= clique->size);
1069 assert(clique != NULL);
1073 right = clique->
nvars;
1074 while( left < right-1 )
1079 middle = (left+right)/2;
1084 else if( varidx > idx )
1088 assert(var == clique->
vars[middle]);
1091 if( clique->
values[middle] < value )
1094 for( i = middle+1; i < clique->
nvars && clique->
vars[i] == var; ++i )
1096 if( clique->
values[i] == value )
1101 if( clique->
values[middle] > value )
1104 for( i = middle-1; i >= 0 && clique->
vars[i] == var; --i )
1106 if( clique->
values[i] == value )
1142 assert(clique != NULL);
1145 assert(doubleentry != NULL);
1146 assert(oppositeentry != NULL);
1150 *doubleentry =
FALSE;
1151 *oppositeentry =
FALSE;
1161 assert(pos >= 0 && pos <= clique->nvars);
1165 if( pos < clique->nvars )
1167 const int amount = clique->
nvars - pos;
1178 for( ; pos < clique->
nvars - 1 && clique->
vars[pos + 1] == var && clique->
values[pos + 1] == value; ++pos );
1181 if( pos < clique->nvars - 1 && clique->
vars[pos + 1] == var )
1183 assert(clique->
values[pos + 1] != value);
1184 *oppositeentry =
TRUE;
1189 *doubleentry =
TRUE;
1193 for( ; pos > 0 && clique->
vars[pos - 1] == var && clique->
values[pos - 1] != value; --pos );
1196 if( pos > 0 && clique->
vars[pos - 1] == var )
1198 assert(clique->
values[pos - 1] == value);
1200 *doubleentry =
TRUE;
1205 assert(clique->
vars[pos] == var);
1206 assert(clique->
values[pos] != value);
1208 clique->
values[pos] = value;
1217 for( ; pos < clique->
nvars - 1 && clique->
vars[pos + 1] == var && clique->
values[pos + 1] != value; ++pos );
1220 if( pos < clique->nvars - 1 && clique->
vars[pos + 1] == var )
1222 assert(clique->
values[pos + 1] == value);
1223 *doubleentry =
TRUE;
1229 *oppositeentry =
TRUE;
1232 assert(clique->
vars[pos] == var);
1233 assert(clique->
values[pos] != value);
1235 clique->
values[pos] = value;
1241 for( ; pos > 0 && clique->
vars[pos - 1] == var && clique->
values[pos - 1] == value; --pos );
1244 *doubleentry =
TRUE;
1247 if( pos > 0 && clique->
vars[pos - 1] == var && clique->
values[pos - 1] != value )
1248 *oppositeentry =
TRUE;
1255 clique->
vars[i] = var;
1256 clique->
values[i] = value;
1272 assert(clique != NULL);
1274 assert(cliquetable != NULL);
1285 assert(0 <= pos && pos < clique->nvars);
1286 assert(clique->
vars[pos] == var);
1287 assert(clique->
values[pos] == value);
1293 if( clique->
startcleanup == -1 || pos < clique->startcleanup )
1296 #ifdef SCIP_MORE_DEBUG 1317 unsigned int cliqueid;
1321 assert(cliques != NULL || ncliques == 0);
1322 assert(clique != NULL);
1324 cliqueid = clique->
id;
1327 while( left < right-1 )
1332 assert(cliques != NULL);
1333 middle = (left+right)/2;
1334 id = cliques[middle]->
id;
1337 else if( cliqueid >
id )
1341 assert(clique == cliques[middle]);
1349 #ifdef SCIP_MORE_DEBUG 1358 assert(clique != NULL);
1360 for( i = 0; i < clique->
nvars; ++i )
1367 var = clique->
vars[i];
1369 assert(i == 0 || clique->
vars[i-1] != var || clique->
values[i-1] <= clique->
values[i]);
1386 assert(0 <= pos && pos < ncliques);
1387 assert(cliques[pos] == clique);
1392 assert(clique->
index >= 0);
1395 #define cliqueCheck(clique) 1405 assert(cliquelist != NULL);
1408 (*cliquelist)->cliques[0] = NULL;
1409 (*cliquelist)->cliques[1] = NULL;
1410 (*cliquelist)->ncliques[0] = 0;
1411 (*cliquelist)->ncliques[1] = 0;
1412 (*cliquelist)->size[0] = 0;
1413 (*cliquelist)->size[1] = 0;
1424 assert(cliquelist != NULL);
1426 if( *cliquelist != NULL )
1444 assert(cliquelist != NULL);
1446 if( num > cliquelist->
size[value] )
1452 cliquelist->
size[value] = newsize;
1454 assert(num <= cliquelist->size[value]);
1471 assert(cliquelist != NULL);
1477 if( *cliquelist == NULL )
1483 if( (*cliquelist)->cliques[value] != NULL )
1485 for( i = (*cliquelist)->ncliques[value]; i > 0 && (*cliquelist)->cliques[value][i - 1]->id >
id; --i );
1487 if( i > 0 && (*cliquelist)->cliques[value][i - 1]->id ==
id )
1493 SCIPsetDebugMsg(
set,
"adding clique %u to cliquelist %p value %u (length: %d)\n",
1494 clique->
id, (
void*)*cliquelist, value, (*cliquelist)->
ncliques[value]);
1496 BMSmoveMemoryArray(&((*cliquelist)->cliques[value][i+1]), &((*cliquelist)->cliques[value][i]), (*cliquelist)->ncliques[value] - i);
1498 (*cliquelist)->cliques[value][i] = clique;
1499 (*cliquelist)->ncliques[value]++;
1514 assert(cliquelist != NULL);
1518 if( *cliquelist == NULL )
1521 SCIPdebugMessage(
"deleting clique %u from cliquelist %p value %u (length: %d)\n",
1522 clique->
id, (
void*)*cliquelist, value, (*cliquelist)->
ncliques[value]);
1524 pos =
cliquesSearchClique((*cliquelist)->cliques[value], (*cliquelist)->ncliques[value], clique);
1529 #ifdef SCIP_MORE_DEBUG 1535 assert(nclqvars >= 2);
1545 for( v = nclqvars - 1; v > 0; --v )
1547 if( clqvars[v] == clqvars[v - 1] )
1549 if( clqvalues[v] == clqvalues[v - 1] || (v > 1 && clqvars[v] == clqvars[v - 2]) )
1561 assert(0 <= pos && pos < (*cliquelist)->ncliques[value]);
1562 assert((*cliquelist)->cliques[value][pos] == clique);
1566 (*cliquelist)->ncliques[value]--;
1567 if( pos < (*cliquelist)->ncliques[value] )
1569 BMSmoveMemoryArray(&((*cliquelist)->cliques[value][pos]), &((*cliquelist)->cliques[value][pos+1]),
1570 (*cliquelist)->ncliques[value] - pos);
1574 if( (*cliquelist)->ncliques[0] == 0 && (*cliquelist)->ncliques[1] == 0 )
1597 if( cliquelist1 == NULL || cliquelist2 == NULL )
1600 ncliques1 = cliquelist1->
ncliques[value1];
1601 cliques1 = cliquelist1->
cliques[value1];
1602 ncliques2 = cliquelist2->
ncliques[value2];
1603 cliques2 = cliquelist2->
cliques[value2];
1608 if( i1 < ncliques1 && i2 < ncliques2 )
1610 unsigned int cliqueid;
1613 if( ncliques2 > ncliques1 )
1620 cliques1 = cliques2;
1621 ncliques1 = ncliques2;
1639 assert(i1 < ncliques1);
1651 assert(i2 < ncliques2);
1671 if( cliquelist != NULL )
1675 SCIPdebugMessage(
"removing variable <%s> from cliques (%d with value 0, %d with value 1)\n",
1678 for( value = 0; value < 2; ++value )
1688 for( i = cliquelist->
ncliques[value] - 1; i >= 0; --i )
1692 clique = cliquelist->
cliques[value][i];
1693 assert(clique != NULL);
1695 SCIPdebugMessage(
" -> removing variable <%s> == %d from clique %u (size %d)\n",
1703 #ifdef SCIP_MORE_DEBUG 1732 assert(clique1 != NULL);
1733 assert(clique2 != NULL);
1739 for( i = 0; i < clique1->
nvars; ++i )
1763 #define HASHTABLE_CLIQUETABLE_SIZE 100 1774 assert(cliquetable != NULL);
1782 hashgetkeyClique, hashkeyeqClique, hashkeyvalClique, NULL) );
1784 (*cliquetable)->varidxtable = NULL;
1785 (*cliquetable)->djset = 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)->compsfromscratch =
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);
1819 if( (*cliquetable)->djset != NULL )
1823 if( (*cliquetable)->varidxtable != NULL )
1845 assert(cliquetable != NULL);
1847 if( num > cliquetable->
size )
1853 cliquetable->
size = newsize;
1855 assert(num <= cliquetable->size);
1887 assert(nclqvars != NULL);
1889 SCIPsetDebugMsg(
set,
"starting merging %d variables in clique %d\n", *nclqvars, (clique == NULL) ? -1 : (
int) clique->
id);
1891 if( *nclqvars <= 1 )
1894 assert(clqvars != NULL);
1895 assert(clqvalues != NULL);
1896 assert(blkmem != NULL);
1897 assert(
set != NULL);
1898 assert(stat != NULL);
1899 assert(transprob != NULL);
1900 assert(origprob != NULL);
1901 assert(tree != NULL);
1902 assert(eventqueue != NULL);
1903 assert(nbdchgs != NULL);
1904 assert(infeasible != NULL);
1910 noldbdchgs = *nbdchgs;
1913 startidx = *nclqvars - 1;
1914 while( startidx >= 0 )
1920 var = clqvars[startidx];
1926 if( clqvalues[startidx] )
1936 curr = startidx - 1;
1941 if( clqvars[curr] == var )
1943 if( clqvalues[curr] )
1954 assert(nzeros + nones <= *nclqvars);
1957 if( nones + nzeros == 1 )
1963 if( nones >= 2 && nzeros >= 2 )
1970 if( nones >= 2 || nzeros >= 2 )
1975 assert(nones <= 1 || nzeros <= 1);
1978 if( clique != NULL )
1994 SCIP_CALL(
SCIPvarFixBinary(var, blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand, eventqueue,
1995 cliquetable, fixvalue, infeasible, nbdchgs) );
1998 fixvalue ? 1 : 0, *infeasible ?
"infeasible" :
"feasible");
2005 if( nones >= 1 && nzeros >= 1 )
2010 if( nzeros + nones < *nclqvars )
2025 assert(clqvars[w] != var);
2031 while( w > 0 && clqvars[w-1] == clqvars[w] )
2033 if( clqvalues[w-1] != clqvalues[w] )
2044 if( clique != NULL )
2049 branchcand, eventqueue, cliquetable, !clqvalues[w], infeasible, nbdchgs) );
2052 clqvalues[w] ? 0 : 1, *infeasible ?
"infeasible" :
"feasible");
2061 if( clique != NULL )
2067 *isequation =
FALSE;
2074 assert(curr < startidx);
2080 if( *infeasible || *nclqvars == 0 )
2088 if( *nbdchgs > noldbdchgs )
2095 onefixedvalue =
TRUE;
2101 while( startidx < *nclqvars )
2103 var = clqvars[startidx];
2111 if( onefixedvar != NULL )
2115 SCIPsetDebugMsg(
set,
"two variables in clique %d fixed to one %s%s and %s%s\n", (clique != NULL) ? (
int) clique->
id : -1,
2120 onefixedvalue = clqvalues[startidx];
2128 clqvars[w] = clqvars[startidx];
2129 clqvalues[w] = clqvalues[startidx];
2138 if( clique != NULL )
2150 if( onefixedvar != NULL )
2152 SCIPsetDebugMsg(
set,
"variable %s%s in clique %d fixed to one, fixing all other variables to zero\n",
2153 onefixedvalue ?
"" :
"~",
SCIPvarGetName(onefixedvar), (clique != NULL) ? (
int) clique->
id : -1);
2156 for( startidx = *nclqvars; startidx >= 0; --startidx )
2162 if( onefixedvalue != clqvalues[startidx] || clqvars[startidx] != onefixedvar )
2164 if( clique != NULL )
2173 while( startidx > 0 && clqvars[startidx - 1] == clqvars[startidx] )
2175 if( clqvalues[startidx - 1] != clqvalues[startidx] )
2184 clqvalues[startidx] ? 0 : 1);
2188 branchcand, eventqueue, cliquetable, !clqvalues[startidx], infeasible, nbdchgs) );
2196 if( clique != NULL )
2202 *isequation =
FALSE;
2206 assert(!(*infeasible));
2210 if( *nclqvars == 0 )
2212 SCIPsetDebugMsg(
set,
"empty equation clique left over -> infeasible\n");
2216 else if( *nclqvars == 1 )
2221 if( clique != NULL )
2225 SCIP_CALL(
SCIPvarFixBinary(clqvars[0], blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand,
2226 eventqueue, cliquetable, clqvalues[0], infeasible, nbdchgs) );
2229 clqvalues[0] ? 1 : 0, *infeasible ?
"infeasible" :
"feasible");
2232 *isequation =
FALSE;
2249 assert(binvar != NULL);
2295 assert(cliquetable != NULL);
2296 assert(clique != NULL);
2299 if( cliquetable->
djset == NULL )
2307 clqvars = clique->
vars;
2308 nclqvars = clique->
nvars;
2318 if( currnode == - 1 )
2322 if( lastnode != -1 )
2325 lastnode = currnode;
2336 assert(var != NULL);
2337 assert(cliquetable->
djset != NULL);
2347 if( nodeindex >= 0 )
2383 int nlocalbdchgs = 0;
2387 assert(cliquetable != NULL);
2388 assert(vars != NULL);
2395 *infeasible =
FALSE;
2399 if( values == NULL )
2404 for( v = nvars - 1; v >= 0; --v )
2405 clqvalues[v] =
TRUE;
2417 for( v = nvars - 1; v >= 0; --v )
2431 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);
2433 for( w = nvars - 1; w >= 0; --w )
2461 #ifdef SCIP_DISABLED_CODE 2466 while( w > 0 && clqvars[w - 1] == clqvars[w] )
2468 if( clqvalues[w - 1] != clqvalues[w] )
2479 branchcand, eventqueue, cliquetable, !clqval, infeasible, &nlocalbdchgs) );
2482 clqval ? 0 : 1, *infeasible ?
"infeasible" :
"feasible");
2499 clqvars[v] = clqvars[nvars];
2500 clqvalues[v] = clqvalues[nvars];
2505 if( nbdchgs != NULL )
2506 *nbdchgs += nlocalbdchgs;
2512 assert(!*infeasible);
2515 if( v < 0 && nvars <= 1)
2524 branchcand, eventqueue, cliquetable, clqvalues[0], infeasible, &nlocalbdchgs) );
2527 clqvalues[0] ? 1 : 0, *infeasible ?
"infeasible" :
"feasible");
2529 if( nbdchgs != NULL )
2530 *nbdchgs += nlocalbdchgs;
2532 else if( nvars == 0 )
2534 SCIPsetDebugMsg(
set,
"empty equation clique left over -> infeasible\n");
2546 SCIP_CALL(
sortAndMergeClique(clqvars, clqvalues, &nvars, &isequation, NULL, blkmem,
set, stat, transprob, origprob, tree,
2547 reopt, lp, branchcand, eventqueue, cliquetable, &nlocalbdchgs, infeasible) );
2549 if( nbdchgs != NULL )
2550 *nbdchgs += nlocalbdchgs;
2553 if( nvars == 0 || *infeasible )
2568 if( sameclique == NULL )
2570 SCIPsetDebugMsg(
set,
"adding clique %u with %d vars to clique table\n", clique->
id, nvars);
2589 SCIPsetDebugMsg(
set,
"same clique %p (id: %d) already found in cliquetable -> discard new one\n", (
void*) sameclique, sameclique->
id);
2595 if( !sameclique->equation && clique->
equation )
2596 sameclique->equation =
TRUE;
2605 assert(!isequation);
2638 assert(clique != NULL);
2639 assert(blkmem != NULL);
2640 assert(
set != NULL);
2641 assert(nchgbds != NULL);
2642 assert(infeasible != NULL);
2655 SCIPsetDebugMsg(
set,
"Starting clean up of clique %u (size %d) from position %d\n", clique->
id, clique->
nvars, w);
2658 for( v = w; v < clique->
nvars; ++v )
2662 addvartoclique =
FALSE;
2681 addvartoclique =
TRUE;
2704 if( onefixedvar != NULL )
2708 SCIPsetDebugMsg(
set,
"two variables in clique %u fixed to one %s%s and %s%s\n", clique->
id,
2713 onefixedvar = clique->
vars[v];
2714 onefixedvalue = clique->
values[v];
2728 if( addvartoclique )
2739 if( onefixedvar != NULL )
2741 SCIPsetDebugMsg(
set,
"variable %s%s in clique %u fixed to one, fixing all other variables to zero\n",
2744 for( v = 0; v < clique->
nvars ; ++v )
2752 if( onefixedvalue != clqval || clqvar != onefixedvar )
2766 assert(clqvar != onefixedvar);
2779 #ifdef SCIP_DISABLED_CODE 2784 while( v < clique->nvars - 1 && clique->
vars[v + 1] == clqvar )
2796 SCIP_CALL(
SCIPvarFixBinary(clqvar, blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand,
2797 eventqueue, cliquetable, !clqval, infeasible, nchgbds) );
2819 if( clique->
nvars == 0 )
2824 else if( clique->
nvars == 1 )
2833 clique->
values[0] ? 1 : 0);
2836 branchcand, eventqueue, cliquetable, clique->
values[0], infeasible, nchgbds) );
2852 transprob, origprob, tree, reopt, lp, branchcand, eventqueue, cliquetable, nchgbds, infeasible) );
2866 #ifdef SCIP_MORE_DEBUG 2876 assert(cliquetable != NULL);
2878 for( c = cliquetable->
ncliques - 1; c >= 0; --c )
2881 return (nentries == cliquetable->
nentries);
2884 #define checkNEntries(cliquetable) TRUE 2909 assert(cliquetable != NULL);
2910 assert(stat != NULL);
2911 assert(infeasible != NULL);
2913 *infeasible =
FALSE;
2921 SCIPsetDebugMsg(
set,
"cleaning up clique table with %d cliques (with %" SCIP_LONGINT_FORMAT
" entries)\n", cliquetable->
ncliques, cliquetable->
nentries);
2932 clique = cliquetable->
cliques[0];
2938 cliquetable->
nentries -= clique->nvars;
2939 assert(cliquetable->
nentries >= 0);
2941 SCIP_CALL(
cliqueCleanup(clique, blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand, eventqueue,
2942 cliquetable, nchgbds, infeasible) );
2965 printf(
"aggr vars, clique %d\n", clique->id);
2969 var0 = clique->vars[0];
2970 var1 = clique->vars[1];
2972 if( !clique->values[0] )
2980 if( !clique->values[1] )
2990 var0 = clique->vars[1];
2991 var1 = clique->vars[0];
2993 if( !clique->values[0] )
3001 if( !clique->values[1] )
3015 tree, lp, cliquetable, branchcand, eventfilter, eventqueue,
3016 var0, var1, scalarx, scalary, rhs, infeasible, &aggregated) );
3018 assert(aggregated || *infeasible);
3025 if( clique->nvars <= 1 || sameclique != NULL )
3030 assert(clique->nvars > 1 || !clique->equation);
3035 if( clique->nvars > 1 && clique->equation && !sameclique->
equation )
3037 assert(sameclique->
nvars >= 2);
3046 for( j = 0; j < clique->nvars; ++j )
3064 cliquetable->
nentries += clique->nvars;
3067 if( !clique->eventsissued )
3072 for( j = 0; j < clique->nvars; ++j )
3079 clique->eventsissued =
TRUE;
3092 SCIPsetDebugMsg(
set,
"cleaned up clique table has %d cliques left (with %" SCIP_LONGINT_FORMAT
" entries)\n", cliquetable->
ncliques, cliquetable->
nentries);
3124 assert(cliquetable != NULL);
3125 assert(vars != NULL);
3129 ndiscvars = nbinvars + nintvars + nimplvars;
3132 for( v = nbinvars; v < ndiscvars; ++v )
3139 nbinvarstotal = nbinvars + nimplbinvars;
3142 if( nbinvarstotal == 0 )
3144 SCIPsetDebugMsg(
set,
"0 binary variables in total --> 0 connected components in the clique table");
3152 SCIPsetDebugMsg(
set,
"0 cliques --> Clique table has %d isolated nodes", nbinvarstotal);
3168 for( v = 0; v < ndiscvars; ++v )
3190 if( cliquetable->
djset != NULL )
3199 djset = cliquetable->
djset;
3202 nnonbinvars = (nintvars + nimplvars) - nimplbinvars;
3204 cliques = cliquetable->
cliques;
3213 clique = cliques[c];
3237 #undef SCIPvboundsGetNVbds 3238 #undef SCIPvboundsGetVars 3239 #undef SCIPvboundsGetCoefs 3240 #undef SCIPvboundsGetConstants 3241 #undef SCIPimplicsGetNImpls 3242 #undef SCIPimplicsGetVars 3243 #undef SCIPimplicsGetTypes 3244 #undef SCIPimplicsGetBounds 3245 #undef SCIPimplicsGetIds 3246 #undef SCIPcliqueGetNVars 3247 #undef SCIPcliqueGetVars 3248 #undef SCIPcliqueGetValues 3249 #undef SCIPcliqueGetId 3250 #undef SCIPcliqueGetIndex 3251 #undef SCIPcliqueIsCleanedUp 3252 #undef SCIPcliqueIsEquation 3253 #undef SCIPcliquelistGetNCliques 3254 #undef SCIPcliquelistGetCliques 3255 #undef SCIPcliquelistCheck 3256 #undef SCIPcliquetableGetNCliques 3257 #undef SCIPcliquetableGetCliques 3258 #undef SCIPcliquetableGetNEntries 3259 #undef SCIPcliquetableGetNCliqueComponents 3260 #undef SCIPcliquetableNeedsComponentUpdate 3267 return vbounds != NULL ? vbounds->
len : 0;
3275 return vbounds != NULL ? vbounds->
vars : NULL;
3283 return vbounds != NULL ? vbounds->
coefs : NULL;
3291 return vbounds != NULL ? vbounds->
constants : NULL;
3300 return implics != NULL ? implics->
nimpls[varfixing] : 0;
3309 return implics != NULL ? implics->
vars[varfixing] : NULL;
3318 return implics != NULL ? implics->
types[varfixing] : NULL;
3327 return implics != NULL ? implics->
bounds[varfixing] : NULL;
3339 return implics != NULL ? implics->
ids[varfixing] : NULL;
3347 assert(clique != NULL);
3349 return clique->
nvars;
3357 assert(clique != NULL);
3359 return clique->
vars;
3369 assert(clique != NULL);
3381 assert(clique != NULL);
3385 return (
unsigned int)id;
3393 assert(clique != NULL);
3395 return clique->
index;
3403 assert(clique != NULL);
3413 assert(clique != NULL);
3424 return cliquelist != NULL ? cliquelist->
ncliques[value] : 0;
3433 return cliquelist != NULL ? cliquelist->
cliques[value] : NULL;
3453 for( value = 0; value < 2; ++value )
3461 for( i = 0; i < ncliques; ++i )
3466 clique = cliques[i];
3467 assert(clique != NULL);
3470 assert(0 <= pos && pos < clique->nvars);
3471 assert(clique->
vars[pos] == var);
3483 assert(cliquetable != NULL);
3493 assert(cliquetable != NULL);
3503 assert(cliquetable != NULL);
3513 assert(cliquetable != NULL);
enum SCIP_BoundType SCIP_BOUNDTYPE
void SCIPcliquelistRemoveFromCliques(SCIP_CLIQUELIST *cliquelist, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_Bool irrelevantvar)
#define HASHTABLE_CLIQUETABLE_SIZE
static int cliquetableGetNodeIndexBinvar(SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *binvar)
SCIP_HASHMAP * varidxtable
#define BMSfreeBlockMemoryArrayNull(mem, ptr, num)
internal methods for managing events
SCIP_VAR ** SCIPcliqueGetVars(SCIP_CLIQUE *clique)
int SCIPcliquetableGetVarComponentIdx(SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var)
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)
void SCIPdisjointsetUnion(SCIP_DISJOINTSET *djset, int p, int q, SCIP_Bool forcerepofp)
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)
#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_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)
int SCIPcliqueGetIndex(SCIP_CLIQUE *clique)
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)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
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 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)
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)
int SCIPdisjointsetGetSize(SCIP_DISJOINTSET *djset)
SCIP_CLIQUE ** SCIPcliquelistGetCliques(SCIP_CLIQUELIST *cliquelist, SCIP_Bool value)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
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 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)
int SCIPcliquetableGetNCliquesCreated(SCIP_CLIQUETABLE *cliquetable)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
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)
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)
SCIP_Bool compsfromscratch
#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)
void SCIPdisjointsetFree(SCIP_DISJOINTSET **djset, BMS_BLKMEM *blkmem)
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)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
internal miscellaneous methods
SCIP_Real * SCIPvboundsGetCoefs(SCIP_VBOUNDS *vbounds)
int SCIPdisjointsetFind(SCIP_DISJOINTSET *djset, int element)
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)
static void cliquetableUpdateConnectednessClique(SCIP_CLIQUETABLE *cliquetable, SCIP_CLIQUE *clique)
int SCIPdisjointsetGetComponentCount(SCIP_DISJOINTSET *djset)
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)
SCIP_RETCODE SCIPhashmapRemoveAll(SCIP_HASHMAP *hashmap)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
int * SCIPimplicsGetIds(SCIP_IMPLICS *implics, SCIP_Bool varfixing)
SCIP_RETCODE SCIPcliquetableComputeCliqueComponents(SCIP_CLIQUETABLE *cliquetable, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **vars, int nbinvars, int nintvars, int nimplvars)
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)
#define BMSallocMemory(ptr)
#define BMSreallocMemoryArray(ptr, num)
unsigned int SCIPcliqueGetId(SCIP_CLIQUE *clique)
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_RETCODE SCIPdisjointsetCreate(SCIP_DISJOINTSET **djset, BMS_BLKMEM *blkmem, int ncomponents)
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)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
common defines and data types used in all packages of SCIP
struct BMS_BlkMem BMS_BLKMEM
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)
SCIP_RETCODE SCIPvarDelCliqueFromList(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_Bool value, SCIP_CLIQUE *clique)