41 #define CONSHDLR_NAME "bounddisjunction" 42 #define CONSHDLR_DESC "bound disjunction constraints" 43 #define CONSHDLR_ENFOPRIORITY -3000000 44 #define CONSHDLR_CHECKPRIORITY -3000000 45 #define CONSHDLR_PROPFREQ 1 46 #define CONSHDLR_EAGERFREQ 100 48 #define CONSHDLR_MAXPREROUNDS -1 49 #define CONSHDLR_DELAYPROP FALSE 50 #define CONSHDLR_NEEDSCONS TRUE 52 #define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_FAST 53 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP 55 #define QUADCONSUPGD_PRIORITY 500000 64 #define EVENTHDLR_NAME "bounddisjunction" 65 #define EVENTHDLR_DESC "event handler for bound disjunction constraints" 74 #define CONFLICTHDLR_NAME "bounddisjunction" 75 #define CONFLICTHDLR_DESC "conflict handler creating bound disjunction constraints" 76 #define CONFLICTHDLR_PRIORITY -3000000 85 #define DEFAULT_CONTINUOUSFRAC 0.4 96 #define AGEINCREASE(n) (1.0 + 0.2*n) 98 #define AGEINCREASE(n) (0.1*n) 109 #ifdef SCIP_DISABLED_CODE 111 #define isFeasLT(scip, var, val1, val2) (SCIPvarIsIntegral(var) ? (val2) - (val1) > 0.5 : SCIPisFeasLT(scip, val1, val2)) 112 #define isFeasLE(scip, var, val1, val2) (SCIPvarIsIntegral(var) ? (val2) - (val1) > -0.5 : SCIPisFeasLE(scip, val1, val2)) 113 #define isFeasGT(scip, var, val1, val2) (SCIPvarIsIntegral(var) ? (val1) - (val2) > 0.5 : SCIPisFeasGT(scip, val1, val2)) 114 #define isFeasGE(scip, var, val1, val2) (SCIPvarIsIntegral(var) ? (val1) - (val2) > -0.5 : SCIPisFeasGE(scip, val1, val2)) 116 #define isFeasLT(scip, var, val1, val2) SCIPisFeasLT(scip, val1, val2) 117 #define isFeasLE(scip, var, val1, val2) SCIPisFeasLE(scip, val1, val2) 118 #define isFeasGT(scip, var, val1, val2) SCIPisFeasGT(scip, val1, val2) 119 #define isFeasGE(scip, var, val1, val2) SCIPisFeasGE(scip, val1, val2) 125 struct SCIP_ConshdlrData
157 assert(consdata != NULL);
158 assert(0 <= pos && pos < consdata->nvars);
183 assert(consdata != NULL);
184 assert(0 <= pos && pos < consdata->nvars);
211 assert(consdata != NULL);
212 assert(0 <= pos && pos < consdata->nvars);
239 assert(consdata != NULL);
240 assert(0 <= pos && pos < consdata->nvars);
264 assert(scip != NULL);
265 assert(conshdlrdata != NULL);
266 assert(eventhdlr != NULL);
271 (*conshdlrdata)->eventhdlr = eventhdlr;
283 assert(conshdlrdata != NULL);
284 assert(*conshdlrdata != NULL);
302 assert(consdata != NULL);
303 assert(nvars == 0 || vars != NULL);
304 assert(nvars == 0 || boundtypes != NULL);
305 assert(nvars == 0 || bounds != NULL);
329 for( v = 0; v < nvars && !redundant; ++v )
343 boundtypesbuffer[0] = boundtype;
344 boundsbuffer[0] =
bound;
355 boundtypesbuffer[k] = boundtype;
356 boundsbuffer[k] =
bound;
364 assert(nviolations == nvars);
368 (*consdata)->varssize = 1;
369 (*consdata)->nvars = 1;
374 assert(!redundant || k == 1);
380 (*consdata)->varssize = k;
381 (*consdata)->nvars = k;
395 (*consdata)->varssize = nvars;
396 (*consdata)->nvars = nvars;
401 (*consdata)->vars = NULL;
402 (*consdata)->boundtypes = NULL;
403 (*consdata)->bounds = NULL;
404 (*consdata)->varssize = 0;
405 (*consdata)->nvars = 0;
407 (*consdata)->watchedvar1 = -1;
408 (*consdata)->watchedvar2 = -1;
409 (*consdata)->filterpos1 = -1;
410 (*consdata)->filterpos2 = -1;
428 assert(consdata != NULL);
429 assert(*consdata != NULL);
450 assert(consdata != NULL);
454 for( v = 0; v < consdata->nvars; ++v )
456 assert(consdata->vars[v] != NULL);
481 assert(consdata != NULL);
482 assert(watchedvar1 == -1 || watchedvar1 != watchedvar2);
483 assert(watchedvar1 != -1 || watchedvar2 == -1);
484 assert(watchedvar1 == -1 || (0 <= watchedvar1 && watchedvar1 < consdata->nvars));
485 assert(watchedvar2 == -1 || (0 <= watchedvar2 && watchedvar2 < consdata->nvars));
492 if( watchedvar1 == consdata->watchedvar2 || watchedvar2 == consdata->watchedvar1 )
496 tmp = consdata->watchedvar1;
497 consdata->watchedvar1 = consdata->watchedvar2;
498 consdata->watchedvar2 = tmp;
499 tmp = consdata->filterpos1;
500 consdata->filterpos1 = consdata->filterpos2;
501 consdata->filterpos2 = tmp;
503 assert(watchedvar1 == -1 || watchedvar1 != consdata->watchedvar2);
504 assert(watchedvar2 == -1 || watchedvar2 != consdata->watchedvar1);
507 if( consdata->watchedvar1 != -1 && consdata->watchedvar1 != watchedvar1 )
509 assert(consdata->filterpos1 != -1);
510 SCIP_CALL(
dropEvents(scip, cons, consdata, eventhdlr, consdata->watchedvar1, consdata->filterpos1) );
511 consdata->watchedvar1 = -1;
513 if( consdata->watchedvar2 != -1 && consdata->watchedvar2 != watchedvar2 )
515 assert(consdata->filterpos2 != -1);
516 SCIP_CALL(
dropEvents(scip, cons, consdata, eventhdlr, consdata->watchedvar2, consdata->filterpos2) );
517 consdata->watchedvar2 = -1;
521 if( watchedvar1 != -1 && watchedvar1 != consdata->watchedvar1 )
525 if( watchedvar2 != -1 && watchedvar2 != consdata->watchedvar2 )
531 consdata->watchedvar1 = watchedvar1;
532 consdata->watchedvar2 = watchedvar2;
579 assert(eventhdlr != NULL);
582 assert(consdata != NULL);
583 assert(0 <= pos && pos < consdata->nvars);
592 if( consdata->watchedvar1 == pos )
596 if( consdata->watchedvar2 == pos )
601 assert(pos != consdata->watchedvar1);
602 assert(pos != consdata->watchedvar2);
605 consdata->vars[pos] = consdata->vars[consdata->nvars-1];
606 consdata->boundtypes[pos] = consdata->boundtypes[consdata->nvars-1];
607 consdata->bounds[pos] = consdata->bounds[consdata->nvars-1];
611 if( consdata->watchedvar1 == consdata->nvars )
612 consdata->watchedvar1 = pos;
613 if( consdata->watchedvar2 == consdata->nvars )
614 consdata->watchedvar2 = pos;
637 assert(eventhdlr != NULL);
640 assert(consdata != NULL);
646 if( consdata->varssize == consdata->nvars )
654 consdata->varssize = newsize;
656 assert(consdata->varssize > consdata->nvars);
666 for( v = 0; v < consdata->nvars; v++ )
669 if( consdata->vars[v] == var )
671 if( consdata->boundtypes[v] == boundtype )
673 else if(
isOverlapping(scip, var, consdata->boundtypes[v], consdata->bounds[v], boundtype,
bound) )
684 if( samebndidx > -1 )
692 consdata->bounds[samebndidx] =
bound;
698 consdata->vars[consdata->nvars] = var;
699 consdata->boundtypes[consdata->nvars] = boundtype;
700 consdata->bounds[consdata->nvars] =
bound;
709 if( consdata->watchedvar1 == -1 )
711 assert(consdata->watchedvar2 == -1);
714 else if( consdata->watchedvar2 == -1 )
739 assert(eventhdlr != NULL);
740 assert(redundant != NULL);
743 assert(consdata != NULL);
744 assert(consdata->nvars == 0 || consdata->vars != NULL);
748 while( v < consdata->nvars )
752 var = consdata->vars[v];
757 if(
isFeasGE(scip, var, bnd, consdata->bounds[v]) )
765 if(
isFeasLT(scip, var, bnd, consdata->bounds[v]) )
777 if(
isFeasLE(scip, var, bnd, consdata->bounds[v]) )
785 if(
isFeasGT(scip, var, bnd, consdata->bounds[v]) )
811 assert(consdata != NULL);
812 assert(0 <= pos && pos < consdata->nvars);
817 return isFeasGE(scip, consdata->vars[pos], bnd, consdata->bounds[pos]);
822 return isFeasLE(scip, consdata->vars[pos], bnd, consdata->bounds[pos]);
836 assert(consdata != NULL);
837 assert(0 <= pos && pos < consdata->nvars);
842 return isFeasLT(scip, consdata->vars[pos], bnd, consdata->bounds[pos]);
847 return isFeasGT(scip, consdata->vars[pos], bnd, consdata->bounds[pos]);
866 assert(scip != NULL);
867 assert(cons != NULL);
868 assert(eventhdlr != NULL);
871 assert(consdata != NULL);
874 while( v < consdata->nvars )
879 var = consdata->vars[v];
900 bound = consdata->bounds[v];
901 boundtype = consdata->boundtypes[v];
952 assert(scip != NULL);
953 assert(cons != NULL);
954 assert(ndelconss != NULL);
955 assert(naddconss != NULL);
956 assert(naddconss != NULL);
960 assert(consdata != NULL);
962 nvars = consdata->nvars;
964 assert(consdata->vars != NULL);
970 for( v = nvars - 1; v >= 0; --v )
988 newvars[v] = consdata->vars[v];
1000 newvars[v] = consdata->vars[v];
1026 SCIPdebugMsg(scip,
"updated constraint <%s> to the following %s constraint\n",
SCIPconsGetName(cons), (nvars == 2 ?
"setppc" :
"logicor"));
1056 assert(consdata != NULL);
1061 for( v = 0; v < consdata->nvars; ++v )
1116 assert(cons != NULL);
1119 assert(cutoff != NULL);
1120 assert(reduceddom != NULL);
1121 assert(mustcheck != NULL);
1124 assert(consdata != NULL);
1125 assert(consdata->watchedvar1 == -1 || consdata->watchedvar1 != consdata->watchedvar2);
1129 *infeasible =
FALSE;
1130 *reduceddom =
FALSE;
1135 nvars = consdata->nvars;
1136 vars = consdata->vars;
1137 boundtypes = consdata->boundtypes;
1138 bounds = consdata->bounds;
1139 assert(nvars == 0 || vars != NULL);
1140 assert(nvars == 0 || boundtypes != NULL);
1141 assert(nvars == 0 || bounds != NULL);
1144 if( consdata->watchedvar1 >= 0 &&
isLiteralSatisfied(scip, consdata, consdata->watchedvar1) )
1151 if( consdata->watchedvar2 >= 0 &&
isLiteralSatisfied(scip, consdata, consdata->watchedvar2) )
1164 if( consdata->watchedvar1 >= 0 && !
isLiteralViolated(scip, consdata, consdata->watchedvar1) )
1166 watchedvar1 = consdata->watchedvar1;
1169 if( consdata->watchedvar2 >= 0 && !
isLiteralViolated(scip, consdata, consdata->watchedvar2) )
1171 if( watchedvar1 == -1 )
1173 watchedvar1 = consdata->watchedvar2;
1178 watchedvar2 = consdata->watchedvar2;
1182 assert(watchedvar1 >= 0 || watchedvar2 == -1);
1183 assert(nbranchings1 <= nbranchings2);
1188 if( watchedvar2 == -1 )
1192 for( v = 0; v < nvars; ++v )
1197 if( v == consdata->watchedvar1 || v == consdata->watchedvar2 )
1207 assert(v != consdata->watchedvar1);
1208 assert(v != consdata->watchedvar2);
1213 SCIPdebugMsg(scip,
" -> disabling constraint <%s> (variable <%s> fixed to 1.0)\n",
1215 if( consdata->watchedvar1 != -1 )
1230 if( nbranchings < nbranchings2 )
1232 if( nbranchings < nbranchings1 )
1234 watchedvar2 = watchedvar1;
1235 nbranchings2 = nbranchings1;
1237 nbranchings1 = nbranchings;
1242 nbranchings2 = nbranchings;
1247 assert(nbranchings1 <= nbranchings2);
1248 assert(watchedvar1 >= 0 || watchedvar2 == -1);
1250 if( watchedvar1 == -1 )
1256 assert(watchedvar2 == -1);
1271 else if( watchedvar2 == -1 )
1278 assert(0 <= watchedvar1 && watchedvar1 < nvars);
1292 for (v = 0; v < nvars; ++v)
1294 if ( v != watchedvar1 )
1302 SCIPdebugMsg(scip,
" -> single-literal constraint <%s> (change bound <%s> %s %g) at depth %d\n",
1318 if( watchedvar1 != consdata->watchedvar1 )
1328 SCIPdebugMsg(scip,
" -> new watched variables <%s> and <%s> of constraint <%s> are still undecided\n",
1367 assert(violated != NULL);
1371 assert(consdata != NULL);
1373 nvars = consdata->nvars;
1374 vars = consdata->vars;
1375 boundtypes = consdata->boundtypes;
1376 bounds = consdata->bounds;
1377 assert(nvars == 0 || vars != NULL);
1378 assert(nvars == 0 || boundtypes != NULL);
1379 assert(nvars == 0 || bounds != NULL);
1385 for( v = 0; v < nvars; ++v )
1391 if( viol < absviol )
1409 assert(0 == nvars || -1 != violpos);
1443 assert(cons != NULL);
1446 assert(neednarybranch != NULL);
1449 assert(consdata != NULL);
1450 nvars = consdata->nvars;
1451 vars = consdata->vars;
1452 boundtypes = consdata->boundtypes;
1453 bounds = consdata->bounds;
1454 assert(nvars == 0 || vars != NULL);
1455 assert(nvars == 0 || boundtypes != NULL);
1456 assert(nvars == 0 || bounds != NULL);
1458 *neednarybranch =
TRUE;
1460 for( v = 0; v < nvars; ++v )
1465 assert(var != NULL);
1500 *neednarybranch =
FALSE;
1523 assert(cons != NULL);
1526 assert(cutoff != NULL);
1527 assert(infeasible != NULL);
1528 assert(reduceddom != NULL);
1529 assert(registeredbrcand != NULL);
1555 if( !neednarybranch )
1556 *registeredbrcand =
TRUE;
1585 assert(cons != NULL);
1590 assert(consdata != NULL);
1591 nvars = consdata->nvars;
1592 vars = consdata->vars;
1593 boundtypes = consdata->boundtypes;
1594 bounds = consdata->bounds;
1595 assert(nvars == 0 || vars != NULL);
1596 assert(nvars == 0 || boundtypes != NULL);
1597 assert(nvars == 0 || bounds != NULL);
1599 for( v = 0; v < nvars; ++v )
1604 assert(var != NULL);
1632 SCIPdebugMsg(scip,
" -> creating child to enforce: <%s> %c= %g (priority: %g, estimate: %g)\n",
1702 int nnarybranchconsvars;
1705 assert(conshdlr != NULL);
1707 assert(nconss == 0 || conss != NULL);
1708 assert(result != NULL);
1710 SCIPdebugMsg(scip,
"Enforcing %d bound disjunction constraints for %s solution\n", nconss, sol == NULL ?
"LP" :
"relaxation");
1715 assert(conshdlrdata != NULL);
1720 registeredbrcand =
FALSE;
1721 narybranchcons = NULL;
1722 nnarybranchconsvars = INT_MAX;
1725 for( c = 0; c < nconss && !cutoff && !reduceddom; ++c )
1727 infeasiblecons =
FALSE;
1729 ®isteredbrcand) );
1730 infeasible |= infeasiblecons;
1731 if( infeasiblecons && !registeredbrcand )
1734 if( narybranchcons == NULL ||
SCIPconsGetData(conss[c])->nvars < nnarybranchconsvars )
1736 narybranchcons = conss[c];
1738 assert(nnarybranchconsvars > 0);
1745 else if( reduceddom )
1747 else if( infeasible )
1749 if( registeredbrcand )
1793 assert(scip != NULL);
1794 assert(cons != NULL);
1795 assert(nupgdconss != NULL);
1796 assert(upgdconss != NULL);
1832 x = quadvarterms[0].
var;
1833 y = quadvarterms[1].
var;
1836 coefx = quadvarterms[0].
lincoef;
1837 coefy = quadvarterms[1].
lincoef;
1898 if( upgdconsssize < *nupgdconss )
1901 *nupgdconss = -*nupgdconss;
1909 if( *nupgdconss == 1 )
1914 2, xy, boundtypes, bounds,
1920 SCIPdebugMsg(scip,
"created bounddisjunction constraint:\n");
1928 assert(*nupgdconss == 2);
1936 2, xy, boundtypes, bounds,
1946 2, xy, boundtypes, bounds,
1952 SCIPdebugMsg(scip,
"created bounddisjunction constraints:\n");
1959 assert(*nupgdconss == 2);
1967 2, xy, boundtypes, bounds,
1977 2, xy, boundtypes, bounds,
1983 SCIPdebugMsg(scip,
"created bounddisjunction constraints:\n");
1991 assert(*nupgdconss == 4);
1998 2, xy, boundtypes, bounds,
2009 2, xy, boundtypes, bounds,
2020 2, xy, boundtypes, bounds,
2031 2, xy, boundtypes, bounds,
2037 SCIPdebugMsg(scip,
"created bounddisjunction constraints:\n");
2064 if( upgdconsssize < 2 )
2081 2, xy, boundtypes, bounds,
2092 2, xy, boundtypes, bounds,
2098 SCIPdebugMsg(scip,
"created bounddisjunction constraints:\n");
2124 if( upgdconsssize < 2 )
2141 2, xy, boundtypes, bounds,
2152 2, xy, boundtypes, bounds,
2158 SCIPdebugMsg(scip,
"created bounddisjunction constraints:\n");
2179 assert(scip != NULL);
2180 assert(conshdlr != NULL);
2197 assert(conshdlr != NULL);
2199 assert(scip != NULL);
2203 assert(conshdlrdata != NULL);
2222 assert(conshdlr != NULL);
2224 assert(scip != NULL);
2227 assert(conshdlrdata != NULL);
2230 for( c = 0; c < nconss; ++c )
2233 assert(cons != NULL);
2264 assert(conshdlr != NULL);
2266 assert(consdata != NULL);
2267 assert(*consdata != NULL);
2285 assert(conshdlr != NULL);
2288 assert(sourcecons != NULL);
2289 assert(targetcons != NULL);
2292 assert(sourcedata != NULL);
2296 sourcedata->boundtypes, sourcedata->bounds) );
2341 assert(conshdlr != NULL);
2343 assert(nconss == 0 || conss != NULL);
2344 assert(result != NULL);
2346 SCIPdebugMsg(scip,
"pseudo enforcing %d bound disjunction constraints\n", nconss);
2351 assert(conshdlrdata != NULL);
2356 registeredbrcand =
FALSE;
2357 narybranchcons = NULL;
2360 for( c = 0; c < nconss && !cutoff && !reduceddom; ++c )
2363 ®isteredbrcand) );
2364 if( infeasible && !registeredbrcand )
2368 narybranchcons = conss[c];
2374 else if( reduceddom )
2376 else if( infeasible )
2378 if( registeredbrcand )
2401 assert(conshdlr != NULL);
2403 assert(nconss == 0 || conss != NULL);
2404 assert(result != NULL);
2409 for( c = 0; c < nconss && (*result ==
SCIP_FEASIBLE || completely); ++c )
2415 assert(consdata != NULL);
2426 for( v = 0; v < consdata->nvars; ++v )
2428 assert(consdata->vars[v] != NULL);
2458 assert(conshdlr != NULL);
2460 assert(nconss == 0 || conss != NULL);
2461 assert(result != NULL);
2464 assert(conshdlrdata != NULL);
2471 for( c = 0; c < nusefulconss && !cutoff; ++c )
2474 &cutoff, &infeasible, &consreduceddom, &mustcheck) );
2475 reduceddom = reduceddom || consreduceddom;
2481 else if( reduceddom )
2502 assert(conshdlr != NULL);
2504 assert(scip != NULL);
2505 assert(result != NULL);
2510 assert(conshdlrdata != NULL);
2516 assert(cons != NULL);
2518 assert(consdata != NULL);
2553 if( consdata->nvars == 0 )
2559 else if( consdata->nvars == 1 )
2561 SCIPdebugMsg(scip,
"bound disjunction constraint <%s> has only one undecided literal\n",
2564 assert(consdata->vars != NULL);
2599 1, &consdata->vars[0], &one, consdata->bounds[0],
SCIPinfinity(scip),
2608 1, &consdata->vars[0], &one, -
SCIPinfinity(scip), consdata->bounds[0],
2650 assert(conshdlr != NULL);
2652 assert(cons != NULL);
2653 assert(infervar != NULL);
2654 assert(result != NULL);
2657 assert(consdata != NULL);
2658 assert(consdata->vars != NULL);
2659 assert(consdata->nvars > 0);
2660 assert(0 <= inferinfo && inferinfo < consdata->nvars);
2661 assert(consdata->vars[inferinfo] == infervar);
2663 vars = consdata->vars;
2664 boundtypes = consdata->boundtypes;
2666 bounds = consdata->bounds;
2667 assert(bounds != NULL);
2669 assert(boundtypes != NULL);
2671 SCIPdebugMsg(scip,
"conflict resolving method of bound disjunction constraint handler\n");
2681 for( v = 0; v < consdata->nvars; ++v )
2683 if( v != inferinfo )
2685 assert(consdata->vars[v] != infervar || consdata->boundtypes[v] != consdata->boundtypes[inferinfo]);
2714 assert(consdata != NULL);
2717 for( i = 0; i < consdata->nvars; ++i )
2740 assert(conshdlr != NULL);
2742 assert(cons != NULL);
2746 assert(conshdlrdata != NULL);
2748 assert(consdata != NULL);
2749 assert(consdata->watchedvar1 == -1 || consdata->watchedvar1 != consdata->watchedvar2);
2755 if( consdata->watchedvar1 != -1 )
2758 &consdata->filterpos1) );
2760 if( consdata->watchedvar2 != -1 )
2763 &consdata->filterpos2) );
2777 assert(conshdlr != NULL);
2779 assert(cons != NULL);
2783 assert(conshdlrdata != NULL);
2785 assert(consdata != NULL);
2786 assert(consdata->watchedvar1 == -1 || consdata->watchedvar1 != consdata->watchedvar2);
2792 if( consdata->watchedvar1 != -1 )
2794 assert(consdata->filterpos1 != -1);
2795 SCIP_CALL(
dropEvents(scip, cons, consdata, conshdlrdata->eventhdlr, consdata->watchedvar1, consdata->filterpos1) );
2796 consdata->watchedvar1 = -1;
2798 if( consdata->watchedvar2 != -1 )
2800 assert(consdata->filterpos2 != -1);
2801 SCIP_CALL(
dropEvents(scip, cons, consdata, conshdlrdata->eventhdlr, consdata->watchedvar2, consdata->filterpos2) );
2802 consdata->watchedvar2 = -1;
2814 assert( scip != NULL );
2815 assert( conshdlr != NULL );
2816 assert( cons != NULL );
2834 assert(valid != NULL);
2847 for( v = 0; v < nvars && *valid; ++v )
2850 assert(!(*valid) || targetvars[v] != NULL);
2857 bounds, initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
2876 assert( success != NULL );
2879 SCIPdebugMsg(scip,
"parse <%s> as bounddisjunction constraint\n", str);
2882 while( *str !=
'\0' && isspace((
unsigned char)*str) )
2886 if( strncmp(str,
"bounddisjunction(", 16) != 0 )
2905 while( *str !=
'\0' && *str !=
')' )
2921 while( *str !=
'\0' && isspace((
unsigned char)*str) && *str !=
'>' && *str !=
'<' )
2951 while( *str !=
'\0' && isspace((
unsigned char)*str) )
2964 while( (*str !=
'\0' && isspace((
unsigned char)*str)) || *str ==
',' )
2968 vars[nvars++] = var;
2971 if( nvars > varssize )
2983 if( *success && nvars > 0 )
2986 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
3004 assert(cons != NULL);
3007 assert(consdata != NULL);
3009 if( varssize < consdata->nvars )
3013 assert(vars != NULL);
3028 assert(cons != NULL);
3031 assert(consdata != NULL);
3033 (*nvars) = consdata->nvars;
3048 assert(eventhdlr != NULL);
3049 assert(eventdata != NULL);
3051 assert(event != NULL);
3078 struct SCIP_ConflicthdlrData
3097 assert(conflicthdlr != NULL);
3099 assert(bdchginfos != NULL || nbdchginfos == 0);
3100 assert(result != NULL);
3110 assert(conflicthdlrdata != NULL);
3122 for( i = 0; i < nbdchginfos; ++i )
3129 assert(bdchginfos != NULL);
3132 assert(var != NULL);
3135 bound = relaxedbds[i];
3142 for( j = nliterals-1; j >= 0; --j )
3144 if( vars[j] != var )
3148 if( boundtypes[j] == boundtype )
3153 SCIPdebugMsg(scip,
"relax lower bound of variable <%s> from %g to %g in bounddisjunction conflict\n",
3160 SCIPdebugMsg(scip,
"relax upper bound of variable <%s> from %g to %g in bounddisjunction conflict\n",
3168 else if(
isOverlapping(scip, var, boundtype, bound, boundtypes[j], bounds[j]) )
3171 SCIPdebugMsg(scip,
"redundant bounddisjunction conflict due to overlapping\n");
3172 goto DISCARDCONFLICT;
3176 vars[nliterals] = var;
3177 boundtypes[nliterals] = boundtype;
3178 bounds[nliterals] =
bound;
3193 SCIPdebugMsg(scip,
"redundant bounddisjunction conflict due to globally fulfilled literal\n");
3194 goto DISCARDCONFLICT;
3204 if( i == nbdchginfos && ncontinuous < conflicthdlrdata->continuousfrac * nbdchginfos + 0.5 )
3231 assert(conflicthdlr != NULL);
3235 assert(conflicthdlrdata != NULL);
3263 eventExecBounddisjunction, NULL) );
3270 "conflict/" CONSHDLR_NAME "/continuousfrac",
"maximal percantage of continuous variables within a conflict",
3275 conflictExecBounddisjunction, conflicthdlrdata) );
3285 consEnfolpBounddisjunction, consEnfopsBounddisjunction, consCheckBounddisjunction, consLockBounddisjunction,
3288 assert(conshdlr != NULL);
3359 assert(scip != NULL);
3363 if( conshdlr == NULL )
3373 for( v1 = 0; v1 < nvars; v1++ )
3376 for( v2 = v1+1; v2 < nvars; v2++ )
3379 && !
isOverlapping(scip, vars[v1], boundtypes[v1], bounds[v1], boundtypes[v2], bounds[v2])));
3389 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
3390 local, modifiable, dynamic, removable, stickingatnode) );
3413 assert(scip != NULL);
3437 assert(consdata != NULL);
3439 return consdata->nvars;
3458 assert(consdata != NULL);
3460 return consdata->vars;
3479 assert(consdata != NULL);
3481 return consdata->boundtypes;
3500 assert(consdata != NULL);
3502 return consdata->bounds;
enum SCIP_Result SCIP_RESULT
static SCIP_DECL_CONSCHECK(consCheckBounddisjunction)
enum SCIP_BoundType SCIP_BOUNDTYPE
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
static SCIP_RETCODE dropEvents(SCIP *scip, SCIP_CONS *cons, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos, int filterpos)
SCIP_RETCODE SCIPaddConsAge(SCIP *scip, SCIP_CONS *cons, SCIP_Real deltaage)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
static SCIP_RETCODE lockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_CONSDATA *consdata, int pos)
static SCIP_RETCODE conshdlrdataFree(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata)
SCIP_RETCODE SCIPtightenVarLb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPincludeConshdlrBounddisjunction(SCIP *scip)
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)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
SCIP_Bool SCIPisFeasLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
static SCIP_Bool isOverlapping(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype1, SCIP_Real bound1, SCIP_BOUNDTYPE boundtype2, SCIP_Real bound2)
int SCIPconsGetValidDepth(SCIP_CONS *cons)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
SCIP_RETCODE SCIPcatchVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int *filterpos)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_VAR * SCIPbdchginfoGetVar(SCIP_BDCHGINFO *bdchginfo)
static SCIP_DECL_CONSDELETE(consDeleteBounddisjunction)
#define CONSHDLR_PROPFREQ
SCIP_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
SCIP_RETCODE SCIPincludeQuadconsUpgrade(SCIP *scip, SCIP_DECL_QUADCONSUPGD((*quadconsupgd)), int priority, SCIP_Bool active, const char *conshdlrname)
SCIP_RETCODE SCIPsetConshdlrGetVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETVARS((*consgetvars)))
#define CONSHDLR_NEEDSCONS
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_Real * SCIPgetBoundsBounddisjunction(SCIP *scip, SCIP_CONS *cons)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
static SCIP_RETCODE applyGlobalBounds(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *redundant)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_Bool SCIPisGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_RETCODE SCIPdisableConsPropagation(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPsetConshdlrDeactive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDEACTIVE((*consdeactive)))
SCIP_RETCODE SCIPchgVarLbNode(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound)
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 SCIPdelConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons)
int SCIPgetNVarsBounddisjunction(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE disableCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPparseVarName(SCIP *scip, const char *str, SCIP_VAR **var, char **endptr)
SCIP_Bool SCIPvarIsBinary(SCIP_VAR *var)
static SCIP_RETCODE registerBranchingCandidates(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *neednarybranch)
SCIP_Bool SCIPisFeasGE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define isFeasGT(scip, var, val1, val2)
static SCIP_DECL_CONSGETVARS(consGetVarsBounddisjunction)
const char * SCIPeventhdlrGetName(SCIP_EVENTHDLR *eventhdlr)
SCIP_Real SCIPrelDiff(SCIP_Real val1, SCIP_Real val2)
#define isFeasGE(scip, var, val1, 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_RETCODE delCoefPos(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int pos)
#define CONFLICTHDLR_DESC
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
static SCIP_RETCODE catchEvents(SCIP *scip, SCIP_CONS *cons, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos, int *filterpos)
enum SCIP_Retcode SCIP_RETCODE
#define CONSHDLR_PROP_TIMING
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
#define CONFLICTHDLR_PRIORITY
static SCIP_DECL_CONSENFORELAX(consEnforelaxBounddisjunction)
static SCIP_RETCODE analyzeConflict(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
SCIP_RETCODE SCIPtightenVarUb(SCIP *scip, SCIP_VAR *var, SCIP_Real newbound, SCIP_Bool force, SCIP_Bool *infeasible, SCIP_Bool *tightened)
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_RETCODE SCIPenableConsPropagation(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSTRANS(consTransBounddisjunction)
SCIP_RETCODE SCIPchgVarUbNode(SCIP *scip, SCIP_NODE *node, SCIP_VAR *var, SCIP_Real newbound)
SCIP_Bool SCIPisEQ(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define SCIPfreeBufferArray(scip, ptr)
SCIP_Longint SCIPvarGetNBranchingsCurrentRun(SCIP_VAR *var, SCIP_BRANCHDIR dir)
Constraint handler for the set partitioning / packing / covering constraints .
static SCIP_DECL_CONSFREE(consFreeBounddisjunction)
SCIP_RETCODE SCIPincludeConflicthdlrBasic(SCIP *scip, SCIP_CONFLICTHDLR **conflicthdlrptr, const char *name, const char *desc, int priority, SCIP_DECL_CONFLICTEXEC((*conflictexec)), SCIP_CONFLICTHDLRDATA *conflicthdlrdata)
#define CONSHDLR_ENFOPRIORITY
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPdebugPrintCons(x, y, z)
SCIP_Bool SCIPisTransformed(SCIP *scip)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
SCIP_Real SCIPgetLhsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
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)
#define CONSHDLR_DELAYPROP
SCIP_Real SCIPcomputeVarUbGlobal(SCIP *scip, SCIP_VAR *var)
SCIP_Real SCIPcomputeVarLbLocal(SCIP *scip, SCIP_VAR *var)
int SCIPgetNQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
static SCIP_Bool isLiteralSatisfied(SCIP *scip, SCIP_CONSDATA *consdata, int pos)
#define SCIP_EVENTTYPE_LBRELAXED
int SCIPgetNBilinTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
SCIP_RETCODE SCIPcreateConsBasicBounddisjunction(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds)
#define CONSHDLR_EAGERFREQ
SCIP_RETCODE SCIPenableCons(SCIP *scip, SCIP_CONS *cons)
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
SCIP_VAR * SCIPvarGetProbvar(SCIP_VAR *var)
static SCIP_RETCODE addCoef(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_Real bound, SCIP_Bool *redundant)
static SCIP_RETCODE enforceCurrentSol(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *infeasible, SCIP_Bool *reduceddom, SCIP_Bool *registeredbrcand)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
static SCIP_DECL_QUADCONSUPGD(upgradeConsQuadratic)
SCIP_VAR ** SCIPgetVarsBounddisjunction(SCIP *scip, SCIP_CONS *cons)
SCIP_BOUNDTYPE SCIPboundtypeOpposite(SCIP_BOUNDTYPE boundtype)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
static SCIP_RETCODE enforceConstraint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_RESULT *result)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSGETNVARS(consGetNVarsBounddisjunction)
SCIP_Bool SCIPisLT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
#define QUADCONSUPGD_PRIORITY
Constraint handler for logicor constraints (equivalent to set covering, but algorithms are suited fo...
SCIP_RETCODE SCIPunlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsPropagated(SCIP_CONS *cons)
struct SCIP_EventData SCIP_EVENTDATA
const char * SCIPvarGetName(SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrFree(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSFREE((*consfree)))
constraint handler for quadratic constraints
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
static SCIP_DECL_CONSENFOLP(consEnfolpBounddisjunction)
#define CONSHDLR_CHECKPRIORITY
#define SCIP_EVENTTYPE_UBRELAXED
SCIP_RETCODE SCIPcreateChild(SCIP *scip, SCIP_NODE **node, SCIP_Real nodeselprio, SCIP_Real estimate)
SCIP_RETCODE SCIPsetConflicthdlrFree(SCIP *scip, SCIP_CONFLICTHDLR *conflicthdlr, SCIP_DECL_CONFLICTFREE((*conflictfree)))
struct SCIP_ConflicthdlrData SCIP_CONFLICTHDLRDATA
#define SCIP_EVENTTYPE_LBTIGHTENED
SCIP_Bool SCIPisFeasGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
SCIP_Real SCIPcomputeVarUbLocal(SCIP *scip, SCIP_VAR *var)
static SCIP_DECL_CONSPARSE(consParseBounddisjunction)
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)))
struct SCIP_ConsData SCIP_CONSDATA
SCIP_RETCODE SCIPdisableCons(SCIP *scip, SCIP_CONS *cons)
SCIP_BILINTERM * SCIPgetBilinTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
#define SCIP_EVENTTYPE_BOUNDTIGHTENED
SCIP_BOUNDTYPE * SCIPgetBoundtypesBounddisjunction(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddConsNode(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode)
SCIP_Real SCIPgetRhsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateConsSetpack(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
static SCIP_RETCODE processWatchedVars(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *infeasible, SCIP_Bool *reduceddom, SCIP_Bool *mustcheck)
#define SCIPallocBufferArray(scip, ptr, num)
public data structures and miscellaneous methods
static SCIP_RETCODE conshdlrdataCreate(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr)
SCIP_Bool SCIPconsIsUpdatedeactivate(SCIP_CONS *cons)
#define isFeasLT(scip, var, val1, val2)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
SCIP_Bool SCIPconsIsPropagationEnabled(SCIP_CONS *cons)
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyBounddisjunction)
int SCIPgetDepth(SCIP *scip)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
static SCIP_DECL_CONSACTIVE(consActiveBounddisjunction)
SCIP_Bool SCIPstrToRealValue(const char *str, SCIP_Real *value, char **endptr)
static SCIP_RETCODE removeFixedVariables(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *redundant)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddConflictBd(SCIP *scip, SCIP_VAR *var, SCIP_BOUNDTYPE boundtype, SCIP_BDCHGIDX *bdchgidx)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_Real SCIPcomputeVarLbGlobal(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
SCIP_Real SCIPbdchginfoGetNewbound(SCIP_BDCHGINFO *bdchginfo)
SCIP_Real SCIPcalcNodeselPriority(SCIP *scip, SCIP_VAR *var, SCIP_BRANCHDIR branchdir, SCIP_Real targetvalue)
SCIP_RETCODE SCIPaddExternBranchCand(SCIP *scip, SCIP_VAR *var, SCIP_Real score, SCIP_Real solval)
static SCIP_DECL_CONSRESPROP(consRespropBounddisjunction)
#define BMScopyMemoryArray(ptr, source, num)
int SCIPgetNRuns(SCIP *scip)
static SCIP_RETCODE checkCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *violated)
SCIP_RETCODE SCIPlockVarCons(SCIP *scip, SCIP_VAR *var, SCIP_CONS *cons, SCIP_Bool lockdown, SCIP_Bool lockup)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRINT((*consprint)))
static SCIP_DECL_CONSPRESOL(consPresolBounddisjunction)
#define SCIP_EVENTTYPE_UBTIGHTENED
Constraint handler for linear constraints in their most general form, .
SCIP_Longint SCIPgetNConflictConssApplied(SCIP *scip)
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_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_Real SCIPcalcChildEstimate(SCIP *scip, SCIP_VAR *var, SCIP_Real targetvalue)
SCIP_Bool SCIPinProbing(SCIP *scip)
SCIP_RETCODE SCIPvarGetProbvarBound(SCIP_VAR **var, SCIP_Real *bound, SCIP_BOUNDTYPE *boundtype)
static SCIP_Bool isLiteralViolated(SCIP *scip, SCIP_CONSDATA *consdata, int pos)
#define isFeasLE(scip, var, val1, val2)
static SCIP_DECL_CONSENFOPS(consEnfopsBounddisjunction)
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)))
int SCIPgetNLinearVarsQuadratic(SCIP *scip, SCIP_CONS *cons)
static SCIP_RETCODE createNAryBranch(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol)
SCIP_Bool SCIPisGT(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
static SCIP_RETCODE upgradeCons(SCIP *scip, SCIP_CONS *cons, int *ndelconss, int *naddconss)
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_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)
static SCIP_RETCODE unlockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_CONSDATA *consdata, int pos)
SCIP_Bool SCIPisConsCompressionEnabled(SCIP *scip)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
const char * SCIPconflicthdlrGetName(SCIP_CONFLICTHDLR *conflicthdlr)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
void SCIPupdateSolConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
SCIP_VARSTATUS SCIPvarGetStatus(SCIP_VAR *var)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
static SCIP_DECL_CONSPROP(consPropBounddisjunction)
SCIP_Bool SCIPisStopped(SCIP *scip)
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
static void consdataPrint(SCIP *scip, SCIP_CONSDATA *consdata, FILE *file, SCIP_Bool endline)
SCIP_VARTYPE SCIPvarGetType(SCIP_VAR *var)
SCIP_RETCODE SCIPcreateConsBounddisjunction(SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSDATA **consdata, int nvars, SCIP_VAR **vars, SCIP_BOUNDTYPE *boundtypes, SCIP_Real *bounds)
SCIP_Bool SCIPisZero(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPisLE(SCIP *scip, SCIP_Real val1, SCIP_Real val2)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
static SCIP_DECL_CONSCOPY(consCopyBounddisjunction)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
static SCIP_DECL_CONSEXITPRE(consExitpreBounddisjunction)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
SCIP_BOUNDTYPE SCIPbdchginfoGetBoundtype(SCIP_BDCHGINFO *bdchginfo)
SCIP_RETCODE SCIPsetConshdlrActive(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSACTIVE((*consactive)))
SCIP_QUADVARTERM * SCIPgetQuadVarTermsQuadratic(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddConflict(SCIP *scip, SCIP_NODE *node, SCIP_CONS *cons, SCIP_NODE *validnode, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
static SCIP_DECL_CONFLICTFREE(conflictFreeBounddisjunction)
static SCIP_DECL_CONFLICTEXEC(conflictExecBounddisjunction)
SCIP_CONFLICTHDLRDATA * SCIPconflicthdlrGetData(SCIP_CONFLICTHDLR *conflicthdlr)
constraint handler for bound disjunction constraints
#define CONFLICTHDLR_NAME
static SCIP_DECL_CONSPRINT(consPrintBounddisjunction)
static SCIP_DECL_EVENTEXEC(eventExecBounddisjunction)
#define CONSHDLR_MAXPREROUNDS
SCIP_Bool SCIPvarIsIntegral(SCIP_VAR *var)
#define CONSHDLR_PRESOLTIMING
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_RETCODE SCIPaddRealParam(SCIP *scip, const char *name, const char *desc, SCIP_Real *valueptr, SCIP_Bool isadvanced, SCIP_Real defaultvalue, SCIP_Real minvalue, SCIP_Real maxvalue, SCIP_DECL_PARAMCHGD((*paramchgd)), SCIP_PARAMDATA *paramdata)
#define DEFAULT_CONTINUOUSFRAC
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
static SCIP_DECL_CONSDEACTIVE(consDeactiveBounddisjunction)
static SCIP_RETCODE switchWatchedvars(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int watchedvar1, int watchedvar2)
SCIP_Bool SCIPvarIsActive(SCIP_VAR *var)
#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_DECL_CONSLOCK(consLockBounddisjunction)
#define SCIP_EVENTTYPE_BOUNDRELAXED