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 )
979 else if( (ndelconss != NULL && naddconss != NULL) ||
SCIPconsIsAdded(cons) )
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 )
1565 assert(consdata != NULL);
1566 assert(consdata->row == NULL);
1586 assert( cutoff != NULL );
1590 assert(consdata != NULL);
1592 if( consdata->row == NULL )
1597 assert(consdata->row != NULL);
1624 assert(cons != NULL);
1627 assert(cutoff != NULL);
1628 assert(separated != NULL);
1629 assert(reduceddom != NULL);
1652 assert(consdata != NULL);
1655 if( sol == NULL && consdata->row != NULL )
1702 assert(cons != NULL);
1705 assert(cutoff != NULL);
1706 assert(infeasible != NULL);
1707 assert(reduceddom != NULL);
1708 assert(solvelp != NULL);
1751 assert(consdata != NULL);
1753 if( !consdata->sorted )
1755 if( consdata->nvars <= 1 )
1756 consdata->sorted =
TRUE;
1763 if( consdata->watchedvar1 != -1 )
1765 var1 = consdata->vars[consdata->watchedvar1];
1766 assert(var1 != NULL);
1767 consdata->watchedvar1 = -1;
1768 if( consdata->watchedvar2 != -1 )
1770 var2 = consdata->vars[consdata->watchedvar2];
1771 assert(var2 != NULL);
1772 consdata->watchedvar2 = -1;
1775 assert(consdata->watchedvar1 == -1);
1776 assert(consdata->watchedvar2 == -1);
1777 assert(var1 != NULL || var2 == NULL);
1780 SCIPsortPtr((
void**)consdata->vars, SCIPvarComp, consdata->nvars);
1781 consdata->sorted =
TRUE;
1790 found =
SCIPsortedvecFindPtr((
void**)consdata->vars, SCIPvarComp, (
void*)var1, consdata->nvars, &pos);
1795 assert(pos >= 0 && pos < consdata->nvars);
1796 consdata->watchedvar1 = pos;
1801 found =
SCIPsortedvecFindPtr((
void**)consdata->vars, SCIPvarComp, (
void*)var2, consdata->nvars, &pos);
1806 assert(pos >= 0 && pos < consdata->nvars);
1807 consdata->watchedvar2 = pos;
1818 for( v = consdata->nvars - 1; v > 0; --v )
1820 assert(
SCIPvarCompare(consdata->vars[v], consdata->vars[v - 1]) >= 0);
1845 scip = (
SCIP*)userptr;
1846 assert(scip != NULL);
1853 if( consdata1->nvars != consdata2->nvars )
1859 assert(consdata1->sorted);
1860 assert(consdata2->sorted);
1864 for( i = 0; i < consdata1->nvars ; ++i )
1867 if( consdata1->vars[i] != consdata2->vars[i] )
1869 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 1 ||
1874 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 0);
1890 assert(consdata != NULL);
1891 assert(consdata->sorted);
1892 assert(consdata->nvars > 0);
1897 assert(minidx >= 0 && minidx <= maxidx);
1920 assert(conss != NULL);
1921 assert(ndelconss != NULL);
1924 hashtablesize = nconss;
1927 hashGetKeyLogicorcons, hashKeyEqLogicorcons, hashKeyValLogicorcons, (
void*) scip) );
1930 for( c = 0; c < nconss; ++c )
1944 assert(consdata0->sorted);
1961 assert(consdata1 != NULL);
1962 assert(consdata0->nvars >= 1 && consdata0->nvars == consdata1->nvars);
1964 assert(consdata0->sorted && consdata1->sorted);
1965 assert(consdata0->vars[0] == consdata1->vars[0]);
2002 assert(ndelconss != NULL);
2004 SCIPdebugMsg(scip,
" -> removing logicor constraint <%s> which is redundant to <%s>\n",
2027 unsigned int signature = 0;
2030 assert(vars != NULL);
2033 for( v = nvars - 1; v >= 0; --v )
2035 signature |= ((
unsigned int)1 << ((
unsigned int)
SCIPvarGetIndex(vars[v]) % (
sizeof(
unsigned int) * 8)));
2049 if( consdata->validsignature )
2052 consdata->signature =
calcSignature(consdata->vars, consdata->nvars);
2053 consdata->validsignature =
TRUE;
2062 int* noccurlistentries,
2074 assert(cons != NULL);
2076 assert(varstopos != NULL);
2077 assert(occurlist != NULL);
2078 assert(noccurlistentries != NULL);
2081 assert(consdata != NULL);
2083 nvars = consdata->nvars;
2085 vars = consdata->vars;
2086 assert(vars != NULL);
2089 for( v = nvars - 1; v >= 0; --v )
2096 assert(0 < pos && pos <= occurlistlength);
2101 for( l = noccurlistentries[pos] - 1; l >= 0; --l )
2103 if( occurlist[pos][l] == cons )
2105 --noccurlistentries[pos];
2106 assert(noccurlistentries[pos] >= 0);
2108 occurlist[pos][l] = occurlist[pos][noccurlistentries[pos]];
2123 int* noccurlistentries,
2124 int occurlistlength,
2135 assert(varstopos != NULL);
2136 assert(occurlist != NULL);
2137 assert(noccurlistentries != NULL);
2138 assert(nentries != NULL);
2139 assert(shortestlist != NULL);
2141 *nentries = INT_MAX;
2142 *shortestlist = NULL;
2145 for( v = nvars - 1; v >= 0; --v )
2148 assert(var != NULL);
2158 assert(0 < pos && pos <= occurlistlength);
2163 if( noccurlistentries[pos] < *nentries )
2165 *nentries = noccurlistentries[pos];
2166 *shortestlist = occurlist[pos];
2178 int* noccurlistentries,
2179 int occurlistlength,
2192 assert(scip != NULL);
2193 assert(cons != NULL);
2196 assert(varstopos != NULL);
2197 assert(occurlist != NULL);
2198 assert(noccurlistentries != NULL);
2199 assert(ndelconss != NULL);
2202 assert(consdata != NULL);
2203 assert(consdata->nvars > 1);
2204 assert(consdata->validsignature);
2205 assert(consdata->sorted);
2207 vars = consdata->vars;
2208 assert(vars != NULL);
2211 findShortestOccurlist(vars, consdata->nvars, varstopos, occurlist, noccurlistentries, occurlistlength, &nentries, &shortestlist);
2217 assert(shortestlist != NULL);
2218 assert(0 < nentries);
2221 for( c = nentries - 1; c >= 0; --c )
2223 cons1 = shortestlist[c];
2224 assert(cons1 != NULL);
2231 assert(consdata1 != NULL);
2232 assert(consdata1->nvars >= consdata->nvars);
2237 if( consdata1->nvars == consdata->nvars )
2240 assert(consdata->validsignature);
2241 assert(consdata->sorted);
2242 assert(consdata1->validsignature);
2243 assert(consdata1->sorted);
2245 if( (consdata->signature & (~consdata1->signature)) == 0 )
2253 while( v < consdata->nvars && v1 < consdata1->nvars )
2258 var1 = consdata1->vars[v1];
2274 if( v == consdata->nvars )
2296 assert(elem1 != NULL);
2297 assert(elem2 != NULL);
2302 assert(consdata1 != NULL);
2303 assert(consdata2 != NULL);
2305 return consdata1->nvars - consdata2->nvars;
2315 int* noccurlistentries,
2316 int* occurlistsizes,
2317 int* occurlistlength,
2327 assert(scip != NULL);
2328 assert(cons != NULL);
2330 assert(varstopos != NULL);
2331 assert(occurlist != NULL);
2332 assert(noccurlistentries != NULL);
2333 assert(occurlistsizes != NULL);
2334 assert(occurlistlength != NULL);
2335 assert(*occurlistlength <= occurlistsize);
2338 assert(consdata != NULL);
2339 assert(consdata->nvars > 1);
2341 vars = consdata->vars;
2342 assert(vars != NULL);
2344 for( v = consdata->nvars - 1; v >= 0; --v )
2347 assert(var != NULL);
2353 pos = *occurlistlength;
2354 assert(pos <= occurlistsize);
2357 assert(occurlist[pos] == NULL);
2358 assert(noccurlistentries[pos] == 0);
2359 assert(occurlistsizes[pos] == 0);
2367 occurlist[pos][noccurlistentries[pos]] = cons;
2368 ++(noccurlistentries[pos]);
2373 ++(*occurlistlength);
2378 assert(0 < pos && pos <= *occurlistlength);
2382 assert(occurlist[pos] != NULL);
2383 assert(occurlistsizes[pos] > 0);
2386 if( noccurlistentries[pos] == occurlistsizes[pos] )
2389 assert(occurlistsizes[pos] > noccurlistentries[pos] && occurlistsizes[pos] < INT_MAX);
2394 assert(noccurlistentries[pos] < occurlistsizes[pos]);
2397 occurlist[pos][noccurlistentries[pos]] = cons;
2398 ++(noccurlistentries[pos]);
2416 int* noccurlistentries,
2417 int occurlistlength,
2429 unsigned int signature;
2436 assert(scip != NULL);
2437 assert(cons != NULL);
2438 assert(artvar != NULL);
2441 assert(varstopos != NULL);
2443 assert(occurlist != NULL);
2444 assert(noccurlistentries != NULL);
2445 assert(nchgcoefs != NULL);
2446 assert(deleted != NULL);
2449 assert(consdata != NULL);
2450 assert(consdata->sorted);
2452 nvars = consdata->nvars;
2454 assert(0 <= artpos && artpos < nvars);
2456 vars = consdata->vars;
2457 assert(vars != NULL);
2462 oldvar = vars[artpos];
2464 vars[artpos] = artvar;
2467 findShortestOccurlist(vars, nvars, varstopos, occurlist, noccurlistentries, occurlistlength, &nentries, &shortestlist);
2470 vars[artpos] = oldvar;
2476 assert(shortestlist != NULL);
2477 assert(0 < nentries);
2480 oldvar = vars[artpos];
2481 vars[artpos] = artvar;
2485 vars[artpos] = oldvar;
2488 for( c = nentries - 1; c >= 0; --c )
2490 cons1 = shortestlist[c];
2491 assert(cons1 != NULL);
2500 assert(consdata1 != NULL);
2503 if( consdata1->nvars < nvars )
2508 assert(consdata->sorted);
2509 assert(consdata->merged);
2510 assert(consdata1->validsignature);
2511 assert(consdata1->sorted);
2512 assert(consdata1->merged);
2514 if( (signature & (~consdata1->signature)) == 0 )
2522 while( v < nvars && v1 < consdata1->nvars )
2533 var1 = consdata1->vars[v1];
2536 if( artvar == var1 )
2571 while( v1 < consdata1->nvars )
2573 if( artvar == consdata1->vars[v1] )
2587 assert(pos < consdata1->nvars);
2588 assert(artvar == consdata1->vars[pos]);
2591 SCIPdebugMsg(scip,
"variable %s in logicor constraint <%s> is redundant and will be removed (used constraint %s)\n",
2596 if( consdata1->nvars > nvars )
2599 assert(0 < pos && pos <= occurlistlength);
2604 for( l = noccurlistentries[pos] - 1; l >= 0; --l )
2606 if( occurlist[pos][l] == cons1 )
2608 --noccurlistentries[pos];
2609 assert(noccurlistentries[pos] >= 0);
2611 occurlist[pos][l] = occurlist[pos][noccurlistentries[pos]];
2619 assert(consdata1->nvars == nvars);
2622 SCIPdebugMsg(scip,
"logicor constraint <%s> is redundant due to constraint <%s> after removing variable <%s>\n",
2660 int* noccurlistentries,
2661 int occurlistlength,
2675 assert(scip != NULL);
2676 assert(conss != NULL || nconss == 0);
2677 assert(varstopos != NULL);
2678 assert(occurlist != NULL);
2679 assert(noccurlistentries != NULL);
2680 assert(eventhdlr != NULL);
2681 assert(ndelconss != NULL);
2682 assert(nchgcoefs != NULL);
2687 assert(conss != NULL);
2689 for( c = 0; c < nconss; ++c )
2692 assert(cons != NULL);
2699 assert(consdata != NULL);
2701 nvars = consdata->nvars;
2707 vars = consdata->vars;
2708 assert(vars != NULL);
2710 for( v = nvars - 1; v >= 0; --v )
2725 occurlistlength, eventhdlr, nchgcoefs, &deleted) );
2749 unsigned char** entries,
2760 assert(scip != NULL);
2761 assert(cons != NULL);
2763 assert(eventhdlr != NULL);
2764 assert(*entries != NULL);
2765 assert(nentries != NULL);
2766 assert(redundant != NULL);
2767 assert(nfixedvars != NULL);
2768 assert(nchgcoefs != NULL);
2769 assert(ndelconss != NULL);
2770 assert(redundant != NULL);
2773 assert(consdata != NULL);
2774 assert(consdata->nvars > 0);
2779 if( !consdata->presolved )
2799 if( consdata->nvars == 0 )
2803 else if( consdata->nvars == 1 )
2808 SCIPdebugMsg(scip,
" -> fix last remaining variable and delete constraint\n");
2811 assert(!infeasible);
2820 consdata->presolved =
TRUE;
2845 unsigned char** entries,
2863 int* noccurlistentries;
2864 int* occurlistsizes;
2868 int occurlistlength;
2874 assert(scip != NULL);
2875 assert(conss != NULL || nconss == 0);
2876 assert(entries != NULL);
2877 assert(*entries != NULL);
2878 assert(nentries != NULL);
2879 assert(eventhdlr != NULL);
2880 assert(firstchange != NULL);
2881 assert(0 <= *firstchange);
2882 assert(nfixedvars != NULL);
2883 assert(ndelconss != NULL);
2884 assert(nchgcoefs != NULL);
2886 if( *firstchange > nconss || nconss < 2 )
2889 SCIPdebugMsg(scip,
"starting removeRedundantConssAndNonzeros(), pairwise comparison to detect covered logicor constraints\n");
2895 for( c = nconss - 1; c >= 0; --c )
2898 assert(cons != NULL);
2902 myconss[c] = myconss[nmyconss - 1];
2909 SCIP_CALL(
prepareCons(scip, cons, eventhdlr, entries, nentries, &redundant, nfixedvars, nchgcoefs, ndelconss, cutoff) );
2915 myconss[c] = myconss[nmyconss - 1];
2931 assert(consdata->nvars >= 2);
2934 SCIPsortPtr((
void**)myconss, conssLogicorComp, nmyconss);
2935 assert(myconss[0] != NULL && myconss[nmyconss - 1] != NULL);
2954 occurlistsize = 2 * nbinvars;
2970 assert(cons != NULL);
2973 assert(consdata != NULL);
2974 nmaxvars = consdata->nvars;
2976 occurlistlength = 0;
2977 conschanged =
FALSE;
2984 assert(consdata->validsignature);
2985 conschanged = conschanged || consdata->changed;
2986 consdata->changed =
FALSE;
2989 SCIP_CALL(
addConsToOccurList(scip, cons, varstopos, occurlist, noccurlistentries, occurlistsizes, &occurlistlength, occurlistsize) );
2996 assert(cons != NULL);
2999 assert(consdata != NULL);
3001 while( consdata->nvars == nmaxvars );
3007 assert(cons != NULL);
3010 assert(consdata != NULL);
3014 assert(consdata->validsignature);
3017 if( conschanged || consdata->changed )
3029 consdata->changed =
FALSE;
3034 SCIP_CALL(
addConsToOccurList(scip, cons, varstopos, occurlist, noccurlistentries, occurlistsizes, &occurlistlength, occurlistsize) );
3054 SCIP_CALL(
strengthenConss(scip, myconss, nmyconss, varstopos, occurlist, noccurlistentries, occurlistlength, eventhdlr, ndelconss, nchgcoefs) );
3057 for( --occurlistsize ; occurlistsize >= 0; --occurlistsize )
3059 assert((occurlistsizes[occurlistsize] == 0) == (occurlist[occurlistsize] == NULL));
3073 #define MAX_CONSLENGTH 200 3085 unsigned char** entries,
3104 assert(scip != NULL);
3105 assert(eventhdlr != NULL);
3106 assert(conss != NULL || nconss == 0);
3107 assert(entries != NULL);
3108 assert(*entries != NULL);
3109 assert(nentries != NULL);
3110 assert(nfixedvars != NULL);
3111 assert(ndelconss != NULL);
3112 assert(nchgcoefs != NULL);
3117 assert(conss != NULL);
3134 for( c = nconss - 1; c >= 0; --c )
3141 assert(cons != NULL);
3147 assert(consdata != NULL);
3150 SCIP_CALL(
prepareCons(scip, cons, eventhdlr, entries, nentries, &redundant, nfixedvars, nchgcoefs, ndelconss, cutoff) );
3161 assert(consdata->nvars >= 2);
3168 for( v = consdata->nvars - 1; v >= 0; --v)
3170 var = consdata->vars[v];
3171 assert(var != NULL);
3178 boundtypes[v] =
FALSE;
3184 boundtypes[v] =
TRUE;
3195 nfixedvars, &redundant, &glbinfeas,
TRUE) );
3212 for( v = consdata->nvars - 1; v >= 0; --v )
3216 redundants[v] =
FALSE;
3227 for( v = consdata->nvars - 1; v >= 0; --v )
3234 redundants[v] =
FALSE;
3237 *nchgcoefs += nredvars;
3240 if( consdata->nvars == 1 )
3245 SCIPdebugMsg(scip,
" -> fix last remaining variable and delete constraint\n");
3248 assert(!infeasible);
3269 #define MAXCOMPARISONS 1000000 3282 unsigned char** entries,
3304 assert(scip != NULL);
3305 assert(conshdlr != NULL);
3306 assert(eventhdlr != NULL);
3307 assert(conss != NULL || nconss == 0);
3308 assert(entries != NULL);
3309 assert(*entries != NULL);
3310 assert(nentries != NULL);
3311 assert(nfixedvars != NULL);
3312 assert(ndelconss != NULL);
3313 assert(nupgdconss != NULL);
3314 assert(nchgcoefs != NULL);
3315 assert(cutoff != NULL);
3318 assert(conshdlrdata != NULL);
3339 for( c = nconss - 1; c >= 0; --c )
3343 assert(conss != NULL);
3346 assert(cons != NULL);
3352 SCIP_CALL(
prepareCons(scip, cons, eventhdlr, entries, nentries, &redundant, nfixedvars, nchgcoefs, ndelconss, cutoff) );
3364 assert(consdata != NULL);
3365 assert(consdata->nvars >= 2);
3366 assert(consdata->nvars <= size);
3367 assert(consdata->presolved);
3383 for( v = consdata->nvars - 1; v >= 0; --v )
3389 for( v = consdata->nvars - 1; v > 0; --v )
3417 comppercons += (v - 1);
3421 for( w = v - 1; w >= 0; --w )
3452 SCIPdebugMsg(scip,
"logicor constraint <%s> is redundant, because variable <%s> and its negation <%s> exist\n",
3462 SCIP_VAR* lastvar = consdata->vars[consdata->nvars - 1];
3464 SCIPdebugMsg(scip,
"in logicor constraint <%s>, active variable of <%s> and active variable of <%s> are the same, removing the first\n",
3469 if( v < consdata->nvars )
3474 assert(consdata->vars[v] == lastvar);
3475 negated[v] = negated[consdata->nvars];
3514 SCIPdebugMsg(scip,
"logicor constraint <%s> is redundant due to negated clique information and will be replaced by a setppc constraint \n",
3529 if( comppercons > maxcomppercons )
3568 assert(scip != NULL);
3569 assert(cons != NULL);
3570 assert(eventhdlr != NULL);
3571 assert(nfixedvars != NULL);
3572 assert(nchgbds != NULL);
3573 assert(nchgcoefs != NULL);
3574 assert(ndelconss != NULL);
3575 assert(naddconss != NULL);
3576 assert(nupgdconss != NULL);
3577 assert(cutoff != NULL);
3585 assert(consdata != NULL);
3590 if( consdata->nvars == 2 )
3593 if( !consdata->impladded )
3605 *nchgbds += nimplbdchgs;
3606 if( implinfeasible )
3613 if ( nimplbdchgs > 0 )
3631 consdata->impladded =
TRUE;
3635 if( consdata->nvars == 2 && conshdlrsetppc != NULL )
3666 if( consdata->nvars == 0 )
3672 else if( consdata->nvars == 1 )
3674 SCIPdebugMsg(scip,
"logic or constraint <%s> has only one variable not fixed to 0.0\n",
3677 assert(consdata->vars != NULL);
3678 assert(consdata->vars[0] != NULL);
3682 SCIPdebugMsg(scip,
" -> fix variable and delete constraint\n");
3698 else if( conshdlrlinear != NULL )
3704 SCIPdebugMsg(scip,
" -> variable is multi-aggregated, upgrade to linear constraint <%s> == 1 \n",
3771 assert(nvars == 0 || vars != NULL);
3772 assert(nvars == 0 || vals != NULL);
3773 assert(mult == +1 || mult == -1);
3779 for( v = 0; v < nvars; ++v )
3781 if( mult * vals[v] > 0.0 )
3782 transvars[v] = vars[v];
3787 assert(transvars[v] != NULL);
3792 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
3803 assert(upgdcons != NULL);
3816 if( nvars > 2 && nposbin + nnegbin + nposimplbin + nnegimplbin == nvars && ncoeffspone + ncoeffsnone == nvars
3857 assert(conshdlr != NULL);
3859 assert(nconss == 0 || conss != NULL);
3860 assert(result != NULL);
3862 SCIPdebugMsg(scip,
"Enforcing %d logic or constraints for %s solution\n", nconss, sol == NULL ?
"LP" :
"relaxation");
3867 assert(conshdlrdata != NULL);
3874 for( c = 0; c < nusefulconss && !cutoff && !reduceddom; ++c )
3876 SCIP_CALL(
separateCons(scip, conss[c], sol, conshdlrdata->eventhdlr, &cutoff, &separated, &reduceddom) );
3880 for( c = nusefulconss; c < nconss && !cutoff && !separated && !reduceddom; ++c )
3882 SCIP_CALL(
separateCons(scip, conss[c], sol, conshdlrdata->eventhdlr, &cutoff, &separated, &reduceddom) );
3888 else if( separated )
3890 else if( reduceddom )
3905 assert(scip != NULL);
3906 assert(conshdlr != NULL);
3923 assert(conshdlr != NULL);
3925 assert(scip != NULL);
3928 assert(conshdlrdata != NULL);
3948 assert(conshdlr != NULL);
3950 assert(conshdlrdata != NULL);
3952 conshdlrdata->nlastcliquesneg = 0;
3953 conshdlrdata->nlastimplsneg = 0;
3954 conshdlrdata->nlastcliquesshorten = 0;
3955 conshdlrdata->nlastimplsshorten = 0;
3958 for( c = nconss - 1; c >= 0; --c )
3961 assert(consdata != NULL);
3963 for( v = consdata->nvars - 1; v >= 0; --v )
3983 assert(conshdlr != NULL);
3985 assert(conshdlrdata != NULL);
3988 for( c = 0; c < nconss; ++c )
3991 assert(consdata != NULL);
3993 for( v = 0; v < consdata->nvars; ++v )
4002 SCIP_CALL(
applyFixings(scip, conss[c], conshdlrdata->eventhdlr, &redundant, &nchgcoefs, NULL, NULL) );
4018 for( c = 0; c < nconss; ++c )
4021 assert(consdata != NULL);
4023 if( consdata->row != NULL )
4037 assert(conshdlr != NULL);
4039 assert(consdata != NULL);
4040 assert(*consdata != NULL);
4048 assert(conshdlrdata != NULL);
4050 for( v = (*consdata)->nvars - 1; v >= 0; --v )
4073 assert(conshdlr != NULL);
4076 assert(sourcecons != NULL);
4077 assert(targetcons != NULL);
4080 assert(sourcedata != NULL);
4081 assert(sourcedata->row == NULL);
4103 *infeasible =
FALSE;
4105 for( c = 0; c < nconss && !(*infeasible); ++c )
4125 assert(conshdlr != NULL);
4127 assert(nconss == 0 || conss != NULL);
4128 assert(result != NULL);
4130 SCIPdebugMsg(scip,
"separating %d/%d logic or constraints\n", nusefulconss, nconss);
4133 assert(conshdlrdata != NULL);
4140 for( c = 0; c < nusefulconss && !cutoff; ++c )
4142 SCIP_CALL(
separateCons(scip, conss[c], NULL, conshdlrdata->eventhdlr, &cutoff, &separated, &reduceddom) );
4151 else if( reduceddom )
4153 else if( separated )
4172 assert(conshdlr != NULL);
4174 assert(nconss == 0 || conss != NULL);
4175 assert(result != NULL);
4177 SCIPdebugMsg(scip,
"separating %d/%d logic or constraints\n", nusefulconss, nconss);
4180 assert(conshdlrdata != NULL);
4187 for( c = 0; c < nusefulconss && !cutoff; ++c )
4189 SCIP_CALL(
separateCons(scip, conss[c], sol, conshdlrdata->eventhdlr, &cutoff, &separated, &reduceddom) );
4198 else if( reduceddom )
4200 else if( separated )
4240 assert(conshdlr != NULL);
4242 assert(nconss == 0 || conss != NULL);
4243 assert(result != NULL);
4245 SCIPdebugMsg(scip,
"pseudo enforcing %d logic or constraints\n", nconss);
4250 assert(conshdlrdata != NULL);
4258 for( c = 0; c < nconss && !cutoff && !reduceddom && !solvelp; ++c )
4260 SCIP_CALL(
enforcePseudo(scip, conss[c], conshdlrdata->eventhdlr, &cutoff, &infeasible, &reduceddom, &solvelp) );
4265 else if( reduceddom )
4269 else if( infeasible )
4284 assert(conshdlr != NULL);
4286 assert(nconss == 0 || conss != NULL);
4287 assert(result != NULL);
4292 for( c = 0; c < nconss && (*result ==
SCIP_FEASIBLE || completely); ++c )
4296 assert(consdata != NULL);
4297 if( checklprows || consdata->row == NULL || !
SCIProwIsInLP(consdata->row) )
4311 for( v = 0; v < consdata->nvars; ++v )
4313 assert( consdata->vars[v] != NULL);
4320 SCIPinfoMessage(scip, NULL,
"violation: all variables are set to zero\n");
4344 assert(conshdlr != NULL);
4346 assert(nconss == 0 || conss != NULL);
4347 assert(result != NULL);
4350 assert(conshdlrdata != NULL);
4356 for( c = 0; c < nusefulconss && !cutoff; ++c )
4367 else if( reduceddom )
4382 unsigned char* entries;
4393 assert(conshdlr != NULL);
4395 assert(scip != NULL);
4396 assert(result != NULL);
4401 assert(conshdlrdata != NULL);
4405 oldnfixedvars = *nfixedvars;
4406 oldnchgbds = *nchgbds;
4407 oldndelconss = *ndelconss;
4408 oldnupgdconss = *nupgdconss;
4409 oldnchgcoefs = *nchgcoefs;
4411 firstchange = INT_MAX;
4419 assert(cons != NULL);
4421 assert(consdata != NULL);
4432 if( !consdata->presolved )
4435 SCIP_CALL(
applyFixings(scip, cons, conshdlrdata->eventhdlr, &redundant, nchgcoefs, naddconss, ndelconss) );
4458 if( consdata->nvars <= 2 )
4464 conshdlrdata->conshdlrsetppc, nfixedvars, nchgbds, nchgcoefs, ndelconss, naddconss, nupgdconss, &cutoff) );
4471 else if( *nfixedvars > oldnfixedvars || *nchgbds > oldnchgbds || *nchgcoefs > oldnchgcoefs
4472 || *ndelconss > oldndelconss || *nupgdconss > oldnupgdconss )
4490 if( consdata->nvars <= 2 )
4496 conshdlrdata->conshdlrsetppc, nfixedvars, nchgbds, nchgcoefs, ndelconss, naddconss, nupgdconss, &cutoff) );
4503 else if( *nfixedvars > oldnfixedvars || *nchgbds > oldnchgbds || *nchgcoefs > oldnchgcoefs
4504 || *ndelconss > oldndelconss || *nupgdconss > oldnupgdconss )
4513 if( firstchange == INT_MAX && consdata->changed )
4522 if( firstchange < nconss && conshdlrdata->presolusehashing )
4537 conshdlrdata->usestrengthening, &firstchange, nfixedvars, ndelconss, nchgcoefs, &cutoff) );
4551 if( conshdlrdata->useimplications && (presoltiming & SCIP_PRESOLTIMING_EXHAUSTIVE) != 0 )
4554 &entries, &nentries, nfixedvars, ndelconss, nchgcoefs, &cutoff) );
4567 conshdlrdata->eventhdlr, conss, nconss, &entries, &nentries, nfixedvars, ndelconss,
4568 nupgdconss, nchgcoefs, &cutoff) );
4597 assert(conshdlr != NULL);
4599 assert(cons != NULL);
4600 assert(infervar != NULL);
4601 assert(result != NULL);
4604 assert(consdata != NULL);
4606 SCIPdebugMsg(scip,
"conflict resolving method of logic or constraint handler\n");
4614 infervarfound =
FALSE;
4616 for( v = 0; v < consdata->nvars; ++v )
4618 if( consdata->vars[v] != infervar )
4627 assert(!infervarfound);
4628 infervarfound =
TRUE;
4632 assert(infervarfound);
4648 assert(consdata != NULL);
4651 for( i = 0; i < consdata->nvars; ++i )
4667 assert(conshdlr != NULL);
4669 assert(cons != NULL);
4673 assert(conshdlrdata != NULL);
4675 assert(consdata != NULL);
4676 assert(consdata->watchedvar1 == -1 || consdata->watchedvar1 != consdata->watchedvar2);
4682 if( consdata->watchedvar1 != -1 )
4686 &consdata->filterpos1) );
4688 if( consdata->watchedvar2 != -1 )
4692 &consdata->filterpos2) );
4706 assert(conshdlr != NULL);
4708 assert(cons != NULL);
4712 assert(conshdlrdata != NULL);
4714 assert(consdata != NULL);
4715 assert(consdata->watchedvar1 == -1 || consdata->watchedvar1 != consdata->watchedvar2);
4721 if( consdata->watchedvar1 != -1 )
4723 assert(consdata->filterpos1 != -1);
4726 consdata->filterpos1) );
4728 if( consdata->watchedvar2 != -1 )
4730 assert(consdata->filterpos2 != -1);
4733 consdata->filterpos2) );
4745 assert( scip != NULL );
4746 assert( conshdlr != NULL );
4747 assert( cons != NULL );
4759 const char* consname;
4774 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode, global, valid) );
4775 assert(cons != NULL);
4792 SCIPdebugMsg(scip,
"parse <%s> as logicor constraint\n", str);
4797 startptr = strchr((
char*)str,
'(');
4799 if( startptr == NULL )
4809 endptr = strrchr(startptr,
')');
4811 if( endptr == NULL )
4816 assert(endptr >= startptr);
4818 if( endptr > startptr )
4835 if( varssize < requiredsize )
4838 varssize = requiredsize;
4846 assert(varssize >= requiredsize);
4850 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
4867 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
4882 assert(consdata != NULL);
4884 if( varssize < consdata->nvars )
4888 assert(vars != NULL);
4904 assert(consdata != NULL);
4906 (*nvars) = consdata->nvars;
4919 assert(eventhdlr != NULL);
4920 assert(eventdata != NULL);
4922 assert(event != NULL);
4924 SCIPdebugMsg(scip,
"exec method of event handler for logic or constraints\n");
4944 assert(cons != NULL);
4946 assert(consdata != NULL);
4950 assert(var != NULL);
4952 consdata->presolved =
FALSE;
4959 consdata->merged =
FALSE;
4961 if( !consdata->existmultaggr )
4964 consdata->existmultaggr =
TRUE;
4984 assert(conflicthdlr != NULL);
4986 assert(bdchginfos != NULL || nbdchginfos == 0);
4987 assert(result != NULL);
4996 if( nbdchginfos == 2 )
5003 for( i = 0; i < nbdchginfos; ++i )
5005 assert(bdchginfos != NULL);
5006 assert(bdchginfos[i] != NULL);
5021 if( i == nbdchginfos )
5060 eventExecLogicor, NULL) );
5064 conflictExecLogicor, NULL) );
5072 consEnfolpLogicor, consEnfopsLogicor, consCheckLogicor, consLockLogicor,
5074 assert(conshdlr != NULL);
5102 if( conshdlrdata->conshdlrlinear != NULL )
5110 "constraints/logicor/presolpairwise",
5111 "should pairwise constraint comparison be performed in presolving?",
5114 "constraints/logicor/presolusehashing",
5115 "should hash table be used for detecting redundant constraints in advance",
5118 "constraints/logicor/dualpresolving",
5119 "should dual presolving steps be performed?",
5122 "constraints/logicor/negatedclique",
5123 "should negated clique information be used in presolving",
5126 "constraints/logicor/implications",
5127 "should implications/cliques be used in presolving",
5130 "constraints/logicor/strengthen",
5131 "should pairwise constraint comparison try to strengthen constraints by removing superflous non-zeros?",
5176 assert(scip != NULL);
5180 if( conshdlr == NULL )
5190 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
5191 local, modifiable, dynamic, removable, stickingatnode) );
5199 assert(conshdlrdata != NULL);
5201 for( v = consdata->nvars - 1; v >= 0; --v )
5227 assert(scip != NULL);
5242 assert(var != NULL);
5274 assert(consdata != NULL);
5276 return consdata->nvars;
5295 assert(consdata != NULL);
5297 return consdata->vars;
5316 assert(consdata != NULL);
5318 if( consdata->row != NULL )
5340 assert(consdata != NULL);
5342 if( consdata->row != NULL )
5366 assert(consdata != NULL);
5368 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)))
#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_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
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 SCIP_RETCODE addCut(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff)
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
void SCIPupdateSolLPConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
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 SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
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)