49 #define CONSHDLR_NAME "linking" 50 #define CONSHDLR_DESC "linking constraint x = sum_{i=1}^{n} c_i*y_i, y1+...+yn = 1, x integer, y's binary" 52 #define EVENTHDLR_NAME "linking" 53 #define EVENTHDLR_DESC "event handler for linking constraints" 55 #define CONSHDLR_SEPAPRIORITY 750000 56 #define CONSHDLR_ENFOPRIORITY -2050000 57 #define CONSHDLR_CHECKPRIORITY -750000 58 #define CONSHDLR_SEPAFREQ 1 59 #define CONSHDLR_PROPFREQ 1 60 #define CONSHDLR_EAGERFREQ 100 61 #define CONSHDLR_MAXPREROUNDS -1 62 #define CONSHDLR_DELAYSEPA FALSE 63 #define CONSHDLR_DELAYPROP FALSE 64 #define CONSHDLR_NEEDSCONS TRUE 66 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP 67 #define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_MEDIUM 70 #define HASHSIZE_BINVARSCONS 500 71 #define DEFAULT_LINEARIZE FALSE 91 unsigned int cliqueadded:1;
92 unsigned int sorted:1;
96 struct SCIP_ConshdlrData
123 if( consdata->sorted )
127 SCIPsortIntPtr(consdata->vals, (
void**)consdata->binvars, consdata->nbinvars);
129 consdata->sorted =
TRUE;
144 for( b = 0; b < nbinvars; ++b )
160 assert(scip !=
NULL);
161 assert(conshdlrdata !=
NULL);
162 assert(eventhdlr !=
NULL);
167 (*conshdlrdata)->varmap =
NULL;
170 (*conshdlrdata)->eventhdlr = eventhdlr;
182 assert(conshdlrdata !=
NULL);
183 assert(*conshdlrdata !=
NULL);
186 if( (*conshdlrdata)->varmap !=
NULL )
208 assert(scip !=
NULL);
209 assert(consdata !=
NULL);
211 intvar = consdata->intvar;
212 binvars = consdata->binvars;
213 nbinvars = consdata->nbinvars;
215 assert(intvar !=
NULL);
216 assert(binvars !=
NULL || nbinvars == 0);
233 assert(binvars !=
NULL);
236 for( b = 0; b < nbinvars; ++b )
260 assert(consdata !=
NULL);
261 assert(eventhdlr !=
NULL);
262 assert(0 <= pos && pos < consdata->nbinvars);
263 assert(consdata->binvars !=
NULL);
265 var = consdata->binvars[pos];
274 consdata->nfixedzeros++;
276 consdata->nfixedones++;
292 assert(consdata !=
NULL);
293 assert(eventhdlr !=
NULL);
294 assert(0 <= pos && pos < consdata->nbinvars);
295 assert(consdata->binvars !=
NULL);
297 var = consdata->binvars[pos];
305 consdata->nfixedzeros--;
307 consdata->nfixedones--;
322 assert(consdata !=
NULL);
324 if( consdata->nbinvars <= 1 )
328 for( i = 0; i < consdata->nbinvars; ++i )
346 assert(consdata !=
NULL);
348 if( consdata->nbinvars <= 1 )
352 for( i = 0; i < consdata->nbinvars; ++i )
388 for( b = 0; b < consdata->nbinvars; ++b )
418 assert(scip !=
NULL);
419 assert(consdata !=
NULL);
420 assert(consdata->nbinvars == 0);
421 assert(consdata->binvars ==
NULL);
425 intvar = consdata->intvar;
429 assert(nbinvars > 0);
433 consdata->sizebinvars = nbinvars;
445 consdata->binvars[0] = binvar;
446 consdata->vals[0] = lb;
450 for( b = 0; b < nbinvars; ++b)
460 consdata->binvars[b] = binvar;
461 consdata->vals[b] = lb + b;
465 consdata->nbinvars = nbinvars;
467 assert(consdata->nfixedzeros == 0);
468 assert(consdata->nfixedones == 0);
510 assert(consdata !=
NULL);
511 assert(intvar !=
NULL);
512 assert(binvars !=
NULL || nbinvars == 0);
518 (*consdata)->intvar = intvar;
519 (*consdata)->nbinvars = nbinvars;
520 (*consdata)->sizebinvars = nbinvars;
521 (*consdata)->row1 =
NULL;
522 (*consdata)->row2 =
NULL;
523 (*consdata)->cliqueadded =
FALSE;
526 (*consdata)->sorted =
FALSE;
527 (*consdata)->firstnonfixed = 0;
528 (*consdata)->lastnonfixed = nbinvars - 1;
529 (*consdata)->nfixedzeros = 0;
530 (*consdata)->nfixedones = 0;
534 (*consdata)->binvars =
NULL;
535 (*consdata)->vals =
NULL;
564 for( v = 0; v < nbinvars; ++v )
566 assert((*consdata)->binvars[v] !=
NULL);
584 assert(consdata !=
NULL);
585 assert(*consdata !=
NULL);
586 assert((*consdata)->nbinvars == 0 || (*consdata)->binvars !=
NULL);
589 if( (*consdata)->row1 !=
NULL )
591 assert((*consdata)->row2 !=
NULL);
598 for( v = 0; v < (*consdata)->nbinvars; ++v )
600 assert((*consdata)->binvars[v] !=
NULL);
606 if( (*consdata)->sizebinvars > 0 )
614 assert((*consdata)->nfixedzeros == 0);
615 assert((*consdata)->nfixedones == 0);
637 assert(scip !=
NULL);
648 assert(intvar !=
NULL);
654 assert(intvar !=
NULL);
685 assert(consdata !=
NULL);
687 intvar = consdata->intvar;
747 assert(cons !=
NULL);
750 assert(cutoff !=
NULL);
751 assert(nchgbds !=
NULL);
752 assert(mustcheck !=
NULL);
755 assert(consdata !=
NULL);
760 nbinvars = consdata->nbinvars;
763 assert(nbinvars > 1);
766 if( consdata->nfixedones > 0 || consdata->nfixedzeros >= nbinvars-1 )
769 intvar = consdata->intvar;
770 assert(intvar !=
NULL);
772 binvars = consdata->binvars;
773 vals = consdata->vals;
777 assert(lblocal <= ublocal);
781 for( b = 0; b < consdata->firstnonfixed; ++b )
785 for( b = consdata->lastnonfixed + 1; b < nbinvars; ++b )
789 for( b = consdata->firstnonfixed; b < nbinvars; ++b )
791 if( vals[b] < lblocal )
798 SCIPdebugMsg(scip,
"fix variable <%s> to zero due to the lower bound of the integer variable <%s> [%g,%g]\n",
814 consdata->firstnonfixed++;
819 assert(consdata->firstnonfixed <= consdata->lastnonfixed);
822 for( b = consdata->lastnonfixed; b >= 0; --b )
824 if( vals[b] > ublocal )
831 SCIPdebugMsg(scip,
"fix variable <%s> to zero due to the upper bound of the integer variable <%s> [%g,%g]\n",
847 consdata->lastnonfixed--;
853 if( consdata->firstnonfixed > consdata->lastnonfixed )
859 *mustcheck = (*nchgbds) == 0;
864 if( lblocal == ublocal )
866 if( consdata->firstnonfixed == consdata->lastnonfixed )
870 var = binvars[consdata->firstnonfixed];
872 SCIPdebugMsg(scip,
"fix variable <%s> to one due to the fixed integer variable <%s> [%g,%g]\n",
899 vars = &consdata->binvars[consdata->firstnonfixed];
900 nvars = consdata->lastnonfixed - consdata->firstnonfixed + 1;
929 assert(scip !=
NULL);
930 assert(eventhdlr !=
NULL);
933 assert(consdata !=
NULL);
934 assert(0 <= pos && pos < consdata->nbinvars);
936 var = consdata->binvars[pos];
952 assert(conshdlrdata !=
NULL);
953 assert(conshdlrdata->eventhdlr !=
NULL);
960 if( pos != consdata->nbinvars - 1 )
962 consdata->binvars[pos] = consdata->binvars[consdata->nbinvars-1];
963 consdata->vals[pos] = consdata->vals[consdata->nbinvars-1];
964 consdata->sorted =
FALSE;
967 consdata->nbinvars--;
988 assert(consdata !=
NULL);
989 assert(consdata->sorted);
995 nbinvars = consdata->nbinvars;
997 for( b = nbinvars - 1; b > consdata->lastnonfixed; --b )
1002 for( b = consdata->firstnonfixed - 1; b >= 0; --b )
1007 for( b = consdata->nbinvars - 1; b >= 0; --b )
1016 consdata->firstnonfixed = 0;
1017 consdata->lastnonfixed = consdata->nbinvars - 1;
1042 if( consdata->nfixedones > 1 || consdata->nfixedzeros >= consdata->nbinvars-1 )
1048 assert(consdata->sorted);
1050 intvar = consdata->intvar;
1051 binvars = consdata->binvars;
1052 vals = consdata->vals;
1053 nbinvars = consdata->nbinvars;
1057 for( b = 0; b < consdata->firstnonfixed; ++b )
1061 assert(consdata->firstnonfixed < nbinvars);
1062 assert(consdata->lastnonfixed < nbinvars);
1065 for( b = consdata->firstnonfixed; b < nbinvars; ++b )
1070 consdata->firstnonfixed++;
1081 SCIPdebugMsg(scip,
"conflict at <%s> due to bounds and fixed binvars: [lb,ub] = [%g,%g]; b= %d; coef = %d \n",
1091 for( b = 0; b < consdata->firstnonfixed; ++b )
1109 for( b = consdata->lastnonfixed + 1; b < nbinvars; ++b )
1114 for( b = consdata->lastnonfixed; b >= 0; --b )
1119 consdata->lastnonfixed--;
1129 SCIPdebugMsg(scip,
"conflict at <%s> due to bounds and fixed binvars: [lb,ub] = [%g,%g]; b = %d; coef = %d,\n",
1139 for( b = consdata->lastnonfixed + 1; b < nbinvars; ++b )
1173 assert(cons !=
NULL);
1176 assert(cutoff !=
NULL);
1177 assert(nchgbds !=
NULL);
1178 assert(addcut !=
NULL);
1179 assert(mustcheck !=
NULL);
1182 assert(consdata !=
NULL);
1183 assert(consdata->nbinvars == 0 || consdata->binvars !=
NULL);
1184 assert(0 <= consdata->nfixedzeros && consdata->nfixedzeros <= consdata->nbinvars);
1185 assert(0 <= consdata->nfixedones && consdata->nfixedones <= consdata->nbinvars);
1191 assert(consdata->nbinvars > 1);
1196 if( consdata->nfixedones == 1 )
1202 if( consdata->nfixedzeros < consdata->nbinvars - 1 ||
1213 SCIPdebugMsg(scip,
" -> fixing all other variables to zero due to the set partitioning condition <%s>\n",
1220 vars = consdata->binvars;
1221 nvars = consdata->nbinvars;
1223 fixedonefound =
FALSE;
1226 for( v = 0; v < nvars && consdata->nfixedones == 1 && !(*cutoff); ++v )
1233 assert(!infeasible);
1239 fixedonefound =
TRUE;
1248 assert(consdata->nfixedones >= 1 || fixedonefound);
1264 else if( consdata->nfixedones >= 2 )
1281 vars = consdata->binvars;
1282 nvars = consdata->nbinvars;
1289 for( v = 0; v < nvars && n < 2; ++v )
1305 else if( consdata->nfixedzeros == consdata->nbinvars )
1312 assert(consdata->nfixedones == 0);
1329 vars = consdata->binvars;
1330 nvars = consdata->nbinvars;
1335 for( v = 0; v < nvars; ++v )
1347 else if( consdata->nfixedzeros == consdata->nbinvars - 1 )
1354 assert(consdata->nfixedones == 0);
1364 vars = consdata->binvars;
1365 nvars = consdata->nbinvars;
1366 for( v = 0; v < nvars && !(*cutoff); ++v )
1378 assert(!infeasible);
1387 assert(consdata->nfixedzeros == consdata->nbinvars - 1);
1388 assert(consdata->nfixedones == 1);
1399 *mustcheck = (*nchgbds) == 0;
1401 assert(consdata->nfixedzeros + consdata->nfixedones <= consdata->nbinvars);
1424 assert(scip !=
NULL);
1425 assert(cons !=
NULL);
1430 assert(consdata !=
NULL);
1431 assert(consdata->binvars !=
NULL || consdata->nbinvars == 0);
1434 assert(consdata->nbinvars > 1);
1437 binvars = consdata->binvars;
1438 vals = consdata->vals;
1439 nbinvars = consdata->nbinvars;
1445 for( b = 0; b < nbinvars && setpartsum < setpartsumbound; ++b )
1452 linksum += vals[b] * solval;
1453 setpartsum += solval;
1491 assert(varmap !=
NULL);
1493 for( c = 0; c < nconss; ++c )
1496 assert(consdata !=
NULL);
1498 intvar = consdata->intvar;
1499 assert(intvar !=
NULL);
1507 if( aggrcons !=
NULL )
1510 assert(aggrconsdata !=
NULL);
1516 if(
SCIPisEQ(scip, aggrscalar, 1.0 ) )
1524 offset = consdata->offset;
1525 binvars = consdata->binvars;
1526 aggroffset = aggrconsdata->offset;
1527 aggrbinvars = aggrconsdata->binvars;
1529 nbinvars =
MIN(consdata->nbinvars + offset, aggrconsdata->nbinvars + shift + aggroffset);
1531 for( b =
MAX(offset, aggroffset-shift); b < nbinvars; ++b )
1533 assert(b - offset >= 0);
1534 assert(b + shift - aggroffset >= 0);
1535 assert(b < consdata->nbinvars);
1536 assert(b < aggrconsdata->nbinvars - shift);
1540 &infeasible, &redundant, &aggregated) );
1574 assert( cons !=
NULL);
1578 assert(consdata !=
NULL);
1579 assert(consdata->row1 ==
NULL);
1580 assert(consdata->row2 ==
NULL);
1581 assert(consdata->nbinvars > 1);
1590 assert(consdata->intvar !=
NULL);
1594 assert(consdata->binvars !=
NULL);
1595 for( b = 0; b < consdata->nbinvars; ++b )
1602 assert( consdata->nbinvars > 0 );
1624 assert( cutoff !=
NULL );
1628 assert(consdata !=
NULL);
1631 assert(consdata->nbinvars > 1);
1633 if( consdata->row1 ==
NULL )
1635 assert(consdata->row2 ==
NULL);
1640 assert(consdata->row1 !=
NULL);
1641 assert(consdata->row2 !=
NULL);
1676 assert(cons !=
NULL);
1679 assert(cutoff !=
NULL);
1680 assert(separated !=
NULL);
1681 assert(nchgbds !=
NULL);
1684 assert(consdata !=
NULL);
1687 assert(consdata->nbinvars > 1);
1701 if( mustcheck && !(*cutoff) )
1704 if( sol ==
NULL && consdata->row1 !=
NULL )
1709 assert(consdata->row2 !=
NULL);
1721 feasibility =
MIN(feasibility, tmp);
1728 feasibility =
MIN(feasibility, tmp);
1770 assert(cons !=
NULL);
1773 assert(cutoff !=
NULL);
1774 assert(infeasible !=
NULL);
1775 assert(nchgbds !=
NULL);
1776 assert(solvelp !=
NULL);
1830 assert(conshdlr !=
NULL);
1832 assert(nconss == 0 || conss !=
NULL);
1833 assert(result !=
NULL);
1835 SCIPdebugMsg(scip,
"Enforcing %d linking constraints for %s solution\n", nconss, sol ==
NULL ?
"LP" :
"relaxation");
1842 for( c = 0; c < nusefulconss && !cutoff && nchgbds == 0; ++c )
1848 for( c = nusefulconss; c < nconss && !cutoff && !separated && nchgbds == 0; ++c )
1856 else if( nchgbds > 0 )
1858 else if( separated )
1875 assert(scip !=
NULL);
1876 assert(conshdlr !=
NULL);
1893 assert(conshdlr !=
NULL);
1895 assert(scip !=
NULL);
1899 assert(conshdlrdata !=
NULL);
1916 assert(conshdlrdata !=
NULL);
1919 for( c = 0; c < nconss; ++c )
1922 assert(consdata !=
NULL);
1928 if( consdata->nbinvars <= 1 )
1933 else if( conshdlrdata->linearize )
1951 for( c = 0; c < nconss; ++c )
1954 assert(consdata !=
NULL);
1957 if( consdata->row1 !=
NULL )
1959 assert(consdata->row2 !=
NULL);
1976 assert(conshdlr !=
NULL);
1978 assert(consdata !=
NULL);
1979 assert(*consdata !=
NULL);
1982 assert(conshdlrdata !=
NULL);
1983 assert(conshdlrdata->eventhdlr !=
NULL);
1986 assert(conshdlrdata->varmap !=
NULL);
2010 assert(conshdlr !=
NULL);
2013 assert(sourcecons !=
NULL);
2014 assert(targetcons !=
NULL);
2018 assert(conshdlrdata !=
NULL);
2019 assert(conshdlrdata->eventhdlr !=
NULL);
2022 assert(sourcedata !=
NULL);
2023 assert(sourcedata->row1 ==
NULL);
2024 assert(sourcedata->row2 ==
NULL);
2030 sourcedata->intvar, sourcedata->binvars, sourcedata->vals, sourcedata->nbinvars) );
2040 assert(conshdlrdata->varmap !=
NULL);
2053 *infeasible =
FALSE;
2055 for( c = 0; c < nconss && !(*infeasible); ++c )
2060 assert(consdata !=
NULL);
2062 if( consdata->nbinvars <= 1 )
2081 assert(conshdlr !=
NULL);
2083 assert(nconss == 0 || conss !=
NULL);
2084 assert(result !=
NULL);
2086 SCIPdebugMsg(scip,
"separating %d/%d linking constraints\n", nusefulconss, nconss);
2093 for( c = 0; c < nusefulconss && !cutoff; ++c )
2101 else if( nchgbds > 0 )
2103 else if( separated )
2121 assert(conshdlr !=
NULL);
2123 assert(nconss == 0 || conss !=
NULL);
2124 assert(result !=
NULL);
2133 for( c = 0; c < nusefulconss && !cutoff; ++c )
2141 else if( nchgbds > 0 )
2143 else if( separated )
2182 assert(conshdlr !=
NULL);
2184 assert(nconss == 0 || conss !=
NULL);
2185 assert(result !=
NULL);
2201 for( c = 0; c < nconss && !cutoff && !solvelp; ++c )
2208 else if( nchgbds > 0 )
2212 else if( infeasible )
2229 assert(conshdlr !=
NULL);
2231 assert(nconss == 0 || conss !=
NULL);
2232 assert(result !=
NULL);
2237 for( c = 0; c < nconss && (*result ==
SCIP_FEASIBLE || completely); ++c )
2241 assert(consdata !=
NULL);
2243 if( consdata->nbinvars > 1 && (checklprows || consdata->row1 ==
NULL || !
SCIProwIsInLP(consdata->row1)) )
2258 for( b = 0; b < consdata->nbinvars; ++b )
2260 assert(consdata->binvars[b] !=
NULL);
2269 for( b = 0; b < consdata->nbinvars; ++b )
2315 assert(conshdlr !=
NULL);
2317 assert(nconss == 0 || conss !=
NULL);
2318 assert(result !=
NULL);
2328 for( c = 0; c < nusefulconss && !cutoff; ++c )
2337 else if( nchgbds > 0 )
2364 assert(conshdlr !=
NULL);
2366 assert(scip !=
NULL);
2367 assert(result !=
NULL);
2369 SCIPdebugMsg(scip,
"presolve %d linking constraints\n", nconss);
2373 oldnchgbds = *nchgbds;
2374 oldnaggrvars = *naggrvars;
2375 oldnfixedvars = *nfixedvars;
2376 oldndelconss = *ndelconss;
2380 assert(conshdlrdata !=
NULL);
2383 firstchange = INT_MAX;
2384 firstclique = INT_MAX;
2396 assert(cons !=
NULL);
2402 assert(consdata !=
NULL);
2408 assert(consdata->nbinvars > 1);
2411 if( consdata->nfixedones >= 2 )
2421 if( consdata->nfixedones == 1 )
2433 for( v = 0; v < consdata->nbinvars; ++v )
2435 var = consdata->binvars[v];
2436 assert(var !=
NULL);
2481 if( consdata->nfixedzeros == consdata->nbinvars )
2486 assert(consdata->nfixedones == 0);
2493 if( consdata->nfixedzeros == consdata->nbinvars - 1 )
2505 assert(consdata->nfixedones == 0);
2513 for( v = 0; v < consdata->nbinvars && !found; ++v )
2515 var = consdata->binvars[v];
2551 if( consdata->nfixedzeros == consdata->nbinvars - 2 )
2567 for( v = 0; v < consdata->nbinvars && var2 ==
NULL; ++v )
2569 var = consdata->binvars[v];
2578 assert(var1 !=
NULL && var2 !=
NULL);
2588 SCIPdebugMsg(scip,
"linking constraint <%s>: infeasible aggregation <%s> + <%s> == 1\n",
2613 if( firstchange == INT_MAX )
2617 if( !consdata->cliqueadded && consdata->nbinvars >= 2 )
2619 if( firstclique == INT_MAX )
2626 for( c = firstclique; c < lastclique && !
SCIPisStopped(scip); ++c )
2634 assert(cons !=
NULL);
2641 assert(consdata !=
NULL);
2643 if( !consdata->cliqueadded && consdata->nbinvars >= 3 )
2649 *nchgbds += ncliquebdchgs;
2657 consdata->cliqueadded =
TRUE;
2663 assert(conshdlrdata->varmap !=
NULL);
2669 else if( oldndelconss < *ndelconss || oldnfixedvars < *nfixedvars || oldnchgbds < *nchgbds || oldnaggrvars < *naggrvars)
2688 assert(consdata !=
NULL);
2690 intvar = consdata->intvar;
2691 assert( intvar !=
NULL);
2695 if( inferinfo == -1 )
2709 for( v = 0; v < consdata->nbinvars; ++v )
2717 assert(v < consdata->nbinvars);
2725 for( v = 0; v < consdata->nbinvars; ++v )
2727 if( consdata->binvars[v] != infervar )
2736 else if( inferinfo == -2 )
2749 else if( inferinfo == -3 )
2761 else if( inferinfo == -4 )
2770 assert(infervar == intvar);
2773 binvars = consdata->binvars;
2774 nbinvars = consdata->nbinvars;
2775 vals = consdata->vals;
2780 for( b = 0; b < nbinvars; ++b )
2789 else if( inferinfo == -5 )
2799 assert(infervar == intvar);
2802 binvars = consdata->binvars;
2803 nbinvars = consdata->nbinvars;
2804 vals = consdata->vals;
2810 for( b = nbinvars - 1; b >= 0; --b )
2819 else if( inferinfo == -6 )
2837 assert(infervar == intvar);
2838 assert(inferinfo >= 0);
2839 assert(inferinfo < consdata->nbinvars);
2860 assert(consdata !=
NULL);
2866 for( b = 0; b < consdata->nbinvars; ++b )
2883 assert(conshdlrdata !=
NULL);
2886 assert(consdata !=
NULL);
2888 if( consdata->nbinvars <= 1 )
2893 else if( conshdlrdata->linearize )
2906 assert(scip !=
NULL);
2907 assert(conshdlr !=
NULL);
2908 assert(cons !=
NULL);
2924 const char* consname;
2938 assert(sourceconsdata !=
NULL);
2941 nbinvars = sourceconsdata->nbinvars;
2942 intvar = sourceconsdata->intvar;
2957 for( v = 0; v < nbinvars && *valid; ++v )
2959 assert(binvars !=
NULL);
2961 assert(!(*valid) || binvars[v] !=
NULL);
2968 assert(!(*valid) || intvar !=
NULL);
2980 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
3004 assert(scip !=
NULL);
3005 assert(success !=
NULL);
3006 assert(str !=
NULL);
3007 assert(name !=
NULL);
3008 assert(cons !=
NULL);
3015 if( intvar ==
NULL )
3029 while( *str !=
'=' )
3036 while( isspace((
int)*str) )
3040 if( strncmp(str,
"no binary variables yet", 24) != 0 )
3051 if( *success && requsize > varssize )
3054 varssize = requsize;
3060 assert(!*success || requsize <= varssize);
3067 for( v = 0; v < nbinvars; ++v )
3084 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
3100 assert(consdata !=
NULL);
3102 if( varssize < consdata->nbinvars + 1)
3106 assert(vars !=
NULL);
3109 vars[consdata->nbinvars] = consdata->intvar;
3123 assert(consdata !=
NULL);
3125 (*nvars) = consdata->nbinvars + 1;
3142 assert(eventhdlr !=
NULL);
3143 assert(eventdata !=
NULL);
3145 assert(event !=
NULL);
3148 assert(consdata !=
NULL);
3154 consdata->nfixedones++;
3157 consdata->nfixedones--;
3158 consdata->firstnonfixed = 0;
3159 consdata->lastnonfixed = consdata->nbinvars - 1;
3162 consdata->nfixedzeros++;
3165 consdata->firstnonfixed = 0;
3166 consdata->lastnonfixed = consdata->nbinvars - 1;
3167 consdata->nfixedzeros--;
3173 assert(0 <= consdata->nfixedzeros && consdata->nfixedzeros <= consdata->nbinvars);
3174 assert(0 <= consdata->nfixedones && consdata->nfixedones <= consdata->nbinvars);
3197 eventExecBinvar,
NULL) );
3205 consEnfolpLinking, consEnfopsLinking, consCheckLinking, consLockLinking,
3208 assert(conshdlr !=
NULL);
3236 "constraints/" CONSHDLR_NAME "/linearize",
"this constraint will not propagate or separate, linear and setppc are used?",
3283 assert(scip !=
NULL);
3289 if( conshdlr ==
NULL )
3295 SCIPdebugMsg(scip,
"create linking constraint for variable <%s> with %d binary variable (SCIP stage %d)\n",
3300 assert(conshdlrdata !=
NULL);
3302 if( conshdlrdata->varmap ==
NULL )
3306 assert(conshdlrdata->varmap !=
NULL);
3315 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
3342 assert(scip !=
NULL);
3360 assert(conshdlr !=
NULL);
3363 assert(conshdlrdata !=
NULL);
3378 assert(conshdlr !=
NULL);
3381 assert(conshdlrdata !=
NULL);
3383 if( conshdlrdata->varmap !=
NULL )
3405 assert(consdata !=
NULL);
3407 return consdata->intvar;
3429 assert(consdata !=
NULL);
3431 if( consdata->binvars ==
NULL )
3437 assert(conshdlr !=
NULL);
3440 assert(conshdlrdata !=
NULL);
3445 assert(consdata->binvars !=
NULL);
3447 if( binvars !=
NULL )
3448 (*binvars) = consdata->binvars;
3449 if( nbinvars !=
NULL )
3450 (*nbinvars) = consdata->nbinvars;
3471 assert(consdata !=
NULL);
3473 return consdata->nbinvars;
3492 assert(consdata !=
NULL);
3493 assert(consdata->sorted);
3495 return consdata->vals;
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)
SCIP_Bool SCIPisFeasZero(SCIP *scip, SCIP_Real val)
SCIP_RETCODE SCIPincConsAge(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPincludeConshdlrLinking(SCIP *scip)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
SCIP_Bool SCIPinRepropagation(SCIP *scip)
SCIP_Real SCIPfeastol(SCIP *scip)
SCIP_Bool SCIPconsIsEnabled(SCIP_CONS *cons)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
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_STAGE SCIPgetStage(SCIP *scip)
#define CONSHDLR_DELAYPROP
static SCIP_DECL_EVENTEXEC(eventExecBinvar)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
static SCIP_RETCODE consFixInteger(SCIP *scip, SCIP_CONS *cons, int pos, SCIP_Bool *cutoff)
static SCIP_DECL_CONSTRANS(consTransLinking)
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
static SCIP_RETCODE consdataPrint(SCIP *scip, SCIP_CONSDATA *consdata, FILE *file)
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)
#define CONSHDLR_ENFOPRIORITY
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
static SCIP_RETCODE removeFixedBinvars(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENFORELAX((*consenforelax)))
SCIP_RETCODE SCIPresetConsAge(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
#define DEFAULT_LINEARIZE
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
static SCIP_DECL_CONSENFORELAX(consEnforelaxLinking)
SCIP_RETCODE SCIPaddConflictBinvar(SCIP *scip, SCIP_VAR *var)
static SCIP_DECL_CONSPRINT(consPrintLinking)
int * SCIPgetValsLinking(SCIP *scip, SCIP_CONS *cons)
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)
SCIP_RETCODE SCIPgetTransformedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **transvar)
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)
static SCIP_RETCODE analyzeConflict(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *intvar, SCIP_VAR *binvar, SCIP_Bool lbintvar, SCIP_Bool ubintvar)
SCIP_RETCODE SCIPsetConshdlrInitpre(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITPRE((*consinitpre)))
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define CONSHDLR_EAGERFREQ
#define CONSHDLR_NEEDSCONS
static SCIP_RETCODE createRows(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPhashmapCreate(SCIP_HASHMAP **hashmap, BMS_BLKMEM *blkmem, int mapsize)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPincludeConshdlrBasic(SCIP *scip, SCIP_CONSHDLR **conshdlrptr, const char *name, const char *desc, int enfopriority, int chckpriority, int eagerfreq, SCIP_Bool needscons, SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_CONSHDLRDATA *conshdlrdata)
static SCIP_DECL_CONSSEPASOL(consSepasolLinking)
int SCIPsnprintf(char *t, int len, const char *s,...)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPaddConflictUb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
SCIP_Bool SCIPexistsConsLinking(SCIP *scip, SCIP_VAR *intvar)
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
SCIP_Real SCIPvarGetAggrScalar(SCIP_VAR *var)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
static SCIP_Bool checkCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
#define SCIPfreeBlockMemory(scip, ptr)
#define CONSHDLR_PROP_TIMING
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)
#define SCIPfreeBufferArray(scip, ptr)
static SCIP_RETCODE dropAllEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
Constraint handler for the set partitioning / packing / covering constraints .
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Bool SCIPisTransformed(SCIP *scip)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
#define SCIP_EVENTTYPE_BOUNDCHANGED
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
int SCIPgetNBinvarsLinking(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_CONSDATA **consdata, SCIP_VAR *intvar, SCIP_VAR **binvars, int *vals, int nbinvars)
static SCIP_RETCODE separateCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *cutoff, SCIP_Bool *separated, int *nchgbds)
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
static SCIP_DECL_CONSINITLP(consInitlpLinking)
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddCoefLinear(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var, SCIP_Real val)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
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)
SCIP_RETCODE SCIPparseVarsLinearsum(SCIP *scip, const char *str, SCIP_VAR **vars, SCIP_Real *vals, int *nvars, int varssize, int *requiredsize, char **endptr, SCIP_Bool *success)
SCIP_RETCODE SCIPaddConflictLb(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx)
static void * getHashmapKey(SCIP_VAR *var)
static SCIP_RETCODE addCuts(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *cutoff)
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
SCIP_Bool SCIPhashmapExists(SCIP_HASHMAP *hashmap, void *origin)
#define SCIP_EVENTTYPE_LBRELAXED
void SCIPsortIntPtr(int *intarray, void **ptrarray, int len)
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
SCIP_RETCODE SCIPenableCons(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)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
static SCIP_DECL_CONSENFOLP(consEnfolpLinking)
static SCIP_DECL_CONSGETVARS(consGetVarsLinking)
static SCIP_RETCODE lockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR **binvars, int nbinvars)
static SCIP_DECL_CONSLOCK(consLockLinking)
SCIP_VAR * SCIPgetIntvarLinking(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
#define CONSHDLR_DELAYSEPA
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)
static SCIP_DECL_CONSPARSE(consParseLinking)
static SCIP_RETCODE tightenedIntvar(SCIP *scip, SCIP_CONS *cons, SCIP_CONSDATA *consdata, SCIP_Bool *cutoff, int *nchgbds)
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyLinking)
#define SCIPfreeBufferArrayNull(scip, ptr)
BMS_BLKMEM * SCIPblkmem(SCIP *scip)
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_RETCODE SCIPmarkDoNotMultaggrVar(SCIP *scip, SCIP_VAR *var)
SCIP_Real SCIPvarGetAggrConstant(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)))
void SCIPhashmapFree(SCIP_HASHMAP **hashmap)
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
#define CONSHDLR_PROPFREQ
#define SCIP_EVENTTYPE_UBRELAXED
#define SCIP_EVENTTYPE_LBTIGHTENED
static SCIP_RETCODE consdataLinearize(SCIP *scip, SCIP_CONS *cons, SCIP_CONSDATA *consdata)
static SCIP_RETCODE catchEvent(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
SCIP_RETCODE SCIPaddCut(SCIP *scip, SCIP_SOL *sol, SCIP_ROW *cut, SCIP_Bool forcecut, SCIP_Bool *infeasible)
struct SCIP_ConsData SCIP_CONSDATA
SCIP_RETCODE SCIPdisableCons(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE catchAllEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
#define HASHSIZE_BINVARSCONS
SCIP_Bool SCIPhasCurrentNodeLP(SCIP *scip)
static SCIP_DECL_CONSRESPROP(consRespropLinking)
static SCIP_DECL_CONSDELETE(consDeleteLinking)
static SCIP_DECL_CONSINITPRE(consInitpreLinking)
constraint handler for linking binary variables to an integer variable
#define SCIPallocBufferArray(scip, ptr, num)
static SCIP_DECL_CONSPRESOL(consPresolLinking)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
static SCIP_DECL_CONSCHECK(consCheckLinking)
static SCIP_RETCODE processIntegerBoundChg(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nchgbds, SCIP_Bool *mustcheck)
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)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
static SCIP_DECL_CONSPROP(consPropLinking)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
static SCIP_DECL_CONSFREE(consFreeLinking)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_VAR * SCIPvarGetAggrVar(SCIP_VAR *var)
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)
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)
static SCIP_DECL_CONSENFOPS(consEnfopsLinking)
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_Bool SCIPisInfinity(SCIP *scip, SCIP_Real val)
int SCIPconvertRealToInt(SCIP *scip, SCIP_Real real)
SCIP_RETCODE SCIPinferVarLbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPsetConshdlrEnable(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSENABLE((*consenable)))
static SCIP_RETCODE aggregateVariables(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nfixedvars, int *naggrvars, int *ndelconss)
SCIP_Bool SCIPinProbing(SCIP *scip)
#define CONSHDLR_CHECKPRIORITY
static void consdataSort(SCIP_CONSDATA *consdata)
SCIP_RETCODE SCIPwriteVarsLinearsum(SCIP *scip, FILE *file, SCIP_VAR **vars, SCIP_Real *vals, int nvars, SCIP_Bool type)
static SCIP_DECL_CONSGETNVARS(consGetNVarsLinking)
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 SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
static SCIP_RETCODE delCoefPos(SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_CONS *cons, int pos)
SCIP_RETCODE SCIPhashmapRemove(SCIP_HASHMAP *hashmap, void *origin)
SCIP_RETCODE SCIPcreateConsLinking(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *intvar, SCIP_VAR **binvars, int *vals, int nbinvars, 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 SCIPisIntegral(SCIP *scip, SCIP_Real val)
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)
static SCIP_DECL_CONSENABLE(consEnableLinking)
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
SCIP_RETCODE SCIPinferVarUbCons(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_CONS *infercons, int inferinfo, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPgetBinvarsLinking(SCIP *scip, SCIP_CONS *cons, SCIP_VAR ***binvars, int *nbinvars)
static SCIP_DECL_CONSEXITSOL(consExitsolLinking)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
static SCIP_RETCODE processBinvarFixings(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, int *nchgbds, SCIP_Bool *addcut, SCIP_Bool *mustcheck)
SCIP_Real SCIPgetRowLPFeasibility(SCIP *scip, SCIP_ROW *row)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
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)))
static SCIP_RETCODE conshdlrdataCreate(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr)
#define CONSHDLR_PRESOLTIMING
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
static SCIP_DECL_CONSSEPALP(consSepalpLinking)
#define CONSHDLR_SEPAFREQ
int SCIPvarGetIndex(SCIP_VAR *var)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
static SCIP_DECL_CONSCOPY(consCopyLinking)
SCIP_CONS * SCIPgetConsLinking(SCIP *scip, SCIP_VAR *intvar)
SCIP_RETCODE SCIPhashmapInsert(SCIP_HASHMAP *hashmap, void *origin, void *image)
static SCIP_RETCODE enforcePseudo(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff, SCIP_Bool *infeasible, int *nchgbds, SCIP_Bool *solvelp)
static SCIP_RETCODE enforceConstraint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, int nusefulconss, SCIP_SOL *sol, SCIP_RESULT *result)
SCIP_RETCODE SCIPsetConshdlrExitsol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSEXITSOL((*consexitsol)))
SCIP_RETCODE SCIPwriteVarName(SCIP *scip, FILE *file, SCIP_VAR *var, SCIP_Bool type)
#define CONSHDLR_SEPAPRIORITY
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_RETCODE SCIPcreateConsBasicLinking(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *intvar, SCIP_VAR **binvars, int *vals, int nbinvars)
SCIP_RETCODE SCIPinferBinvarCons(SCIP *scip, SCIP_VAR *var, SCIP_Bool fixedval, SCIP_CONS *infercons, int inferinfo, SCIP_Bool *infeasible, SCIP_Bool *tightened)
#define CONSHDLR_MAXPREROUNDS
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)
static SCIP_RETCODE dropEvent(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos)
#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)
static SCIP_RETCODE conshdlrdataFree(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata)
static SCIP_RETCODE consdataCreateBinvars(SCIP *scip, SCIP_CONS *cons, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool linearize)