49 #define CONSHDLR_NAME "and" 50 #define CONSHDLR_DESC "constraint handler for AND-constraints: r = and(x1, ..., xn)" 51 #define CONSHDLR_SEPAPRIORITY +850100 52 #define CONSHDLR_ENFOPRIORITY -850100 53 #define CONSHDLR_CHECKPRIORITY -850100 54 #define CONSHDLR_SEPAFREQ 1 55 #define CONSHDLR_PROPFREQ 1 56 #define CONSHDLR_EAGERFREQ 100 58 #define CONSHDLR_MAXPREROUNDS -1 59 #define CONSHDLR_DELAYSEPA FALSE 60 #define CONSHDLR_DELAYPROP FALSE 61 #define CONSHDLR_NEEDSCONS TRUE 63 #define CONSHDLR_PRESOLTIMING (SCIP_PRESOLTIMING_FAST | SCIP_PRESOLTIMING_EXHAUSTIVE) 64 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP 66 #define EVENTHDLR_NAME "and" 67 #define EVENTHDLR_DESC "bound change event handler for AND-constraints" 69 #define DEFAULT_PRESOLPAIRWISE TRUE 70 #define DEFAULT_LINEARIZE FALSE 71 #define DEFAULT_ENFORCECUTS TRUE 72 #define DEFAULT_AGGRLINEARIZATION FALSE 73 #define DEFAULT_UPGRRESULTANT TRUE 74 #define DEFAULT_DUALPRESOLVING TRUE 76 #define HASHSIZE_ANDCONS 500 77 #define DEFAULT_PRESOLUSEHASHING TRUE 78 #define NMINCOMPARISONS 200000 79 #define MINGAINPERNMINCOMPARISONS 1e-06 80 #define EXPRGRAPHREFORM_PRIORITY 100000 102 unsigned int propagated:1;
103 unsigned int nofixedzero:1;
104 unsigned int impladded:1;
105 unsigned int opimpladded:1;
106 unsigned int sorted:1;
107 unsigned int changed:1;
108 unsigned int merged:1;
109 unsigned int checkwhenupgr:1;
112 unsigned int notremovablewhenupgr:1;
118 struct SCIP_ConshdlrData
186 assert(scip != NULL);
187 assert(conshdlrdata != NULL);
188 assert(eventhdlr != NULL);
193 (*conshdlrdata)->eventhdlr = eventhdlr;
205 assert(conshdlrdata != NULL);
206 assert(*conshdlrdata != NULL);
223 assert(consdata != NULL);
224 assert(consdata->vars != NULL);
225 assert(eventhdlr != NULL);
226 assert(0 <= pos && pos < consdata->nvars);
227 assert(filterpos != NULL);
247 assert(consdata != NULL);
248 assert(consdata->vars != NULL);
249 assert(eventhdlr != NULL);
250 assert(0 <= pos && pos < consdata->nvars);
251 assert(filterpos >= 0);
270 assert(consdata != NULL);
277 for( i = 0; i < consdata->nvars; ++i )
296 assert(consdata != NULL);
303 for( i = 0; i < consdata->nvars; ++i )
322 assert(consdata != NULL);
323 assert(watchedvar1 == -1 || watchedvar1 != watchedvar2);
324 assert(watchedvar1 != -1 || watchedvar2 == -1);
325 assert(watchedvar1 == -1 || (0 <= watchedvar1 && watchedvar1 < consdata->nvars));
326 assert(watchedvar2 == -1 || (0 <= watchedvar2 && watchedvar2 < consdata->nvars));
329 if( watchedvar1 == consdata->watchedvar2 || watchedvar2 == consdata->watchedvar1 )
333 tmp = consdata->watchedvar1;
334 consdata->watchedvar1 = consdata->watchedvar2;
335 consdata->watchedvar2 = tmp;
336 tmp = consdata->filterpos1;
337 consdata->filterpos1 = consdata->filterpos2;
338 consdata->filterpos2 = tmp;
340 assert(watchedvar1 == -1 || watchedvar1 != consdata->watchedvar2);
341 assert(watchedvar2 == -1 || watchedvar2 != consdata->watchedvar1);
344 if( consdata->watchedvar1 != -1 && consdata->watchedvar1 != watchedvar1 )
346 assert(consdata->filterpos1 != -1);
349 if( consdata->watchedvar2 != -1 && consdata->watchedvar2 != watchedvar2 )
351 assert(consdata->filterpos2 != -1);
356 if( watchedvar1 != -1 && watchedvar1 != consdata->watchedvar1 )
360 if( watchedvar2 != -1 && watchedvar2 != consdata->watchedvar2 )
366 consdata->watchedvar1 = watchedvar1;
367 consdata->watchedvar2 = watchedvar2;
380 assert(consdata != NULL);
381 assert(consdata->nvars <= consdata->varssize);
383 if( num > consdata->varssize )
389 consdata->varssize = newsize;
391 assert(num <= consdata->varssize);
415 assert(consdata != NULL);
416 assert(nvars == 0 || vars != NULL);
417 assert(resvar != NULL);
421 (*consdata)->resvar = resvar;
422 (*consdata)->rows = NULL;
423 (*consdata)->aggrrow = NULL;
424 (*consdata)->nvars = nvars;
425 (*consdata)->varssize = nvars;
426 (*consdata)->nrows = 0;
427 (*consdata)->watchedvar1 = -1;
428 (*consdata)->watchedvar2 = -1;
429 (*consdata)->filterpos1 = -1;
430 (*consdata)->filterpos2 = -1;
431 (*consdata)->propagated =
FALSE;
432 (*consdata)->nofixedzero =
FALSE;
433 (*consdata)->impladded =
FALSE;
434 (*consdata)->opimpladded =
FALSE;
435 (*consdata)->sorted =
FALSE;
436 (*consdata)->changed =
TRUE;
437 (*consdata)->merged =
FALSE;
438 (*consdata)->checkwhenupgr = checkwhenupgr;
439 (*consdata)->notremovablewhenupgr = notremovablewhenupgr;
458 for( v = 0; v < (*consdata)->nvars; ++v )
460 assert((*consdata)->vars[v] != NULL);
468 for( v = 0; v < (*consdata)->nvars; v++ )
470 assert((*consdata)->vars[v] != NULL);
488 assert(consdata != NULL);
490 if( consdata->rows != NULL )
492 for( r = 0; r < consdata->nrows; ++r )
501 if( consdata->aggrrow != NULL )
504 consdata->aggrrow = NULL;
520 assert(consdata != NULL);
521 assert(*consdata != NULL);
533 assert((*consdata)->watchedvar1 == -1);
534 assert((*consdata)->watchedvar2 == -1);
541 for( v = 0; v < (*consdata)->nvars; v++ )
543 assert((*consdata)->vars[v] != NULL);
563 assert(consdata != NULL);
595 assert(consdata != NULL);
596 assert(consdata->rows == NULL);
610 consdata->vars[consdata->nvars] = var;
612 consdata->sorted = (consdata->nvars == 1);
613 consdata->changed =
TRUE;
614 consdata->merged =
FALSE;
631 if( consdata->rows != NULL )
633 SCIPerrorMessage(
"cannot add coefficients to AND-constraint after LP relaxation was created\n");
651 assert(eventhdlr != NULL);
654 assert(consdata != NULL);
655 assert(0 <= pos && pos < consdata->nvars);
671 if( consdata->watchedvar1 == pos )
675 if( consdata->watchedvar2 == pos )
680 assert(pos != consdata->watchedvar1);
681 assert(pos != consdata->watchedvar2);
687 consdata->vars[pos] = consdata->vars[consdata->nvars-1];
691 if( consdata->watchedvar1 == consdata->nvars )
692 consdata->watchedvar1 = pos;
693 if( consdata->watchedvar2 == consdata->nvars )
694 consdata->watchedvar2 = pos;
696 consdata->propagated =
FALSE;
697 consdata->sorted =
FALSE;
698 consdata->changed =
TRUE;
709 assert(consdata != NULL);
711 if( !consdata->sorted )
713 if( consdata->nvars <= 1 )
714 consdata->sorted =
TRUE;
721 if( consdata->watchedvar1 != -1 )
723 var1 = consdata->vars[consdata->watchedvar1];
724 assert(var1 != NULL);
725 consdata->watchedvar1 = -1;
726 if( consdata->watchedvar2 != -1 )
728 var2 = consdata->vars[consdata->watchedvar2];
729 assert(var2 != NULL);
730 consdata->watchedvar2 = -1;
733 assert(consdata->watchedvar1 == -1);
734 assert(consdata->watchedvar2 == -1);
735 assert(var1 != NULL || var2 == NULL);
738 SCIPsortPtr((
void**)consdata->vars, SCIPvarComp, consdata->nvars);
739 consdata->sorted =
TRUE;
748 found =
SCIPsortedvecFindPtr((
void**)consdata->vars, SCIPvarComp, (
void*)var1, consdata->nvars, &pos);
753 assert(pos >= 0 && pos < consdata->nvars);
754 consdata->watchedvar1 = pos;
759 found =
SCIPsortedvecFindPtr((
void**)consdata->vars, SCIPvarComp, (
void*)var2, consdata->nvars, &pos);
764 assert(pos >= 0 && pos < consdata->nvars);
765 consdata->watchedvar2 = pos;
776 for( v = 0; v < consdata->nvars; ++v )
778 assert(v == consdata->nvars-1 ||
SCIPvarCompare(consdata->vars[v], consdata->vars[v+1]) <= 0);
797 assert(scip != NULL);
798 assert(cons != NULL);
799 assert(eventhdlr != NULL);
800 assert(nchgcoefs != NULL);
803 assert(consdata != NULL);
804 assert(consdata->nvars == 0 || consdata->vars != NULL);
807 while( v < consdata->nvars )
809 var = consdata->vars[v];
840 #ifdef SCIP_DISABLED_CODE 852 if( repvar != consdata->resvar )
871 consdata->resvar = repvar;
872 consdata->changed =
TRUE;
897 assert(consdata != NULL);
898 assert(consdata->rows == NULL);
900 nvars = consdata->nvars;
903 consdata->nrows = nvars + 1;
919 for( i = 0; i < nvars; ++i )
951 assert(consdata != NULL);
954 if( consdata->aggrrow == NULL )
973 if( consdata->rows == NULL )
979 assert(consdata->rows != NULL);
1006 assert(violated != NULL);
1009 assert(consdata != NULL);
1014 mustcheck = checklprows;
1015 mustcheck = mustcheck || (consdata->rows == NULL);
1018 assert(consdata->rows != NULL);
1020 for( r = 0; r < consdata->nrows; ++r )
1049 for( i = 0; i < consdata->nvars; ++i )
1054 if( absviol < viol )
1102 else if( i == consdata->nvars )
1104 SCIPinfoMessage(scip, NULL,
" all operands are TRUE and resultant <%s> = FALSE\n",
1109 SCIPinfoMessage(scip, NULL,
" operand <%s> = FALSE and resultant <%s> = TRUE\n",
1135 assert(separated != NULL);
1136 assert(cutoff != NULL);
1142 assert(consdata != NULL);
1145 if( consdata->rows == NULL )
1149 assert(consdata->rows != NULL);
1152 for( r = 0; r < consdata->nrows; ++r )
1185 assert(consdata != NULL);
1187 assert(0 <= falsepos && falsepos < consdata->nvars);
1219 assert(consdata != NULL);
1226 for( v = 0; v < consdata->nvars; ++v )
1252 SCIPdebugMsg(scip,
"constraint <%s>: operator %d fixed to 0.0 -> fix resultant <%s> to 0.0\n",
1292 for( v = 0; v < nvars && !(*cutoff); ++v )
1294 SCIPdebugMsg(scip,
"constraint <%s>: resultant fixed to 1.0 -> fix operator var <%s> to 1.0\n",
1306 else if( tightened )
1348 assert(consdata != NULL);
1353 nvars = consdata->nvars;
1354 conscreated =
FALSE;
1378 else if( tightened )
1387 else if( tightened )
1407 for( v = 0; v < nvars; ++v )
1456 assert(consdata != NULL);
1459 if( watchedvar2 == -1 )
1464 assert(watchedvar1 != -1);
1471 for( v = consdata->nvars - 1; v >= 0; --v )
1472 if( v != watchedvar1 )
1477 SCIPdebugMsg(scip,
"constraint <%s>: resultant <%s> fixed to 0.0, only one unfixed operand -> fix operand <%s> to 0.0\n",
1509 unsigned char** entries,
1529 assert(scip != NULL);
1530 assert(cons != NULL);
1531 assert(eventhdlr != NULL);
1532 assert(*entries != NULL);
1533 assert(nentries != NULL);
1534 assert(nfixedvars != NULL);
1535 assert(nchgcoefs != NULL);
1536 assert(ndelconss != NULL);
1539 assert(consdata != NULL);
1541 if( consdata->merged )
1545 if( consdata->nvars <= 1 )
1547 consdata->merged =
TRUE;
1551 vars = consdata->vars;
1552 nvars = consdata->nvars;
1554 assert(vars != NULL);
1561 assert(*nentries >= nbinvars + nintvars + nimplvars);
1565 for( v = nvars - 1; v >= 0; --v )
1568 assert(var != NULL);
1572 assert(probvar != NULL);
1575 assert(0 <= probidx);
1581 (probidx >= nbinvars + nintvars && probidx < nbinvars + nintvars + nimplvars &&
1585 (*entries)[probidx] = 0;
1592 for( v = nvars - 1; v >= 0; --v )
1595 assert(var != NULL);
1599 assert(probvar != NULL);
1602 assert(0 <= probidx && probidx < *nentries);
1605 if( (*entries)[probidx] == 0 )
1623 SCIPdebugMsg(scip,
"AND-constraint <%s> is redundant: variable <%s> and its negation are present -> fix resultant <%s> = 0\n",
1637 assert(!infeasible);
1646 consdata->merged =
TRUE;
1681 assert(cutoff != NULL);
1682 assert(nfixedvars != NULL);
1685 assert(consdata != NULL);
1687 resvar = consdata->resvar;
1688 vars = consdata->vars;
1689 nvars = consdata->nvars;
1694 if( consdata->propagated )
1696 assert(consdata->nofixedzero);
1708 if( !consdata->nofixedzero )
1710 for( i = 0; i < nvars && SCIPvarGetUbLocal(vars[i]) > 0.5; ++i )
1718 consdata->nofixedzero =
TRUE;
1759 watchedvar1 = consdata->watchedvar1;
1760 watchedvar2 = consdata->watchedvar2;
1763 if( watchedvar1 != -1 )
1769 if( watchedvar2 != -1 )
1777 if( watchedvar1 == -1 )
1779 watchedvar1 = watchedvar2;
1782 assert(watchedvar1 != -1 || watchedvar2 == -1);
1785 if( watchedvar2 == -1 )
1787 for( i = 0; i < nvars; ++i )
1792 if( watchedvar1 == -1 )
1794 assert(watchedvar2 == -1);
1797 else if( watchedvar1 != i )
1805 assert(watchedvar1 != -1 || watchedvar2 == -1);
1808 if( watchedvar1 == -1 )
1810 assert(watchedvar2 == -1);
1812 SCIPdebugMsg(scip,
"constraint <%s>: all operator vars fixed to 1.0 -> fix resultant <%s> to 1.0\n",
1841 assert(watchedvar1 != -1);
1881 assert(result != NULL);
1884 assert(consdata != NULL);
1885 vars = consdata->vars;
1886 nvars = consdata->nvars;
1893 assert(infervar == consdata->resvar);
1894 for( i = 0; i < nvars; ++i )
1917 assert(infervar == consdata->resvar);
1918 for( i = 0; i < nvars; ++i )
1931 for( i = 0; i < nvars; ++i )
1933 if( vars[i] != infervar )
1958 unsigned char** entries,
1983 assert(scip != NULL);
1984 assert(conss != NULL || nconss == 0);
1985 assert(eventhdlr != NULL);
1986 assert(*entries != NULL);
1987 assert(nentries != NULL);
1988 assert(cutoff != NULL);
1989 assert(nfixedvars != NULL);
1990 assert(naggrvars != NULL);
1991 assert(nchgcoefs != NULL);
1992 assert(ndelconss != NULL);
1993 assert(nupgdconss != NULL);
1994 assert(naddconss != NULL);
1999 assert(conss != NULL);
2005 for( c = nconss - 1; c >= 0 && !(*cutoff); --c )
2008 assert(cons != NULL);
2031 assert(consdata != NULL);
2033 vars = consdata->vars;
2034 nvars = consdata->nvars;
2035 assert(vars != NULL || nvars == 0);
2040 assert(vars != NULL);
2042 resvar = consdata->resvar;
2043 assert(resvar != NULL);
2055 int oldnfixedvars = *nfixedvars;
2056 int oldnaggrvars = *naggrvars;
2061 for( v = nvars - 1; v >= 0; --v )
2064 assert(var != NULL);
2069 impoperands[nimpoperands] = var;
2082 maxpos = nimpoperands - 1;
2087 assert(nimpoperands >= 0 && nimpoperands <= nvars);
2090 if( nimpoperands == 0 )
2104 if( nimpoperands == nvars && poscontissmall )
2110 *cutoff = *cutoff || infeasible;
2115 for( v = nvars - 1; v >= 0 && !(*cutoff); --v )
2119 *cutoff = *cutoff || infeasible;
2134 assert(nimpoperands > 0);
2136 SCIPdebugMsg(scip,
"dual-fixing all variables in constraint <%s> with positive contribution (when together exceeding the negative contribution of the resultant) to 0 and with negative contribution to 1\n",
SCIPconsGetName(cons));
2138 for( v = nimpoperands - 1; v >= 0 && !(*cutoff); --v )
2147 *cutoff = *cutoff || infeasible;
2151 else if( !poscontissmall )
2154 assert(!infeasible);
2167 &infeasible, &redundant, &aggregated) );
2168 assert(!infeasible);
2175 aggregationperformed =
TRUE;
2181 assert(*nfixedvars - oldnfixedvars + *naggrvars - oldnaggrvars <= nimpoperands);
2186 if( aggregationperformed || zerofix )
2201 if( fixval < 0.5 || *nfixedvars - oldnfixedvars + *naggrvars - oldnaggrvars == nvars )
2206 assert(!infeasible);
2226 assert(nimpoperands > 0);
2227 assert(maxpos >= 0 && maxpos <= consdata->nvars);
2230 assert(
SCIPisEQ(scip, tmpobj, maxobj));
2236 if( nimpoperands == nvars &&
SCIPisLE(scip, maxobj, 0.0) )
2240 SCIPdebugMsg(scip,
"dual-fixing variable <%s> in constraint <%s> to %g, because the contribution is%s enough to nullify/exceed the contribution of the resultant \n",
SCIPvarGetName(impoperands[maxpos]),
SCIPconsGetName(cons), fixval, (fixval < 0.5) ?
" not" :
"");
2243 zerofix = (fixval < 0.5);
2245 *cutoff = *cutoff || infeasible;
2250 SCIPdebugMsg(scip,
"dual-fixing all variables, except the variable with the highest contribution to the objective, in constraint <%s> with positive contribution to 0 and with negative contribution to 1\n",
SCIPconsGetName(cons));
2252 for( v = nimpoperands - 1; v >= 0 && !(*cutoff); --v )
2270 *cutoff = *cutoff || infeasible;
2274 assert(*nfixedvars - oldnfixedvars <= nimpoperands);
2276 assert((*nfixedvars - oldnfixedvars == nvars) == (nimpoperands == nvars));
2278 if( *nfixedvars - oldnfixedvars == nvars )
2284 *cutoff = *cutoff || infeasible;
2307 int oldnchgcoefs = *nchgcoefs;
2308 int oldnfixedvars = *nfixedvars;
2314 resobjispos =
SCIPisGT(scip, resobj, 0.0);
2321 for( v = nvars - 1; v >= 0; --v )
2324 assert(var != NULL);
2339 &infeasible, &redundant, &aggregated) );
2354 *cutoff = *cutoff || infeasible;
2357 goodvarsfound =
TRUE;
2360 assert(*nchgcoefs - oldnchgcoefs <= nvars);
2372 if( !*cutoff && goodvarsfound && linearize )
2375 for( v = consdata->nvars - 1; v >= 0; --v )
2378 assert(var != NULL);
2391 assert(!infeasible);
2396 assert(*nfixedvars - oldnfixedvars <= consdata->nvars);
2398 assert(*nchgcoefs - oldnchgcoefs + *nfixedvars - oldnfixedvars <= nvars);
2408 for( v = nvars - 1; v >= 0; --v )
2411 assert(var != NULL);
2437 *cutoff = *cutoff || infeasible;
2444 assert(*nchgcoefs - oldnchgcoefs <= nvars);
2449 if( !zerofix && locksareone &&
SCIPisGE(scip, resobj,
REALABS(maxobj)) )
2453 assert(
SCIPisLT(scip, maxobj, 0.0));
2459 *cutoff = *cutoff || infeasible;
2473 *cutoff = *cutoff || infeasible;
2477 SCIPdebugMsg(scip,
"deleting constraint <%s> because at least one operand and the resultant is fixed to zero\n",
SCIPconsGetName(cons));
2497 consvars[0] = consdata->resvar;
2502 for( v = consdata->nvars - 1; v >= 0; --v )
2505 consvars[1] = consdata->vars[v];
2517 (*naddconss) += consdata->nvars;
2525 else if( consdata->nvars == 1 )
2531 &infeasible, &redundant, &aggregated) );
2536 *cutoff = *cutoff || infeasible;
2616 assert(scip != NULL);
2617 assert(cons != NULL);
2618 assert(eventhdlr != NULL);
2619 assert(cutoff != NULL);
2620 assert(nfixedvars != NULL);
2621 assert(naggrvars != NULL);
2622 assert(nchgcoefs != NULL);
2623 assert(ndelconss != NULL);
2624 assert(naddconss != NULL);
2627 assert(consdata != NULL);
2632 vars = consdata->vars;
2633 nvars = consdata->nvars;
2634 assert(vars != NULL || nvars == 0);
2641 for( v = nvars - 1; v >= 0; --v )
2643 assert(vars != NULL);
2647 SCIPdebugMsg(scip,
"In constraint <%s> the operand <%s> is fixed to 1 so remove it from the constraint\n",
2654 assert(consdata->vars == vars);
2660 SCIPdebugMsg(scip,
"constraint <%s> redundant: because operand <%s> is fixed to zero so we can fix the resultant <%s> to 0\n",
2664 *cutoff = *cutoff || infeasible;
2676 if( consdata->nvars < nvars )
2678 assert(vars == consdata->vars);
2683 if( consdata->nvars == 0 )
2685 SCIPdebugMsg(scip,
"All operand in constraint <%s> were deleted, so the resultant needs to be fixed to 1\n",
2689 *cutoff = *cutoff || infeasible;
2699 else if( consdata->nvars == 1 )
2706 &infeasible, &redundant, &aggregated) );
2714 *cutoff = *cutoff || infeasible;
2719 nvars = consdata->nvars;
2727 for( v = nvars - 1; v > 0; --v )
2729 assert(vars != NULL);
2732 assert(var1 != NULL);
2736 assert(var1 != NULL);
2745 for( v2 = v - 1; v2 >= 0; --v2 )
2748 assert(var2 != NULL);
2752 assert(var2 != NULL);
2774 SCIPdebugMsg(scip,
"constraint <%s> redundant: because variable <%s> and variable <%s> are in a clique, the resultant <%s> can be fixed to 0\n",
2778 *cutoff = *cutoff || infeasible;
2819 var1 = consdata->resvar;
2820 assert(var1 != NULL);
2824 assert(var1 != NULL);
2832 SCIPdebugMsg(scip,
"In constraint <%s> the resultant <%s> is fixed to 1 so fix all operands to 1\n",
2836 for( v = nvars - 1; v >= 0 && !(*cutoff); --v )
2838 assert(vars != NULL);
2843 *cutoff = *cutoff || infeasible;
2866 for( v = nvars - 1; v >= 0; --v )
2868 assert(vars != NULL);
2871 assert(var2 != NULL);
2875 assert(var2 != NULL);
2888 if( value1 != value2 )
2890 SCIPdebugMsg(scip,
"In constraint <%s> the resultant <%s> can be fixed to 0 because the negation of it is an operand.\n",
2894 *cutoff = *cutoff || infeasible;
2908 assert(value1 == value2);
2910 consvars[0] = consdata->resvar;
2912 for( v2 = nvars - 1; v2 >= 0; --v2 )
2930 if( value1 == negated )
2932 SCIPdebugMsg(scip,
"In constraint <%s> the resultant <%s> can be fixed to 0 because the negation of it is an operand.\n",
2936 *cutoff = *cutoff || infeasible;
2947 assert(consvars[1] != NULL);
2975 if( var1 == var2 && value1 == value2 )
2983 SCIPdebugMsg(scip,
"in constraint <%s> the resultant <%s> can be fixed to 0 because it is in a clique with operand <%s>\n",
2987 *cutoff = *cutoff || infeasible;
3000 for( v = nvars - 1; v >= 0; --v )
3002 assert(vars != NULL);
3005 assert(var1 != NULL);
3009 assert(var1 != NULL);
3019 allnegoperandsexist =
FALSE;
3024 allnegoperandsexist =
TRUE;
3029 else if( v2 >= 0 && v == -1 )
3043 for( v = vstart; v >= vend; --v )
3045 assert(vars != NULL);
3048 assert(var1 != NULL);
3052 assert(var1 != NULL);
3059 for( v2 = nvars - 1; v2 >= 0; --v2 )
3065 assert(var2 != NULL);
3069 assert(var2 != NULL);
3084 if( var1 == var2 && value1 == value2 )
3086 SCIPdebugMsg(scip,
"in constraint <%s> the resultant <%s> can be fixed to 0 because two operands are negated of each other\n",
3090 *cutoff = *cutoff || infeasible;
3100 if( var1 == var2 && value1 != value2 )
3112 SCIPdebugMsg(scip,
"In constraint <%s> the operand <%s> is in a negated clique with all other operands, so we can aggregated this operand to the resultant <%s>.\n",
3116 &infeasible, &redundant, &aggregated) );
3117 *cutoff = *cutoff || infeasible;
3140 var1 = consdata->resvar;
3142 assert(var1 != NULL);
3145 newvars[nvars] = var1;
3148 for( v = nvars - 1; v >= 0; --v )
3150 assert(vars != NULL);
3154 assert(var1 != NULL);
3160 assert(newvars[v] != newvars[nvars]);
3167 for( v = nvars - 1; v >= 0 && upgrade; --v )
3169 for( v2 = v - 1; v2 >= 0; --v2 )
3187 if( negations[nvars] )
3195 assert(newvars[nvars] != NULL);
3197 for( v = nvars - 1; v >= 0; --v )
3207 assert(newvars[v] != NULL);
3217 SCIPdebugMsg(scip,
" -> upgrading AND-constraint <%s> with use of clique information to a set-partitioning constraint: \n",
SCIPconsGetName(cons));
3254 scip = (
SCIP*)userptr;
3255 assert(scip != NULL);
3262 if( consdata1->nvars != consdata2->nvars )
3268 assert(consdata1->sorted);
3269 assert(consdata2->sorted);
3273 for( i = 0; i < consdata1->nvars ; ++i )
3276 if( consdata1->vars[i] != consdata2->vars[i] )
3278 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 1 ||
3283 assert(
SCIPvarCompare(consdata1->vars[i], consdata2->vars[i]) == 0);
3299 assert(consdata != NULL);
3300 assert(consdata->sorted);
3301 assert(consdata->nvars > 0);
3306 assert(minidx >= 0 && minidx <= maxidx);
3331 assert(conss != NULL);
3332 assert(ndelconss != NULL);
3335 hashtablesize = nconss;
3338 hashGetKeyAndcons, hashKeyEqAndcons, hashKeyValAndcons, (
void*) scip) );
3343 for( c = 0; c < nconss; ++c )
3358 assert(consdata0->sorted);
3373 assert(consdata1 != NULL);
3374 assert(consdata0->nvars >= 1 && consdata0->nvars == consdata1->nvars);
3376 assert(consdata0->sorted && consdata1->sorted);
3377 assert(consdata0->vars[0] == consdata1->vars[0]);
3381 if( consdata0->resvar != consdata1->resvar )
3385 assert(
SCIPvarCompare(consdata0->resvar, consdata1->resvar) != 0);
3389 cutoff, &redundant, &aggregated) );
3407 consdata1->checkwhenupgr = consdata1->checkwhenupgr || consdata0->checkwhenupgr;
3408 consdata1->notremovablewhenupgr = consdata1->notremovablewhenupgr || consdata0->notremovablewhenupgr;
3453 assert(conshdlrdata != NULL);
3456 for( i = 0; i < nconss; i++ )
3461 if( conshdlrdata->enforcecuts )
3471 separated = separated || consseparated;
3481 #ifdef SCIP_DISABLED_CODE 3482 assert(consseparated);
3522 assert(conss != NULL);
3523 assert(firstchange <= chkind);
3524 assert(cutoff != NULL);
3525 assert(naggrvars != NULL);
3526 assert(nbdchgs != NULL);
3527 assert(ndelconss != NULL);
3530 cons0 = conss[chkind];
3539 assert(consdata0->nvars >= 1);
3540 assert(consdata0->sorted);
3543 cons0changed = consdata0->changed;
3547 for( c = (cons0changed ? 0 : firstchange); c < chkind && !(*cutoff); ++c )
3566 assert(consdata1 != NULL);
3568 #ifdef SCIP_DISABLED_CODE 3569 SCIPdebugMsg(scip,
"preprocess AND-constraint pair <%s>[chg:%d] and <%s>[chg:%d]\n",
3574 if( !cons0changed && !consdata1->changed )
3577 assert(consdata1->nvars >= 1);
3581 assert(consdata1->sorted);
3589 cons0superset =
TRUE;
3590 cons1superset =
TRUE;
3591 while( (v0 < consdata0->nvars || v1 < consdata1->nvars) && (cons0superset || cons1superset) )
3596 if( v0 < consdata0->nvars && v1 < consdata1->nvars )
3597 varcmp =
SCIPvarCompare(consdata0->vars[v0], consdata1->vars[v1]);
3598 else if( v0 < consdata0->nvars )
3607 cons1superset =
FALSE;
3613 cons0superset =
FALSE;
3631 if( cons0superset && cons1superset )
3638 SCIPdebugMsg(scip,
"equivalent AND-constraints <%s> and <%s>: aggregate resultants <%s> == <%s>\n",
3644 &infeasible, &redundant, &aggregated) );
3659 consdata0->checkwhenupgr = consdata1->checkwhenupgr || consdata0->checkwhenupgr;
3660 consdata0->notremovablewhenupgr = consdata1->notremovablewhenupgr || consdata0->notremovablewhenupgr;
3667 *cutoff = *cutoff || infeasible;
3669 else if( cons0superset )
3675 SCIPdebugMsg(scip,
"AND-constraint <%s> is superset of <%s>: add implication <%s> = 1 -> <%s> = 1\n",
3681 &infeasible, &nboundchgs) );
3682 *cutoff = *cutoff || infeasible;
3683 (*nbdchgs) += nboundchgs;
3685 else if( cons1superset )
3691 SCIPdebugMsg(scip,
"AND-constraint <%s> is superset of <%s>: add implication <%s> = 1 -> <%s> = 1\n",
3697 &infeasible, &nboundchgs) );
3698 *cutoff = *cutoff || infeasible;
3699 (*nbdchgs) += nboundchgs;
3703 consdata0->changed =
FALSE;
3720 assert(scip != NULL);
3721 assert(exprgraph != NULL);
3722 assert(node != NULL);
3723 assert(naddcons != NULL);
3724 assert(reformnode != NULL);
3742 if( nchildren <= 2 )
3746 for( c = 0; c < nchildren; ++c )
3759 SCIPdebugMsg(scip,
"reformulate node %p via AND-constraint\n", (
void*)node);
3763 for( c = 0; c < nchildren; ++c )
3775 TRUE,
TRUE, NULL, NULL, NULL, NULL, NULL) );
3778 #ifdef WITH_DEBUG_SOLUTION 3779 if( SCIPdebugIsMainscip(scip) )
3785 for( c = 0; c < nchildren; ++c )
3788 debugval = debugval && (varval > 0.5);
3817 if( coef != 1.0 || constant != 0.0 )
3822 *reformnode = linnode;
3837 assert(scip != NULL);
3838 assert(conshdlr != NULL);
3857 assert(conshdlrdata != NULL);
3873 assert( scip != NULL );
3874 assert( conshdlr != NULL );
3875 assert( nconss == 0 || conss != NULL );
3878 assert(conshdlrdata != NULL);
3880 if( conshdlrdata->linearize )
3898 for( c = 0; c < nconss; ++c )
3901 assert( cons != NULL );
3908 assert( consdata != NULL );
3909 assert( consdata->resvar != NULL );
3911 nvars = consdata->nvars;
3913 if( !conshdlrdata->aggrlinearization )
3915 vars[0] = consdata->resvar;
3920 for( v = 0; v < nvars; ++v )
3923 vars[1] = consdata->vars[v];
3942 for( v = 0; v < nvars; ++v )
3944 vars[v] = consdata->vars[v];
3948 vars[nvars] = consdata->resvar;
3950 if( conshdlrdata->aggrlinearization )
3996 #ifdef GMLGATEPRINTING 4020 unsigned int id = 1;
4038 gmlfile = fopen(fname,
"w");
4040 if( gmlfile == NULL )
4054 for( c = nconss - 1; c >= 0; --c )
4063 assert(consdata != NULL);
4066 if( consdata->nvars == 0 )
4069 assert(consdata->vars != NULL);
4070 assert(consdata->resvar != NULL);
4093 for( v = consdata->nvars - 1; v >= 0; --v )
4115 #ifdef SCIP_DISABLED_CODE 4116 for( v = nvars - 1; v >= 0; --v )
4155 for( c = 0; c < nconss; ++c )
4158 assert(consdata != NULL);
4174 assert(conshdlrdata != NULL);
4191 assert(conshdlrdata != NULL);
4194 assert(sourcedata != NULL);
4198 sourcedata->nvars, sourcedata->vars, sourcedata->resvar, sourcedata->checkwhenupgr,
4199 sourcedata->notremovablewhenupgr) );
4218 *infeasible =
FALSE;
4220 for( i = 0; i < nconss && !(*infeasible); i++ )
4241 for( c = 0; c < nusefulconss; ++c )
4246 else if ( separated )
4268 for( c = 0; c < nusefulconss; ++c )
4273 else if ( separated )
4310 for( i = 0; i < nconss; i++ )
4335 for( i = 0; i < nconss && (*result ==
SCIP_FEASIBLE || completely); i++ )
4357 assert(conshdlrdata != NULL);
4364 for( c = 0; c < nusefulconss && !cutoff; ++c )
4372 else if( nfixedvars > 0 || nupgdconss > 0 )
4388 unsigned char* entries;
4399 assert(result != NULL);
4401 oldnfixedvars = *nfixedvars;
4402 oldnaggrvars = *naggrvars;
4403 oldnchgbds = *nchgbds;
4404 oldndelconss = *ndelconss;
4405 oldnupgdconss = *nupgdconss;
4411 assert(conshdlrdata != NULL);
4415 firstchange = INT_MAX;
4416 for( c = 0; c < nconss && !cutoff && (c % 1000 != 0 || !
SCIPisStopped(scip)); ++c )
4419 assert(cons != NULL);
4421 assert(consdata != NULL);
4425 consdata->propagated =
FALSE;
4428 if( firstchange == INT_MAX && consdata->changed )
4442 SCIP_CALL(
mergeMultiples(scip, cons, conshdlrdata->eventhdlr, &entries, &nentries, nfixedvars, nchgcoefs, ndelconss) );
4447 assert(consdata->nvars >= 1);
4450 if( consdata->nvars == 1 )
4457 assert(consdata->vars != NULL);
4463 &cutoff, &redundant, &aggregated) );
4479 else if( !consdata->impladded )
4484 for( i = 0; i < consdata->nvars && !cutoff; ++i )
4490 (*nchgbds) += nimplbdchgs;
4492 consdata->impladded =
TRUE;
4496 if( !cutoff &&
SCIPconsIsActive(cons) && consdata->nvars == 2 && !consdata->opimpladded
4503 (*nchgbds) += nimplbdchgs;
4504 consdata->opimpladded =
TRUE;
4512 SCIP_CALL(
dualPresolve(scip, conss, nconss, conshdlrdata->eventhdlr, &entries, &nentries, &cutoff, nfixedvars, naggrvars, nchgcoefs, ndelconss, nupgdconss, naddconss) );
4518 for( c = 0; c < nconss && !cutoff && !
SCIPisStopped(scip); ++c )
4523 SCIP_CALL(
cliquePresolve(scip, conss[c], conshdlrdata->eventhdlr, &cutoff, nfixedvars, naggrvars, nchgcoefs, ndelconss, naddconss) );
4532 if( !cutoff && conshdlrdata->presolusehashing && (presoltiming & SCIP_PRESOLTIMING_EXHAUSTIVE) != 0 )
4534 if( *nfixedvars == oldnfixedvars && *naggrvars == oldnaggrvars )
4536 if( firstchange < nconss )
4540 oldnaggrvars = *naggrvars;
4545 if( !cutoff && conshdlrdata->presolpairwise && (presoltiming & SCIP_PRESOLTIMING_EXHAUSTIVE) != 0 )
4547 if( *nfixedvars == oldnfixedvars && *naggrvars == oldnaggrvars )
4550 npaircomparisons = 0;
4551 oldndelconss = *ndelconss;
4553 for( c = firstchange; c < nconss && !cutoff && !
SCIPisStopped(scip); ++c )
4566 oldndelconss = *ndelconss;
4567 oldnaggrvars = *naggrvars;
4568 oldnchgbds = *nchgbds;
4570 npaircomparisons = 0;
4582 else if( *nfixedvars > oldnfixedvars || *naggrvars > oldnaggrvars || *nchgbds > oldnchgbds
4583 || *ndelconss > oldndelconss || *nupgdconss > oldnupgdconss )
4610 assert(consdata != NULL);
4616 for( i = 0; i < consdata->nvars; ++i )
4630 assert( scip != NULL );
4631 assert( conshdlr != NULL );
4632 assert( cons != NULL );
4647 const char* consname;
4651 assert(valid != NULL);
4658 assert(!(*valid) || resvar != NULL);
4674 for( v = 0; v < nvars; ++v )
4677 assert(!(*valid) || vars[v] != NULL);
4691 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
4711 SCIPdebugMsg(scip,
"parse <%s> as AND-constraint\n", str);
4719 if( resvar == NULL )
4721 SCIPdebugMsg(scip,
"resultant variable does not exist \n");
4725 char* strcopy = NULL;
4729 startptr = strchr((
char*)str,
'(');
4731 if( startptr == NULL )
4733 SCIPerrorMessage(
"missing starting character '(' parsing AND-constraint\n");
4741 endptr = strrchr(startptr,
')');
4743 if( endptr == NULL )
4748 assert(endptr >= startptr);
4750 if( endptr > startptr )
4767 if( varssize < requiredsize )
4770 varssize = requiredsize;
4778 assert(varssize >= requiredsize);
4782 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
4799 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
4815 assert(consdata != NULL);
4817 if( varssize < consdata->nvars + 1 )
4822 vars[consdata->nvars] = consdata->resvar;
4835 assert(cons != NULL);
4838 assert(consdata != NULL);
4840 (*nvars) = consdata->nvars + 1;
4856 assert(eventhdlr != NULL);
4857 assert(eventdata != NULL);
4858 assert(event != NULL);
4861 assert(consdata != NULL);
4865 consdata->nofixedzero =
FALSE;
4867 consdata->propagated =
FALSE;
4888 eventExecAnd, NULL) );
4896 consEnfolpAnd, consEnfopsAnd, consCheckAnd, consLockAnd,
4899 assert(conshdlr != NULL);
4904 #ifdef GMLGATEPRINTING 4927 "should pairwise constraint comparison be performed in presolving?",
4930 "constraints/and/presolusehashing",
4931 "should hash table be used for detecting redundant constraints in advance",
4935 "should the AND-constraint get linearized and removed (in presolving)?",
4939 "should cuts be separated during LP enforcing?",
4943 "should an aggregated linearization be used?",
4947 "should all binary resultant variables be upgraded to implicit binary variables?",
4951 "should dual presolving be performed?",
5006 if( conshdlr == NULL )
5013 assert(conshdlrdata != NULL);
5034 activeresvar = resvar;
5039 for( v = nvars - 1; v >= 0; --v )
5044 activevar = vars[v];
5054 assert(!infeasible);
5063 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
5064 local, modifiable, dynamic, removable, stickingatnode) );
5086 assert(scip != NULL);
5103 assert(scip != NULL);
5104 assert(cons != NULL);
5114 assert(consdata != NULL);
5116 return consdata->nvars;
5127 assert(scip != NULL);
5128 assert(cons != NULL);
5138 assert(consdata != NULL);
5140 return consdata->vars;
5152 assert(cons != NULL);
5162 assert(consdata != NULL);
5164 return consdata->resvar;
5175 assert(scip != NULL);
5176 assert(cons != NULL);
5186 assert(consdata != NULL);
5188 return consdata->sorted;
5199 assert(scip != NULL);
5200 assert(cons != NULL);
5210 assert(consdata != NULL);
5213 assert(consdata->sorted);
5231 assert(scip != NULL);
5232 assert(cons != NULL);
5242 assert(consdata != NULL);
5244 consdata->checkwhenupgr = flag;
5263 assert(scip != NULL);
5264 assert(cons != NULL);
5274 assert(consdata != NULL);
5276 consdata->notremovablewhenupgr = flag;
enum SCIP_Result SCIP_RESULT
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPaddVarsToRowSameCoef(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real val)
static SCIP_RETCODE conshdlrdataCreate(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr)
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
int SCIPgetNIntVars(SCIP *scip)
static SCIP_RETCODE consdataFixResultantZero(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *resvar, int pos, SCIP_Bool *cutoff, int *nfixedvars)
SCIP_RETCODE SCIPincConsAge(SCIP *scip, SCIP_CONS *cons)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
static SCIP_RETCODE resolvePropagation(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, PROPRULE proprule, SCIP_BDCHGIDX *bdchgidx, SCIP_RESULT *result)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
SCIP_Bool SCIPinRepropagation(SCIP *scip)
#define ARTIFICIALVARNAMEPREFIX
SCIP_RETCODE SCIPincludeNonlinconsUpgrade(SCIP *scip, SCIP_DECL_NONLINCONSUPGD((*nonlinconsupgd)), SCIP_DECL_EXPRGRAPHNODEREFORM((*nodereform)), int priority, SCIP_Bool active, const char *conshdlrname)
static SCIP_DECL_CONSSEPASOL(consSepasolAnd)
SCIP_RETCODE SCIPexprgraphAddNode(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node, int mindepth, int nchildren, SCIP_EXPRGRAPHNODE **children)
SCIP_Bool SCIPvarsHaveCommonClique(SCIP_VAR *var1, SCIP_Bool value1, SCIP_VAR *var2, SCIP_Bool value2, SCIP_Bool regardimplics)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
static SCIP_RETCODE cliquePresolve(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, int *nfixedvars, int *naggrvars, int *nchgcoefs, int *ndelconss, int *naddconss)
SCIP_Real SCIPgetVarUbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
SCIP_Bool SCIPisFeasEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPexprgraphAddVars(SCIP_EXPRGRAPH *exprgraph, int nvars, void **vars, SCIP_EXPRGRAPHNODE **varnodes)
SCIP_STAGE SCIPgetStage(SCIP *scip)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
#define CONSHDLR_SEPAPRIORITY
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
SCIP_RETCODE SCIPgetBinvarRepresentative(SCIP *scip, SCIP_VAR *var, SCIP_VAR **repvar, SCIP_Bool *negated)
static SCIP_DECL_EVENTEXEC(eventExecAnd)
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
SCIP_RETCODE SCIPhashtableInsert(SCIP_HASHTABLE *hashtable, void *element)
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)
int SCIPexprgraphGetNodeNChildren(SCIP_EXPRGRAPHNODE *node)
SCIP_RETCODE SCIPsortAndCons(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
static SCIP_DECL_CONSENFORELAX(consEnforelaxAnd)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
SCIP_RETCODE SCIPvarGetProbvarBinary(SCIP_VAR **var, SCIP_Bool *negated)
static SCIP_RETCODE mergeMultiples(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, unsigned char **entries, int *nentries, int *nfixedvars, int *nchgcoefs, int *ndelconss)
void SCIPgmlWriteArc(FILE *file, unsigned int source, unsigned int target, const char *label, const char *color)
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
static SCIP_RETCODE analyzeConflictZero(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
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 consdataSwitchWatchedvars(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int watchedvar1, int watchedvar2)
SCIP_Bool SCIPisPositive(SCIP *scip, SCIP_Real val)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
#define SCIP_CALL_FINALLY(x, y)
SCIP_RETCODE SCIPaddConflictBinvar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
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_DECL_HASHKEYEQ(hashKeyEqAndcons)
void SCIPgmlWriteNode(FILE *file, unsigned int id, const char *label, const char *nodetype, const char *fillcolor, const char *bordercolor)
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
static SCIP_DECL_CONSPARSE(consParseAnd)
SCIP_RETCODE SCIPupdateConsFlags(SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1)
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
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)))
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
void SCIPgmlWriteClosing(FILE *file)
static SCIP_RETCODE consdataFixOperandsOne(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **vars, int nvars, SCIP_Bool *cutoff, int *nfixedvars)
static SCIP_RETCODE consdataFreeRows(SCIP *scip, SCIP_CONSDATA *consdata)
#define DEFAULT_PRESOLUSEHASHING
SCIP_RETCODE SCIPgetVarsData(SCIP *scip, SCIP_VAR ***vars, int *nvars, int *nbinvars, int *nintvars, int *nimplvars, int *ncontvars)
int SCIPconsGetPos(SCIP_CONS *cons)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
SCIP_RETCODE SCIPincludeConshdlrAnd(SCIP *scip)
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)
#define CONSHDLR_CHECKPRIORITY
SCIP_RETCODE SCIPcutoffNode(SCIP *scip, SCIP_NODE *node)
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)
static SCIP_DECL_CONSPROP(consPropAnd)
#define SCIP_PRESOLTIMING_EXHAUSTIVE
int SCIPvarGetProbindex(SCIP_VAR *var)
static SCIP_RETCODE consdataPrint(SCIP *scip, SCIP_CONSDATA *consdata, FILE *file)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
static SCIP_RETCODE consdataLinearize(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars, int *nupgdconss)
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
Constraint handler for AND constraints, .
static SCIP_DECL_CONSINITPRE(consInitpreAnd)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define DEFAULT_ENFORCECUTS
static SCIP_RETCODE unlockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
void * SCIPhashmapGetImage(SCIP_HASHMAP *hashmap, void *origin)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_CONSPRINT(consPrintAnd)
#define SCIPfreeBufferArray(scip, ptr)
Constraint handler for the set partitioning / packing / covering constraints .
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPdebugPrintCons(x, y, z)
SCIP_Bool SCIPisTransformed(SCIP *scip)
static SCIP_RETCODE consdataEnsureVarsSize(SCIP *scip, SCIP_CONSDATA *consdata, int num)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
#define SCIP_EVENTTYPE_BOUNDCHANGED
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
SCIP_NODE * SCIPgetRootNode(SCIP *scip)
#define SCIPdebugMsgPrint
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
static SCIP_RETCODE consdataDropWatchedEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos, int filterpos)
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
static SCIP_DECL_CONSEXITSOL(consExitsolAnd)
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
#define DEFAULT_PRESOLPAIRWISE
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)
int SCIPexprgraphGetNodePolynomialNMonomials(SCIP_EXPRGRAPHNODE *node)
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 dualPresolve(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_EVENTHDLR *eventhdlr, unsigned char **entries, int *nentries, SCIP_Bool *cutoff, int *nfixedvars, int *naggrvars, int *nchgcoefs, int *ndelconss, int *nupgdconss, int *naddconss)
SCIP_Bool SCIPisAndConsSorted(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSENFOPS(consEnfopsAnd)
int SCIPexprGetMonomialNFactors(SCIP_EXPRDATA_MONOMIAL *monomial)
SCIP_VAR * SCIPvarGetNegatedVar(SCIP_VAR *var)
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
#define SCIP_EVENTTYPE_LBRELAXED
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
SCIP_EXPROP SCIPexprgraphGetNodeOperator(SCIP_EXPRGRAPHNODE *node)
SCIP_EXPRDATA_MONOMIAL ** SCIPexprgraphGetNodePolynomialMonomials(SCIP_EXPRGRAPHNODE *node)
SCIP_RETCODE SCIPchgVarType(SCIP *scip, SCIP_VAR *var, SCIP_VARTYPE vartype, SCIP_Bool *infeasible)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_VAR * SCIPvarGetProbvar(SCIP_VAR *var)
static SCIP_DECL_CONSFREE(consFreeAnd)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
static SCIP_DECL_CONSPRESOL(consPresolAnd)
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_VAR ** SCIPgetVarsAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPexprgraphGetNodePolynomialConstant(SCIP_EXPRGRAPHNODE *node)
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
#define CONSHDLR_PRESOLTIMING
SCIP_RETCODE SCIPgetBinvarRepresentatives(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **repvars, SCIP_Bool *negated)
static SCIP_RETCODE detectRedundantConstraints(SCIP *scip, BMS_BLKMEM *blkmem, SCIP_CONS **conss, int nconss, int *firstchange, SCIP_Bool *cutoff, int *naggrvars, int *ndelconss)
SCIP_RETCODE SCIPcreateConsAnd(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *resvar, 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)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
#define CONSHDLR_PROP_TIMING
SCIP_VAR * SCIPgetResultantAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE preprocessConstraintPairs(SCIP *scip, SCIP_CONS **conss, int firstchange, int chkind, SCIP_Bool *cutoff, int *naggrvars, int *nbdchgs, int *ndelconss)
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE delCoefPos(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int pos)
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
SCIP_RETCODE SCIPaddVarImplication(SCIP *scip, SCIP_VAR *var, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype, SCIP_Real implbound, SCIP_Bool *infeasible, int *nbdchgs)
static SCIP_DECL_CONSDELETE(consDeleteAnd)
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)
static SCIP_RETCODE checkCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_Bool *violated)
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
struct SCIP_EventData SCIP_EVENTDATA
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPcreateConsSetpart(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)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
SCIP_RETCODE SCIPcreateConsBasicAnd(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *resvar, int nvars, SCIP_VAR **vars)
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
static SCIP_DECL_CONSTRANS(consTransAnd)
static SCIP_RETCODE addRelaxation(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible)
#define SCIP_EVENTTYPE_UBRELAXED
SCIP_RETCODE SCIPexprgraphCreateNodeLinear(BMS_BLKMEM *blkmem, SCIP_EXPRGRAPHNODE **node, int ncoefs, SCIP_Real *coefs, SCIP_Real constant)
#define DEFAULT_LINEARIZE
void SCIPsortPtr(void **ptrarray, SCIP_DECL_SORTPTRCOMP((*ptrcomp)), int len)
SCIP_RETCODE SCIPvarGetAggregatedObj(SCIP_VAR *var, SCIP_Real *aggrobj)
#define SCIPhashTwo(a, b)
#define SCIP_EVENTTYPE_LBTIGHTENED
SCIP_RETCODE SCIPchgAndConsRemovableFlagWhenUpgr(SCIP *scip, SCIP_CONS *cons, SCIP_Bool flag)
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
static SCIP_RETCODE propagateCons(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, int *nfixedvars, int *nupgdconss)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
#define EXPRGRAPHREFORM_PRIORITY
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)))
#define SCIPdebugGetSolVal(scip, var, val)
struct SCIP_ConsData SCIP_CONSDATA
static SCIP_DECL_CONSINITLP(consInitlpAnd)
static SCIP_RETCODE conshdlrdataFree(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata)
static SCIP_DECL_CONSGETVARS(consGetVarsAnd)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata, SCIP_EVENTHDLR *eventhdlr)
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)
#define SCIPallocBufferArray(scip, ptr, num)
public data structures and miscellaneous methods
SCIP_RETCODE SCIPchgAndConsCheckFlagWhenUpgr(SCIP *scip, SCIP_CONS *cons, SCIP_Bool flag)
static SCIP_RETCODE addCoef(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_VAR *var)
int SCIPgetNImplVars(SCIP *scip)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
static SCIP_RETCODE enforceConstraint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_RESULT *result)
#define CONSHDLR_NEEDSCONS
static SCIP_DECL_CONSCOPY(consCopyAnd)
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)
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSDATA **consdata, SCIP_EVENTHDLR *eventhdlr, int nvars, SCIP_VAR **vars, SCIP_VAR *resvar, SCIP_Bool checkwhenupgr, SCIP_Bool notremovablewhenupgr)
int SCIPgetDepth(SCIP *scip)
constraint handler for nonlinear constraints
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
int SCIPvarGetNLocksUp(SCIP_VAR *var)
#define SCIP_DECL_CONSEXITPRE(x)
static SCIP_DECL_HASHGETKEY(hashGetKeyAndcons)
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)
static SCIP_RETCODE lockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyAnd)
#define CONSHDLR_MAXPREROUNDS
SCIP_RETCODE SCIPcreateVar(SCIP *scip, SCIP_VAR **var, const char *name, SCIP_Real lb, SCIP_Real ub, SCIP_Real obj, SCIP_VARTYPE vartype, SCIP_Bool initial, SCIP_Bool removable, SCIP_DECL_VARDELORIG((*vardelorig)), SCIP_DECL_VARTRANS((*vartrans)), SCIP_DECL_VARDELTRANS((*vardeltrans)), SCIP_DECL_VARCOPY((*varcopy)), SCIP_VARDATA *vardata)
#define DEFAULT_UPGRRESULTANT
SCIP_RETCODE SCIPfixVar(SCIP *scip, SCIP_VAR *var, SCIP_Real fixedval, SCIP_Bool *infeasible, SCIP_Bool *fixed)
#define BMScopyMemoryArray(ptr, source, num)
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
#define DEFAULT_DUALPRESOLVING
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, .
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)
SCIP_Real SCIPexprGetMonomialCoef(SCIP_EXPRDATA_MONOMIAL *monomial)
#define CONSHDLR_DELAYPROP
void * SCIPexprgraphGetNodeVar(SCIP_EXPRGRAPH *exprgraph, SCIP_EXPRGRAPHNODE *node)
int SCIPgetNBinVars(SCIP *scip)
SCIP_Bool SCIPinProbing(SCIP *scip)
void SCIPhashtableFree(SCIP_HASHTABLE **hashtable)
static SCIP_DECL_CONSENFOLP(consEnfolpAnd)
int SCIPgetNVars(SCIP *scip)
#define CONSHDLR_EAGERFREQ
#define CONSHDLR_PROPFREQ
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)))
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
SCIP_RETCODE SCIPwriteVarsList(SCIP *scip, FILE *file, SCIP_VAR **vars, int nvars, SCIP_Bool type, char delimiter)
static SCIP_RETCODE analyzeZeroResultant(SCIP *scip, SCIP_CONS *cons, int watchedvar1, int watchedvar2, SCIP_Bool *cutoff, int *nfixedvars)
static SCIP_DECL_EXPRGRAPHNODEREFORM(exprgraphnodeReformAnd)
int SCIPvarGetNLocksDown(SCIP_VAR *var)
static SCIP_RETCODE consdataCatchEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_CONSSEPALP(consSepalpAnd)
SCIP_RETCODE SCIPgetVarCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_VAR *sourcevar, SCIP_VAR **targetvar, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, SCIP_Bool global, SCIP_Bool *success)
SCIP_RETCODE SCIPaddVar(SCIP *scip, SCIP_VAR *var)
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
#define DEFAULT_AGGRLINEARIZATION
static SCIP_RETCODE createRelaxation(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
#define MINGAINPERNMINCOMPARISONS
SCIP_Bool SCIPallowDualReds(SCIP *scip)
#define CONSHDLR_DELAYSEPA
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
static SCIP_RETCODE consdataCatchWatchedEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos, int *filterpos)
void SCIPupdateSolConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
static SCIP_RETCODE consdataDropEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
#define CONSHDLR_SEPAFREQ
SCIP_RETCODE SCIPaggregateVars(SCIP *scip, SCIP_VAR *varx, SCIP_VAR *vary, SCIP_Real scalarx, SCIP_Real scalary, SCIP_Real rhs, SCIP_Bool *infeasible, SCIP_Bool *redundant, SCIP_Bool *aggregated)
SCIP_RETCODE SCIPcaptureVar(SCIP *scip, SCIP_VAR *var)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
int SCIPgetNVarsAnd(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPdoNotAggr(SCIP *scip)
static SCIP_DECL_HASHKEYVAL(hashKeyValAndcons)
SCIP_EXPRGRAPHNODE ** SCIPexprgraphGetNodeChildren(SCIP_EXPRGRAPHNODE *node)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
void SCIPvarsGetProbvar(SCIP_VAR **vars, int nvars)
static void consdataSort(SCIP_CONSDATA *consdata)
static SCIP_DECL_CONSGETNVARS(consGetNVarsAnd)
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
#define SCIPdebugAddSolVal(scip, var, val)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
static SCIP_DECL_CONSRESPROP(consRespropAnd)
constraint handler for pseudoboolean constraints
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_DECL_CONSCHECK(consCheckAnd)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
void SCIPgmlWriteOpening(FILE *file, SCIP_Bool directed)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
#define BMSclearMemoryArray(ptr, num)
struct BMS_BlkMem BMS_BLKMEM
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
#define SCIPcombineTwoInt(a, b)
SCIP_RETCODE SCIPwriteVarName(SCIP *scip, FILE *file, SCIP_VAR *var, SCIP_Bool type)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
static SCIP_RETCODE separateCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *separated, SCIP_Bool *cutoff)
#define CONSHDLR_ENFOPRIORITY
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 applyFixings(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int *nchgcoefs)
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
static SCIP_RETCODE analyzeConflictOne(SCIP *scip, SCIP_CONS *cons, int falsepos)
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)
SCIP_Bool SCIPvarIsNegated(SCIP_VAR *var)
static SCIP_DECL_CONSLOCK(consLockAnd)
#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)