Detailed Description
constraint handler for disjunction constraints
Definition in file cons_disjunction.c.
#include "blockmemshell/memory.h"
#include "scip/cons_disjunction.h"
#include "scip/pub_cons.h"
#include "scip/pub_message.h"
#include "scip/pub_tree.h"
#include "scip/scip_branch.h"
#include "scip/scip_cons.h"
#include "scip/scip_copy.h"
#include "scip/scip_general.h"
#include "scip/scip_mem.h"
#include "scip/scip_message.h"
#include "scip/scip_param.h"
#include "scip/scip_prob.h"
#include "scip/scip_probing.h"
#include "scip/scip_sol.h"
#include "scip/scip_solvingstats.h"
#include "scip/scip_tree.h"
#include <string.h>
Go to the source code of this file.
Macros | |
#define | CONSHDLR_NAME "disjunction" |
#define | CONSHDLR_DESC "disjunction of constraints (or(cons1, cons2, ..., consn))" |
#define | CONSHDLR_ENFOPRIORITY -950000 |
#define | CONSHDLR_CHECKPRIORITY -900000 |
#define | CONSHDLR_PROPFREQ -1 |
#define | CONSHDLR_EAGERFREQ 100 |
#define | CONSHDLR_MAXPREROUNDS -1 |
#define | CONSHDLR_DELAYPROP FALSE |
#define | CONSHDLR_NEEDSCONS TRUE |
#define | CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_FAST |
#define | CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP |
#define | DEFAULT_ALWAYSBRANCH TRUE |
Functions | |
static SCIP_RETCODE | consdataCreate (SCIP *scip, SCIP_CONSDATA **consdata, SCIP_CONS **conss, int nconss, SCIP_CONS *relaxcons) |
static SCIP_RETCODE | consdataFree (SCIP *scip, SCIP_CONSDATA **consdata) |
static SCIP_RETCODE | consdataAddCons (SCIP *scip, SCIP_CONSDATA *consdata, SCIP_CONS *cons) |
static SCIP_RETCODE | branchCons (SCIP *scip, SCIP_CONS *cons, SCIP_RESULT *result) |
static SCIP_RETCODE | checkCons (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool checkintegrality, SCIP_Bool checklprows, SCIP_Bool printreason, SCIP_RESULT *result) |
static SCIP_RETCODE | propagateCons (SCIP *scip, SCIP_CONS *cons, int *ndelconss) |
static SCIP_RETCODE | enforceConstraint (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_CONS **conss, int nconss, SCIP_SOL *sol, SCIP_RESULT *result) |
static | SCIP_DECL_CONSHDLRCOPY (conshdlrCopyDisjunction) |
static | SCIP_DECL_CONSFREE (consFreeDisjunction) |
static | SCIP_DECL_CONSDELETE (consDeleteDisjunction) |
static | SCIP_DECL_CONSTRANS (consTransDisjunction) |
static | SCIP_DECL_CONSINITLP (consInitlpDisjunction) |
static | SCIP_DECL_CONSENFOLP (consEnfolpDisjunction) |
static | SCIP_DECL_CONSENFORELAX (consEnforelaxDisjunction) |
static | SCIP_DECL_CONSENFOPS (consEnfopsDisjunction) |
static | SCIP_DECL_CONSCHECK (consCheckDisjunction) |
static | SCIP_DECL_CONSPROP (consPropDisjunction) |
static | SCIP_DECL_CONSPRESOL (consPresolDisjunction) |
static | SCIP_DECL_CONSLOCK (consLockDisjunction) |
static | SCIP_DECL_CONSPRINT (consPrintDisjunction) |
static | SCIP_DECL_CONSPARSE (consParseDisjunction) |
static | SCIP_DECL_CONSCOPY (consCopyDisjunction) |
SCIP_RETCODE | SCIPincludeConshdlrDisjunction (SCIP *scip) |
SCIP_RETCODE | SCIPcreateConsDisjunction (SCIP *scip, SCIP_CONS **cons, const char *name, int nconss, SCIP_CONS **conss, SCIP_CONS *relaxcons, SCIP_Bool initial, SCIP_Bool enforce, SCIP_Bool check, SCIP_Bool local, SCIP_Bool modifiable, SCIP_Bool dynamic) |
SCIP_RETCODE | SCIPcreateConsBasicDisjunction (SCIP *scip, SCIP_CONS **cons, const char *name, int nconss, SCIP_CONS **conss, SCIP_CONS *relaxcons) |
SCIP_RETCODE | SCIPaddConsElemDisjunction (SCIP *scip, SCIP_CONS *cons, SCIP_CONS *addcons) |
Macro Definition Documentation
◆ CONSHDLR_NAME
#define CONSHDLR_NAME "disjunction" |
Definition at line 55 of file cons_disjunction.c.
◆ CONSHDLR_DESC
#define CONSHDLR_DESC "disjunction of constraints (or(cons1, cons2, ..., consn))" |
Definition at line 56 of file cons_disjunction.c.
◆ CONSHDLR_ENFOPRIORITY
#define CONSHDLR_ENFOPRIORITY -950000 |
priority of the constraint handler for constraint enforcing
Definition at line 57 of file cons_disjunction.c.
◆ CONSHDLR_CHECKPRIORITY
#define CONSHDLR_CHECKPRIORITY -900000 |
priority of the constraint handler for checking feasibility
Definition at line 58 of file cons_disjunction.c.
◆ CONSHDLR_PROPFREQ
#define CONSHDLR_PROPFREQ -1 |
frequency for propagating domains; zero means only preprocessing propagation
Definition at line 59 of file cons_disjunction.c.
◆ CONSHDLR_EAGERFREQ
#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 61 of file cons_disjunction.c.
◆ CONSHDLR_MAXPREROUNDS
#define CONSHDLR_MAXPREROUNDS -1 |
maximal number of presolving rounds the constraint handler participates in (-1: no limit)
Definition at line 63 of file cons_disjunction.c.
◆ CONSHDLR_DELAYPROP
#define CONSHDLR_DELAYPROP FALSE |
should propagation method be delayed, if other propagators found reductions?
Definition at line 64 of file cons_disjunction.c.
◆ CONSHDLR_NEEDSCONS
#define CONSHDLR_NEEDSCONS TRUE |
should the constraint handler be skipped, if no constraints are available?
Definition at line 65 of file cons_disjunction.c.
◆ CONSHDLR_PRESOLTIMING
#define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_FAST |
Definition at line 67 of file cons_disjunction.c.
◆ CONSHDLR_PROP_TIMING
#define CONSHDLR_PROP_TIMING SCIP_PROPTIMING_BEFORELP |
Definition at line 68 of file cons_disjunction.c.
◆ DEFAULT_ALWAYSBRANCH
#define DEFAULT_ALWAYSBRANCH TRUE |
alawys perform branching if one of the constraints is violated, otherwise only if all integers are fixed
Definition at line 71 of file cons_disjunction.c.
Function Documentation
◆ consdataCreate()
|
static |
creates disjunction constraint data, captures initial constraints of disjunction
- Parameters
-
scip SCIP data structure consdata pointer to constraint data conss initial constraint in disjunction nconss number of initial constraints in disjunction relaxcons a conjunction constraint containing the liner relaxation of the disjunction constraint, or NULL
Definition at line 100 of file cons_disjunction.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, SCIPcaptureCons(), SCIPduplicateBlockMemoryArray, SCIPisTransformed(), SCIPtransformCons(), and SCIPtransformConss().
Referenced by SCIP_DECL_CONSTRANS(), and SCIPcreateConsDisjunction().
◆ consdataFree()
|
static |
frees constraint data and releases all constraints in disjunction
- Parameters
-
scip SCIP data structure consdata pointer to constraint data
Definition at line 163 of file cons_disjunction.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArrayNull, and SCIPreleaseCons().
Referenced by SCIP_DECL_CONSDELETE().
◆ consdataAddCons()
|
static |
adds constraint to disjunction
- Parameters
-
scip SCIP data structure consdata constraint data cons constraint to add to the disjunction
Definition at line 195 of file cons_disjunction.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPcaptureCons(), SCIPensureBlockMemoryArray, SCIPisTransformed(), and SCIPtransformCons().
Referenced by SCIPaddConsElemDisjunction().
◆ branchCons()
|
static |
branches on disjunctive constraint
- Parameters
-
scip SCIP data structure cons active disjunction constraint result pointer to store the result
Definition at line 229 of file cons_disjunction.c.
References NULL, SCIP_BRANCHED, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPaddConsNode(), SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsModifiable(), SCIPcreateChild(), SCIPdebugMsg, SCIPdelConsNode(), SCIPgetCurrentNode(), SCIPgetLocalTransEstimate(), SCIPnodeGetNumber(), SCIPresetConsAge(), SCIPsetConsChecked(), SCIPsetConsLocal(), and TRUE.
Referenced by enforceConssSOS1(), enforceConstraint(), enforceIndicators(), and enforceSOS2().
◆ checkCons()
|
static |
checks disjunction constraints if at least one is feasible
- Parameters
-
scip SCIP data structure cons active disjunction constraint sol solution to check checkintegrality Has integrality to be checked? checklprows Do constraints represented by rows in the current LP have to be checked? printreason Should the reason for the violation be printed? result pointer to store the result
Definition at line 297 of file cons_disjunction.c.
References FALSE, NULL, SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIPactivateSolViolationUpdates(), SCIPcheckCons(), SCIPconsGetData(), SCIPconsGetName(), SCIPdeactivateSolViolationUpdates(), SCIPdebug, SCIPinfoMessage(), SCIPprintCons(), and SCIPupdateSolConsViolation().
Referenced by enforceConstraint(), and SCIP_DECL_CONSCHECK().
◆ propagateCons()
|
static |
propagation method for disjunction constraint
- Parameters
-
scip SCIP data structure cons disjunctive constraint ndelconss pointer to count number of deleted constraints
Definition at line 353 of file cons_disjunction.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_PRESOLVING, SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsDeleted(), SCIPdelCons(), SCIPdelConsLocal(), SCIPgetNNodes(), SCIPgetStage(), SCIPsetConsChecked(), and TRUE.
Referenced by SCIP_DECL_CONSPRESOL(), and SCIP_DECL_CONSPROP().
◆ enforceConstraint()
|
static |
helper function to enforce constraints
- Parameters
-
scip SCIP data structure conshdlr constraint handler conss constraints to process nconss number of constraints sol solution to enforce (NULL for LP solution) result pointer to store the result of the enforcing call
Definition at line 416 of file cons_disjunction.c.
References branch(), branchCons(), checkCons(), FALSE, NULL, SCIP_Bool, SCIP_BRANCHED, SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIPconshdlrGetData(), and SCIPgetNPseudoBranchCands().
Referenced by SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSENFOPS(), and SCIP_DECL_CONSENFORELAX().
◆ SCIP_DECL_CONSHDLRCOPY()
|
static |
copy method for constraint handler plugins (called when SCIP copies plugins)
Definition at line 456 of file cons_disjunction.c.
References CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetName(), SCIPincludeConshdlrDisjunction(), and TRUE.
◆ SCIP_DECL_CONSFREE()
|
static |
destructor of constraint handler to free constraint handler data (called when SCIP is exiting)
Definition at line 472 of file cons_disjunction.c.
References CONSHDLR_NAME, NULL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPconshdlrSetData(), and SCIPfreeBlockMemory.
◆ SCIP_DECL_CONSDELETE()
|
static |
frees specific constraint data
Definition at line 493 of file cons_disjunction.c.
References consdataFree(), SCIP_CALL, and SCIP_OKAY.
◆ SCIP_DECL_CONSTRANS()
|
static |
transforms constraint data into data belonging to the transformed problem
Definition at line 503 of file cons_disjunction.c.
References consdataCreate(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), and SCIPcreateCons().
◆ SCIP_DECL_CONSINITLP()
|
static |
LP initialization method of constraint handler
Definition at line 526 of file cons_disjunction.c.
References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddConsLocal(), SCIPconsGetData(), and SCIPconsIsActive().
◆ SCIP_DECL_CONSENFOLP()
|
static |
constraint enforcing method of constraint handler for LP solutions
Definition at line 551 of file cons_disjunction.c.
References enforceConstraint(), NULL, SCIP_CALL, and SCIP_OKAY.
◆ SCIP_DECL_CONSENFORELAX()
|
static |
constraint enforcing method of constraint handler for relaxation solutions
Definition at line 561 of file cons_disjunction.c.
References enforceConstraint(), SCIP_CALL, and SCIP_OKAY.
◆ SCIP_DECL_CONSENFOPS()
|
static |
constraint enforcing method of constraint handler for pseudo solutions
Definition at line 571 of file cons_disjunction.c.
References enforceConstraint(), NULL, SCIP_CALL, and SCIP_OKAY.
◆ SCIP_DECL_CONSCHECK()
|
static |
feasibility check method of constraint handler for integral solutions
Definition at line 581 of file cons_disjunction.c.
References checkCons(), SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, and SCIP_OKAY.
◆ SCIP_DECL_CONSPROP()
|
static |
domain propagation method of constraint handler
Definition at line 605 of file cons_disjunction.c.
References propagateCons(), SCIP_CALL, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, and SCIPinProbing().
◆ SCIP_DECL_CONSPRESOL()
|
static |
presolving method of constraint handler
Definition at line 634 of file cons_disjunction.c.
References NULL, propagateCons(), SCIP_CALL, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_SUCCESS, SCIPaddCons(), SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsModifiable(), SCIPdelCons(), SCIPsetConsChecked(), and TRUE.
◆ SCIP_DECL_CONSLOCK()
|
static |
variable rounding lock method of constraint handler
Definition at line 688 of file cons_disjunction.c.
References NULL, SCIP_CALL, SCIP_LOCKTYPE_MODEL, SCIP_OKAY, SCIPaddConsLocksType(), and SCIPconsGetData().
◆ SCIP_DECL_CONSPRINT()
|
static |
constraint display method of constraint handler
Definition at line 710 of file cons_disjunction.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPinfoMessage(), and SCIPprintCons().
◆ SCIP_DECL_CONSPARSE()
|
static |
constraint parsing method of constraint handler
Definition at line 745 of file cons_disjunction.c.
References FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPcalcMemGrowSize(), SCIPcreateConsDisjunction(), SCIPdebugMsg, SCIPduplicateBufferArray, SCIPfreeBufferArray, SCIPparseCons(), SCIPreallocBufferArray, SCIPreleaseCons(), and TRUE.
◆ SCIP_DECL_CONSCOPY()
|
static |
constraint copying method of constraint handler
Definition at line 954 of file cons_disjunction.c.
References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsDisjunction(), SCIPfreeBufferArray, SCIPgetConsCopy(), SCIPreleaseCons(), and TRUE.