63 (*vbounds)->vars =
NULL;
64 (*vbounds)->coefs =
NULL;
65 (*vbounds)->constants =
NULL;
80 if( *vbounds !=
NULL )
101 if( *vbounds ==
NULL )
106 assert((*vbounds)->len <= (*vbounds)->size);
108 if( num > (*vbounds)->size )
116 (*vbounds)->size = newsize;
118 assert(num <= (*vbounds)->size);
128 SCIP_Bool negativecoef,
140 if( vbounds ==
NULL )
155 if( (vbounds->
coefs[pos] < 0.0) == negativecoef )
161 else if( negativecoef )
164 if( pos+1 < vbounds->
len && vbounds->
vars[pos+1] ==
var )
181 if( pos-1 >= 0 && vbounds->
vars[pos-1] ==
var )
235 assert(0 <= insertpos && insertpos < (*vbounds)->len);
236 assert((*vbounds)->vars[insertpos] ==
var);
237 assert(((*vbounds)->coefs[insertpos] < 0.0) == (coef < 0.0));
241 if( constant +
MIN(coef, 0.0) < (*vbounds)->constants[insertpos] +
MIN((*vbounds)->coefs[insertpos], 0.0) )
243 (*vbounds)->coefs[insertpos] = coef;
244 (*vbounds)->constants[insertpos] = constant;
250 if( constant +
MAX(coef, 0.0) > (*vbounds)->constants[insertpos] +
MAX((*vbounds)->coefs[insertpos], 0.0) )
252 (*vbounds)->coefs[insertpos] = coef;
253 (*vbounds)->constants[insertpos] = constant;
265 assert(0 <= insertpos && insertpos <= (*vbounds)->len);
266 assert(0 <= insertpos && insertpos < (*vbounds)->size);
269 for(
i = (*vbounds)->len;
i > insertpos; --
i )
272 (*vbounds)->vars[
i] = (*vbounds)->vars[
i-1];
273 (*vbounds)->coefs[
i] = (*vbounds)->coefs[
i-1];
274 (*vbounds)->constants[
i] = (*vbounds)->constants[
i-1];
277 (*vbounds)->vars[insertpos] =
var;
278 (*vbounds)->coefs[insertpos] = coef;
279 (*vbounds)->constants[insertpos] = constant;
292 SCIP_Bool negativecoef
307 assert(0 <= pos && pos < (*vbounds)->len);
308 assert((*vbounds)->vars[pos] == vbdvar);
309 assert(((*vbounds)->coefs[pos] < 0.0) == negativecoef);
312 for(
i = pos;
i < (*vbounds)->len - 1;
i++ )
314 (*vbounds)->vars[
i] = (*vbounds)->vars[
i+1];
315 (*vbounds)->coefs[
i] = (*vbounds)->coefs[
i+1];
316 (*vbounds)->constants[
i] = (*vbounds)->constants[
i+1];
326 if( (*vbounds)->len == 0 )
341 assert(newnvbds <= (*vbounds)->len);
346 (*vbounds)->len = newnvbds;
373 if( var1idx < var2idx )
375 else if( var1idx > var2idx )
389 if( implics ==
NULL )
401 types = implics->
types[varfixing];
402 nimpls = implics->
nimpls[varfixing];
404 assert(0 <= nimpls && nimpls <= implics->size[varfixing]);
405 for(
i = 1;
i < nimpls; ++
i )
415 varfixing = !varfixing;
417 while( varfixing ==
TRUE );
420#define checkImplics(implics)
434 (*implics)->vars[0] =
NULL;
435 (*implics)->types[0] =
NULL;
436 (*implics)->bounds[0] =
NULL;
437 (*implics)->ids[0] =
NULL;
438 (*implics)->size[0] = 0;
439 (*implics)->nimpls[0] = 0;
440 (*implics)->vars[1] =
NULL;
441 (*implics)->types[1] =
NULL;
442 (*implics)->bounds[1] =
NULL;
443 (*implics)->ids[1] =
NULL;
444 (*implics)->size[1] = 0;
445 (*implics)->nimpls[1] = 0;
458 if( *implics !=
NULL )
485 if( *implics ==
NULL )
490 assert((*implics)->nimpls[varfixing] <= (*implics)->size[varfixing]);
492 if( num > (*implics)->size[varfixing] )
501 (*implics)->size[varfixing] = newsize;
503 assert(num <= (*implics)->size[varfixing]);
531 if( implics->
nimpls[varfixing] == 0 )
539 right = implics->
nimpls[varfixing] - 1;
543 found =
SCIPsortedvecFindPtr((
void**)(&(implics->
vars[varfixing][0])), SCIPvarComp, (
void*)implvar, right + 1, &pos);
548 assert(pos >= right || compVars((
void*)implics->
vars[varfixing][pos], (
void*)implvar) > 0);
549 assert(pos == 0 || compVars((
void*)implics->
vars[varfixing][pos-1], (
void*)implvar) < 0);
557 assert(implvar == implics->
vars[varfixing][pos]);
564 if( pos + 1 < implics->
nimpls[varfixing] && implics->
vars[varfixing][pos+1] == implvar )
577 if( pos - 1 >= 0 && implics->
vars[varfixing][pos-1] == implvar )
612 assert(*poslower == -1 || *posupper == -1 || *posupper == (*poslower)+1);
613 assert(*poslower == -1 || *posadd == *poslower);
614 assert(*poslower >= 0 || *posupper == -1 || *posadd == *posupper);
615 assert(0 <= *posadd && *posadd <= implics->nimpls[varfixing]);
618 return (*poslower >= 0);
623 assert(*posadd == *poslower);
626 return (*posupper >= 0);
642 SCIP_Bool isshortcut,
674 if( *implics !=
NULL )
676 found =
implicsSearchImplic(*implics, varfixing, implvar, impltype, &poslower, &posupper, &posadd);
677 assert(-1 <= poslower && poslower < (*implics)->nimpls[varfixing]);
678 assert(-1 <= posupper && posupper < (*implics)->nimpls[varfixing]);
679 assert(0 <= posadd && posadd <= (*implics)->nimpls[varfixing]);
693 assert(found == (poslower >= 0));
696 if( poslower >= 0 &&
SCIPsetIsFeasLE(
set, implbound, (*implics)->bounds[varfixing][poslower]) )
703 if( posupper >= 0 &&
SCIPsetIsFeasGT(
set, implbound, (*implics)->bounds[varfixing][posupper]) )
716 assert(posadd == poslower);
719 assert((*implics)->vars[varfixing][poslower] == implvar);
721 (*implics)->bounds[varfixing][poslower] = implbound;
729 *implics !=
NULL ? (*implics)->
nimpls[varfixing]+1 : 1) );
732 if( (*implics)->nimpls[varfixing] - posadd > 0 )
734 int amount = ((*implics)->nimpls[varfixing] - posadd);
737 for( k = (*implics)->nimpls[varfixing]; k > posadd; k-- )
739 assert(compVars((
void*)(*implics)->vars[varfixing][k-1], (
void*)implvar) >= 0);
742 BMSmoveMemoryArray(&((*implics)->types[varfixing][posadd+1]), &((*implics)->types[varfixing][posadd]), amount);
743 BMSmoveMemoryArray(&((*implics)->ids[varfixing][posadd+1]), &((*implics)->ids[varfixing][posadd]), amount);
744 BMSmoveMemoryArray(&((*implics)->vars[varfixing][posadd+1]), &((*implics)->vars[varfixing][posadd]), amount);
745 BMSmoveMemoryArray(&((*implics)->bounds[varfixing][posadd+1]), &((*implics)->bounds[varfixing][posadd]), amount);
748 (*implics)->vars[varfixing][posadd] = implvar;
749 (*implics)->types[varfixing][posadd] = impltype;
750 (*implics)->bounds[varfixing][posadd] = implbound;
752 (*implics)->nimpls[varfixing]++;
754 for( k = posadd-1; k >= 0; k-- )
755 assert(compVars((
void*)(*implics)->vars[varfixing][k], (
void*)implvar) <= 0);
762 assert(found == (posupper >= 0));
765 if( posupper >= 0 &&
SCIPsetIsFeasGE(
set, implbound, (*implics)->bounds[varfixing][posupper]) )
772 if( poslower >= 0 &&
SCIPsetIsFeasLT(
set, implbound, (*implics)->bounds[varfixing][poslower]) )
785 assert(posadd == posupper);
788 assert((*implics)->vars[varfixing][posupper] == implvar);
790 (*implics)->bounds[varfixing][posupper] = implbound;
798 *implics !=
NULL ? (*implics)->
nimpls[varfixing]+1 : 1) );
801 if( (*implics)->nimpls[varfixing] - posadd > 0 )
803 int amount = ((*implics)->nimpls[varfixing] - posadd);
806 for( k = (*implics)->nimpls[varfixing]; k > posadd; k-- )
808 assert(compVars((
void*)(*implics)->vars[varfixing][k-1], (
void*)implvar) >= 0);
811 BMSmoveMemoryArray(&((*implics)->types[varfixing][posadd+1]), &((*implics)->types[varfixing][posadd]), amount);
812 BMSmoveMemoryArray(&((*implics)->ids[varfixing][posadd+1]), &((*implics)->ids[varfixing][posadd]), amount);
813 BMSmoveMemoryArray(&((*implics)->vars[varfixing][posadd+1]), &((*implics)->vars[varfixing][posadd]), amount);
814 BMSmoveMemoryArray(&((*implics)->bounds[varfixing][posadd+1]), &((*implics)->bounds[varfixing][posadd]), amount);
817 (*implics)->vars[varfixing][posadd] = implvar;
818 (*implics)->types[varfixing][posadd] = impltype;
819 (*implics)->bounds[varfixing][posadd] = implbound;
821 (*implics)->nimpls[varfixing]++;
823 for( k = posadd-1; k >= 0; k-- )
824 assert(compVars((
void*)(*implics)->vars[varfixing][k], (
void*)implvar) <= 0);
860 found =
implicsSearchImplic(*implics, varfixing, implvar, impltype, &poslower, &posupper, &posadd);
869 assert(0 <= posadd && posadd < (*implics)->nimpls[varfixing]);
870 assert((*implics)->vars[varfixing][posadd] == implvar);
871 assert((*implics)->types[varfixing][posadd] == impltype);
874 if( (*implics)->nimpls[varfixing] - posadd > 1 )
876 int amount = ((*implics)->nimpls[varfixing] - posadd - 1);
878 BMSmoveMemoryArray(&((*implics)->types[varfixing][posadd]), &((*implics)->types[varfixing][posadd+1]), amount);
879 BMSmoveMemoryArray(&((*implics)->vars[varfixing][posadd]), &((*implics)->vars[varfixing][posadd+1]), amount);
880 BMSmoveMemoryArray(&((*implics)->bounds[varfixing][posadd]), &((*implics)->bounds[varfixing][posadd+1]), amount);
882 (*implics)->nimpls[varfixing]--;
885 if( (*implics)->nimpls[0] == 0 && (*implics)->nimpls[1] == 0 )
898 SCIP_Bool* haslowerimplic,
899 SCIP_Bool* hasupperimplic
909 implicsSearchVar(implics, varfixing, implvar, &poslower, &posupper, &posadd);
911 *haslowerimplic = (poslower >= 0);
912 *hasupperimplic = (posupper >= 0);
929 implicsSearchVar(implics, varfixing, implvar, lowerimplicpos, upperimplicpos, &posadd);
944 return implicsSearchImplic(implics, varfixing, implvar, impltype, &poslower, &posupper, &posadd);
963 if( first != second )
967 tmp = cliquetable->
cliques[first];
972 cliquetable->
cliques[second] = tmp;
1013 SCIP_Bool isequation
1025 (*clique)->nvars =
nvars;
1026 (*clique)->size = size;
1027 (*clique)->startcleanup = -1;
1028 (*clique)->id = (
unsigned int)
id;
1029 (*clique)->eventsissued =
FALSE;
1030 (*clique)->equation = isequation;
1031 (*clique)->index = -1;
1045 if( *clique !=
NULL )
1064 if( num > clique->size )
1071 clique->size = newsize;
1073 assert(num <= clique->size);
1095 right = clique->nvars;
1096 while( left < right-1 )
1101 middle = (left+right)/2;
1113 if( clique->values[middle] < value )
1116 for(
i = middle+1;
i < clique->nvars && clique->vars[
i] ==
var; ++
i )
1118 if( clique->values[
i] == value )
1123 if( clique->values[middle] > value )
1126 for(
i = middle-1;
i >= 0 && clique->vars[
i] ==
var; --
i )
1128 if( clique->values[
i] == value )
1157 SCIP_Bool* doubleentry,
1158 SCIP_Bool* oppositeentry
1172 *doubleentry =
FALSE;
1173 *oppositeentry =
FALSE;
1187 if( pos < clique->
nvars )
1189 const int amount = clique->nvars - pos;
1200 for( ; pos < clique->nvars - 1 && clique->vars[pos + 1] ==
var && clique->values[pos + 1] == value; ++pos );
1203 if( pos < clique->
nvars - 1 && clique->vars[pos + 1] ==
var )
1205 assert(clique->values[pos + 1] != value);
1206 *oppositeentry =
TRUE;
1211 *doubleentry =
TRUE;
1215 for( ; pos > 0 && clique->vars[pos - 1] ==
var && clique->values[pos - 1] != value; --pos );
1218 if( pos > 0 && clique->vars[pos - 1] ==
var )
1220 assert(clique->values[pos - 1] == value);
1222 *doubleentry =
TRUE;
1228 assert(clique->values[pos] != value);
1230 clique->values[pos] = value;
1239 for( ; pos < clique->nvars - 1 && clique->vars[pos + 1] ==
var && clique->values[pos + 1] != value; ++pos );
1242 if( pos < clique->
nvars - 1 && clique->vars[pos + 1] ==
var )
1244 assert(clique->values[pos + 1] == value);
1245 *doubleentry =
TRUE;
1251 *oppositeentry =
TRUE;
1255 assert(clique->values[pos] != value);
1257 clique->values[pos] = value;
1263 for( ; pos > 0 && clique->vars[pos - 1] ==
var && clique->values[pos - 1] == value; --pos );
1266 *doubleentry =
TRUE;
1269 if( pos > 0 && clique->vars[pos - 1] ==
var && clique->values[pos - 1] != value )
1270 *oppositeentry =
TRUE;
1277 clique->vars[
i] =
var;
1278 clique->values[
i] = value;
1279 clique->eventsissued =
FALSE;
1299 if( cliquetable->
incleanup && clique->index == 0 )
1309 assert(clique->values[pos] == value);
1312 if( clique->startcleanup == -1 )
1315 if( clique->startcleanup == -1 || pos < clique->startcleanup )
1316 clique->startcleanup = pos;
1318#ifdef SCIP_MORE_DEBUG
1322 for( v = clique->startcleanup - 1; v >= 0; --v )
1339 unsigned int cliqueid;
1346 cliqueid = clique->id;
1349 while( left < right-1 )
1355 middle = (left+right)/2;
1356 id = cliques[middle]->
id;
1359 else if( cliqueid >
id )
1363 assert(clique == cliques[middle]);
1371#ifdef SCIP_MORE_DEBUG
1382 for(
i = 0;
i < clique->nvars; ++
i )
1389 var = clique->vars[
i];
1391 assert(
i == 0 || clique->vars[
i-1] !=
var || clique->values[
i-1] <= clique->values[
i]);
1408 assert(0 <= pos && pos < ncliques);
1409 assert(cliques[pos] == clique);
1412 assert(0 <= clique->startcleanup && clique->startcleanup <=
i);
1414 assert(clique->index >= 0);
1417#define cliqueCheck(clique)
1430 (*cliquelist)->cliques[0] =
NULL;
1431 (*cliquelist)->cliques[1] =
NULL;
1432 (*cliquelist)->ncliques[0] = 0;
1433 (*cliquelist)->ncliques[1] = 0;
1434 (*cliquelist)->size[0] = 0;
1435 (*cliquelist)->size[1] = 0;
1448 if( *cliquelist !=
NULL )
1468 if( num > cliquelist->
size[value] )
1474 cliquelist->
size[value] = newsize;
1476 assert(num <= cliquelist->size[value]);
1499 if( *cliquelist ==
NULL )
1505 if( (*cliquelist)->cliques[value] !=
NULL )
1507 for(
i = (*cliquelist)->ncliques[value];
i > 0 && (*cliquelist)->cliques[value][
i - 1]->id >
id; --
i );
1509 if(
i > 0 && (*cliquelist)->cliques[value][
i - 1]->id ==
id )
1516 clique->id, (
void*)*cliquelist, value, (*cliquelist)->ncliques[value]);
1518 BMSmoveMemoryArray(&((*cliquelist)->cliques[value][
i+1]), &((*cliquelist)->cliques[value][
i]), (*cliquelist)->ncliques[value] -
i);
1520 (*cliquelist)->cliques[value][
i] = clique;
1521 (*cliquelist)->ncliques[value]++;
1540 if( *cliquelist ==
NULL )
1543 SCIPdebugMessage(
"deleting clique %u from cliquelist %p value %u (length: %d)\n",
1544 clique->id, (
void*)*cliquelist, value, (*cliquelist)->ncliques[value]);
1546 pos =
cliquesSearchClique((*cliquelist)->cliques[value], (*cliquelist)->ncliques[value], clique);
1551#ifdef SCIP_MORE_DEBUG
1553 SCIP_Bool* clqvalues;
1567 for( v = nclqvars - 1; v > 0; --v )
1569 if( clqvars[v] == clqvars[v - 1] )
1571 if( clqvalues[v] == clqvalues[v - 1] || (v > 1 && clqvars[v] == clqvars[v - 2]) )
1583 assert(0 <= pos && pos < (*cliquelist)->ncliques[value]);
1584 assert((*cliquelist)->cliques[value][pos] == clique);
1588 (*cliquelist)->ncliques[value]--;
1589 if( pos < (*cliquelist)->ncliques[value] )
1591 BMSmoveMemoryArray(&((*cliquelist)->cliques[value][pos]), &((*cliquelist)->cliques[value][pos+1]),
1592 (*cliquelist)->ncliques[value] - pos);
1596 if( (*cliquelist)->ncliques[0] == 0 && (*cliquelist)->ncliques[1] == 0 )
1619 if( cliquelist1 ==
NULL || cliquelist2 ==
NULL )
1622 ncliques1 = cliquelist1->
ncliques[value1];
1623 cliques1 = cliquelist1->
cliques[value1];
1624 ncliques2 = cliquelist2->
ncliques[value2];
1625 cliques2 = cliquelist2->
cliques[value2];
1630 if( i1 < ncliques1 && i2 < ncliques2 )
1632 unsigned int cliqueid;
1635 if( ncliques2 > ncliques1 )
1642 cliques1 = cliques2;
1643 ncliques1 = ncliques2;
1687 SCIP_Bool irrelevantvar
1693 if( cliquelist !=
NULL )
1697 SCIPdebugMessage(
"removing variable <%s> from cliques (%d with value 0, %d with value 1)\n",
1700 for( value = 0; value < 2; ++value )
1710 for(
i = cliquelist->
ncliques[value] - 1;
i >= 0; --
i )
1714 clique = cliquelist->
cliques[value][
i];
1717 SCIPdebugMessage(
" -> removing variable <%s> == %d from clique %u (size %d)\n",
1723 clique->equation =
FALSE;
1725#ifdef SCIP_MORE_DEBUG
1727 if( ! cliquetable->
incleanup || clique->index > 0 )
1761 for(
i = 0;
i < clique1->
nvars; ++
i )
1780 clique->nvars, 2*clique->values[0] + clique->values[clique->nvars-1]);
1783#define HASHTABLE_CLIQUETABLE_SIZE 100
1802 hashgetkeyClique, hashkeyeqClique, hashkeyvalClique,
NULL) );
1804 (*cliquetable)->varidxtable =
NULL;
1805 (*cliquetable)->djset =
NULL;
1806 (*cliquetable)->cliques =
NULL;
1807 (*cliquetable)->ncliques = 0;
1808 (*cliquetable)->size = 0;
1809 (*cliquetable)->ncreatedcliques = 0;
1810 (*cliquetable)->ncleanupfixedvars = 0;
1811 (*cliquetable)->ncleanupaggrvars = 0;
1812 (*cliquetable)->ndirtycliques = 0;
1813 (*cliquetable)->nentries = 0;
1814 (*cliquetable)->incleanup =
FALSE;
1815 (*cliquetable)->compsfromscratch =
FALSE;
1816 (*cliquetable)->ncliquecomponents = -1;
1833 for(
i = (*cliquetable)->ncliques - 1;
i >= 0; --
i )
1839 if( (*cliquetable)->djset !=
NULL )
1843 if( (*cliquetable)->varidxtable !=
NULL )
1867 if( num > cliquetable->
size )
1873 cliquetable->
size = newsize;
1875 assert(num <= cliquetable->size);
1884 SCIP_Bool* clqvalues,
1886 SCIP_Bool* isequation,
1900 SCIP_Bool* infeasible
1908 SCIPsetDebugMsg(
set,
"starting merging %d variables in clique %d\n", *nclqvars, (clique ==
NULL) ? -1 : (
int) clique->id);
1910 if( *nclqvars <= 1 )
1928 noldbdchgs = *nbdchgs;
1931 startidx = *nclqvars - 1;
1932 while( startidx >= 0 )
1939 var = clqvars[startidx];
1945 if( clqvalues[startidx] )
1955 curr = startidx - 1;
1960 if( clqvars[curr] ==
var )
1962 if( clqvalues[curr] )
1973 assert(nzeros + nones <= *nclqvars);
1976 if( nones + nzeros == 1 )
1982 if( nones >= 2 && nzeros >= 2 )
1989 if( nones >= 2 || nzeros >= 2 )
1994 assert(nones <= 1 || nzeros <= 1);
1997 if( clique !=
NULL )
2013 SCIP_CALL(
SCIPvarFixBinary(
var, blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand, eventqueue,
2014 cliquetable, fixvalue, infeasible, nbdchgs) );
2017 fixvalue ? 1 : 0, *infeasible ?
"infeasible" :
"feasible");
2024 if( nones >= 1 && nzeros >= 1 )
2029 if( nzeros + nones < *nclqvars )
2050 while(
w > 0 && clqvars[
w-1] == clqvars[
w] )
2052 if( clqvalues[
w-1] != clqvalues[
w] )
2063 if( clique !=
NULL )
2068 branchcand, eventqueue, cliquetable, !clqvalues[
w], infeasible, nbdchgs) );
2071 clqvalues[
w] ? 0 : 1, *infeasible ?
"infeasible" :
"feasible");
2080 if( clique !=
NULL )
2086 *isequation =
FALSE;
2098 if( *infeasible || *nclqvars == 0 )
2106 if( *nbdchgs > noldbdchgs )
2109 SCIP_Bool onefixedvalue;
2113 onefixedvalue =
TRUE;
2119 while( startidx < *nclqvars )
2123 var = clqvars[startidx];
2131 if( onefixedvar !=
NULL )
2135 SCIPsetDebugMsg(
set,
"two variables in clique %d fixed to one %s%s and %s%s\n", (clique !=
NULL) ? (
int) clique->id : -1,
2140 onefixedvalue = clqvalues[startidx];
2148 clqvars[
w] = clqvars[startidx];
2149 clqvalues[
w] = clqvalues[startidx];
2158 if( clique !=
NULL )
2170 if( onefixedvar !=
NULL )
2172 SCIPsetDebugMsg(
set,
"variable %s%s in clique %d fixed to one, fixing all other variables to zero\n",
2173 onefixedvalue ?
"" :
"~",
SCIPvarGetName(onefixedvar), (clique !=
NULL) ? (
int) clique->id : -1);
2176 for( startidx = *nclqvars; startidx >= 0; --startidx )
2182 if( onefixedvalue != clqvalues[startidx] || clqvars[startidx] != onefixedvar )
2184 if( clique !=
NULL )
2193 while( startidx > 0 && clqvars[startidx - 1] == clqvars[startidx] )
2195 if( clqvalues[startidx - 1] != clqvalues[startidx] )
2204 clqvalues[startidx] ? 0 : 1);
2208 branchcand, eventqueue, cliquetable, !clqvalues[startidx], infeasible, nbdchgs) );
2216 if( clique !=
NULL )
2222 *isequation =
FALSE;
2230 if( *nclqvars == 0 )
2236 else if( *nclqvars == 1 )
2241 if( clique !=
NULL )
2245 SCIP_CALL(
SCIPvarFixBinary(clqvars[0], blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand,
2246 eventqueue, cliquetable, clqvalues[0], infeasible, nbdchgs) );
2249 clqvalues[0] ? 1 : 0, *infeasible ?
"infeasible" :
"feasible");
2252 *isequation =
FALSE;
2326 clqvars = clique->vars;
2327 nclqvars = clique->nvars;
2336 if( currnode == - 1 )
2340 if( lastnode != -1 )
2343 lastnode = currnode;
2365 if( nodeindex >= 0 )
2391 SCIP_Bool isequation,
2392 SCIP_Bool* infeasible,
2397 SCIP_Bool* clqvalues;
2401 int nlocalbdchgs = 0;
2413 *infeasible =
FALSE;
2417 if( values ==
NULL )
2422 for( v =
nvars - 1; v >= 0; --v )
2423 clqvalues[v] =
TRUE;
2435 for( v =
nvars - 1; v >= 0; --v )
2458 SCIP_Bool clqval = clqvalues[
w];
2478#ifdef SCIP_DISABLED_CODE
2483 while(
w > 0 && clqvars[
w - 1] == clqvars[
w] )
2485 if( clqvalues[
w - 1] != clqvalues[
w] )
2496 branchcand, eventqueue, cliquetable, !clqval, infeasible, &nlocalbdchgs) );
2499 clqval ? 0 : 1, *infeasible ?
"infeasible" :
"feasible");
2516 clqvars[v] = clqvars[
nvars];
2517 clqvalues[v] = clqvalues[
nvars];
2522 if( nbdchgs !=
NULL )
2523 *nbdchgs += nlocalbdchgs;
2532 if( v < 0 &&
nvars <= 1)
2541 branchcand, eventqueue, cliquetable, clqvalues[0], infeasible, &nlocalbdchgs) );
2544 clqvalues[0] ? 1 : 0, *infeasible ?
"infeasible" :
"feasible");
2546 if( nbdchgs !=
NULL )
2547 *nbdchgs += nlocalbdchgs;
2549 else if(
nvars == 0 )
2563 SCIP_CALL(
sortAndMergeClique(clqvars, clqvalues, &
nvars, &isequation,
NULL, blkmem,
set, stat, transprob, origprob, tree,
2564 reopt, lp, branchcand, eventqueue, cliquetable, &nlocalbdchgs, infeasible) );
2566 if( nbdchgs !=
NULL )
2567 *nbdchgs += nlocalbdchgs;
2570 if(
nvars == 0 || *infeasible )
2575 SCIPsetDebugMsg(
set,
"reject %d-variable clique to keep clique table entries below threshold of %g entries\n",
2593 if( sameclique ==
NULL )
2614 SCIPsetDebugMsg(
set,
"same clique %p (id: %d) already found in cliquetable -> discard new one\n", (
void*) sameclique, sameclique->
id);
2620 if( !sameclique->equation && clique->equation )
2621 sameclique->equation =
TRUE;
2660 SCIP_Bool* infeasible
2673 SCIP_Bool onefixedvalue =
FALSE;
2674 SCIP_Bool needsorting =
FALSE;
2678 w = clique->startcleanup;
2680 SCIPsetDebugMsg(
set,
"Starting clean up of clique %u (size %d) from position %d\n", clique->id, clique->nvars,
w);
2683 for( v =
w; v < clique->nvars; ++v )
2685 SCIP_Bool addvartoclique;
2687 addvartoclique =
FALSE;
2698 clique->values[v] = !clique->values[v];
2702 clique->equation =
FALSE;
2706 addvartoclique =
TRUE;
2718 if( !addvartoclique )
2722 clique->equation =
FALSE;
2732 if( onefixedvar !=
NULL )
2736 SCIPsetDebugMsg(
set,
"two variables in clique %u fixed to one %s%s and %s%s\n", clique->id,
2737 onefixedvalue ?
"" :
"~",
SCIPvarGetName(onefixedvar), clique->values[v] ?
"" :
"~",
2741 onefixedvar = clique->vars[v];
2742 onefixedvalue = clique->values[v];
2751 clique->vars[
w] = clique->vars[v];
2752 clique->values[
w] = clique->values[v];
2756 if( addvartoclique )
2766 if( onefixedvar !=
NULL )
2768 SCIPsetDebugMsg(
set,
"variable %s%s in clique %u fixed to one, fixing all other variables to zero\n",
2769 onefixedvalue ?
"" :
"~",
SCIPvarGetName(onefixedvar), clique->id);
2771 for( v = 0; v < clique->nvars ; ++v )
2773 SCIP_VAR* clqvar = clique->vars[v];
2774 SCIP_Bool clqval = clique->values[v];
2779 if( onefixedvalue != clqval || clqvar != onefixedvar )
2793 assert(clqvar != onefixedvar);
2806#ifdef SCIP_DISABLED_CODE
2811 while( v < clique->
nvars - 1 && clique->vars[v + 1] == clqvar )
2813 if( clique->values[v + 1] != clique->values[v] )
2823 SCIP_CALL(
SCIPvarFixBinary(clqvar, blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand,
2824 eventqueue, cliquetable, !clqval, infeasible, nchgbds) );
2838 clique->equation =
FALSE;
2839 clique->startcleanup = -1;
2844 if( clique->equation )
2846 if( clique->nvars == 0 )
2851 else if( clique->nvars == 1 )
2860 clique->values[0] ? 1 : 0);
2863 branchcand, eventqueue, cliquetable, clique->values[0], infeasible, nchgbds) );
2866 clique->equation =
FALSE;
2867 clique->startcleanup = -1;
2875 SCIP_Bool isequation = clique->equation;
2879 transprob, origprob, tree, reopt, lp, branchcand, eventqueue, cliquetable, nchgbds, infeasible) );
2881 clique->equation = isequation;
2886 clique->startcleanup = -1;
2893#ifdef SCIP_MORE_DEBUG
2900 SCIP_Longint nentries = 0;
2908 return (nentries == cliquetable->
nentries);
2911#define checkNEntries(cliquetable) TRUE
2933 SCIP_Bool* infeasible
2940 *infeasible =
FALSE;
2959 clique = cliquetable->
cliques[0];
2965 cliquetable->
nentries -= clique->nvars;
2968 SCIP_CALL(
cliqueCleanup(clique, blkmem,
set, stat, transprob, origprob, tree, reopt, lp, branchcand, eventqueue,
2969 cliquetable, nchgbds, infeasible) );
2982#ifdef SCIP_DISABLED_CODE
2989 SCIP_Real rhs = 1.0;
2990 SCIP_Bool aggregated;
2992 printf(
"aggr vars, clique %u\n", clique->id);
2996 var0 = clique->vars[0];
2997 var1 = clique->vars[1];
2999 if( !clique->values[0] )
3007 if( !clique->values[1] )
3017 var0 = clique->vars[1];
3018 var1 = clique->vars[0];
3020 if( !clique->values[0] )
3028 if( !clique->values[1] )
3042 tree, lp, cliquetable, branchcand, eventfilter, eventqueue,
3043 var0, var1, scalarx, scalary, rhs, infeasible, &aggregated) );
3045 assert(aggregated || *infeasible);
3052 if( clique->nvars <= 1 || sameclique !=
NULL )
3057 assert(clique->nvars > 1 || !clique->equation);
3062 if( clique->nvars > 1 && clique->equation && !sameclique->
equation )
3073 for( j = 0; j < clique->nvars; ++j )
3091 cliquetable->
nentries += clique->nvars;
3094 if( !clique->eventsissued )
3099 for( j = 0; j < clique->nvars; ++j )
3106 clique->eventsissued =
TRUE;
3159 for( v =
nbinvars; v < ndiscvars; ++v )
3166 nbinvarstotal =
nbinvars + nimplbinvars;
3169 if( nbinvarstotal == 0 )
3171 SCIPsetDebugMsg(
set,
"0 binary variables in total --> 0 connected components in the clique table");
3179 SCIPsetDebugMsg(
set,
"0 cliques --> Clique table has %d isolated nodes", nbinvarstotal);
3195 for( v = 0; v < ndiscvars; ++v )
3226 djset = cliquetable->
djset;
3229 nnonbinvars = (
nintvars + nimplvars) - nimplbinvars;
3231 cliques = cliquetable->
cliques;
3240 clique = cliques[
c];
3264#undef SCIPvboundsGetNVbds
3265#undef SCIPvboundsGetVars
3266#undef SCIPvboundsGetCoefs
3267#undef SCIPvboundsGetConstants
3268#undef SCIPimplicsGetNImpls
3269#undef SCIPimplicsGetVars
3270#undef SCIPimplicsGetTypes
3271#undef SCIPimplicsGetBounds
3272#undef SCIPimplicsGetIds
3273#undef SCIPcliqueGetNVars
3274#undef SCIPcliqueGetVars
3275#undef SCIPcliqueGetValues
3276#undef SCIPcliqueGetId
3277#undef SCIPcliqueGetIndex
3278#undef SCIPcliqueIsCleanedUp
3279#undef SCIPcliqueIsEquation
3280#undef SCIPcliquelistGetNCliques
3281#undef SCIPcliquelistGetCliques
3282#undef SCIPcliquelistCheck
3283#undef SCIPcliquetableGetNCliques
3284#undef SCIPcliquetableGetCliques
3285#undef SCIPcliquetableGetNEntries
3286#undef SCIPcliquetableGetNCliqueComponents
3287#undef SCIPcliquetableNeedsComponentUpdate
3294 return vbounds !=
NULL ? vbounds->
len : 0;
3327 return implics !=
NULL ? implics->
nimpls[varfixing] : 0;
3336 return implics !=
NULL ? implics->
vars[varfixing] :
NULL;
3366 return implics !=
NULL ? implics->
ids[varfixing] :
NULL;
3376 return clique->nvars;
3386 return clique->vars;
3398 return clique->values;
3422 return clique->index;
3432 return (clique->startcleanup == -1);
3442 return (SCIP_Bool)(clique->equation);
3451 return cliquelist !=
NULL ? cliquelist->
ncliques[value] : 0;
3480 for( value = 0; value < 2; ++value )
3488 for(
i = 0;
i < ncliques; ++
i )
3493 clique = cliques[
i];
3499 assert(clique->values[pos] == (SCIP_Bool)value);
#define SCIPdebugCheckClique(set, vars, values, nvars)
#define SCIP_HASHSIZE_CLIQUES
#define SCIP_LONGINT_FORMAT
#define SCIP_HASHSIZE_CLIQUES_SMALL
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_RETCODE SCIPeventqueueProcess(SCIP_EVENTQUEUE *eventqueue, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_PRIMAL *primal, SCIP_LP *lp, SCIP_BRANCHCAND *branchcand, SCIP_EVENTFILTER *eventfilter)
SCIP_RETCODE SCIPeventCreateImplAdded(SCIP_EVENT **event, BMS_BLKMEM *blkmem, SCIP_VAR *var)
SCIP_RETCODE SCIPeventqueueDelay(SCIP_EVENTQUEUE *eventqueue)
internal methods for managing events
int SCIPdisjointsetGetSize(SCIP_DISJOINTSET *djset)
int SCIPdisjointsetGetComponentCount(SCIP_DISJOINTSET *djset)
int SCIPdisjointsetFind(SCIP_DISJOINTSET *djset, int element)
void SCIPdisjointsetUnion(SCIP_DISJOINTSET *djset, int p, int q, SCIP_Bool forcerepofp)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
int SCIPhashmapGetImageInt(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPhashmapInsertInt(SCIP_HASHMAP *hashmap, void *origin, int image)
SCIP_RETCODE SCIPhashmapRemoveAll(SCIP_HASHMAP *hashmap)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
#define SCIPhashFour(a, b, c, d)
SCIP_RETCODE SCIPhashtableCreate(SCIP_HASHTABLE **hashtable, BMS_BLKMEM *blkmem, int tablesize, SCIP_DECL_HASHGETKEY((*hashgetkey)), SCIP_DECL_HASHKEYEQ((*hashkeyeq)), SCIP_DECL_HASHKEYVAL((*hashkeyval)), void *userptr)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
SCIP_RETCODE SCIPhashtableRemove(SCIP_HASHTABLE *hashtable, void *element)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_VAR * SCIPvarGetProbvar(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
int SCIPvarGetIndex(SCIP_VAR *var)
const char * SCIPvarGetName(SCIP_VAR *var)
int SCIPvarGetNCliques(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_VAR * SCIPvarGetNegationVar(SCIP_VAR *var)
SCIP_CLIQUE ** SCIPvarGetCliques(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPvarGetProbvarBinary(SCIP_VAR **var, SCIP_Bool *negated)
SCIP_RETCODE SCIPvarsGetProbvarBinary(SCIP_VAR ***vars, SCIP_Bool **negatedarr, int nvars)
SCIP_Bool SCIPsortedvecFindPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), void *val, int len, int *pos)
void SCIPsortPtrBool(void **ptrarray, SCIP_Bool *boolarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
assert(minobj< SCIPgetCutoffbound(scip))
SCIP_VAR ** SCIPimplicsGetVars(SCIP_IMPLICS *implics, SCIP_Bool varfixing)
void SCIPcliqueDelVar(SCIP_CLIQUE *clique, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_Bool value)
void SCIPcliquelistRemoveFromCliques(SCIP_CLIQUELIST *cliquelist, SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var, SCIP_Bool irrelevantvar)
SCIP_RETCODE SCIPcliquetableFree(SCIP_CLIQUETABLE **cliquetable, BMS_BLKMEM *blkmem)
void SCIPvboundsFree(SCIP_VBOUNDS **vbounds, BMS_BLKMEM *blkmem)
SCIP_Real * SCIPvboundsGetCoefs(SCIP_VBOUNDS *vbounds)
void SCIPvboundsShrink(SCIP_VBOUNDS **vbounds, BMS_BLKMEM *blkmem, int newnvbds)
#define HASHTABLE_CLIQUETABLE_SIZE
int SCIPcliquetableGetNCliquesCreated(SCIP_CLIQUETABLE *cliquetable)
static SCIP_RETCODE vboundsEnsureSize(SCIP_VBOUNDS **vbounds, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
static void cliquetableSwapCliques(SCIP_CLIQUETABLE *cliquetable, int first, int second)
SCIP_Bool SCIPcliquetableNeedsComponentUpdate(SCIP_CLIQUETABLE *cliquetable)
SCIP_VAR ** SCIPcliqueGetVars(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_CLIQUE ** SCIPcliquelistGetCliques(SCIP_CLIQUELIST *cliquelist, SCIP_Bool value)
static SCIP_RETCODE implicsCreate(SCIP_IMPLICS **implics, BMS_BLKMEM *blkmem)
SCIP_Bool SCIPcliquelistsHaveCommonClique(SCIP_CLIQUELIST *cliquelist1, SCIP_Bool value1, SCIP_CLIQUELIST *cliquelist2, SCIP_Bool value2)
SCIP_Real * SCIPimplicsGetBounds(SCIP_IMPLICS *implics, SCIP_Bool varfixing)
SCIP_Longint SCIPcliquetableGetNEntries(SCIP_CLIQUETABLE *cliquetable)
void SCIPcliquelistCheck(SCIP_CLIQUELIST *cliquelist, SCIP_VAR *var)
SCIP_VAR ** SCIPvboundsGetVars(SCIP_VBOUNDS *vbounds)
int SCIPcliqueGetNVars(SCIP_CLIQUE *clique)
static void cliquetableMarkCliqueForCleanup(SCIP_CLIQUETABLE *cliquetable, SCIP_CLIQUE *clique)
SCIP_Bool * SCIPcliqueGetValues(SCIP_CLIQUE *clique)
SCIP_RETCODE SCIPvboundsDel(SCIP_VBOUNDS **vbounds, BMS_BLKMEM *blkmem, SCIP_VAR *vbdvar, SCIP_Bool negativecoef)
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)
int * SCIPimplicsGetIds(SCIP_IMPLICS *implics, SCIP_Bool varfixing)
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)
static int cliquesSearchClique(SCIP_CLIQUE **cliques, int ncliques, SCIP_CLIQUE *clique)
int SCIPcliquetableGetNCliqueComponents(SCIP_CLIQUETABLE *cliquetable)
static int cliquetableGetNodeIndexBinvar(SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *binvar)
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)
void SCIPcliquelistFree(SCIP_CLIQUELIST **cliquelist, BMS_BLKMEM *blkmem)
static SCIP_RETCODE vboundsSearchPos(SCIP_VBOUNDS *vbounds, SCIP_VAR *var, SCIP_Bool negativecoef, int *insertpos, SCIP_Bool *found)
int SCIPimplicsGetNImpls(SCIP_IMPLICS *implics, SCIP_Bool varfixing)
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 checkImplics(SCIP_IMPLICS *implics)
SCIP_RETCODE SCIPcliquetableCreate(SCIP_CLIQUETABLE **cliquetable, SCIP_SET *set, BMS_BLKMEM *blkmem)
SCIP_BOUNDTYPE * SCIPimplicsGetTypes(SCIP_IMPLICS *implics, SCIP_Bool varfixing)
static void cliqueFree(SCIP_CLIQUE **clique, BMS_BLKMEM *blkmem)
SCIP_Bool SCIPcliqueHasVar(SCIP_CLIQUE *clique, SCIP_VAR *var, SCIP_Bool value)
int SCIPcliquetableGetNCliques(SCIP_CLIQUETABLE *cliquetable)
int SCIPcliquelistGetNCliques(SCIP_CLIQUELIST *cliquelist, SCIP_Bool value)
void SCIPimplicsGetVarImplics(SCIP_IMPLICS *implics, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_Bool *haslowerimplic, SCIP_Bool *hasupperimplic)
static SCIP_RETCODE cliquelistCreate(SCIP_CLIQUELIST **cliquelist, BMS_BLKMEM *blkmem)
#define checkNEntries(cliquetable)
static SCIP_RETCODE vboundsCreate(SCIP_VBOUNDS **vbounds, BMS_BLKMEM *blkmem)
static SCIP_RETCODE cliquelistEnsureSize(SCIP_CLIQUELIST *cliquelist, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Bool value, int num)
static void implicsSearchVar(SCIP_IMPLICS *implics, SCIP_Bool varfixing, SCIP_VAR *implvar, int *poslower, int *posupper, int *posadd)
SCIP_RETCODE SCIPcliquelistDel(SCIP_CLIQUELIST **cliquelist, BMS_BLKMEM *blkmem, SCIP_Bool value, SCIP_CLIQUE *clique)
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 cliqueCheck(clique)
SCIP_Bool SCIPcliqueIsCleanedUp(SCIP_CLIQUE *clique)
int SCIPcliquetableGetVarComponentIdx(SCIP_CLIQUETABLE *cliquetable, SCIP_VAR *var)
void SCIPimplicsGetVarImplicPoss(SCIP_IMPLICS *implics, SCIP_Bool varfixing, SCIP_VAR *implvar, int *lowerimplicpos, int *upperimplicpos)
static SCIP_RETCODE cliquetableEnsureSize(SCIP_CLIQUETABLE *cliquetable, SCIP_SET *set, int num)
SCIP_RETCODE SCIPimplicsDel(SCIP_IMPLICS **implics, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype)
SCIP_Real * SCIPvboundsGetConstants(SCIP_VBOUNDS *vbounds)
static SCIP_Bool implicsSearchImplic(SCIP_IMPLICS *implics, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype, int *poslower, int *posupper, int *posadd)
static void cliquetableUpdateConnectednessClique(SCIP_CLIQUETABLE *cliquetable, SCIP_CLIQUE *clique)
int SCIPvboundsGetNVbds(SCIP_VBOUNDS *vbounds)
SCIP_RETCODE SCIPcliquetableComputeCliqueComponents(SCIP_CLIQUETABLE *cliquetable, SCIP_SET *set, BMS_BLKMEM *blkmem, SCIP_VAR **vars, int nbinvars, int nintvars, int nimplvars)
SCIP_CLIQUE ** SCIPcliquetableGetCliques(SCIP_CLIQUETABLE *cliquetable)
SCIP_Bool SCIPimplicsContainsImpl(SCIP_IMPLICS *implics, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype)
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)
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)
static SCIP_RETCODE implicsEnsureSize(SCIP_IMPLICS **implics, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Bool varfixing, int num)
void SCIPimplicsFree(SCIP_IMPLICS **implics, BMS_BLKMEM *blkmem)
int SCIPcliqueGetIndex(SCIP_CLIQUE *clique)
int SCIPcliqueSearchVar(SCIP_CLIQUE *clique, SCIP_VAR *var, SCIP_Bool value)
SCIP_Bool SCIPcliqueIsEquation(SCIP_CLIQUE *clique)
unsigned int SCIPcliqueGetId(SCIP_CLIQUE *clique)
static SCIP_RETCODE cliqueEnsureSize(SCIP_CLIQUE *clique, BMS_BLKMEM *blkmem, SCIP_SET *set, int num)
SCIP_RETCODE SCIPcliquelistAdd(SCIP_CLIQUELIST **cliquelist, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Bool value, SCIP_CLIQUE *clique)
methods for implications, variable bounds, and cliques
#define BMSduplicateBlockMemoryArray(mem, ptr, source, num)
#define BMSfreeMemory(ptr)
#define BMSfreeBlockMemory(mem, ptr)
#define BMSallocBlockMemory(mem, ptr)
#define BMSreallocMemoryArray(ptr, num)
#define BMSfreeBlockMemoryArrayNull(mem, ptr, num)
#define BMSfreeBlockMemoryArray(mem, ptr, num)
#define BMSreallocBlockMemoryArray(mem, ptr, oldnum, newnum)
#define BMSmoveMemoryArray(ptr, source, num)
struct BMS_BlkMem BMS_BLKMEM
#define BMSfreeMemoryArrayNull(ptr)
#define BMSallocMemory(ptr)
void SCIPdisjointsetFree(SCIP_DISJOINTSET **djset, BMS_BLKMEM *blkmem)
SCIP_RETCODE SCIPdisjointsetCreate(SCIP_DISJOINTSET **djset, BMS_BLKMEM *blkmem, int ncomponents)
internal miscellaneous methods
public methods for implications, variable bounds, and cliques
public methods for message output
public data structures and miscellaneous methods
methods for sorting joint arrays of various types
public methods for problem variables
SCIP_Bool SCIPsetIsFeasGT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsFeasLE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_STAGE SCIPsetGetStage(SCIP_SET *set)
SCIP_Bool SCIPsetIsFeasLT(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
SCIP_Bool SCIPsetIsInfinity(SCIP_SET *set, SCIP_Real val)
SCIP_Bool SCIPsetIsZero(SCIP_SET *set, SCIP_Real val)
SCIP_Bool SCIPsetIsFeasGE(SCIP_SET *set, SCIP_Real val1, SCIP_Real val2)
int SCIPsetCalcMemGrowSize(SCIP_SET *set, int num)
internal methods for global SCIP settings
#define SCIPsetFreeBufferArray(set, ptr)
#define SCIPsetAllocBufferArray(set, ptr, num)
#define SCIPsetDuplicateBufferArray(set, ptr, source, num)
SCIP_CLIQUE ** cliques[2]
SCIP_HASHTABLE * hashtable
SCIP_HASHMAP * varidxtable
SCIP_Bool compsfromscratch
SCIP_BOUNDTYPE * types[2]
datastructures for implications, variable bounds, and cliques
datastructures for global SCIP settings
datastructures for problem statistics
enum SCIP_BoundType SCIP_BOUNDTYPE
#define SCIP_DECL_SORTPTRCOMP(x)
#define SCIP_DECL_HASHKEYEQ(x)
#define SCIP_DECL_HASHGETKEY(x)
#define SCIP_DECL_HASHKEYVAL(x)
enum SCIP_Retcode SCIP_RETCODE
@ SCIP_VARTYPE_CONTINUOUS
@ SCIP_VARSTATUS_MULTAGGR
@ SCIP_VARSTATUS_AGGREGATED
SCIP_RETCODE SCIPvarAddCliqueToList(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_Bool value, SCIP_CLIQUE *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)
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)
SCIP_Bool SCIPvarIsMarkedDeleteGlobalStructures(SCIP_VAR *var)
SCIP_RETCODE SCIPvarDelCliqueFromList(SCIP_VAR *var, BMS_BLKMEM *blkmem, SCIP_Bool value, SCIP_CLIQUE *clique)
SCIP_RETCODE SCIPvarsAddClique(SCIP_VAR **vars, SCIP_Bool *values, int nvars, BMS_BLKMEM *blkmem, SCIP_SET *set, SCIP_CLIQUE *clique)
internal methods for problem variables