49#define CONSHDLR_NAME "conjunction"
50#define CONSHDLR_DESC "conjunction of constraints"
51#define CONSHDLR_ENFOPRIORITY +900000
52#define CONSHDLR_CHECKPRIORITY -900000
53#define CONSHDLR_EAGERFREQ 100
55#define CONSHDLR_MAXPREROUNDS -1
56#define CONSHDLR_NEEDSCONS TRUE
58#define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_FAST
92 (*consdata)->consssize = nconss;
93 (*consdata)->nconss = nconss;
103 for(
c = 0;
c < nconss; ++
c )
111 (*consdata)->conss =
NULL;
112 (*consdata)->consssize = 0;
113 (*consdata)->nconss = 0;
132 for(
c = 0;
c < (*consdata)->nconss; ++
c )
157 assert(consdata->nconss < consdata->consssize);
160 consdata->conss[consdata->nconss] = cons;
191 for(
c = 0;
c < nconss; ++
c )
197 for(
i = 0;
i < consdata->nconss; ++
i )
271 SCIPinfoMessage(
scip,
NULL,
"Conjunction constraint %s is violated, at least the sub-constraint %s is violated by this given solution.\n",
327 if( sourcedata->nconss > 0 )
329 targetdata->consssize = sourcedata->nconss;
330 targetdata->nconss = sourcedata->nconss;
332 for(
c = 0;
c < sourcedata->nconss; ++
c )
339 targetdata->conss =
NULL;
340 targetdata->consssize = 0;
341 targetdata->nconss = 0;
423 for(
c = 0;
c < nconss; ++
c )
429 for(
i = 0;
i < consdata->nconss; ++
i )
450 consdata->nconss = 0;
476 for(
c = 0;
c < consdata->nconss; ++
c )
501 for(
i = 0;
i < consdata->nconss; ++
i )
521 char* nexttokenstart;
542 saveptr = strpbrk(copystr,
"(");
544 if( saveptr ==
NULL )
555 nexttokenstart = saveptr;
558 saveptr = strpbrk(saveptr,
"(,");
563 if( saveptr !=
NULL )
567 int bracketcounter = 0;
569 if( *saveptr ==
'(' )
577 while( bracketcounter > 0 )
579 saveptr = strpbrk(saveptr,
"()");
581 if( saveptr !=
NULL )
583 if( *saveptr ==
'(' )
598 saveptr = strpbrk(saveptr,
"(,");
600 while( saveptr !=
NULL && *saveptr ==
'(' );
604 if( saveptr !=
NULL )
609 if( nconss == sconss )
617 assert(saveptr > nexttokenstart);
621 token[saveptr - nexttokenstart] =
'\0';
626 SCIP_CALL(
SCIPparseCons(
scip, &(conss[nconss]), token, initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode, success) );
640 nexttokenstart = saveptr;
642 saveptr = strpbrk(saveptr,
"(,");
645 while( saveptr !=
NULL );
649 saveptr = strrchr(nexttokenstart,
')');
651 if( saveptr ==
NULL )
661 if( nconss == sconss )
667 assert(saveptr > nexttokenstart);
671 token[saveptr - nexttokenstart] =
'\0';
676 SCIP_CALL(
SCIPparseCons(
scip, &(conss[nconss]), token, initial, separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode, success) );
683 assert(nconss > 0 || !(*success));
690 enforce, check, local, modifiable, dynamic) );
694 for( --nconss; nconss >= 0; --nconss )
722 sourceconss = sourcedata->conss;
723 nconss = sourcedata->nconss;
732 for(
c = 0;
c < nconss && (*valid); ++
c )
749 enforce, check, local, modifiable, dynamic) );
754 enforce, check, local, modifiable, dynamic) );
759 for(
c = (*
valid ?
c - 1 :
c - 2);
c >= 0; --
c )
786 consEnfolpConjunction, consEnfopsConjunction, consCheckConjunction, consLockConjunction,
833 if( conshdlr ==
NULL )
843 SCIP_CALL(
SCIPcreateCons(
scip, cons, name, conshdlr, consdata,
FALSE,
FALSE, enforce, check,
FALSE,
#define CONSHDLR_NEEDSCONS
#define CONSHDLR_CHECKPRIORITY
#define CONSHDLR_MAXPREROUNDS
#define CONSHDLR_PRESOLTIMING
#define CONSHDLR_EAGERFREQ
#define CONSHDLR_ENFOPRIORITY
static SCIP_RETCODE checkAllConss(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_Bool completely, SCIP_RESULT *result)
static SCIP_RETCODE consdataAddCons(SCIP *scip, SCIP_CONSDATA *consdata, SCIP_CONS *cons)
static SCIP_RETCODE consdataCreate(SCIP *scip, SCIP_CONSDATA **consdata, SCIP_CONS **conss, int nconss)
static SCIP_RETCODE consdataFree(SCIP *scip, SCIP_CONSDATA **consdata)
static SCIP_RETCODE addAllConss(SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_RESULT *result)
constraint handler for conjunction constraints
SCIP_RETCODE SCIPcreateConsConjunction(SCIP *scip, SCIP_CONS **cons, const char *name, int nconss, SCIP_CONS **conss, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic)
SCIP_RETCODE SCIPaddConsElemConjunction(SCIP *scip, SCIP_CONS *cons, SCIP_CONS *addcons)
SCIP_RETCODE SCIPcreateConsBasicConjunction(SCIP *scip, SCIP_CONS **cons, const char *name, int nconss, SCIP_CONS **conss)
SCIP_RETCODE SCIPincludeConshdlrConjunction(SCIP *scip)
SCIP_RETCODE SCIPgetConsCopy(SCIP *sourcescip, SCIP *targetscip, SCIP_CONS *sourcecons, SCIP_CONS **targetcons, SCIP_CONSHDLR *sourceconshdlr, SCIP_HASHMAP *varmap, SCIP_HASHMAP *consmap, const char *name, 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 global, SCIP_Bool *valid)
SCIP_Bool SCIPisTransformed(SCIP *scip)
SCIP_RETCODE SCIPaddCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPdelCons(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPdelConsLocal(SCIP *scip, SCIP_CONS *cons)
SCIP_RETCODE SCIPaddConsLocal(SCIP *scip, SCIP_CONS *cons, SCIP_NODE *validnode)
void SCIPinfoMessage(SCIP *scip, FILE *file, const char *formatstr,...)
SCIP_RETCODE SCIPsetConshdlrPresol(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSPRESOL((*conspresol)), int maxprerounds, SCIP_PRESOLTIMING presoltiming)
SCIP_RETCODE SCIPsetConshdlrEnforelax(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
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 SCIPsetConshdlrParse(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrPrint(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
const char * SCIPconshdlrGetName(SCIP_CONSHDLR *conshdlr)
SCIP_RETCODE SCIPsetConshdlrCopy(SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_DECL_CONSHDLRCOPY((*conshdlrcopy)),)
SCIP_CONSHDLR * SCIPfindConshdlr(SCIP *scip, const char *name)
SCIP_RETCODE SCIPsetConshdlrDelete(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_RETCODE SCIPsetConshdlrTrans(SCIP *scip, SCIP_CONSHDLR *conshdlr,)
SCIP_CONSDATA * SCIPconsGetData(SCIP_CONS *cons)
SCIP_RETCODE SCIPcheckCons(SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result)
SCIP_Bool SCIPconsIsDynamic(SCIP_CONS *cons)
SCIP_CONSHDLR * SCIPconsGetHdlr(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsInitial(SCIP_CONS *cons)
SCIP_RETCODE SCIPprintCons(SCIP *scip, SCIP_CONS *cons, FILE *file)
SCIP_RETCODE SCIPtransformConss(SCIP *scip, int nconss, SCIP_CONS **conss, SCIP_CONS **transconss)
SCIP_Bool SCIPconsIsChecked(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsEnforced(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsActive(SCIP_CONS *cons)
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 SCIPconsIsPropagated(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsLocal(SCIP_CONS *cons)
SCIP_RETCODE SCIPaddConsLocksType(SCIP *scip, SCIP_CONS *cons, SCIP_LOCKTYPE locktype, int nlockspos, int nlocksneg)
const char * SCIPconsGetName(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsModifiable(SCIP_CONS *cons)
SCIP_Bool SCIPconsIsStickingAtNode(SCIP_CONS *cons)
SCIP_RETCODE SCIPparseCons(SCIP *scip, SCIP_CONS **cons, const char *str, 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 *success)
SCIP_RETCODE SCIPreleaseCons(SCIP *scip, SCIP_CONS **cons)
SCIP_RETCODE SCIPtransformCons(SCIP *scip, SCIP_CONS *cons, SCIP_CONS **transcons)
SCIP_RETCODE SCIPsetConsChecked(SCIP *scip, SCIP_CONS *cons, SCIP_Bool check)
SCIP_Bool SCIPconsIsSeparated(SCIP_CONS *cons)
SCIP_RETCODE SCIPcaptureCons(SCIP *scip, SCIP_CONS *cons)
SCIP_Bool SCIPconsIsRemovable(SCIP_CONS *cons)
#define SCIPensureBlockMemoryArray(scip, ptr, arraysizeptr, minsize)
int SCIPcalcMemGrowSize(SCIP *scip, int num)
#define SCIPallocBufferArray(scip, ptr, num)
#define SCIPreallocBufferArray(scip, ptr, num)
#define SCIPfreeBufferArray(scip, ptr)
#define SCIPduplicateBufferArray(scip, ptr, source, num)
#define SCIPallocBlockMemoryArray(scip, ptr, num)
#define SCIPfreeBlockMemory(scip, ptr)
#define SCIPfreeBlockMemoryArrayNull(scip, ptr, num)
#define SCIPallocBlockMemory(scip, ptr)
#define SCIPduplicateBlockMemoryArray(scip, ptr, source, num)
void SCIPupdateSolConsViolation(SCIP *scip, SCIP_SOL *sol, SCIP_Real absviol, SCIP_Real relviol)
assert(minobj< SCIPgetCutoffbound(scip))
static SCIP_Bool propagate
memory allocation routines
public methods for managing constraints
public methods for message output
public methods for constraint handler plugins and constraints
public methods for problem copies
public methods for memory management
public methods for message handling
public methods for global and local (sub)problems
public methods for solutions
#define SCIP_DECL_CONSENFOLP(x)
#define SCIP_DECL_CONSDELETE(x)
struct SCIP_Cons SCIP_CONS
#define SCIP_DECL_CONSPRINT(x)
#define SCIP_DECL_CONSENFORELAX(x)
#define SCIP_DECL_CONSENFOPS(x)
#define SCIP_DECL_CONSPARSE(x)
#define SCIP_DECL_CONSTRANS(x)
#define SCIP_DECL_CONSPRESOL(x)
#define SCIP_DECL_CONSLOCK(x)
struct SCIP_Conshdlr SCIP_CONSHDLR
#define SCIP_DECL_CONSCOPY(x)
struct SCIP_ConsData SCIP_CONSDATA
#define SCIP_DECL_CONSCHECK(x)
#define SCIP_DECL_CONSHDLRCOPY(x)
enum SCIP_Result SCIP_RESULT
enum SCIP_Retcode SCIP_RETCODE