47#define CONSHDLR_NAME "conjunction"
48#define CONSHDLR_DESC "conjunction of constraints"
49#define CONSHDLR_ENFOPRIORITY +900000
50#define CONSHDLR_CHECKPRIORITY -900000
51#define CONSHDLR_EAGERFREQ 100
53#define CONSHDLR_MAXPREROUNDS -1
54#define CONSHDLR_NEEDSCONS TRUE
56#define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_FAST
90 (*consdata)->consssize = nconss;
91 (*consdata)->nconss = nconss;
101 for(
c = 0;
c < nconss; ++
c )
109 (*consdata)->conss =
NULL;
110 (*consdata)->consssize = 0;
111 (*consdata)->nconss = 0;
130 for(
c = 0;
c < (*consdata)->nconss; ++
c )
155 assert(consdata->nconss < consdata->consssize);
158 consdata->conss[consdata->nconss] = cons;
189 for(
c = 0;
c < nconss; ++
c )
195 for(
i = 0;
i < consdata->nconss; ++
i )
269 SCIPinfoMessage(
scip,
NULL,
"Conjunction constraint %s is violated, at least the sub-constraint %s is violated by this given solution.\n",
326 if( sourcedata->nconss > 0 )
328 targetdata->consssize = sourcedata->nconss;
329 targetdata->nconss = sourcedata->nconss;
331 for(
c = 0;
c < sourcedata->nconss; ++
c )
338 targetdata->conss =
NULL;
339 targetdata->consssize = 0;
340 targetdata->nconss = 0;
422 for(
c = 0;
c < nconss; ++
c )
428 for(
i = 0;
i < consdata->nconss; ++
i )
449 consdata->nconss = 0;
475 for(
c = 0;
c < consdata->nconss; ++
c )
500 for(
i = 0;
i < consdata->nconss; ++
i )
520 char* nexttokenstart;
541 saveptr = strpbrk(copystr,
"(");
543 if( saveptr ==
NULL )
554 nexttokenstart = saveptr;
557 saveptr = strpbrk(saveptr,
"(,");
562 if( saveptr !=
NULL )
566 int bracketcounter = 0;
568 if( *saveptr ==
'(' )
576 while( bracketcounter > 0 )
578 saveptr = strpbrk(saveptr,
"()");
580 if( saveptr !=
NULL )
582 if( *saveptr ==
'(' )
597 saveptr = strpbrk(saveptr,
"(,");
599 while( saveptr !=
NULL && *saveptr ==
'(' );
603 if( saveptr !=
NULL )
608 if( nconss == sconss )
616 assert(saveptr > nexttokenstart);
620 token[saveptr - nexttokenstart] =
'\0';
625 SCIP_CALL(
SCIPparseCons(
scip, &(conss[nconss]), token, initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode, success) );
639 nexttokenstart = saveptr;
641 saveptr = strpbrk(saveptr,
"(,");
644 while( saveptr !=
NULL );
648 saveptr = strrchr(nexttokenstart,
')');
650 if( saveptr ==
NULL )
660 if( nconss == sconss )
666 assert(saveptr > nexttokenstart);
670 token[saveptr - nexttokenstart] =
'\0';
675 SCIP_CALL(
SCIPparseCons(
scip, &(conss[nconss]), token, initial,
separate, enforce, check,
propagate, local, modifiable, dynamic, removable, stickingatnode, success) );
682 assert(nconss > 0 || !(*success));
689 enforce, check, local, modifiable, dynamic) );
693 for( --nconss; nconss >= 0; --nconss )
721 sourceconss = sourcedata->conss;
722 nconss = sourcedata->nconss;
731 for(
c = 0;
c < nconss && (*valid); ++
c )
748 enforce, check, local, modifiable, dynamic) );
753 enforce, check, local, modifiable, dynamic) );
758 for(
c = (*
valid ?
c - 1 :
c - 2);
c >= 0; --
c )
785 consEnfolpConjunction, consEnfopsConjunction, consCheckConjunction, consLockConjunction,
832 if( conshdlr ==
NULL )
842 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
#define SCIP_STRINGEQ(name, reference, retcode)
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
static SCIP_RETCODE separate(SCIP *scip, SCIP_SEPA *sepa, SCIP_SOL *sol, SCIP_RESULT *result)
Main separation function.
#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