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) )
833 if( i == consdata->nvars )
835 SCIPinfoMessage(scip, NULL,
" all operands are FALSE and resultant <%s> = TRUE\n",
840 SCIPinfoMessage(scip, NULL,
" operand <%s> = TRUE and resultant <%s> = FALSE\n",
864 assert(separated != NULL);
867 assert(consdata != NULL);
872 if( consdata->rows == NULL )
876 assert(consdata->rows != NULL);
881 for( r = 0; r < nrows; ++r )
891 assert( ! infeasible );
915 assert(consdata != NULL);
917 assert(0 <= truepos && truepos < consdata->nvars);
949 assert(consdata != NULL);
956 for( v = 0; v < consdata->nvars; ++v )
993 assert(cutoff != NULL);
994 assert(nfixedvars != NULL);
997 assert(consdata != NULL);
999 resvar = consdata->resvar;
1000 vars = consdata->vars;
1001 nvars = consdata->nvars;
1006 if( consdata->propagated )
1008 assert(consdata->nofixedone);
1020 if( !consdata->nofixedone )
1026 SCIPdebugMsg(scip,
"constraint <%s>: operator var <%s> fixed to 1.0 -> fix resultant <%s> to 1.0\n",
1049 consdata->nofixedone =
TRUE;
1051 assert(consdata->nofixedone);
1056 for( i = 0; i < nvars && !(*cutoff); ++i )
1058 SCIPdebugMsg(scip,
"constraint <%s>: resultant var <%s> fixed to 0.0 -> fix operator var <%s> to 0.0\n",
1068 else if( tightened )
1091 watchedvar1 = consdata->watchedvar1;
1092 watchedvar2 = consdata->watchedvar2;
1095 if( watchedvar1 != -1 )
1101 if( watchedvar2 != -1 )
1109 if( watchedvar1 == -1 )
1111 watchedvar1 = watchedvar2;
1114 assert(watchedvar1 != -1 || watchedvar2 == -1);
1117 if( watchedvar2 == -1 )
1119 for( i = 0; i < nvars; ++i )
1124 if( watchedvar1 == -1 )
1126 assert(watchedvar2 == -1);
1129 else if( watchedvar1 != i )
1137 assert(watchedvar1 != -1 || watchedvar2 == -1);
1140 if( watchedvar1 == -1 )
1142 assert(watchedvar2 == -1);
1144 SCIPdebugMsg(scip,
"constraint <%s>: all operator vars fixed to 0.0 -> fix resultant <%s> to 0.0\n",
1172 assert(watchedvar1 != -1);
1174 SCIPdebugMsg(scip,
"constraint <%s>: resultant <%s> fixed to 1.0, only one unfixed operand -> fix operand <%s> to 1.0\n",
1201 consdata->propagated =
TRUE;
1228 assert(result != NULL);
1231 assert(consdata != NULL);
1232 vars = consdata->vars;
1233 nvars = consdata->nvars;
1240 assert(infervar == consdata->resvar);
1241 for( i = 0; i < nvars; ++i )
1264 assert(infervar == consdata->resvar);
1265 for( i = 0; i < nvars; ++i )
1278 for( i = 0; i < nvars; ++i )
1280 if( vars[i] != infervar )
1312 assert(nupgdconss != NULL);
1318 SCIPdebugMsg(scip,
"upgrading or constraint <%s> into equivalent and constraint on negated variables\n",
1322 assert(consdata != NULL);
1326 for( i = 0; i < consdata->nvars; ++i )
1360 assert(scip != NULL);
1361 assert(conshdlr != NULL);
1380 assert(conshdlrdata != NULL);
1398 for( c = 0; c < nconss; ++c )
1415 assert(conshdlrdata != NULL);
1432 assert(conshdlrdata != NULL);
1435 assert(sourcedata != NULL);
1439 sourcedata->nvars, sourcedata->vars, sourcedata->resvar) );
1458 *infeasible =
FALSE;
1460 for( i = 0; i < nconss && !(*infeasible); i++ )
1480 for( c = 0; c < nusefulconss; ++c )
1504 for( c = 0; c < nusefulconss; ++c )
1526 for( i = 0; i < nconss; i++ )
1553 for( i = 0; i < nconss; i++ )
1580 for( i = 0; i < nconss; i++ )
1604 for( i = 0; i < nconss && (*result ==
SCIP_FEASIBLE || completely); i++ )
1628 assert(conshdlrdata != NULL);
1634 for( c = 0; c < nusefulconss && !cutoff; ++c )
1642 else if( nfixedvars > 0 )
1666 assert(result != NULL);
1669 oldnfixedvars = *nfixedvars;
1670 oldnaggrvars = *naggrvars;
1671 oldnupgdconss = *nupgdconss;
1674 assert(conshdlrdata != NULL);
1678 for( c = 0; c < nconss && !cutoff && !
SCIPisStopped(scip); ++c )
1681 assert(cons != NULL);
1683 assert(consdata != NULL);
1687 consdata->propagated =
FALSE;
1702 assert(consdata->nvars >= 1);
1705 if( consdata->nvars == 1 )
1709 assert(consdata->vars != NULL);
1715 &cutoff, &redundant, &aggregated) );
1731 else if( !consdata->impladded )
1736 for( i = 0; i < consdata->nvars && !cutoff; ++i )
1742 *nchgbds += nimplbdchgs;
1744 consdata->impladded =
TRUE;
1748 if( !cutoff &&
SCIPconsIsActive(cons) && consdata->nvars == 2 && !consdata->opimpladded
1755 (*nchgbds) += nimplbdchgs;
1756 consdata->opimpladded =
TRUE;
1764 else if( *nfixedvars > oldnfixedvars || *naggrvars > oldnaggrvars || *nupgdconss > oldnupgdconss )
1789 assert(consdata != NULL);
1795 for( i = 0; i < consdata->nvars; ++i )
1809 assert( scip != NULL );
1810 assert( conshdlr != NULL );
1811 assert( cons != NULL );
1829 assert(valid != NULL);
1845 for( v = 0; v < nvars && *valid; ++v )
1848 assert(!(*valid) || vars[v] != NULL);
1855 assert(!(*valid) || resvar != NULL);
1859 assert(resvar != NULL);
1861 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
1885 SCIPdebugMsg(scip,
"parse <%s> as or constraint\n", str);
1896 if( resvar == NULL )
1898 SCIPdebugMsg(scip,
"resultant variable %s does not exist \n", token);
1921 if( varssize < requiredsize )
1924 varssize = requiredsize;
1932 assert(varssize >= requiredsize);
1936 initial, separate, enforce, check, propagate, local, modifiable, dynamic, removable, stickingatnode) );
1956 assert(consdata != NULL);
1958 if( varssize < consdata->nvars + 1 )
1963 vars[consdata->nvars] = consdata->resvar;
1976 assert(cons != NULL);
1979 assert(consdata != NULL);
1981 (*nvars) = consdata->nvars + 1;
1997 assert(eventhdlr != NULL);
1998 assert(eventdata != NULL);
1999 assert(event != NULL);
2002 assert(consdata != NULL);
2006 consdata->nofixedone =
FALSE;
2008 consdata->propagated =
FALSE;
2029 eventExecOr, NULL) );
2037 consEnfolpOr, consEnfopsOr, consCheckOr, consLockOr,
2039 assert(conshdlr != NULL);
2105 if( conshdlr == NULL )
2112 assert(conshdlrdata != NULL);
2118 SCIP_CALL(
SCIPcreateCons(scip, cons, name, conshdlr, consdata, initial, separate, enforce, check, propagate,
2119 local, modifiable, dynamic, removable, stickingatnode) );
2138 SCIP_CALL(
SCIPcreateConsOr(scip, cons, name, resvar, nvars, vars,
TRUE,
TRUE,
TRUE,
TRUE,
TRUE,
2160 assert(consdata != NULL);
2162 return consdata->nvars;
2181 assert(consdata != NULL);
2183 return consdata->vars;
2202 assert(consdata != NULL);
2204 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 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
#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)
void SCIPupdateSolConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
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