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;
442 FALSE,
TRUE, NULL, NULL, NULL, NULL, NULL) );
445 consdata->binvars[0] = binvar;
446 consdata->vals[0] = lb;
450 for( b = 0; b < nbinvars; ++b)
456 TRUE,
TRUE, NULL, NULL, NULL, NULL, NULL) );
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);
1427 assert(scip != NULL);
1428 assert(cons != NULL);
1433 assert(consdata != NULL);
1434 assert(consdata->binvars != NULL || consdata->nbinvars == 0);
1437 assert(consdata->nbinvars > 1);
1440 binvars = consdata->binvars;
1441 vals = consdata->vals;
1442 nbinvars = consdata->nbinvars;
1448 for( b = 0; b < nbinvars && setpartsum < setpartsumbound; ++b )
1455 linksum += vals[b] * solval;
1456 setpartsum += solval;
1460 intvarval = consdata->intvar;
1467 absviol =
REALABS(setpartsum - 1.0);
1507 assert(varmap != NULL);
1509 for( c = 0; c < nconss; ++c )
1512 assert(consdata != NULL);
1514 intvar = consdata->intvar;
1515 assert(intvar != NULL);
1523 if( aggrcons != NULL )
1526 assert(aggrconsdata != NULL);
1532 if(
SCIPisEQ(scip, aggrscalar, 1.0 ) )
1540 offset = consdata->offset;
1541 binvars = consdata->binvars;
1542 aggroffset = aggrconsdata->offset;
1543 aggrbinvars = aggrconsdata->binvars;
1545 nbinvars = MIN(consdata->nbinvars + offset, aggrconsdata->nbinvars + shift + aggroffset);
1547 for( b =
MAX(offset, aggroffset-shift); b < nbinvars; ++b )
1549 assert(b - offset >= 0);
1550 assert(b + shift - aggroffset >= 0);
1551 assert(b < consdata->nbinvars);
1552 assert(b < aggrconsdata->nbinvars - shift);
1556 &infeasible, &redundant, &aggregated) );
1590 assert( cons != NULL);
1594 assert(consdata != NULL);
1595 assert(consdata->row1 == NULL);
1596 assert(consdata->row2 == NULL);
1597 assert(consdata->nbinvars > 1);
1606 assert(consdata->intvar != NULL);
1610 assert(consdata->binvars != NULL);
1611 for( b = 0; b < consdata->nbinvars; ++b )
1618 assert( consdata->nbinvars > 0 );
1639 assert( cutoff != NULL );
1643 assert(consdata != NULL);
1646 assert(consdata->nbinvars > 1);
1648 if( consdata->row1 == NULL )
1650 assert(consdata->row2 == NULL);
1655 assert(consdata->row1 != NULL);
1656 assert(consdata->row2 != NULL);
1691 assert(cons != NULL);
1694 assert(cutoff != NULL);
1695 assert(separated != NULL);
1696 assert(nchgbds != NULL);
1699 assert(consdata != NULL);
1702 assert(consdata->nbinvars > 1);
1716 if( mustcheck && !(*cutoff) )
1719 if( sol == NULL && consdata->row1 != NULL )
1724 assert(consdata->row2 != NULL);
1736 feasibility = MIN(feasibility, tmp);
1743 feasibility = MIN(feasibility, tmp);
1785 assert(cons != NULL);
1788 assert(cutoff != NULL);
1789 assert(infeasible != NULL);
1790 assert(nchgbds != NULL);
1791 assert(solvelp != NULL);
1845 assert(conshdlr != NULL);
1847 assert(nconss == 0 || conss != NULL);
1848 assert(result != NULL);
1850 SCIPdebugMsg(scip,
"Enforcing %d linking constraints for %s solution\n", nconss, sol == NULL ?
"LP" :
"relaxation");
1857 for( c = 0; c < nusefulconss && !cutoff && nchgbds == 0; ++c )
1863 for( c = nusefulconss; c < nconss && !cutoff && !separated && nchgbds == 0; ++c )
1871 else if( nchgbds > 0 )
1873 else if( separated )
1890 assert(scip != NULL);
1891 assert(conshdlr != NULL);
1908 assert(conshdlr != NULL);
1910 assert(scip != NULL);
1914 assert(conshdlrdata != NULL);
1931 assert(conshdlrdata != NULL);
1934 for( c = 0; c < nconss; ++c )
1937 assert(consdata != NULL);
1943 if( consdata->nbinvars <= 1 )
1948 else if( conshdlrdata->linearize )
1966 for( c = 0; c < nconss; ++c )
1969 assert(consdata != NULL);
1972 if( consdata->row1 != NULL )
1974 assert(consdata->row2 != NULL);
1991 assert(conshdlr != NULL);
1993 assert(consdata != NULL);
1994 assert(*consdata != NULL);
1997 assert(conshdlrdata != NULL);
1998 assert(conshdlrdata->eventhdlr != NULL);
2001 assert(conshdlrdata->varmap != NULL);
2025 assert(conshdlr != NULL);
2028 assert(sourcecons != NULL);
2029 assert(targetcons != NULL);
2033 assert(conshdlrdata != NULL);
2034 assert(conshdlrdata->eventhdlr != NULL);
2037 assert(sourcedata != NULL);
2038 assert(sourcedata->row1 == NULL);
2039 assert(sourcedata->row2 == NULL);
2045 sourcedata->intvar, sourcedata->binvars, sourcedata->vals, sourcedata->nbinvars) );
2055 assert(conshdlrdata->varmap != NULL);
2068 *infeasible =
FALSE;
2070 for( c = 0; c < nconss && !(*infeasible); ++c )
2075 assert(consdata != NULL);
2077 if( consdata->nbinvars <= 1 )
2096 assert(conshdlr != NULL);
2098 assert(nconss == 0 || conss != NULL);
2099 assert(result != NULL);
2101 SCIPdebugMsg(scip,
"separating %d/%d linking constraints\n", nusefulconss, nconss);
2108 for( c = 0; c < nusefulconss && !cutoff; ++c )
2116 else if( nchgbds > 0 )
2118 else if( separated )
2136 assert(conshdlr != NULL);
2138 assert(nconss == 0 || conss != NULL);
2139 assert(result != NULL);
2148 for( c = 0; c < nusefulconss && !cutoff; ++c )
2156 else if( nchgbds > 0 )
2158 else if( separated )
2197 assert(conshdlr != NULL);
2199 assert(nconss == 0 || conss != NULL);
2200 assert(result != NULL);
2216 for( c = 0; c < nconss && !cutoff && !solvelp; ++c )
2223 else if( nchgbds > 0 )
2227 else if( infeasible )
2244 assert(conshdlr != NULL);
2246 assert(nconss == 0 || conss != NULL);
2247 assert(result != NULL);
2252 for( c = 0; c < nconss && (*result ==
SCIP_FEASIBLE || completely); ++c )
2256 assert(consdata != NULL);
2258 if( consdata->nbinvars > 1 && (checklprows || consdata->row1 == NULL || !
SCIProwIsInLP(consdata->row1)) )
2273 for( b = 0; b < consdata->nbinvars; ++b )
2275 assert(consdata->binvars[b] != NULL);
2284 for( b = 0; b < consdata->nbinvars; ++b )
2293 SCIPinfoMessage(scip, NULL,
"violation: more than one binary variable is set to one");
2303 SCIPinfoMessage(scip, NULL,
"violation: none of the binary variables is set to one");
2308 SCIPinfoMessage(scip, NULL,
"violation: <%s> = <%g> and <%s> is one\n",
2330 assert(conshdlr != NULL);
2332 assert(nconss == 0 || conss != NULL);
2333 assert(result != NULL);
2343 for( c = 0; c < nusefulconss && !cutoff; ++c )
2352 else if( nchgbds > 0 )
2379 assert(conshdlr != NULL);
2381 assert(scip != NULL);
2382 assert(result != NULL);
2384 SCIPdebugMsg(scip,
"presolve %d linking constraints\n", nconss);
2388 oldnchgbds = *nchgbds;
2389 oldnaggrvars = *naggrvars;
2390 oldnfixedvars = *nfixedvars;
2391 oldndelconss = *ndelconss;
2395 assert(conshdlrdata != NULL);
2398 firstchange = INT_MAX;
2399 firstclique = INT_MAX;
2411 assert(cons != NULL);
2417 assert(consdata != NULL);
2423 assert(consdata->nbinvars > 1);
2426 if( consdata->nfixedones >= 2 )
2436 if( consdata->nfixedones == 1 )
2448 for( v = 0; v < consdata->nbinvars; ++v )
2450 var = consdata->binvars[v];
2451 assert(var != NULL);
2496 if( consdata->nfixedzeros == consdata->nbinvars )
2501 assert(consdata->nfixedones == 0);
2508 if( consdata->nfixedzeros == consdata->nbinvars - 1 )
2520 assert(consdata->nfixedones == 0);
2528 for( v = 0; v < consdata->nbinvars && !found; ++v )
2530 var = consdata->binvars[v];
2566 if( consdata->nfixedzeros == consdata->nbinvars - 2 )
2582 for( v = 0; v < consdata->nbinvars && var2 == NULL; ++v )
2584 var = consdata->binvars[v];
2593 assert(var1 != NULL && var2 != NULL);
2603 SCIPdebugMsg(scip,
"linking constraint <%s>: infeasible aggregation <%s> + <%s> == 1\n",
2628 if( firstchange == INT_MAX )
2632 if( !consdata->cliqueadded && consdata->nbinvars >= 2 )
2634 if( firstclique == INT_MAX )
2641 for( c = firstclique; c < lastclique && !
SCIPisStopped(scip); ++c )
2649 assert(cons != NULL);
2656 assert(consdata != NULL);
2658 if( !consdata->cliqueadded && consdata->nbinvars >= 3 )
2664 *nchgbds += ncliquebdchgs;
2672 consdata->cliqueadded =
TRUE;
2678 assert(conshdlrdata->varmap != NULL);
2684 else if( oldndelconss < *ndelconss || oldnfixedvars < *nfixedvars || oldnchgbds < *nchgbds || oldnaggrvars < *naggrvars)
2703 assert(consdata != NULL);
2705 intvar = consdata->intvar;
2706 assert( intvar != NULL);
2710 if( inferinfo == -1 )
2724 for( v = 0; v < consdata->nbinvars; ++v )
2732 assert(v < consdata->nbinvars);
2740 for( v = 0; v < consdata->nbinvars; ++v )
2742 if( consdata->binvars[v] != infervar )
2751 else if( inferinfo == -2 )
2764 else if( inferinfo == -3 )
2776 else if( inferinfo == -4 )
2785 assert(infervar == intvar);
2788 binvars = consdata->binvars;
2789 nbinvars = consdata->nbinvars;
2790 vals = consdata->vals;
2795 for( b = 0; b < nbinvars; ++b )
2804 else if( inferinfo == -5 )
2814 assert(infervar == intvar);
2817 binvars = consdata->binvars;
2818 nbinvars = consdata->nbinvars;
2819 vals = consdata->vals;
2825 for( b = nbinvars - 1; b >= 0; --b )
2834 else if( inferinfo == -6 )
2852 assert(infervar == intvar);
2853 assert(inferinfo >= 0);
2854 assert(inferinfo < consdata->nbinvars);
2875 assert(consdata != NULL);
2881 for( b = 0; b < consdata->nbinvars; ++b )
2898 assert(conshdlrdata != NULL);
2901 assert(consdata != NULL);
2903 if( consdata->nbinvars <= 1 )
2908 else if( conshdlrdata->linearize )
2921 assert(scip != NULL);
2922 assert(conshdlr != NULL);
2923 assert(cons != NULL);
2939 const char* consname;
2953 assert(sourceconsdata != NULL);
2956 nbinvars = sourceconsdata->nbinvars;
2957 intvar = sourceconsdata->intvar;
2972 for( v = 0; v < nbinvars && *valid; ++v )
2974 assert(binvars != NULL);
2976 assert(!(*valid) || binvars[v] != NULL);
2983 assert(!(*valid) || intvar != NULL);
2995 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
3019 assert(scip != NULL);
3020 assert(success != NULL);
3021 assert(str != NULL);
3022 assert(name != NULL);
3023 assert(cons != NULL);
3030 if( intvar == NULL )
3044 while( *str !=
'=' )
3051 while( isspace((
int)*str) )
3055 if( strncmp(str,
"no binary variables yet", 24) != 0 )
3066 if( *success && requsize > varssize )
3069 varssize = requsize;
3075 assert(!*success || requsize <= varssize);
3082 for( v = 0; v < nbinvars; ++v )
3099 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
3115 assert(consdata != NULL);
3117 if( varssize < consdata->nbinvars + 1)
3121 assert(vars != NULL);
3124 vars[consdata->nbinvars] = consdata->intvar;
3138 assert(consdata != NULL);
3140 (*nvars) = consdata->nbinvars + 1;
3157 assert(eventhdlr != NULL);
3158 assert(eventdata != NULL);
3160 assert(event != NULL);
3163 assert(consdata != NULL);
3169 consdata->nfixedones++;
3172 consdata->nfixedones--;
3173 consdata->firstnonfixed = 0;
3174 consdata->lastnonfixed = consdata->nbinvars - 1;
3177 consdata->nfixedzeros++;
3180 consdata->firstnonfixed = 0;
3181 consdata->lastnonfixed = consdata->nbinvars - 1;
3182 consdata->nfixedzeros--;
3188 assert(0 <= consdata->nfixedzeros && consdata->nfixedzeros <= consdata->nbinvars);
3189 assert(0 <= consdata->nfixedones && consdata->nfixedones <= consdata->nbinvars);
3212 eventExecBinvar, NULL) );
3220 consEnfolpLinking, consEnfopsLinking, consCheckLinking, consLockLinking,
3223 assert(conshdlr != NULL);
3251 "constraints/" CONSHDLR_NAME "/linearize",
"this constraint will not propagate or separate, linear and setppc are used?",
3298 assert(scip != NULL);
3304 if( conshdlr == NULL )
3310 SCIPdebugMsg(scip,
"create linking constraint for variable <%s> with %d binary variable (SCIP stage %d)\n",
3315 assert(conshdlrdata != NULL);
3317 if( conshdlrdata->varmap == NULL )
3321 assert(conshdlrdata->varmap != NULL);
3330 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
3357 assert(scip != NULL);
3375 assert(conshdlr != NULL);
3378 assert(conshdlrdata != NULL);
3393 assert(conshdlr != NULL);
3396 assert(conshdlrdata != NULL);
3398 if( conshdlrdata->varmap != NULL )
3420 assert(consdata != NULL);
3422 return consdata->intvar;
3444 assert(consdata != NULL);
3446 if( consdata->binvars == NULL )
3452 assert(conshdlr != NULL);
3455 assert(conshdlrdata != NULL);
3460 assert(consdata->binvars != NULL);
3462 if( binvars != NULL )
3463 (*binvars) = consdata->binvars;
3464 if( nbinvars != NULL )
3465 (*nbinvars) = consdata->nbinvars;
3486 assert(consdata != NULL);
3488 return consdata->nbinvars;
3507 assert(consdata != NULL);
3508 assert(consdata->sorted);
3510 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_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)
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)
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)
void SCIPupdateSolLPConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
SCIP_Bool SCIPisFeasLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
void SCIPverbMessage(SCIP *scip, SCIP_VERBLEVEL msgverblevel, FILE *file, const char *formatstr,...)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddRow(SCIP *scip, SCIP_ROW *row, SCIP_Bool forcecut, SCIP_Bool *infeasible)
SCIP_RETCODE SCIPsetConshdlrResprop(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSRESPROP((*consresprop)))
struct SCIP_ConsData SCIP_CONSDATA
SCIP_RETCODE SCIPdisableCons(SCIP *scip, SCIP_CONS *cons)
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 addCuts(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *cutoff)
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)