Scippy

SCIP

Solving Constraint Integer Programs

cons_conjunction.c File Reference

Detailed Description

constraint handler for conjunction constraints

Author
Tobias Achterberg

Definition in file cons_conjunction.c.

#include <assert.h>
#include <string.h>
#include <limits.h>
#include "scip/cons_conjunction.h"

Go to the source code of this file.

Macros

#define CONSHDLR_NAME   "conjunction"
 
#define CONSHDLR_DESC   "conjunction of constraints"
 
#define CONSHDLR_ENFOPRIORITY   +900000
 
#define CONSHDLR_CHECKPRIORITY   -900000
 
#define CONSHDLR_EAGERFREQ   100
 
#define CONSHDLR_MAXPREROUNDS   -1
 
#define CONSHDLR_DELAYPRESOL   FALSE
 
#define CONSHDLR_NEEDSCONS   TRUE
 

Functions

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 consdataAddCons (SCIP *scip, SCIP_CONSDATA *consdata, SCIP_CONS *cons)
 
static SCIP_RETCODE addAllConss (SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_RESULT *result)
 
static SCIP_RETCODE checkAllConss (SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result)
 
static SCIP_DECL_CONSDELETE (consDeleteConjunction)
 
static SCIP_DECL_CONSTRANS (consTransConjunction)
 
static SCIP_DECL_CONSENFOLP (consEnfolpConjunction)
 
static SCIP_DECL_CONSENFOPS (consEnfopsConjunction)
 
static SCIP_DECL_CONSCHECK (consCheckConjunction)
 
static SCIP_DECL_CONSPRESOL (consPresolConjunction)
 
static SCIP_DECL_CONSLOCK (consLockConjunction)
 
static SCIP_DECL_CONSPRINT (consPrintConjunction)
 
static SCIP_DECL_CONSPARSE (consParseConjunction)
 
SCIP_RETCODE SCIPincludeConshdlrConjunction (SCIP *scip)
 
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 SCIPcreateConsBasicConjunction (SCIP *scip, SCIP_CONS **cons, const char *name, int nconss, SCIP_CONS **conss)
 
SCIP_RETCODE SCIPaddConsElemConjunction (SCIP *scip, SCIP_CONS *cons, SCIP_CONS *addcons)
 

Macro Definition Documentation

#define CONSHDLR_NAME   "conjunction"
#define CONSHDLR_DESC   "conjunction of constraints"

Definition at line 32 of file cons_conjunction.c.

Referenced by SCIPincludeConshdlrConjunction().

#define CONSHDLR_ENFOPRIORITY   +900000

priority of the constraint handler for constraint enforcing

Definition at line 33 of file cons_conjunction.c.

Referenced by SCIPincludeConshdlrConjunction().

#define CONSHDLR_CHECKPRIORITY   -900000

priority of the constraint handler for checking feasibility

Definition at line 34 of file cons_conjunction.c.

Referenced by SCIPincludeConshdlrConjunction().

#define CONSHDLR_EAGERFREQ   100

frequency for using all instead of only the useful constraints in separation, propagation and enforcement, -1 for no eager evaluations, 0 for first only

Definition at line 35 of file cons_conjunction.c.

Referenced by SCIPincludeConshdlrConjunction().

#define CONSHDLR_MAXPREROUNDS   -1

maximal number of presolving rounds the constraint handler participates in (-1: no limit)

Definition at line 37 of file cons_conjunction.c.

Referenced by SCIPincludeConshdlrConjunction().

#define CONSHDLR_DELAYPRESOL   FALSE

should presolving method be delayed, if other presolvers found reductions?

Definition at line 38 of file cons_conjunction.c.

Referenced by SCIPincludeConshdlrConjunction().

#define CONSHDLR_NEEDSCONS   TRUE

should the constraint handler be skipped, if no constraints are available?

Definition at line 39 of file cons_conjunction.c.

Referenced by SCIPincludeConshdlrConjunction().

Function Documentation

static SCIP_RETCODE consdataCreate ( SCIP scip,
SCIP_CONSDATA **  consdata,
SCIP_CONS **  conss,
int  nconss 
)
static

creates conjunction constraint data, captures initial constraints of conjunction

Parameters
scipSCIP data structure
consdatapointer to constraint data
conssinitial constraint in conjunction
nconssnumber of initial constraints in conjunction

Definition at line 60 of file cons_conjunction.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPcaptureCons(), SCIPduplicateBlockMemoryArray, SCIPisTransformed(), and SCIPtransformConss().

Referenced by SCIPcreateConsConjunction().

static SCIP_RETCODE consdataFree ( SCIP scip,
SCIP_CONSDATA **  consdata 
)
static

frees constraint data and releases all constraints in conjunction

Parameters
scipSCIP data structure
consdatapointer to constraint data

Definition at line 102 of file cons_conjunction.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArrayNull, and SCIPreleaseCons().

Referenced by SCIP_DECL_CONSDELETE().

static SCIP_RETCODE consdataAddCons ( SCIP scip,
SCIP_CONSDATA consdata,
SCIP_CONS cons 
)
static

adds constraint to conjunction

Parameters
scipSCIP data structure
consdataconstraint data
consconstraint to add to the conjunction

Definition at line 127 of file cons_conjunction.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPcaptureCons(), SCIPensureBlockMemoryArray, SCIPisTransformed(), and SCIPtransformCons().

Referenced by SCIPaddConsElemConjunction().

static SCIP_RETCODE addAllConss ( SCIP scip,
SCIP_CONS **  conss,
int  nconss,
SCIP_RESULT result 
)
static

adds all constraints in conjunction constraints to the problem; disables unmodifiable conjunction constraints

Parameters
scipSCIP data structure
conssactive conjunction constraints
nconssnumber of active conjunction constraints
resultpointer to store the result

Definition at line 159 of file cons_conjunction.c.

References NULL, SCIP_CALL, SCIP_CONSADDED, SCIP_OKAY, SCIPaddConsLocal(), SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsModifiable(), SCIPdebugMessage, SCIPdelConsLocal(), SCIPsetConsChecked(), and TRUE.

Referenced by SCIP_DECL_CONSENFOLP(), and SCIP_DECL_CONSENFOPS().

static SCIP_RETCODE checkAllConss ( SCIP scip,
SCIP_CONS **  conss,
int  nconss,
SCIP_SOL sol,
SCIP_Bool  checkintegrality,
SCIP_Bool  checklprows,
SCIP_Bool  printreason,
SCIP_RESULT result 
)
static

checks all constraints in conjunction constraints for feasibility

Parameters
scipSCIP data structure
conssactive conjunction constraints
nconssnumber of active conjunction constraints
solsolution to check
checkintegralityhas integrality to be checked?
checklprowshave current LP rows to be checked?
printreasonshould the reason for the violation be printed?
resultpointer to store the result

Definition at line 208 of file cons_conjunction.c.

References NULL, SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIPcheckCons(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebug, SCIPinfoMessage(), and SCIPprintCons().

Referenced by SCIP_DECL_CONSCHECK().

static SCIP_DECL_CONSDELETE ( consDeleteConjunction  )
static

frees specific constraint data

Definition at line 274 of file cons_conjunction.c.

References consdataFree(), SCIP_CALL, and SCIP_OKAY.

static SCIP_DECL_CONSENFOLP ( consEnfolpConjunction  )
static

constraint enforcing method of constraint handler for LP solutions

Definition at line 325 of file cons_conjunction.c.

References addAllConss(), SCIP_CALL, SCIP_FEASIBLE, and SCIP_OKAY.

static SCIP_DECL_CONSENFOPS ( consEnfopsConjunction  )
static

constraint enforcing method of constraint handler for pseudo solutions

Definition at line 338 of file cons_conjunction.c.

References addAllConss(), SCIP_CALL, SCIP_FEASIBLE, and SCIP_OKAY.

static SCIP_DECL_CONSCHECK ( consCheckConjunction  )
static

feasibility check method of constraint handler for integral solutions

Definition at line 351 of file cons_conjunction.c.

References checkAllConss(), SCIP_CALL, SCIP_FEASIBLE, and SCIP_OKAY.

static SCIP_DECL_CONSPRESOL ( consPresolConjunction  )
static
static SCIP_DECL_CONSLOCK ( consLockConjunction  )
static

variable rounding lock method of constraint handler

Definition at line 420 of file cons_conjunction.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPaddConsLocks(), and SCIPconsGetData().

static SCIP_DECL_CONSPRINT ( consPrintConjunction  )
static

constraint display method of constraint handler

Definition at line 440 of file cons_conjunction.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPinfoMessage(), and SCIPprintCons().

static SCIP_DECL_CONSPARSE ( consParseConjunction  )
static
SCIP_RETCODE SCIPincludeConshdlrConjunction ( SCIP scip)
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 
)

creates and captures a conjunction constraint

Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
nconssnumber of initial constraints in conjunction
conssinitial constraint in conjunction
enforceshould the constraint be enforced during node processing? TRUE for model constraints, FALSE for additional, redundant constraints.
checkshould the constraint be checked for feasibility? TRUE for model constraints, FALSE for additional, redundant constraints.
localis constraint only valid locally? Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints.
modifiableis constraint modifiable (subject to column generation)? Usually set to FALSE. In column generation applications, set to TRUE if pricing adds coefficients to this constraint.
dynamicis constraint subject to aging? Usually set to FALSE. Set to TRUE for own cuts which are separated as constraints.

Definition at line 698 of file cons_conjunction.c.

References consdataCreate(), CONSHDLR_NAME, FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_PLUGINNOTFOUND, SCIPcreateCons(), SCIPerrorMessage, and SCIPfindConshdlr().

Referenced by SCIP_DECL_CONSPARSE(), and SCIPcreateConsBasicConjunction().

SCIP_RETCODE SCIPcreateConsBasicConjunction ( SCIP scip,
SCIP_CONS **  cons,
const char *  name,
int  nconss,
SCIP_CONS **  conss 
)

creates and captures an and constraint in its most basic version, i. e., all constraint flags are set to their basic value as explained for the method SCIPcreateConsConjunction(); all flags can be set via SCIPsetConsFLAGNAME-methods in scip.h

See Also
SCIPcreateConsConjunction() for information about the basic constraint flag configuration
Note
the constraint gets captured, hence at one point you have to release it using the method SCIPreleaseCons()
Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
nconssnumber of initial constraints in conjunction
conssinitial constraint in conjunction

Definition at line 747 of file cons_conjunction.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPcreateConsConjunction(), and TRUE.

SCIP_RETCODE SCIPaddConsElemConjunction ( SCIP scip,
SCIP_CONS cons,
SCIP_CONS addcons 
)

adds constraint to the conjunction of constraints

Parameters
scipSCIP data structure
consconjunction constraint
addconsadditional constraint in conjunction

Definition at line 764 of file cons_conjunction.c.

References consdataAddCons(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPerrorMessage.