43 #define CONSHDLR_NAME "or" 44 #define CONSHDLR_DESC "constraint handler for or constraints: r = or(x1, ..., xn)" 45 #define CONSHDLR_SEPAPRIORITY +850000 46 #define CONSHDLR_ENFOPRIORITY -850000 47 #define CONSHDLR_CHECKPRIORITY -850000 48 #define CONSHDLR_SEPAFREQ 0 49 #define CONSHDLR_PROPFREQ 1 50 #define CONSHDLR_EAGERFREQ 100 52 #define CONSHDLR_MAXPREROUNDS -1 53 #define CONSHDLR_DELAYSEPA FALSE 54 #define CONSHDLR_DELAYPROP FALSE 55 #define CONSHDLR_NEEDSCONS TRUE 57 #define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP 58 #define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_MEDIUM 60 #define EVENTHDLR_NAME "or" 61 #define EVENTHDLR_DESC "event handler for or constraints" 81 unsigned int propagated:1;
82 unsigned int nofixedone:1;
83 unsigned int impladded:1;
84 unsigned int opimpladded:1;
88 struct SCIP_ConshdlrData
149 assert(scip !=
NULL);
150 assert(conshdlrdata !=
NULL);
151 assert(eventhdlr !=
NULL);
156 (*conshdlrdata)->eventhdlr = eventhdlr;
168 assert(conshdlrdata !=
NULL);
169 assert(*conshdlrdata !=
NULL);
182 assert(consdata !=
NULL);
184 return consdata->nvars + 1;
197 assert(consdata !=
NULL);
198 assert(consdata->vars !=
NULL);
199 assert(eventhdlr !=
NULL);
200 assert(0 <= pos && pos < consdata->nvars);
201 assert(filterpos !=
NULL);
221 assert(consdata !=
NULL);
222 assert(consdata->vars !=
NULL);
223 assert(eventhdlr !=
NULL);
224 assert(0 <= pos && pos < consdata->nvars);
225 assert(filterpos >= 0);
244 assert(consdata !=
NULL);
251 for( i = 0; i < consdata->nvars; ++i )
270 assert(consdata !=
NULL);
277 for( i = 0; i < consdata->nvars; ++i )
296 assert(consdata !=
NULL);
297 assert(watchedvar1 == -1 || watchedvar1 != watchedvar2);
298 assert(watchedvar1 != -1 || watchedvar2 == -1);
299 assert(watchedvar1 == -1 || (0 <= watchedvar1 && watchedvar1 < consdata->nvars));
300 assert(watchedvar2 == -1 || (0 <= watchedvar2 && watchedvar2 < consdata->nvars));
303 if( watchedvar1 == consdata->watchedvar2 || watchedvar2 == consdata->watchedvar1 )
307 tmp = consdata->watchedvar1;
308 consdata->watchedvar1 = consdata->watchedvar2;
309 consdata->watchedvar2 = tmp;
310 tmp = consdata->filterpos1;
311 consdata->filterpos1 = consdata->filterpos2;
312 consdata->filterpos2 = tmp;
314 assert(watchedvar1 == -1 || watchedvar1 != consdata->watchedvar2);
315 assert(watchedvar2 == -1 || watchedvar2 != consdata->watchedvar1);
318 if( consdata->watchedvar1 != -1 && consdata->watchedvar1 != watchedvar1 )
320 assert(consdata->filterpos1 != -1);
323 if( consdata->watchedvar2 != -1 && consdata->watchedvar2 != watchedvar2 )
325 assert(consdata->filterpos2 != -1);
330 if( watchedvar1 != -1 && watchedvar1 != consdata->watchedvar1 )
334 if( watchedvar2 != -1 && watchedvar2 != consdata->watchedvar2 )
340 consdata->watchedvar1 = watchedvar1;
341 consdata->watchedvar2 = watchedvar2;
354 assert(consdata !=
NULL);
355 assert(consdata->nvars <= consdata->varssize);
357 if( num > consdata->varssize )
363 consdata->varssize = newsize;
365 assert(num <= consdata->varssize);
381 assert(consdata !=
NULL);
382 assert(nvars == 0 || vars !=
NULL);
383 assert(resvar !=
NULL);
387 (*consdata)->resvar = resvar;
388 (*consdata)->rows =
NULL;
389 (*consdata)->nvars = nvars;
390 (*consdata)->varssize = nvars;
391 (*consdata)->rowssize = 0;
392 (*consdata)->watchedvar1 = -1;
393 (*consdata)->watchedvar2 = -1;
394 (*consdata)->filterpos1 = -1;
395 (*consdata)->filterpos2 = -1;
396 (*consdata)->propagated =
FALSE;
397 (*consdata)->nofixedone =
FALSE;
398 (*consdata)->impladded =
FALSE;
399 (*consdata)->opimpladded =
FALSE;
423 assert(consdata !=
NULL);
425 if( consdata->rows !=
NULL )
431 for( r = 0; r < nrows; ++r )
449 assert(consdata !=
NULL);
450 assert(*consdata !=
NULL);
462 assert((*consdata)->watchedvar1 == -1);
463 assert((*consdata)->watchedvar2 == -1);
483 assert(consdata !=
NULL);
515 assert(consdata !=
NULL);
516 assert(consdata->rows ==
NULL);
530 consdata->vars[consdata->nvars] = var;
545 if( consdata->rows !=
NULL )
547 SCIPerrorMessage(
"cannot add coefficients to or constraint after LP relaxation was created\n");
565 assert(eventhdlr !=
NULL);
568 assert(consdata !=
NULL);
569 assert(0 <= pos && pos < consdata->nvars);
585 if( consdata->watchedvar1 == pos )
589 if( consdata->watchedvar2 == pos )
594 assert(pos != consdata->watchedvar1);
595 assert(pos != consdata->watchedvar2);
598 consdata->vars[pos] = consdata->vars[consdata->nvars-1];
602 if( consdata->watchedvar1 == consdata->nvars )
603 consdata->watchedvar1 = pos;
604 if( consdata->watchedvar2 == consdata->nvars )
605 consdata->watchedvar2 = pos;
607 consdata->propagated =
FALSE;
625 assert(consdata !=
NULL);
626 assert(consdata->nvars == 0 || consdata->vars !=
NULL);
629 while( v < consdata->nvars )
631 var = consdata->vars[v];
684 assert(consdata !=
NULL);
685 assert(consdata->rows ==
NULL);
687 nvars = consdata->nvars;
692 assert(consdata->rowssize == nvars+1);
695 for( i = 0; i < nvars; ++i )
727 assert(consdata !=
NULL);
729 if( consdata->rows ==
NULL )
733 assert( consdata->rows !=
NULL );
737 for( r = 0; r < nrows && !(*infeasible); ++r )
763 assert(violated !=
NULL);
766 assert(consdata !=
NULL);
771 mustcheck = checklprows;
772 mustcheck = mustcheck || (consdata->rows ==
NULL);
777 assert(consdata->rows !=
NULL);
781 for( r = 0; r < nrows; ++r )
804 for( i = 0; i < consdata->nvars; ++i )
816 if( (i == consdata->nvars) != (solval < 0.5) )
830 if( i == consdata->nvars )
861 assert(separated !=
NULL);
864 assert(consdata !=
NULL);
869 if( consdata->rows ==
NULL )
873 assert(consdata->rows !=
NULL);
878 for( r = 0; r < nrows; ++r )
888 assert( ! infeasible );
912 assert(consdata !=
NULL);
914 assert(0 <= truepos && truepos < consdata->nvars);
946 assert(consdata !=
NULL);
953 for( v = 0; v < consdata->nvars; ++v )
990 assert(cutoff !=
NULL);
991 assert(nfixedvars !=
NULL);
994 assert(consdata !=
NULL);
996 resvar = consdata->resvar;
997 vars = consdata->vars;
998 nvars = consdata->nvars;
1003 if( consdata->propagated )
1005 assert(consdata->nofixedone);
1017 if( !consdata->nofixedone )
1023 SCIPdebugMsg(scip,
"constraint <%s>: operator var <%s> fixed to 1.0 -> fix resultant <%s> to 1.0\n",
1046 consdata->nofixedone =
TRUE;
1048 assert(consdata->nofixedone);
1053 for( i = 0; i < nvars && !(*cutoff); ++i )
1055 SCIPdebugMsg(scip,
"constraint <%s>: resultant var <%s> fixed to 0.0 -> fix operator var <%s> to 0.0\n",
1065 else if( tightened )
1088 watchedvar1 = consdata->watchedvar1;
1089 watchedvar2 = consdata->watchedvar2;
1092 if( watchedvar1 != -1 )
1098 if( watchedvar2 != -1 )
1106 if( watchedvar1 == -1 )
1108 watchedvar1 = watchedvar2;
1111 assert(watchedvar1 != -1 || watchedvar2 == -1);
1114 if( watchedvar2 == -1 )
1116 for( i = 0; i < nvars; ++i )
1121 if( watchedvar1 == -1 )
1123 assert(watchedvar2 == -1);
1126 else if( watchedvar1 != i )
1134 assert(watchedvar1 != -1 || watchedvar2 == -1);
1137 if( watchedvar1 == -1 )
1139 assert(watchedvar2 == -1);
1141 SCIPdebugMsg(scip,
"constraint <%s>: all operator vars fixed to 0.0 -> fix resultant <%s> to 0.0\n",
1169 assert(watchedvar1 != -1);
1171 SCIPdebugMsg(scip,
"constraint <%s>: resultant <%s> fixed to 1.0, only one unfixed operand -> fix operand <%s> to 1.0\n",
1198 consdata->propagated =
TRUE;
1225 assert(result !=
NULL);
1228 assert(consdata !=
NULL);
1229 vars = consdata->vars;
1230 nvars = consdata->nvars;
1237 assert(infervar == consdata->resvar);
1238 for( i = 0; i < nvars; ++i )
1261 assert(infervar == consdata->resvar);
1262 for( i = 0; i < nvars; ++i )
1275 for( i = 0; i < nvars; ++i )
1277 if( vars[i] != infervar )
1309 assert(nupgdconss !=
NULL);
1315 SCIPdebugMsg(scip,
"upgrading or constraint <%s> into equivalent and constraint on negated variables\n",
1319 assert(consdata !=
NULL);
1323 for( i = 0; i < consdata->nvars; ++i )
1357 assert(scip !=
NULL);
1358 assert(conshdlr !=
NULL);
1377 assert(conshdlrdata !=
NULL);
1395 for( c = 0; c < nconss; ++c )
1412 assert(conshdlrdata !=
NULL);
1429 assert(conshdlrdata !=
NULL);
1432 assert(sourcedata !=
NULL);
1436 sourcedata->nvars, sourcedata->vars, sourcedata->resvar) );
1455 *infeasible =
FALSE;
1457 for( i = 0; i < nconss && !(*infeasible); i++ )
1477 for( c = 0; c < nusefulconss; ++c )
1501 for( c = 0; c < nusefulconss; ++c )
1523 for( i = 0; i < nconss; i++ )
1550 for( i = 0; i < nconss; i++ )
1577 for( i = 0; i < nconss; i++ )
1601 for( i = 0; i < nconss && (*result ==
SCIP_FEASIBLE || completely); i++ )
1625 assert(conshdlrdata !=
NULL);
1631 for( c = 0; c < nusefulconss && !cutoff; ++c )
1639 else if( nfixedvars > 0 )
1663 assert(result !=
NULL);
1666 oldnfixedvars = *nfixedvars;
1667 oldnaggrvars = *naggrvars;
1668 oldnupgdconss = *nupgdconss;
1671 assert(conshdlrdata !=
NULL);
1675 for( c = 0; c < nconss && !cutoff && !
SCIPisStopped(scip); ++c )
1678 assert(cons !=
NULL);
1680 assert(consdata !=
NULL);
1684 consdata->propagated =
FALSE;
1699 assert(consdata->nvars >= 1);
1702 if( consdata->nvars == 1 )
1706 assert(consdata->vars !=
NULL);
1712 &cutoff, &redundant, &aggregated) );
1728 else if( !consdata->impladded )
1733 for( i = 0; i < consdata->nvars && !cutoff; ++i )
1739 *nchgbds += nimplbdchgs;
1741 consdata->impladded =
TRUE;
1745 if( !cutoff &&
SCIPconsIsActive(cons) && consdata->nvars == 2 && !consdata->opimpladded
1752 (*nchgbds) += nimplbdchgs;
1753 consdata->opimpladded =
TRUE;
1761 else if( *nfixedvars > oldnfixedvars || *naggrvars > oldnaggrvars || *nupgdconss > oldnupgdconss )
1786 assert(consdata !=
NULL);
1792 for( i = 0; i < consdata->nvars; ++i )
1806 assert( scip !=
NULL );
1807 assert( conshdlr !=
NULL );
1808 assert( cons !=
NULL );
1826 assert(valid !=
NULL);
1839 for( v = 0; v < nvars && *valid; ++v )
1842 assert(!(*valid) || vars[v] !=
NULL);
1849 assert(!(*valid) || resvar !=
NULL);
1853 assert(resvar !=
NULL);
1855 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
1879 SCIPdebugMsg(scip,
"parse <%s> as or constraint\n", str);
1890 if( resvar ==
NULL )
1892 SCIPdebugMsg(scip,
"resultant variable %s does not exist \n", token);
1915 if( varssize < requiredsize )
1918 varssize = requiredsize;
1926 assert(varssize >= requiredsize);
1930 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
1950 assert(consdata !=
NULL);
1952 if( varssize < consdata->nvars + 1 )
1957 vars[consdata->nvars] = consdata->resvar;
1970 assert(cons !=
NULL);
1973 assert(consdata !=
NULL);
1975 (*nvars) = consdata->nvars + 1;
1991 assert(eventhdlr !=
NULL);
1992 assert(eventdata !=
NULL);
1993 assert(event !=
NULL);
1996 assert(consdata !=
NULL);
2000 consdata->nofixedone =
FALSE;
2002 consdata->propagated =
FALSE;
2023 eventExecOr,
NULL) );
2031 consEnfolpOr, consEnfopsOr, consCheckOr, consLockOr,
2033 assert(conshdlr !=
NULL);
2099 if( conshdlr ==
NULL )
2106 assert(conshdlrdata !=
NULL);
2112 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
2113 local, modifiable, dynamic, removable, stickingatnode) );
2132 SCIP_CALL(
SCIPcreateConsOr(scip, cons, name, resvar, nvars, vars,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
2154 assert(consdata !=
NULL);
2156 return consdata->nvars;
2175 assert(consdata !=
NULL);
2177 return consdata->vars;
2196 assert(consdata !=
NULL);
2198 return consdata->resvar;
enum SCIP_Result SCIP_RESULT
#define CONSHDLR_DELAYSEPA
#define SCIPfreeBlockMemoryArray(scip, ptr, num)
SCIP_RETCODE SCIPaddVarsToRowSameCoef(SCIP *scip, SCIP_ROW *row, int nvars, SCIP_VAR **vars, SCIP_Real val)
void SCIPconshdlrSetData(SCIP_CONSHDLR *conshdlr, SCIP_CONSHDLRDATA *conshdlrdata)
SCIP_RETCODE SCIPincConsAge(SCIP *scip, SCIP_CONS *cons)
#define SCIPreallocBlockMemoryArray(scip, ptr, oldnum, newnum)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSDELETE((*consdelete)))
SCIP_Bool SCIPinRepropagation(SCIP *scip)
static SCIP_RETCODE delCoefPos(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int pos)
static SCIP_RETCODE conshdlrdataFree(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
static SCIP_RETCODE checkCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_Bool *violated)
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)
static SCIP_RETCODE addRelaxation(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *infeasible)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
static SCIP_RETCODE consdataCatchWatchedEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos, int *filterpos)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSTRANS((*constrans)))
SCIP_RETCODE SCIPgetBinvarRepresentative(SCIP *scip, SCIP_VAR *var, SCIP_VAR **repvar, SCIP_Bool *negated)
static SCIP_RETCODE consdataPrint(SCIP *scip, SCIP_CONSDATA *consdata, FILE *file)
static SCIP_DECL_CONSLOCK(consLockOr)
SCIP_Real SCIPgetVarLbAtIndex(SCIP *scip, SCIP_VAR *var, SCIP_BDCHGIDX *bdchgidx, SCIP_Bool after)
static SCIP_RETCODE unlockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
static SCIP_DECL_CONSINITLP(consInitlpOr)
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_Real SCIPvarGetLbGlobal(SCIP_VAR *var)
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)
#define CONSHDLR_EAGERFREQ
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
SCIP_RETCODE SCIPaddVarToRow(SCIP *scip, SCIP_ROW *row, SCIP_VAR *var, SCIP_Real val)
SCIP_Real SCIPvarGetLbLocal(SCIP_VAR *var)
SCIP_RETCODE SCIPaddConflictBinvar(SCIP *scip, SCIP_VAR *var)
SCIP_RETCODE SCIPincludeEventhdlrBasic(SCIP *scip, SCIP_EVENTHDLR **eventhdlrptr, const char *name, const char *desc, SCIP_DECL_EVENTEXEC((*eventexec)), SCIP_EVENTHDLRDATA *eventhdlrdata)
static SCIP_RETCODE upgradeCons(SCIP *scip, SCIP_CONS *cons, int *nupgdconss)
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_Bool SCIPvarIsBinary(SCIP_VAR *var)
SCIP_Bool SCIPisFeasNegative(SCIP *scip, SCIP_Real val)
static SCIP_RETCODE consdataDropWatchedEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int pos, int filterpos)
static SCIP_RETCODE consdataSwitchWatchedvars(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr, int watchedvar1, int watchedvar2)
SCIP_RETCODE SCIPincludeConshdlrBasic(SCIP *scip, SCIP_CONSHDLR **conshdlrptr, const char *name, const char *desc, int enfopriority, int chckpriority, int eagerfreq, SCIP_Bool needscons, SCIP_DECL_CONSENFOLP((*consenfolp)), SCIP_DECL_CONSENFOPS((*consenfops)), SCIP_DECL_CONSCHECK((*conscheck)), SCIP_DECL_CONSLOCK((*conslock)), SCIP_CONSHDLRDATA *conshdlrdata)
SCIP_RETCODE SCIPcreateConsBasicOr(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *resvar, int nvars, SCIP_VAR **vars)
SCIP_Real SCIPinfinity(SCIP *scip)
int SCIPsnprintf(char *t, int len, const char *s,...)
static SCIP_DECL_CONSCHECK(consCheckOr)
static SCIP_RETCODE conshdlrdataCreate(SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr)
enum SCIP_Retcode SCIP_RETCODE
SCIP_RETCODE SCIPaddVarLocks(SCIP *scip, SCIP_VAR *var, int nlocksdown, int nlocksup)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
static SCIP_RETCODE resolvePropagation(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *infervar, PROPRULE proprule, SCIP_BDCHGIDX *bdchgidx, SCIP_RESULT *result)
static SCIP_DECL_CONSPROP(consPropOr)
SCIP_Bool SCIPconsIsTransformed(SCIP_CONS *cons)
static SCIP_DECL_CONSSEPALP(consSepalpOr)
static SCIP_DECL_CONSPARSE(consParseOr)
SCIP_RETCODE SCIPinitConflictAnalysis(SCIP *scip, SCIP_CONFTYPE conftype, SCIP_Bool iscutoffinvolved)
#define SCIPfreeBlockMemory(scip, ptr)
SCIP_RETCODE SCIPsetConshdlrSepa(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSSEPALP((*conssepalp)), SCIP_DECL_CONSSEPASOL((*conssepasol)), int sepafreq, int sepapriority, SCIP_Bool delaysepa)
Constraint handler for AND constraints, .
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPallocBlockMemory(scip, ptr)
SCIP_Bool SCIPisTransformed(SCIP *scip)
static SCIP_DECL_CONSENFOPS(consEnfopsOr)
#define CONSHDLR_ENFOPRIORITY
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
#define SCIP_EVENTTYPE_BOUNDCHANGED
SCIP_RETCODE SCIPsetConshdlrInitlp(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSINITLP((*consinitlp)))
#define SCIPdebugMsgPrint
SCIP_RETCODE SCIPgetTransformedVars(SCIP *scip, int nvars, SCIP_VAR **vars, SCIP_VAR **transvars)
SCIP_RETCODE SCIPcreateConsOr(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *resvar, int nvars, SCIP_VAR **vars, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
SCIP_RETCODE SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPARSE((*consparse)))
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)
SCIP_Bool SCIProwIsInLP(SCIP_ROW *row)
#define CONSHDLR_MAXPREROUNDS
#define SCIP_EVENTTYPE_LBRELAXED
SCIP_Bool SCIPisConflictAnalysisApplicable(SCIP *scip)
static SCIP_RETCODE createRelaxation(SCIP *scip, SCIP_CONS *cons)
Constraint handler for "or" constraints, .
#define CONSHDLR_SEPAPRIORITY
SCIP_Real SCIPvarGetUbGlobal(SCIP_VAR *var)
static SCIP_DECL_CONSCOPY(consCopyOr)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSDATA **consdata, SCIP_EVENTHDLR *eventhdlr, int nvars, SCIP_VAR **vars, SCIP_VAR *resvar)
SCIP_RETCODE SCIPparseVarsList(SCIP *scip, const char *str, SCIP_VAR **vars, int *nvars, int varssize, int *requiredsize, char **endptr, char delimiter, SCIP_Bool *success)
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)), SCIP_DECL_CONSCOPY((*conscopy)))
static SCIP_RETCODE consdataCatchEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
SCIP_RETCODE SCIPcreateConsAnd(SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR *resvar, int nvars, SCIP_VAR **vars, SCIP_Bool initial, SCIP_Bool separate, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool propagate, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic, SCIP_Bool removable, SCIP_Bool stickingatnode)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
#define CONSHDLR_DELAYPROP
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddVarImplication(SCIP *scip, SCIP_VAR *var, SCIP_Bool varfixing, SCIP_VAR *implvar, SCIP_BOUNDTYPE impltype, SCIP_Real implbound, SCIP_Bool *infeasible, int *nbdchgs)
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)))
SCIP_CONSHDLRDATA * SCIPconshdlrGetData(SCIP_CONSHDLR *conshdlr)
static SCIP_DECL_CONSPRESOL(consPresolOr)
static SCIP_DECL_CONSPRINT(consPrintOr)
#define SCIP_EVENTTYPE_UBRELAXED
#define CONSHDLR_CHECKPRIORITY
#define SCIP_EVENTTYPE_LBTIGHTENED
static SCIP_DECL_CONSFREE(consFreeOr)
static SCIP_DECL_CONSGETVARS(consGetVarsOr)
SCIP_VAR ** SCIPgetVarsOr(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPanalyzeConflictCons(SCIP *scip, SCIP_CONS *cons, SCIP_Bool *success)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
static SCIP_DECL_CONSHDLRCOPY(conshdlrCopyOr)
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
#define CONSHDLR_PRESOLTIMING
#define SCIPallocBufferArray(scip, ptr, num)
public data structures and miscellaneous methods
static int consdataGetNRows(SCIP_CONSDATA *consdata)
SCIP_EVENTTYPE SCIPeventGetType(SCIP_EVENT *event)
int SCIPgetNVarsOr(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPcreateEmptyRowCons(SCIP *scip, SCIP_ROW **row, SCIP_CONSHDLR *conshdlr, const char *name, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool removable)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
static SCIP_DECL_CONSENFORELAX(consEnforelaxOr)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
static SCIP_RETCODE consdataDropEvents(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_EVENTHDLR *eventhdlr)
static SCIP_DECL_CONSSEPASOL(consSepasolOr)
SCIP_Bool SCIPconsIsDeleted(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_RETCODE SCIPdropVarEvent(SCIP *scip, SCIP_VAR *var, SCIP_EVENTTYPE eventtype, SCIP_EVENTHDLR *eventhdlr, SCIP_EVENTDATA *eventdata, int filterpos)
static SCIP_RETCODE separateCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *separated)
static SCIP_DECL_CONSDELETE(consDeleteOr)
#define BMScopyMemoryArray(ptr, source, num)
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)))
#define SCIP_EVENTTYPE_UBTIGHTENED
static SCIP_DECL_EVENTEXEC(eventExecOr)
SCIP_Bool SCIPinProbing(SCIP *scip)
static SCIP_RETCODE consdataFreeRows(SCIP *scip, SCIP_CONSDATA *consdata)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata, SCIP_EVENTHDLR *eventhdlr)
static SCIP_RETCODE propagateCons(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, int *nfixedvars)
SCIP_RETCODE SCIPreleaseRow(SCIP *scip, SCIP_ROW **row)
SCIP_RETCODE SCIPwriteVarsList(SCIP *scip, FILE *file, SCIP_VAR **vars, int nvars, SCIP_Bool type, char delimiter)
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_VAR * SCIPgetResultantOr(SCIP *scip, SCIP_CONS *cons)
static SCIP_DECL_CONSRESPROP(consRespropOr)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
static SCIP_RETCODE lockRounding(SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
static SCIP_DECL_CONSEXITSOL(consExitsolOr)
static SCIP_RETCODE addCoef(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, 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_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_Bool SCIPisStopped(SCIP *scip)
static SCIP_DECL_CONSTRANS(consTransOr)
SCIP_RETCODE SCIPsetConshdlrGetNVars(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSGETNVARS((*consgetnvars)))
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPdoNotAggr(SCIP *scip)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_Real SCIPgetRowSolFeasibility(SCIP *scip, SCIP_ROW *row, SCIP_SOL *sol)
#define CONSHDLR_NEEDSCONS
static SCIP_RETCODE consdataEnsureVarsSize(SCIP *scip, SCIP_CONSDATA *consdata, int num)
#define CONSHDLR_PROP_TIMING
static SCIP_RETCODE analyzeConflictZero(SCIP *scip, SCIP_CONS *cons, int truepos)
struct SCIP_ConshdlrData SCIP_CONSHDLRDATA
SCIP_RETCODE SCIPincludeConshdlrOr(SCIP *scip)
SCIP_Real SCIPvarGetUbLocal(SCIP_VAR *var)
static SCIP_RETCODE analyzeConflictOne(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPisFeasIntegral(SCIP *scip, SCIP_Real val)
SCIP_Bool SCIPvarIsTransformed(SCIP_VAR *var)
#define CONSHDLR_PROPFREQ
static SCIP_DECL_CONSENFOLP(consEnfolpOr)
static SCIP_RETCODE applyFixings(SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr)
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)
char * SCIPstrtok(char *s, const char *delim, char **ptrptr)
SCIP_Real SCIPgetSolVal(SCIP *scip, SCIP_SOL *sol, SCIP_VAR *var)
SCIP_RETCODE SCIPinferBinvarCons(SCIP *scip, SCIP_VAR *var, SCIP_Bool fixedval, SCIP_CONS *infercons, int inferinfo, SCIP_Bool *infeasible, SCIP_Bool *tightened)
SCIP_RETCODE SCIPgetNegatedVar(SCIP *scip, SCIP_VAR *var, SCIP_VAR **negvar)
static SCIP_DECL_CONSGETNVARS(consGetNVarsOr)
#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)
#define CONSHDLR_SEPAFREQ