35 #define CONSHDLR_NAME "logicor" 36 #define CONSHDLR_DESC "logic or constraints" 37 #define CONSHDLR_SEPAPRIORITY +10000 38 #define CONSHDLR_ENFOPRIORITY -2000000 39 #define CONSHDLR_CHECKPRIORITY -2000000 40 #define CONSHDLR_SEPAFREQ 0 41 #define CONSHDLR_PROPFREQ 1 42 #define CONSHDLR_EAGERFREQ 100 44 #define CONSHDLR_MAXPREROUNDS -1 45 #define CONSHDLR_DELAYSEPA FALSE 46 #define CONSHDLR_DELAYPROP FALSE 47 #define CONSHDLR_NEEDSCONS TRUE 49 #define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_ALWAYS 50 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP 52 #define LINCONSUPGD_PRIORITY +800000 54 #define EVENTHDLR_NAME "logicor" 55 #define EVENTHDLR_DESC "event handler for logic or constraints" 57 #define CONFLICTHDLR_NAME "logicor" 58 #define CONFLICTHDLR_DESC "conflict handler creating logic or constraints" 59 #define CONFLICTHDLR_PRIORITY LINCONSUPGD_PRIORITY 61 #define DEFAULT_PRESOLPAIRWISE TRUE 62 #define DEFAULT_STRENGTHEN TRUE 64 #define HASHSIZE_LOGICORCONS 500 65 #define DEFAULT_PRESOLUSEHASHING TRUE 66 #define DEFAULT_DUALPRESOLVING TRUE 67 #define DEFAULT_NEGATEDCLIQUE TRUE 68 #define DEFAULT_IMPLICATIONS TRUE 73 #define AGEINCREASE(n) (1.0 + 0.2 * (n)) 75 #define AGEINCREASE(n) (0.1 * (n)) 86 struct SCIP_ConshdlrData
102 int nlastcliquesshorten;
103 int nlastimplsshorten;
122 unsigned int signature;
123 unsigned int presolved:1;
126 unsigned int impladded:1;
127 unsigned int sorted:1;
128 unsigned int changed:1;
129 unsigned int merged:1;
130 unsigned int existmultaggr:1;
131 unsigned int validsignature:1;
176 assert(scip !=
NULL);
177 assert(conshdlrdata !=
NULL);
178 assert(eventhdlr !=
NULL);
182 (*conshdlrdata)->nlastcliquesneg = 0;
183 (*conshdlrdata)->nlastimplsneg = 0;
184 (*conshdlrdata)->nlastcliquesshorten = 0;
185 (*conshdlrdata)->nlastimplsshorten = 0;
188 (*conshdlrdata)->eventhdlr = eventhdlr;
200 assert(conshdlrdata !=
NULL);
201 assert(*conshdlrdata !=
NULL);
216 assert(consdata !=
NULL);
217 assert(consdata->nvars <= consdata->varssize);
219 if( num > consdata->varssize )
225 consdata->varssize = newsize;
227 assert(num <= consdata->varssize);
243 assert(consdata !=
NULL);
244 assert(nvars == 0 || vars !=
NULL);
248 (*consdata)->row =
NULL;
252 (*consdata)->varssize = nvars;
253 (*consdata)->nvars = nvars;
257 (*consdata)->vars =
NULL;
258 (*consdata)->varssize = 0;
259 (*consdata)->nvars = 0;
261 (*consdata)->watchedvar1 = -1;
262 (*consdata)->watchedvar2 = -1;
263 (*consdata)->filterpos1 = -1;
264 (*consdata)->filterpos2 = -1;
265 (*consdata)->presolved =
FALSE;
266 (*consdata)->impladded =
FALSE;
267 (*consdata)->changed =
TRUE;
268 (*consdata)->sorted = (nvars <= 1);
269 (*consdata)->merged = (nvars <= 1);
270 (*consdata)->existmultaggr =
FALSE;
271 (*consdata)->validsignature =
FALSE;
279 for( v = 0; v < (*consdata)->nvars; v++ )
290 for( v = 0; v < (*consdata)->nvars; v++ )
292 assert((*consdata)->vars[v] !=
NULL);
309 assert(consdata !=
NULL);
310 assert(*consdata !=
NULL);
313 if( (*consdata)->row !=
NULL )
319 for( v = 0; v < (*consdata)->nvars; v++ )
321 assert((*consdata)->vars[v] !=
NULL);
340 assert(consdata !=
NULL);
370 assert(consdata !=
NULL);
371 assert(watchedvar1 == -1 || watchedvar1 != watchedvar2);
372 assert(watchedvar1 != -1 || watchedvar2 == -1);
373 assert(watchedvar1 == -1 || (0 <= watchedvar1 && watchedvar1 < consdata->nvars));
374 assert(watchedvar2 == -1 || (0 <= watchedvar2 && watchedvar2 < consdata->nvars));
377 if( watchedvar1 == consdata->watchedvar2 || watchedvar2 == consdata->watchedvar1 )
381 tmp = consdata->watchedvar1;
382 consdata->watchedvar1 = consdata->watchedvar2;
383 consdata->watchedvar2 = tmp;
384 tmp = consdata->filterpos1;
385 consdata->filterpos1 = consdata->filterpos2;
386 consdata->filterpos2 = tmp;
388 assert(watchedvar1 == -1 || watchedvar1 != consdata->watchedvar2);
389 assert(watchedvar2 == -1 || watchedvar2 != consdata->watchedvar1);
392 if( consdata->watchedvar1 != -1 && consdata->watchedvar1 != watchedvar1 )
394 assert(consdata->filterpos1 != -1);
397 consdata->filterpos1) );
399 if( consdata->watchedvar2 != -1 && consdata->watchedvar2 != watchedvar2 )
401 assert(consdata->filterpos2 != -1);
404 consdata->filterpos2) );
408 if( watchedvar1 != -1 && watchedvar1 != consdata->watchedvar1 )
412 &consdata->filterpos1) );
414 if( watchedvar2 != -1 && watchedvar2 != consdata->watchedvar2 )
418 &consdata->filterpos2) );
422 consdata->watchedvar1 = watchedvar1;
423 consdata->watchedvar2 = watchedvar2;
442 assert(consdata !=
NULL);
453 consdata->existmultaggr =
TRUE;
455 consdata->presolved =
FALSE;
461 consdata->vars[consdata->nvars] = var;
472 assert(conshdlr !=
NULL);
474 assert(conshdlrdata !=
NULL);
480 consdata->sorted = (consdata->nvars == 1);
481 consdata->changed =
TRUE;
482 consdata->validsignature =
FALSE;
488 if( consdata->row !=
NULL )
493 consdata->merged =
FALSE;
509 assert(eventhdlr !=
NULL);
512 assert(consdata !=
NULL);
513 assert(0 <= pos && pos < consdata->nvars);
529 if( consdata->watchedvar1 == pos )
533 if( consdata->watchedvar2 == pos )
538 assert(pos != consdata->watchedvar1);
539 assert(pos != consdata->watchedvar2);
545 if( pos != consdata->nvars - 1 )
547 consdata->vars[pos] = consdata->vars[consdata->nvars-1];
548 consdata->sorted =
FALSE;
553 if( consdata->watchedvar1 == consdata->nvars )
554 consdata->watchedvar1 = pos;
555 if( consdata->watchedvar2 == consdata->nvars )
556 consdata->watchedvar2 = pos;
558 consdata->changed =
TRUE;
559 consdata->validsignature =
FALSE;
609 assert(scip !=
NULL);
610 assert(cons !=
NULL);
611 assert(eventhdlr !=
NULL);
612 assert(nfixedvars !=
NULL);
613 assert(ndelconss !=
NULL);
614 assert(nchgcoefs !=
NULL);
615 assert(result !=
NULL);
627 assert(consdata !=
NULL);
629 nvars = consdata->nvars;
637 vars = consdata->vars;
648 for( v = nvars - 1; v >= 0; --v )
659 if( idx == consdata->nvars - 1 )
662 bestvar = consdata->vars[idx];
670 assert(bestvar ==
NULL || bestvar == consdata->vars[v]);
689 if(
SCIPisLT(scip, objval, bestobjval) )
692 bestobjvalnouplocks = objval;
715 if(
SCIPisLT(scip, objval, bestobjval) )
722 nvars = consdata->nvars;
725 if( nfixables == 1 && idxnouplocks >= 0 )
729 for( v = nvars - 1; v >= 0; --v )
737 assert(idxnouplocks != v);
759 nvars = consdata->nvars;
761 assert(idx >= 0 && idx < nvars);
769 for( v = 0; v < nvars; ++v )
854 assert(eventhdlr !=
NULL);
855 assert(redundant !=
NULL);
858 assert(consdata !=
NULL);
859 assert(consdata->nvars == 0 || consdata->vars !=
NULL);
865 consdata->existmultaggr =
FALSE;
866 consdata->presolved =
TRUE;
869 while( v < consdata->nvars )
871 var = consdata->vars[v];
891 if( consdata->nvars == 0 )
894 nvars = consdata->nvars;
904 for( v = nvars - 1; v >= 0; --v )
928 if( requiredsize > nconsvars )
934 assert(requiredsize <= nconsvars);
942 for( v2 = nconsvars - 1; v2 >= 0; --v2 )
948 SCIPerrorMessage(
"try to resolve a multi-aggregation with a non-binary variable <%s>\n", consvars[v2]);
953 if( !
SCIPisEQ(scip, consvals[v2], 1.0) )
969 for( v2 = nconsvars - 1; v2 >= 0; --v2 )
990 size =
MAX(nconsvars, 1) + nvars - 1;
999 for( k = nvars - 1; k >= 0; --k )
1001 consvars[k] = vars[k];
1011 if( requiredsize > nconsvars )
1017 assert(requiredsize <= nconsvars);
1020 lhs = 1.0 - constant;
1041 if( ndelconss !=
NULL && naddconss !=
NULL )
1052 if( var != consdata->vars[v] )
1058 SCIPwarningMessage(scip,
"logicor constraint <%s> has a multi-aggregated variable, which was not resolved and therefore could lead to aborts\n",
SCIPconsGetName(cons));
1064 else if( var != consdata->vars[v] )
1079 consdata->presolved =
TRUE;
1099 assert(consdata !=
NULL);
1104 for( v = 0; v < consdata->nvars; ++v )
1145 unsigned char** entries,
1164 assert(scip !=
NULL);
1165 assert(cons !=
NULL);
1166 assert(eventhdlr !=
NULL);
1167 assert(*entries !=
NULL);
1168 assert(nentries !=
NULL);
1169 assert(redundant !=
NULL);
1170 assert(nchgcoefs !=
NULL);
1173 assert(consdata !=
NULL);
1175 nvars = consdata->nvars;
1179 if( consdata->merged )
1182 if( consdata->nvars <= 1 )
1184 consdata->merged =
TRUE;
1188 assert(consdata->vars !=
NULL && nvars > 0);
1194 assert(*nentries >= nbinvars + nintvars + nimplvars);
1199 assert(consdata->presolved);
1205 vars = consdata->vars;
1208 for( v = nvars - 1; v >= 0; --v )
1225 (pos >= nbinvars + nintvars && pos < nbinvars + nintvars + nimplvars &&
1229 (*entries)[pos] = 0;
1233 for( v = nvars - 1; v >= 0; --v )
1241 if( (*entries)[pos] == 0 )
1242 (*entries)[pos] = negarray[v] ? 2 : 1;
1244 else if( (*entries)[pos] == 1 )
1248 SCIPdebugMsg(scip,
"logicor constraint <%s> redundant: variable <%s> and its negation are present\n",
1265 SCIPdebugMsg(scip,
"logicor constraint <%s> redundant: variable <%s> and its negation are present\n",
1283 consdata->merged =
TRUE;
1308 assert(cons !=
NULL);
1311 assert(cutoff !=
NULL);
1312 assert(reduceddom !=
NULL);
1313 assert(addcut !=
NULL);
1314 assert(mustcheck !=
NULL);
1317 assert(consdata !=
NULL);
1318 assert(consdata->watchedvar1 == -1 || consdata->watchedvar1 != consdata->watchedvar2);
1325 vars = consdata->vars;
1326 nvars = consdata->nvars;
1327 assert(nvars == 0 || vars !=
NULL);
1330 if( consdata->watchedvar1 >= 0 &&
SCIPvarGetLbLocal(vars[consdata->watchedvar1]) > 0.5 )
1337 if( consdata->watchedvar2 >= 0 &&
SCIPvarGetLbLocal(vars[consdata->watchedvar2]) > 0.5 )
1350 if( consdata->watchedvar1 >= 0 &&
SCIPvarGetUbLocal(vars[consdata->watchedvar1]) > 0.5 )
1352 watchedvar1 = consdata->watchedvar1;
1355 if( consdata->watchedvar2 >= 0 &&
SCIPvarGetUbLocal(vars[consdata->watchedvar2]) > 0.5 )
1357 if( watchedvar1 == -1 )
1359 watchedvar1 = consdata->watchedvar2;
1364 watchedvar2 = consdata->watchedvar2;
1368 assert(watchedvar1 >= 0 || watchedvar2 == -1);
1369 assert(nbranchings1 <= nbranchings2);
1372 if( watchedvar2 == -1 )
1376 for( v = 0; v < nvars; ++v )
1381 if( v == consdata->watchedvar1 || v == consdata->watchedvar2 )
1391 assert(v != consdata->watchedvar1);
1392 assert(v != consdata->watchedvar2);
1397 SCIPdebugMsg(scip,
" -> disabling constraint <%s> (variable <%s> fixed to 1.0)\n",
1399 if( consdata->watchedvar1 != -1 )
1413 assert(nbranchings >= 0);
1414 if( nbranchings < nbranchings2 )
1416 if( nbranchings < nbranchings1 )
1418 watchedvar2 = watchedvar1;
1419 nbranchings2 = nbranchings1;
1421 nbranchings1 = nbranchings;
1426 nbranchings2 = nbranchings;
1431 assert(nbranchings1 <= nbranchings2);
1432 assert(watchedvar1 >= 0 || watchedvar2 == -1);
1434 if( watchedvar1 == -1 )
1440 assert(watchedvar2 == -1);
1456 else if( watchedvar2 == -1 )
1462 assert(0 <= watchedvar1 && watchedvar1 < nvars);
1472 SCIPdebugMsg(scip,
" -> single-literal constraint <%s> (fix <%s> to 1.0) at depth %d\n",
1477 if( watchedvar1 != consdata->watchedvar1 )
1487 SCIPdebugMsg(scip,
" -> new watched variables <%s> and <%s> of constraint <%s> are still unfixed\n",
1522 assert(violated !=
NULL);
1526 assert(consdata !=
NULL);
1528 vars = consdata->vars;
1529 nvars = consdata->nvars;
1533 for( v = 0; v < nvars && sum < 1.0; ++v )
1558 assert(consdata !=
NULL);
1559 assert(consdata->row ==
NULL);
1580 assert( cutoff !=
NULL );
1584 assert(consdata !=
NULL);
1586 if( consdata->row ==
NULL )
1591 assert(consdata->row !=
NULL);
1618 assert(cons !=
NULL);
1621 assert(cutoff !=
NULL);
1622 assert(separated !=
NULL);
1623 assert(reduceddom !=
NULL);
1646 assert(consdata !=
NULL);
1649 if( sol ==
NULL && consdata->row !=
NULL )
1696 assert(cons !=
NULL);
1699 assert(cutoff !=
NULL);
1700 assert(infeasible !=
NULL);
1701 assert(reduceddom !=
NULL);
1702 assert(solvelp !=
NULL);
1745 assert(consdata !=
NULL);
1747 if( !consdata->sorted )
1749 if( consdata->nvars <= 1 )
1750 consdata->sorted =
TRUE;
1757 if( consdata->watchedvar1 != -1 )
1759 var1 = consdata->vars[consdata->watchedvar1];
1760 assert(var1 !=
NULL);
1761 consdata->watchedvar1 = -1;
1762 if( consdata->watchedvar2 != -1 )
1764 var2 = consdata->vars[consdata->watchedvar2];
1765 assert(var2 !=
NULL);
1766 consdata->watchedvar2 = -1;
1769 assert(consdata->watchedvar1 == -1);
1770 assert(consdata->watchedvar2 == -1);
1771 assert(var1 !=
NULL || var2 ==
NULL);
1774 SCIPsortPtr((
void**)consdata->vars, SCIPvarComp, consdata->nvars);
1775 consdata->sorted =
TRUE;
1784 found =
SCIPsortedvecFindPtr((
void**)consdata->vars, SCIPvarComp, (
void*)var1, consdata->nvars, &pos);
1789 assert(pos >= 0 && pos < consdata->nvars);
1790 consdata->watchedvar1 = pos;
1795 found =
SCIPsortedvecFindPtr((
void**)consdata->vars, SCIPvarComp, (
void*)var2, consdata->nvars, &pos);
1800 assert(pos >= 0 && pos < consdata->nvars);
1801 consdata->watchedvar2 = pos;
1812 for( v = consdata->nvars - 1; v > 0; --v )
1814 assert(
SCIPvarCompare(consdata->vars[v], consdata->vars[v - 1]) >= 0);
1839 scip = (
SCIP*)userptr;
1840 assert(scip !=
NULL);
1847 if( consdata1->nvars != consdata2->nvars )
1853 assert(consdata1->sorted);
1854 assert(consdata2->sorted);
1858 for( i = 0; i < consdata1->nvars ; ++i )
1861 if( consdata1->vars[i] != consdata2->vars[i] )
1863 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 1 ||
1868 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 0);
1884 assert(consdata !=
NULL);
1885 assert(consdata->sorted);
1886 assert(consdata->nvars > 0);
1891 assert(minidx >= 0 && minidx <= maxidx);
1914 assert(conss !=
NULL);
1915 assert(ndelconss !=
NULL);
1918 hashtablesize = nconss;
1921 hashGetKeyLogicorcons, hashKeyEqLogicorcons, hashKeyValLogicorcons, (
void*) scip) );
1924 for( c = 0; c < nconss; ++c )
1938 assert(consdata0->sorted);
1955 assert(consdata1 !=
NULL);
1956 assert(consdata0->nvars >= 1 && consdata0->nvars == consdata1->nvars);
1958 assert(consdata0->sorted && consdata1->sorted);
1959 assert(consdata0->vars[0] == consdata1->vars[0]);
1996 assert(ndelconss !=
NULL);
1998 SCIPdebugMsg(scip,
" -> removing logicor constraint <%s> which is redundant to <%s>\n",
2021 unsigned int signature = 0;
2024 assert(vars !=
NULL);
2027 for( v = nvars - 1; v >= 0; --v )
2029 signature |= ((
unsigned int)1 << ((
unsigned int)
SCIPvarGetIndex(vars[v]) % (
sizeof(
unsigned int) * 8)));
2043 if( consdata->validsignature )
2046 consdata->signature =
calcSignature(consdata->vars, consdata->nvars);
2047 consdata->validsignature =
TRUE;
2056 int* noccurlistentries,
2068 assert(cons !=
NULL);
2070 assert(varstopos !=
NULL);
2071 assert(occurlist !=
NULL);
2072 assert(noccurlistentries !=
NULL);
2075 assert(consdata !=
NULL);
2077 nvars = consdata->nvars;
2079 vars = consdata->vars;
2080 assert(vars !=
NULL);
2083 for( v = nvars - 1; v >= 0; --v )
2090 assert(0 < pos && pos <= occurlistlength);
2095 for( l = noccurlistentries[pos] - 1; l >= 0; --l )
2097 if( occurlist[pos][l] == cons )
2099 --noccurlistentries[pos];
2100 assert(noccurlistentries[pos] >= 0);
2102 occurlist[pos][l] = occurlist[pos][noccurlistentries[pos]];
2117 int* noccurlistentries,
2118 int occurlistlength,
2129 assert(varstopos !=
NULL);
2130 assert(occurlist !=
NULL);
2131 assert(noccurlistentries !=
NULL);
2132 assert(nentries !=
NULL);
2133 assert(shortestlist !=
NULL);
2135 *nentries = INT_MAX;
2136 *shortestlist =
NULL;
2139 for( v = nvars - 1; v >= 0; --v )
2142 assert(var !=
NULL);
2152 assert(0 < pos && pos <= occurlistlength);
2157 if( noccurlistentries[pos] < *nentries )
2159 *nentries = noccurlistentries[pos];
2160 *shortestlist = occurlist[pos];
2172 int* noccurlistentries,
2173 int occurlistlength,
2186 assert(scip !=
NULL);
2187 assert(cons !=
NULL);
2190 assert(varstopos !=
NULL);
2191 assert(occurlist !=
NULL);
2192 assert(noccurlistentries !=
NULL);
2193 assert(ndelconss !=
NULL);
2196 assert(consdata !=
NULL);
2197 assert(consdata->nvars > 1);
2198 assert(consdata->validsignature);
2199 assert(consdata->sorted);
2201 vars = consdata->vars;
2202 assert(vars !=
NULL);
2205 findShortestOccurlist(vars, consdata->nvars, varstopos, occurlist, noccurlistentries, occurlistlength, &nentries, &shortestlist);
2211 assert(shortestlist !=
NULL);
2212 assert(0 < nentries);
2215 for( c = nentries - 1; c >= 0; --c )
2217 cons1 = shortestlist[c];
2218 assert(cons1 !=
NULL);
2225 assert(consdata1 !=
NULL);
2226 assert(consdata1->nvars >= consdata->nvars);
2231 if( consdata1->nvars == consdata->nvars )
2234 assert(consdata->validsignature);
2235 assert(consdata->sorted);
2236 assert(consdata1->validsignature);
2237 assert(consdata1->sorted);
2239 if( (consdata->signature & (~consdata1->signature)) == 0 )
2247 while( v < consdata->nvars && v1 < consdata1->nvars )
2252 var1 = consdata1->vars[v1];
2268 if( v == consdata->nvars )
2290 assert(elem1 !=
NULL);
2291 assert(elem2 !=
NULL);
2296 assert(consdata1 !=
NULL);
2297 assert(consdata2 !=
NULL);
2299 return consdata1->nvars - consdata2->nvars;
2309 int* noccurlistentries,
2310 int* occurlistsizes,
2311 int* occurlistlength,
2321 assert(scip !=
NULL);
2322 assert(cons !=
NULL);
2324 assert(varstopos !=
NULL);
2325 assert(occurlist !=
NULL);
2326 assert(noccurlistentries !=
NULL);
2327 assert(occurlistsizes !=
NULL);
2328 assert(occurlistlength !=
NULL);
2329 assert(*occurlistlength <= occurlistsize);
2332 assert(consdata !=
NULL);
2333 assert(consdata->nvars > 1);
2335 vars = consdata->vars;
2336 assert(vars !=
NULL);
2338 for( v = consdata->nvars - 1; v >= 0; --v )
2341 assert(var !=
NULL);
2347 pos = *occurlistlength;
2348 assert(pos <= occurlistsize);
2351 assert(occurlist[pos] ==
NULL);
2352 assert(noccurlistentries[pos] == 0);
2353 assert(occurlistsizes[pos] == 0);
2361 occurlist[pos][noccurlistentries[pos]] = cons;
2362 ++(noccurlistentries[pos]);
2367 ++(*occurlistlength);
2372 assert(0 < pos && pos <= *occurlistlength);
2376 assert(occurlist[pos] !=
NULL);
2377 assert(occurlistsizes[pos] > 0);
2380 if( noccurlistentries[pos] == occurlistsizes[pos] )
2383 assert(occurlistsizes[pos] > noccurlistentries[pos] && occurlistsizes[pos] < INT_MAX);
2388 assert(noccurlistentries[pos] < occurlistsizes[pos]);
2391 occurlist[pos][noccurlistentries[pos]] = cons;
2392 ++(noccurlistentries[pos]);
2410 int* noccurlistentries,
2411 int occurlistlength,
2423 unsigned int signature;
2430 assert(scip !=
NULL);
2431 assert(cons !=
NULL);
2432 assert(artvar !=
NULL);
2435 assert(varstopos !=
NULL);
2437 assert(occurlist !=
NULL);
2438 assert(noccurlistentries !=
NULL);
2439 assert(nchgcoefs !=
NULL);
2440 assert(deleted !=
NULL);
2443 assert(consdata !=
NULL);
2444 assert(consdata->sorted);
2446 nvars = consdata->nvars;
2448 assert(0 <= artpos && artpos < nvars);
2450 vars = consdata->vars;
2451 assert(vars !=
NULL);
2456 oldvar = vars[artpos];
2458 vars[artpos] = artvar;
2461 findShortestOccurlist(vars, nvars, varstopos, occurlist, noccurlistentries, occurlistlength, &nentries, &shortestlist);
2464 vars[artpos] = oldvar;
2470 assert(shortestlist !=
NULL);
2471 assert(0 < nentries);
2474 oldvar = vars[artpos];
2475 vars[artpos] = artvar;
2479 vars[artpos] = oldvar;
2482 for( c = nentries - 1; c >= 0; --c )
2484 cons1 = shortestlist[c];
2485 assert(cons1 !=
NULL);
2494 assert(consdata1 !=
NULL);
2497 if( consdata1->nvars < nvars )
2502 assert(consdata->sorted);
2503 assert(consdata->merged);
2504 assert(consdata1->validsignature);
2505 assert(consdata1->sorted);
2506 assert(consdata1->merged);
2508 if( (signature & (~consdata1->signature)) == 0 )
2516 while( v < nvars && v1 < consdata1->nvars )
2527 var1 = consdata1->vars[v1];
2530 if( artvar == var1 )
2565 while( v1 < consdata1->nvars )
2567 if( artvar == consdata1->vars[v1] )
2581 assert(pos < consdata1->nvars);
2582 assert(artvar == consdata1->vars[pos]);
2585 SCIPdebugMsg(scip,
"variable %s in logicor constraint <%s> is redundant and will be removed (used constraint %s)\n",
2590 if( consdata1->nvars > nvars )
2593 assert(0 < pos && pos <= occurlistlength);
2598 for( l = noccurlistentries[pos] - 1; l >= 0; --l )
2600 if( occurlist[pos][l] == cons1 )
2602 --noccurlistentries[pos];
2603 assert(noccurlistentries[pos] >= 0);
2605 occurlist[pos][l] = occurlist[pos][noccurlistentries[pos]];
2613 assert(consdata1->nvars == nvars);
2616 SCIPdebugMsg(scip,
"logicor constraint <%s> is redundant due to constraint <%s> after removing variable <%s>\n",
2654 int* noccurlistentries,
2655 int occurlistlength,
2669 assert(scip !=
NULL);
2670 assert(conss !=
NULL || nconss == 0);
2671 assert(varstopos !=
NULL);
2672 assert(occurlist !=
NULL);
2673 assert(noccurlistentries !=
NULL);
2674 assert(eventhdlr !=
NULL);
2675 assert(ndelconss !=
NULL);
2676 assert(nchgcoefs !=
NULL);
2681 assert(conss !=
NULL);
2683 for( c = 0; c < nconss; ++c )
2686 assert(cons !=
NULL);
2693 assert(consdata !=
NULL);
2695 nvars = consdata->nvars;
2701 vars = consdata->vars;
2702 assert(vars !=
NULL);
2704 for( v = nvars - 1; v >= 0; --v )
2719 occurlistlength, eventhdlr, nchgcoefs, &deleted) );
2743 unsigned char** entries,
2754 assert(scip !=
NULL);
2755 assert(cons !=
NULL);
2757 assert(eventhdlr !=
NULL);
2758 assert(*entries !=
NULL);
2759 assert(nentries !=
NULL);
2760 assert(redundant !=
NULL);
2761 assert(nfixedvars !=
NULL);
2762 assert(nchgcoefs !=
NULL);
2763 assert(ndelconss !=
NULL);
2764 assert(redundant !=
NULL);
2767 assert(consdata !=
NULL);
2768 assert(consdata->nvars > 0);
2773 if( !consdata->presolved )
2793 if( consdata->nvars == 0 )
2797 else if( consdata->nvars == 1 )
2802 SCIPdebugMsg(scip,
" -> fix last remaining variable and delete constraint\n");
2805 assert(!infeasible);
2814 consdata->presolved =
TRUE;
2839 unsigned char** entries,
2857 int* noccurlistentries;
2858 int* occurlistsizes;
2862 int occurlistlength;
2868 assert(scip !=
NULL);
2869 assert(conss !=
NULL || nconss == 0);
2870 assert(entries !=
NULL);
2871 assert(*entries !=
NULL);
2872 assert(nentries !=
NULL);
2873 assert(eventhdlr !=
NULL);
2874 assert(firstchange !=
NULL);
2875 assert(0 <= *firstchange);
2876 assert(nfixedvars !=
NULL);
2877 assert(ndelconss !=
NULL);
2878 assert(nchgcoefs !=
NULL);
2880 if( *firstchange > nconss || nconss < 2 )
2883 SCIPdebugMsg(scip,
"starting removeRedundantConssAndNonzeros(), pairwise comparison to detect covered logicor constraints\n");
2889 for( c = nconss - 1; c >= 0; --c )
2892 assert(cons !=
NULL);
2896 myconss[c] = myconss[nmyconss - 1];
2903 SCIP_CALL(
prepareCons(scip, cons, eventhdlr, entries, nentries, &redundant, nfixedvars, nchgcoefs, ndelconss, cutoff) );
2909 myconss[c] = myconss[nmyconss - 1];
2925 assert(consdata->nvars >= 2);
2928 SCIPsortPtr((
void**)myconss, conssLogicorComp, nmyconss);
2929 assert(myconss[0] !=
NULL && myconss[nmyconss - 1] !=
NULL);
2948 occurlistsize = 2 * nbinvars;
2964 assert(cons !=
NULL);
2967 assert(consdata !=
NULL);
2968 nmaxvars = consdata->nvars;
2970 occurlistlength = 0;
2971 conschanged =
FALSE;
2978 assert(consdata->validsignature);
2979 conschanged = conschanged || consdata->changed;
2980 consdata->changed =
FALSE;
2983 SCIP_CALL(
addConsToOccurList(scip, cons, varstopos, occurlist, noccurlistentries, occurlistsizes, &occurlistlength, occurlistsize) );
2990 assert(cons !=
NULL);
2993 assert(consdata !=
NULL);
2995 while( consdata->nvars == nmaxvars );
3001 assert(cons !=
NULL);
3004 assert(consdata !=
NULL);
3008 assert(consdata->validsignature);
3011 if( conschanged || consdata->changed )
3023 consdata->changed =
FALSE;
3028 SCIP_CALL(
addConsToOccurList(scip, cons, varstopos, occurlist, noccurlistentries, occurlistsizes, &occurlistlength, occurlistsize) );
3048 SCIP_CALL(
strengthenConss(scip, myconss, nmyconss, varstopos, occurlist, noccurlistentries, occurlistlength, eventhdlr, ndelconss, nchgcoefs) );
3051 for( --occurlistsize ; occurlistsize >= 0; --occurlistsize )
3053 assert((occurlistsizes[occurlistsize] == 0) == (occurlist[occurlistsize] ==
NULL));
3067 #define MAX_CONSLENGTH 200 3079 unsigned char** entries,
3098 assert(scip !=
NULL);
3099 assert(eventhdlr !=
NULL);
3100 assert(conss !=
NULL || nconss == 0);
3101 assert(entries !=
NULL);
3102 assert(*entries !=
NULL);
3103 assert(nentries !=
NULL);
3104 assert(nfixedvars !=
NULL);
3105 assert(ndelconss !=
NULL);
3106 assert(nchgcoefs !=
NULL);
3111 assert(conss !=
NULL);
3128 for( c = nconss - 1; c >= 0; --c )
3135 assert(cons !=
NULL);
3141 assert(consdata !=
NULL);
3144 SCIP_CALL(
prepareCons(scip, cons, eventhdlr, entries, nentries, &redundant, nfixedvars, nchgcoefs, ndelconss, cutoff) );
3155 assert(consdata->nvars >= 2);
3162 for( v = consdata->nvars - 1; v >= 0; --v)
3164 var = consdata->vars[v];
3165 assert(var !=
NULL);
3172 boundtypes[v] =
FALSE;
3178 boundtypes[v] =
TRUE;
3189 nfixedvars, &redundant, &glbinfeas,
TRUE) );
3206 for( v = consdata->nvars - 1; v >= 0; --v )
3210 redundants[v] =
FALSE;
3221 for( v = consdata->nvars - 1; v >= 0; --v )
3228 redundants[v] =
FALSE;
3231 *nchgcoefs += nredvars;
3234 if( consdata->nvars == 1 )
3239 SCIPdebugMsg(scip,
" -> fix last remaining variable and delete constraint\n");
3242 assert(!infeasible);
3263 #define MAXCOMPARISONS 1000000 3276 unsigned char** entries,
3298 assert(scip !=
NULL);
3299 assert(conshdlr !=
NULL);
3300 assert(eventhdlr !=
NULL);
3301 assert(conss !=
NULL || nconss == 0);
3302 assert(entries !=
NULL);
3303 assert(*entries !=
NULL);
3304 assert(nentries !=
NULL);
3305 assert(nfixedvars !=
NULL);
3306 assert(ndelconss !=
NULL);
3307 assert(nupgdconss !=
NULL);
3308 assert(nchgcoefs !=
NULL);
3309 assert(cutoff !=
NULL);
3312 assert(conshdlrdata !=
NULL);
3333 for( c = nconss - 1; c >= 0; --c )
3337 assert(conss !=
NULL);
3340 assert(cons !=
NULL);
3346 SCIP_CALL(
prepareCons(scip, cons, eventhdlr, entries, nentries, &redundant, nfixedvars, nchgcoefs, ndelconss, cutoff) );
3358 assert(consdata !=
NULL);
3359 assert(consdata->nvars >= 2);
3360 assert(consdata->nvars <= size);
3361 assert(consdata->presolved);
3377 for( v = consdata->nvars - 1; v >= 0; --v )
3383 for( v = consdata->nvars - 1; v > 0; --v )
3411 comppercons += (v - 1);
3415 for( w = v - 1; w >= 0; --w )
3446 SCIPdebugMsg(scip,
"logicor constraint <%s> is redundant, because variable <%s> and its negation <%s> exist\n",
3456 SCIP_VAR* lastvar = consdata->vars[consdata->nvars - 1];
3458 SCIPdebugMsg(scip,
"in logicor constraint <%s>, active variable of <%s> and active variable of <%s> are the same, removing the first\n",
3463 if( v < consdata->nvars )
3468 assert(consdata->vars[v] == lastvar);
3469 negated[v] = negated[consdata->nvars];
3508 SCIPdebugMsg(scip,
"logicor constraint <%s> is redundant due to negated clique information and will be replaced by a setppc constraint \n",
3523 if( comppercons > maxcomppercons )
3562 assert(scip !=
NULL);
3563 assert(cons !=
NULL);
3564 assert(eventhdlr !=
NULL);
3565 assert(nfixedvars !=
NULL);
3566 assert(nchgbds !=
NULL);
3567 assert(nchgcoefs !=
NULL);
3568 assert(ndelconss !=
NULL);
3569 assert(naddconss !=
NULL);
3570 assert(nupgdconss !=
NULL);
3571 assert(cutoff !=
NULL);
3579 assert(consdata !=
NULL);
3584 if( consdata->nvars == 2 )
3587 if( !consdata->impladded )
3599 *nchgbds += nimplbdchgs;
3600 if( implinfeasible )
3607 if ( nimplbdchgs > 0 )
3625 consdata->impladded =
TRUE;
3629 if( consdata->nvars == 2 && conshdlrsetppc !=
NULL )
3660 if( consdata->nvars == 0 )
3666 else if( consdata->nvars == 1 )
3668 SCIPdebugMsg(scip,
"logic or constraint <%s> has only one variable not fixed to 0.0\n",
3671 assert(consdata->vars !=
NULL);
3672 assert(consdata->vars[0] !=
NULL);
3676 SCIPdebugMsg(scip,
" -> fix variable and delete constraint\n");
3692 else if( conshdlrlinear !=
NULL )
3698 SCIPdebugMsg(scip,
" -> variable is multi-aggregated, upgrade to linear constraint <%s> == 1 \n",
3765 assert(nvars == 0 || vars !=
NULL);
3766 assert(nvars == 0 || vals !=
NULL);
3767 assert(mult == +1 || mult == -1);
3773 for( v = 0; v < nvars; ++v )
3775 if( mult * vals[v] > 0.0 )
3776 transvars[v] = vars[v];
3781 assert(transvars[v] !=
NULL);
3786 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
3810 if( nvars > 2 && nposbin + nnegbin + nposimplbin + nnegimplbin == nvars && ncoeffspone + ncoeffsnone == nvars
3851 assert(conshdlr !=
NULL);
3853 assert(nconss == 0 || conss !=
NULL);
3854 assert(result !=
NULL);
3856 SCIPdebugMsg(scip,
"Enforcing %d logic or constraints for %s solution\n", nconss, sol ==
NULL ?
"LP" :
"relaxation");
3861 assert(conshdlrdata !=
NULL);
3868 for( c = 0; c < nusefulconss && !cutoff && !reduceddom; ++c )
3870 SCIP_CALL(
separateCons(scip, conss[c], sol, conshdlrdata->eventhdlr, &cutoff, &separated, &reduceddom) );
3874 for( c = nusefulconss; c < nconss && !cutoff && !separated && !reduceddom; ++c )
3876 SCIP_CALL(
separateCons(scip, conss[c], sol, conshdlrdata->eventhdlr, &cutoff, &separated, &reduceddom) );
3882 else if( separated )
3884 else if( reduceddom )
3900 assert(conshdlr !=
NULL);
3917 assert(conshdlr !=
NULL);
3919 assert(scip !=
NULL);
3922 assert(conshdlrdata !=
NULL);
3942 assert(conshdlr !=
NULL);
3944 assert(conshdlrdata !=
NULL);
3946 conshdlrdata->nlastcliquesneg = 0;
3947 conshdlrdata->nlastimplsneg = 0;
3948 conshdlrdata->nlastcliquesshorten = 0;
3949 conshdlrdata->nlastimplsshorten = 0;
3952 for( c = nconss - 1; c >= 0; --c )
3955 assert(consdata !=
NULL);
3957 for( v = consdata->nvars - 1; v >= 0; --v )
3977 assert(conshdlr !=
NULL);
3979 assert(conshdlrdata !=
NULL);
3982 for( c = 0; c < nconss; ++c )
3985 assert(consdata !=
NULL);
3987 for( v = 0; v < consdata->nvars; ++v )
4012 for( c = 0; c < nconss; ++c )
4015 assert(consdata !=
NULL);
4017 if( consdata->row !=
NULL )
4033 assert(consdata !=
NULL);
4034 assert(*consdata !=
NULL);
4042 assert(conshdlrdata !=
NULL);
4044 for( v = (*consdata)->nvars - 1; v >= 0; --v )
4067 assert(conshdlr !=
NULL);
4070 assert(sourcecons !=
NULL);
4071 assert(targetcons !=
NULL);
4074 assert(sourcedata !=
NULL);
4075 assert(sourcedata->row ==
NULL);
4097 *infeasible =
FALSE;
4099 for( c = 0; c < nconss && !(*infeasible); ++c )
4119 assert(conshdlr !=
NULL);
4121 assert(nconss == 0 || conss !=
NULL);
4122 assert(result !=
NULL);
4124 SCIPdebugMsg(scip,
"separating %d/%d logic or constraints\n", nusefulconss, nconss);
4127 assert(conshdlrdata !=
NULL);
4134 for( c = 0; c < nusefulconss && !cutoff; ++c )
4145 else if( reduceddom )
4147 else if( separated )
4166 assert(conshdlr !=
NULL);
4168 assert(nconss == 0 || conss !=
NULL);
4169 assert(result !=
NULL);
4171 SCIPdebugMsg(scip,
"separating %d/%d logic or constraints\n", nusefulconss, nconss);
4174 assert(conshdlrdata !=
NULL);
4181 for( c = 0; c < nusefulconss && !cutoff; ++c )
4183 SCIP_CALL(
separateCons(scip, conss[c], sol, conshdlrdata->eventhdlr, &cutoff, &separated, &reduceddom) );
4192 else if( reduceddom )
4194 else if( separated )
4234 assert(conshdlr !=
NULL);
4236 assert(nconss == 0 || conss !=
NULL);
4237 assert(result !=
NULL);
4239 SCIPdebugMsg(scip,
"pseudo enforcing %d logic or constraints\n", nconss);
4244 assert(conshdlrdata !=
NULL);
4252 for( c = 0; c < nconss && !cutoff && !reduceddom && !solvelp; ++c )
4254 SCIP_CALL(
enforcePseudo(scip, conss[c], conshdlrdata->eventhdlr, &cutoff, &infeasible, &reduceddom, &solvelp) );
4259 else if( reduceddom )
4263 else if( infeasible )
4278 assert(conshdlr !=
NULL);
4280 assert(nconss == 0 || conss !=
NULL);
4281 assert(result !=
NULL);
4286 for( c = 0; c < nconss && (*result ==
SCIP_FEASIBLE || completely); ++c )
4290 assert(consdata !=
NULL);
4305 for( v = 0; v < consdata->nvars; ++v )
4307 assert( consdata->vars[v] !=
NULL);
4338 assert(conshdlr !=
NULL);
4340 assert(nconss == 0 || conss !=
NULL);
4341 assert(result !=
NULL);
4344 assert(conshdlrdata !=
NULL);
4350 for( c = 0; c < nusefulconss && !cutoff; ++c )
4361 else if( reduceddom )
4376 unsigned char* entries;
4387 assert(conshdlr !=
NULL);
4389 assert(scip !=
NULL);
4390 assert(result !=
NULL);
4395 assert(conshdlrdata !=
NULL);
4399 oldnfixedvars = *nfixedvars;
4400 oldnchgbds = *nchgbds;
4401 oldndelconss = *ndelconss;
4402 oldnupgdconss = *nupgdconss;
4403 oldnchgcoefs = *nchgcoefs;
4405 firstchange = INT_MAX;
4413 assert(cons !=
NULL);
4415 assert(consdata !=
NULL);
4426 if( !consdata->presolved )
4429 SCIP_CALL(
applyFixings(scip, cons, conshdlrdata->eventhdlr, &redundant, nchgcoefs, naddconss, ndelconss) );
4452 if( consdata->nvars <= 2 )
4458 conshdlrdata->conshdlrsetppc, nfixedvars, nchgbds, nchgcoefs, ndelconss, naddconss, nupgdconss, &cutoff) );
4465 else if( *nfixedvars > oldnfixedvars || *nchgbds > oldnchgbds || *nchgcoefs > oldnchgcoefs
4466 || *ndelconss > oldndelconss || *nupgdconss > oldnupgdconss )
4484 if( consdata->nvars <= 2 )
4490 conshdlrdata->conshdlrsetppc, nfixedvars, nchgbds, nchgcoefs, ndelconss, naddconss, nupgdconss, &cutoff) );
4497 else if( *nfixedvars > oldnfixedvars || *nchgbds > oldnchgbds || *nchgcoefs > oldnchgcoefs
4498 || *ndelconss > oldndelconss || *nupgdconss > oldnupgdconss )
4507 if( firstchange == INT_MAX && consdata->changed )
4516 if( firstchange < nconss && conshdlrdata->presolusehashing )
4531 conshdlrdata->usestrengthening, &firstchange, nfixedvars, ndelconss, nchgcoefs, &cutoff) );
4545 if( conshdlrdata->useimplications && (presoltiming & SCIP_PRESOLTIMING_EXHAUSTIVE) != 0 )
4548 &entries, &nentries, nfixedvars, ndelconss, nchgcoefs, &cutoff) );
4561 conshdlrdata->eventhdlr, conss, nconss, &entries, &nentries, nfixedvars, ndelconss,
4562 nupgdconss, nchgcoefs, &cutoff) );
4591 assert(conshdlr !=
NULL);
4593 assert(cons !=
NULL);
4594 assert(infervar !=
NULL);
4595 assert(result !=
NULL);
4598 assert(consdata !=
NULL);
4600 SCIPdebugMsg(scip,
"conflict resolving method of logic or constraint handler\n");
4608 infervarfound =
FALSE;
4610 for( v = 0; v < consdata->nvars; ++v )
4612 if( consdata->vars[v] != infervar )
4621 assert(!infervarfound);
4622 infervarfound =
TRUE;
4626 assert(infervarfound);
4642 assert(consdata !=
NULL);
4645 for( i = 0; i < consdata->nvars; ++i )
4661 assert(conshdlr !=
NULL);
4663 assert(cons !=
NULL);
4667 assert(conshdlrdata !=
NULL);
4669 assert(consdata !=
NULL);
4670 assert(consdata->watchedvar1 == -1 || consdata->watchedvar1 != consdata->watchedvar2);
4676 if( consdata->watchedvar1 != -1 )
4680 &consdata->filterpos1) );
4682 if( consdata->watchedvar2 != -1 )
4686 &consdata->filterpos2) );
4700 assert(conshdlr !=
NULL);
4702 assert(cons !=
NULL);
4706 assert(conshdlrdata !=
NULL);
4708 assert(consdata !=
NULL);
4709 assert(consdata->watchedvar1 == -1 || consdata->watchedvar1 != consdata->watchedvar2);
4715 if( consdata->watchedvar1 != -1 )
4717 assert(consdata->filterpos1 != -1);
4720 consdata->filterpos1) );
4722 if( consdata->watchedvar2 != -1 )
4724 assert(consdata->filterpos2 != -1);
4727 consdata->filterpos2) );
4739 assert( scip !=
NULL );
4740 assert( conshdlr !=
NULL );
4741 assert( cons !=
NULL );
4753 const char* consname;
4768 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, global, valid) );
4769 assert(cons !=
NULL);
4786 SCIPdebugMsg(scip,
"parse <%s> as logicor constraint\n", str);
4791 startptr = strchr((
char*)str,
'(');
4793 if( startptr ==
NULL )
4803 endptr = strrchr(startptr,
')');
4805 if( endptr ==
NULL )
4810 assert(endptr >= startptr);
4812 if( endptr > startptr )
4829 if( varssize < requiredsize )
4832 varssize = requiredsize;
4840 assert(varssize >= requiredsize);
4844 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
4861 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
4876 assert(consdata !=
NULL);
4878 if( varssize < consdata->nvars )
4882 assert(vars !=
NULL);
4898 assert(consdata !=
NULL);
4900 (*nvars) = consdata->nvars;
4914 assert(eventdata !=
NULL);
4916 assert(event !=
NULL);
4918 SCIPdebugMsg(scip,
"exec method of event handler for logic or constraints\n");
4938 assert(cons !=
NULL);
4940 assert(consdata !=
NULL);
4944 assert(var !=
NULL);
4946 consdata->presolved =
FALSE;
4953 consdata->merged =
FALSE;
4955 if( !consdata->existmultaggr )
4958 consdata->existmultaggr =
TRUE;
4978 assert(conflicthdlr !=
NULL);
4980 assert(bdchginfos !=
NULL || nbdchginfos == 0);
4981 assert(result !=
NULL);
4990 if( nbdchginfos == 2 )
4997 for( i = 0; i < nbdchginfos; ++i )
4999 assert(bdchginfos !=
NULL);
5000 assert(bdchginfos[i] !=
NULL);
5015 if( i == nbdchginfos )
5054 eventExecLogicor,
NULL) );
5058 conflictExecLogicor,
NULL) );
5066 consEnfolpLogicor, consEnfopsLogicor, consCheckLogicor, consLockLogicor,
5068 assert(conshdlr !=
NULL);
5096 if( conshdlrdata->conshdlrlinear !=
NULL )
5104 "constraints/logicor/presolpairwise",
5105 "should pairwise constraint comparison be performed in presolving?",
5108 "constraints/logicor/presolusehashing",
5109 "should hash table be used for detecting redundant constraints in advance",
5112 "constraints/logicor/dualpresolving",
5113 "should dual presolving steps be performed?",
5116 "constraints/logicor/negatedclique",
5117 "should negated clique information be used in presolving",
5120 "constraints/logicor/implications",
5121 "should implications/cliques be used in presolving",
5124 "constraints/logicor/strengthen",
5125 "should pairwise constraint comparison try to strengthen constraints by removing superflous non-zeros?",
5170 assert(scip !=
NULL);
5174 if( conshdlr ==
NULL )
5184 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
5185 local, modifiable, dynamic, removable, stickingatnode) );
5193 assert(conshdlrdata !=
NULL);
5195 for( v = consdata->nvars - 1; v >= 0; --v )
5221 assert(scip !=
NULL);
5236 assert(var !=
NULL);
5268 assert(consdata !=
NULL);
5270 return consdata->nvars;
5289 assert(consdata !=
NULL);
5291 return consdata->vars;
5310 assert(consdata !=
NULL);
5312 if( consdata->row !=
NULL )
5334 assert(consdata !=
NULL);
5336 if( consdata->row !=
NULL )
5360 assert(consdata !=
NULL);
5362 return consdata->row;
enum SCIP_Result SCIP_RESULT
SCIP_RETCODE SCIPaddVarsToRowSameCoef(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real val)
SCIP_RETCODE SCIPaddCoefLogicor(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
int SCIPgetNIntVars(SCIP *scip)
static SCIP_DECL_CONSCHECK(consCheckLogicor)
SCIP_RETCODE SCIPaddConsAge(SCIP *scip, SCIP_CONS *cons, SCIP_Real deltaage)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
static SCIP_DECL_CONSPRESOL(consPresolLogicor)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
static SCIP_RETCODE addCut(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *cutoff)
#define DEFAULT_PRESOLUSEHASHING
static SCIP_RETCODE removeRedundantCons(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1, int *ndelconss)
SCIP_Bool SCIPvarsHaveCommonClique(SCIP_VAR *var1, SCIP_Bool value1, SCIP_VAR *var2, SCIP_Bool value2, SCIP_Bool regardimplics)
#define DEFAULT_PRESOLPAIRWISE
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
#define CONSHDLR_DELAYSEPA
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_STAGE SCIPgetStage(SCIP *scip)
#define SCIP_EVENTTYPE_VARFIXED
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
static SCIP_DECL_CONSINITLP(consInitlpLogicor)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE enforcePseudo(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *infeasible, SCIP_Bool *reduceddom, SCIP_Bool *solvelp)
#define CONSHDLR_NEEDSCONS
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
int SCIPconsGetValidDepth(SCIP_CONS *cons)
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_VAR * SCIPbdchginfoGetVar(SCIP_BDCHGINFO *bdchginfo)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
SCIP_RETCODE SCIPcopyConsLinear(SCIP *scip, SCIP_CONS **cons, SCIP *sourcescip, const char *name, int nvars, SCIP_VAR **sourcevars, SCIP_Real *sourcecoefs, SCIP_Real lhs, SCIP_Real rhs, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode, SCIP_Bool global, SCIP_Bool *valid)
int SCIPgetNVarsLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPvarGetProbvarBinary(SCIP_VAR **var, SCIP_Bool *negated)
static SCIP_DECL_CONSEXITPRE(consExitpreLogicor)
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSPRINT(consPrintLogicor)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPaddConflictBinvar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_CONFLICTEXEC(conflictExecLogicor)
SCIP_RETCODE SCIPdisableConsPropagation(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrDeactive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
SCIP_Bool SCIPconsIsAdded(SCIP_CONS *cons)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
static SCIP_RETCODE removeConstraintsDueToNegCliques(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLR *conshdlrsetppc, SCIP_EVENTHDLR *eventhdlr, SCIP_CONS **conss, int nconss, unsigned char **entries, int *nentries, int *nfixedvars, int *ndelconss, int *nupgdconss, int *nchgcoefs, SCIP_Bool *cutoff)
static SCIP_DECL_SORTPTRCOMP(conssLogicorComp)
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1)
SCIP_RETCODE SCIPreleaseVar(SCIP *scip, SCIP_VAR **var)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
static SCIP_RETCODE disableCons(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
static SCIP_DECL_CONSDEACTIVE(consDeactiveLogicor)
static SCIP_DECL_EVENTEXEC(eventExecLogicor)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE delCoefPos(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int pos)
#define CONSHDLR_DELAYPROP
int SCIPconsGetPos(SCIP_CONS *cons)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPincludeConshdlrBasic(SCIP *scip, SCIP_CONSHDLR **conshdlrptr, const char *name, const char *desc, int enfopriority, int chckpriority, int eagerfreq, SCIP_Bool needscons, SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_CONSHDLRDATA *conshdlrdata)
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
SCIP_Bool SCIPisNegative(SCIP *scip, SCIP_Real val)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
#define SCIP_PRESOLTIMING_EXHAUSTIVE
#define LINCONSUPGD_PRIORITY
static unsigned int calcSignature(SCIP_VAR **vars, int nvars)
int SCIPvarGetProbindex(SCIP_VAR *var)
static SCIP_DECL_CONSEXITSOL(consExitsolLogicor)
static SCIP_DECL_CONSSEPALP(consSepalpLogicor)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
#define CONSHDLR_SEPAFREQ
static SCIP_RETCODE checkCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *violated)
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_RETCODE SCIPenableConsPropagation(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE detectRedundantConstraints(SCIP *scip, BMS_BLKMEM *blkmem, SCIP_CONS **conss, int nconss, int *firstchange, int *ndelconss)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_Longint SCIPvarGetNBranchingsCurrentRun(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Constraint handler for the set partitioning / packing / covering constraints .
SCIP_RETCODE SCIPincludeConflicthdlrBasic(SCIP *scip, SCIP_CONFLICTHDLR **conflicthdlrptr, const char *name, const char *desc, int priority, SCIP_DECL_CONFLICTEXEC((*conflictexec)), SCIP_CONFLICTHDLRDATA *conflicthdlrdata)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPdebugPrintCons(x, y, z)
SCIP_Bool SCIPisTransformed(SCIP *scip)
SCIP_VAR * SCIPvarGetNegationVar(SCIP_VAR *var)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
SCIP_Real SCIProwGetDualsol(SCIP_ROW *row)
void SCIPwarningMessage(SCIP *scip, const char *formatstr,...)
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
int SCIPvarGetNCliques(SCIP_VAR *var, SCIP_Bool varfixing)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
int SCIPgetNContVars(SCIP *scip)
SCIP_RETCODE SCIPcreateCons(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_CONSHDLR *conshdlr, SCIP_CONSDATA *consdata, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
static SCIP_DECL_HASHGETKEY(hashGetKeyLogicorcons)
static SCIP_RETCODE switchWatchedvars(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int watchedvar1, int watchedvar2)
static void consdataCalcSignature(SCIP_CONSDATA *consdata)
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 SCIP_RETCODE conshdlrdataFree(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata)
SCIP_VAR * SCIPvarGetNegatedVar(SCIP_VAR *var)
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
#define SCIP_EVENTTYPE_LBRELAXED
static SCIP_RETCODE shortenConss(SCIP *scip, SCIP_CONSHDLRDATA *conshdlrdata, SCIP_EVENTHDLR *eventhdlr, SCIP_CONS **conss, int nconss, unsigned char **entries, int *nentries, int *nfixedvars, int *ndelconss, int *nchgcoefs, SCIP_Bool *cutoff)
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
static SCIP_RETCODE analyzeConflict(SCIP *scip, SCIP_CONS *cons)
#define SCIPallocCleanBufferArray(scip, ptr, num)
SCIP_RETCODE SCIPenableCons(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPgetDualsolLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddClique(SCIP *scip, SCIP_VAR **vars, SCIP_Bool *values, int nvars, SCIP_Bool isequation, SCIP_Bool *infeasible, int *nbdchgs)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_VAR * SCIPvarGetProbvar(SCIP_VAR *var)
static void removeConsFromOccurList(SCIP_CONS *cons, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
static SCIP_DECL_HASHKEYVAL(hashKeyValLogicorcons)
SCIP_RETCODE SCIPparseVarsList(SCIP *scip, const char *str, SCIP_VAR **vars, int *nvars, int varssize, int *requiredsize, char **endptr, char delimiter, SCIP_Bool *success)
SCIP_Bool SCIPisPresolveFinished(SCIP *scip)
#define DEFAULT_DUALPRESOLVING
static SCIP_DECL_CONSACTIVE(consActiveLogicor)
#define SCIP_PRESOLTIMING_MEDIUM
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
static SCIP_DECL_CONSDELETE(consDeleteLogicor)
static SCIP_RETCODE prepareCons(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, unsigned char **entries, int *nentries, SCIP_Bool *redundant, int *nfixedvars, int *nchgcoefs, int *ndelconss, SCIP_Bool *cutoff)
static SCIP_DECL_CONSLOCK(consLockLogicor)
static SCIP_DECL_LINCONSUPGD(linconsUpgdLogicor)
SCIP_RETCODE SCIPgetBinvarRepresentatives(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **repvars, SCIP_Bool *negated)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define CONSHDLR_ENFOPRIORITY
static SCIP_DECL_CONSTRANS(consTransLogicor)
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
static SCIP_DECL_CONSRESPROP(consRespropLogicor)
#define SCIPfreeBufferArrayNull(scip, ptr)
static SCIP_DECL_HASHKEYEQ(hashKeyEqLogicorcons)
static SCIP_RETCODE fixDeleteOrUpgradeCons(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_CONSHDLR *conshdlrlinear, SCIP_CONSHDLR *conshdlrsetppc, int *nfixedvars, int *nchgbds, int *nchgcoefs, int *ndelconss, int *naddconss, int *nupgdconss, SCIP_Bool *cutoff)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
SCIP_Bool SCIPsortedvecFindPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), void *val, int len, int *pos)
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
SCIP_VAR ** SCIPgetVarsLogicor(SCIP *scip, SCIP_CONS *cons)
struct SCIP_EventData SCIP_EVENTDATA
const char * SCIPvarGetName(SCIP_VAR *var)
static SCIP_RETCODE removeRedundantConssAndNonzeros(SCIP *scip, SCIP_CONS **conss, int nconss, unsigned char **entries, int *nentries, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool usestrengthening, int *firstchange, int *nfixedvars, int *ndelconss, int *nchgcoefs, SCIP_Bool *cutoff)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
static SCIP_RETCODE unlockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
static SCIP_RETCODE addConsToOccurList(SCIP *scip, SCIP_CONS *cons, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int *occurlistsizes, int *occurlistlength, int occurlistsize)
SCIP_RETCODE SCIPcreateConsBasicLogicor(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars)
void SCIPsortPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
SCIP_RETCODE SCIPvarGetAggregatedObj(SCIP_VAR *var, SCIP_Real *aggrobj)
#define SCIPhashTwo(a, b)
SCIP_RETCODE SCIPgetProbvarLinearSum(SCIP *scip, SCIP_VAR **vars, SCIP_Real *scalars, int *nvars, int varssize, SCIP_Real *constant, int *requiredsize, SCIP_Bool mergemultiples)
#define CONFLICTHDLR_NAME
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_ROW * SCIPgetRowLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
static SCIP_RETCODE consdataEnsureVarsSize(SCIP *scip, SCIP_CONSDATA *consdata, int num)
static SCIP_RETCODE applyFixings(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *redundant, int *nchgcoefs, int *naddconss, int *ndelconss)
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
SCIP_RETCODE SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible)
struct SCIP_ConsData SCIP_CONSDATA
SCIP_RETCODE SCIPdisableCons(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
SCIP_RETCODE SCIPcreateConsSetpack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
static SCIP_RETCODE consdataPrint(SCIP *scip, SCIP_CONSDATA *consdata, FILE *file, SCIP_Bool endline)
#define SCIPallocBufferArray(scip, ptr, num)
public data structures and miscellaneous methods
static SCIP_DECL_CONSGETVARS(consGetVarsLogicor)
SCIP_VAR * SCIPeventGetVar(SCIP_EVENT *event)
#define CONFLICTHDLR_DESC
int SCIPgetNImplVars(SCIP *scip)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
static SCIP_DECL_CONSENFOLP(consEnfolpLogicor)
static SCIP_RETCODE createNormalizedLogicor(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, int mult, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
static SCIP_DECL_CONSENFOPS(consEnfopsLogicor)
SCIP_Bool SCIPconsIsPropagationEnabled(SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateEmptyRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
int SCIPgetDepth(SCIP *scip)
static void consdataSort(SCIP_CONSDATA *consdata)
int SCIPvarGetNImpls(SCIP_VAR *var, SCIP_Bool varfixing)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
int SCIPvarGetNLocksUp(SCIP_VAR *var)
#define CONSHDLR_MAXPREROUNDS
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
int SCIPvarCompare(SCIP_VAR *var1, SCIP_VAR *var2)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_Real SCIPvarGetObj(SCIP_VAR *var)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_Real SCIPbdchginfoGetNewbound(SCIP_BDCHGINFO *bdchginfo)
static SCIP_DECL_CONSCOPY(consCopyLogicor)
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
#define BMScopyMemoryArray(ptr, source, num)
int SCIPgetNRuns(SCIP *scip)
SCIP_Real SCIProwGetDualfarkas(SCIP_ROW *row)
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
SCIP_Real SCIPgetDualfarkasLogicor(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
#define SCIP_EVENTTYPE_UBTIGHTENED
Constraint handler for linear constraints in their most general form, .
SCIP_Longint SCIPgetNConflictConssApplied(SCIP *scip)
void * SCIPhashtableRetrieve(SCIP_HASHTABLE *hashtable, void *key)
SCIP_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPcreateConsLogicor(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
static SCIP_RETCODE strengthenConss(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength, SCIP_EVENTHDLR *eventhdlr, int *ndelconss, int *nchgcoefs)
static SCIP_RETCODE conshdlrdataCreate(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr)
static SCIP_DECL_CONSFREE(consFreeLogicor)
int SCIPgetNBinVars(SCIP *scip)
SCIP_Bool SCIPinProbing(SCIP *scip)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
SCIP_RETCODE SCIPincludeLinconsUpgrade(SCIP *scip, SCIP_DECL_LINCONSUPGD((*linconsupgd)), int priority, const char *conshdlrname)
int SCIPgetNVars(SCIP *scip)
static SCIP_RETCODE createRow(SCIP *scip, SCIP_CONS *cons)
#define DEFAULT_NEGATEDCLIQUE
#define HASHSIZE_LOGICORCONS
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSDATA **consdata, int nvars, SCIP_VAR **vars)
SCIP_RETCODE SCIPcreateConsLinear(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPsetConshdlrExitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITPRE((*consexitpre)))
static SCIP_DECL_CONSENFORELAX(consEnforelaxLogicor)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
static SCIP_RETCODE processWatchedVars(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *reduceddom, SCIP_Bool *addcut, SCIP_Bool *mustcheck)
#define CONSHDLR_PRESOLTIMING
SCIP_RETCODE SCIPwriteVarsList(SCIP *scip, FILE *file, SCIP_VAR **vars, int nvars, SCIP_Bool type, char delimiter)
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyLogicor)
int SCIPvarGetNLocksDown(SCIP_VAR *var)
#define CONSHDLR_PROPFREQ
static SCIP_DECL_CONSPARSE(consParseLogicor)
#define CONSHDLR_EAGERFREQ
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
static SCIP_RETCODE lockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_Bool SCIPallowDualReds(SCIP *scip)
static SCIP_DECL_CONSINITPRE(consInitpreLogicor)
const char * SCIPconflicthdlrGetName(SCIP_CONFLICTHDLR *conflicthdlr)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
static SCIP_RETCODE removeRedundantConss(SCIP *scip, SCIP_CONS *cons, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength, int *ndelconss)
int SCIPgetNCliques(SCIP *scip)
SCIP_Real SCIPgetRowLPFeasibility(SCIP *scip, SCIP_ROW *row)
int SCIPgetNImplications(SCIP *scip)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_RETCODE SCIPincludeConshdlrLogicor(SCIP *scip)
static SCIP_DECL_CONSPROP(consPropLogicor)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
#define SCIPfreeCleanBufferArray(scip, ptr)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
static SCIP_DECL_CONSGETNVARS(consGetNVarsLogicor)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
#define CONSHDLR_SEPAPRIORITY
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
static SCIP_RETCODE enforceConstraint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int nusefulconss, SCIP_SOL *sol, SCIP_RESULT *result)
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_RETCODE SCIPshrinkDisjunctiveVarSet(SCIP *scip, SCIP_VAR **vars, SCIP_Real *bounds, SCIP_Bool *boundtypes, SCIP_Bool *redundants, int nvars, int *nredvars, int *nglobalred, SCIP_Bool *setredundant, SCIP_Bool *glbinfeas, SCIP_Bool fullshortening)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
#define CONSHDLR_PROP_TIMING
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
static SCIP_RETCODE dualPresolving(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int *nfixedvars, int *ndelconss, int *nchgcoefs, SCIP_RESULT *result)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
#define BMSclearMemoryArray(ptr, num)
SCIP_RETCODE SCIPsetConshdlrActive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSACTIVE((*consactive)))
#define CONSHDLR_CHECKPRIORITY
struct BMS_BlkMem BMS_BLKMEM
SCIP_RETCODE SCIPaddConflict(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
static SCIP_RETCODE addCoef(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
static SCIP_DECL_CONSSEPASOL(consSepasolLogicor)
SCIP_RETCODE SCIPcleanupCliques(SCIP *scip, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
#define SCIPcombineTwoInt(a, b)
#define CONFLICTHDLR_PRIORITY
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_RETCODE SCIPinferBinvarCons(SCIP *scip, SCIP_VAR *var, SCIP_Bool fixedval, SCIP_CONS *infercons, int inferinfo, SCIP_Bool *infeasible, SCIP_Bool *tightened)
static SCIP_RETCODE separateCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *separated, SCIP_Bool *reduceddom)
static void findShortestOccurlist(SCIP_VAR **vars, int nvars, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength, int *nentries, SCIP_CONS ***shortestlist)
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
static SCIP_RETCODE removeRedundantNonZeros(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *artvar, int artpos, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength, SCIP_EVENTHDLR *eventhdlr, int *nchgcoefs, SCIP_Bool *deleted)
SCIP_RETCODE SCIPaddBoolParam(SCIP *scip, const char *name, const char *desc, SCIP_Bool *valueptr, SCIP_Bool isadvanced, SCIP_Bool defaultvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
#define DEFAULT_STRENGTHEN
#define DEFAULT_IMPLICATIONS
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
static SCIP_RETCODE mergeMultiples(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, unsigned char **entries, int *nentries, SCIP_Bool *redundant, int *nchgcoefs)
#define SCIPreallocBufferArray(scip, ptr, num)
SCIP_RETCODE SCIPsetConshdlrProp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPROP((*consprop)), int propfreq, SCIP_Bool delayprop, SCIP_PROPTIMING proptiming)