Scippy

SCIP

Solving Constraint Integer Programs

cons_logicor.c File Reference

Detailed Description

Constraint handler for logic or constraints $1^T x \ge 1$ (equivalent to set covering, but algorithms are suited for depth first search).

Author
Tobias Achterberg
Michael Winkler

Definition in file cons_logicor.c.

#include <assert.h>
#include <string.h>
#include <limits.h>
#include "scip/cons_logicor.h"
#include "scip/cons_linear.h"
#include "scip/cons_setppc.h"
#include "scip/pub_misc.h"

Go to the source code of this file.

Macros

#define CONSHDLR_NAME   "logicor"
 
#define CONSHDLR_DESC   "logic or constraints"
 
#define CONSHDLR_SEPAPRIORITY   +10000
 
#define CONSHDLR_ENFOPRIORITY   -2000000
 
#define CONSHDLR_CHECKPRIORITY   -2000000
 
#define CONSHDLR_SEPAFREQ   0
 
#define CONSHDLR_PROPFREQ   1
 
#define CONSHDLR_EAGERFREQ   100
 
#define CONSHDLR_MAXPREROUNDS   -1
 
#define CONSHDLR_DELAYSEPA   FALSE
 
#define CONSHDLR_DELAYPROP   FALSE
 
#define CONSHDLR_DELAYPRESOL   FALSE
 
#define CONSHDLR_NEEDSCONS   TRUE
 
#define CONSHDLR_PROP_TIMING   SCIP_PROPTIMING_BEFORELP
 
#define LINCONSUPGD_PRIORITY   +800000
 
#define EVENTHDLR_NAME   "logicor"
 
#define EVENTHDLR_DESC   "event handler for logic or constraints"
 
#define CONFLICTHDLR_NAME   "logicor"
 
#define CONFLICTHDLR_DESC   "conflict handler creating logic or constraints"
 
#define CONFLICTHDLR_PRIORITY   LINCONSUPGD_PRIORITY
 
#define DEFAULT_PRESOLPAIRWISE   TRUE
 
#define DEFAULT_STRENGTHEN   TRUE
 
#define HASHSIZE_LOGICORCONS   131101
 
#define DEFAULT_PRESOLUSEHASHING   TRUE
 
#define DEFAULT_DUALPRESOLVING   TRUE
 
#define DEFAULT_NEGATEDCLIQUE   TRUE
 
#define DEFAULT_IMPLICATIONS   TRUE
 
#define AGEINCREASE(n)   (1.0 + 0.2 * (n))
 
#define HASHTABLESIZE_FACTOR   5
 
#define MAX_CONSLENGTH   200
 
#define MAXCOMPARISONS   1000000
 

Functions

static SCIP_RETCODE lockRounding (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
 
static SCIP_RETCODE unlockRounding (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
 
static SCIP_RETCODE conshdlrdataCreate (SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata, SCIP_EVENTHDLR *eventhdlr)
 
static SCIP_RETCODE conshdlrdataFree (SCIP *scip, SCIP_CONSHDLRDATA **conshdlrdata)
 
static SCIP_RETCODE consdataEnsureVarsSize (SCIP *scip, SCIP_CONSDATA *consdata, int num)
 
static SCIP_RETCODE consdataCreate (SCIP *scip, SCIP_CONSDATA **consdata, int nvars, SCIP_VAR **vars)
 
static SCIP_RETCODE consdataFree (SCIP *scip, SCIP_CONSDATA **consdata)
 
static SCIP_RETCODE consdataPrint (SCIP *scip, SCIP_CONSDATA *consdata, FILE *file, SCIP_Bool endline)
 
static SCIP_RETCODE switchWatchedvars (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int watchedvar1, int watchedvar2)
 
static SCIP_RETCODE addCoef (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
 
static SCIP_RETCODE delCoefPos (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int pos)
 
static SCIP_RETCODE dualPresolving (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, int *nfixedvars, int *ndelconss, int *nchgcoefs, SCIP_RESULT *result)
 
static SCIP_RETCODE applyFixings (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *redundant, int *nchgcoefs, int *naddconss, int *ndelconss)
 
static SCIP_RETCODE analyzeConflict (SCIP *scip, SCIP_CONS *cons)
 
static SCIP_RETCODE disableCons (SCIP *scip, SCIP_CONS *cons)
 
static SCIP_RETCODE mergeMultiples (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, unsigned char **entries, int *nentries, SCIP_Bool *redundant, int *nchgcoefs)
 
static SCIP_RETCODE processWatchedVars (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *reduceddom, SCIP_Bool *addcut, SCIP_Bool *mustcheck)
 
static SCIP_RETCODE checkCons (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *violated)
 
static SCIP_RETCODE createRow (SCIP *scip, SCIP_CONS *cons)
 
static SCIP_RETCODE addCut (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_Bool *cutoff)
 
static SCIP_RETCODE separateCons (SCIP *scip, SCIP_CONS *cons, SCIP_SOL *sol, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *separated, SCIP_Bool *reduceddom)
 
static SCIP_RETCODE enforcePseudo (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool *cutoff, SCIP_Bool *infeasible, SCIP_Bool *reduceddom, SCIP_Bool *solvelp)
 
static void consdataSort (SCIP_CONSDATA *consdata)
 
static SCIP_DECL_HASHGETKEY (hashGetKeyLogicorcons)
 
static SCIP_DECL_HASHKEYEQ (hashKeyEqLogicorcons)
 
static SCIP_DECL_HASHKEYVAL (hashKeyValLogicorcons)
 
static SCIP_RETCODE detectRedundantConstraints (SCIP *scip, BMS_BLKMEM *blkmem, SCIP_CONS **conss, int nconss, int *firstchange, int *ndelconss)
 
static SCIP_RETCODE removeRedundantCons (SCIP *scip, SCIP_CONS *cons0, SCIP_CONS *cons1, int *ndelconss)
 
static unsigned int calcSignature (SCIP_VAR **vars, int nvars)
 
static void consdataCalcSignature (SCIP_CONSDATA *consdata)
 
static void removeConsFromOccurList (SCIP_CONS *cons, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength)
 
static void findShortestOccurlist (SCIP_VAR **vars, int nvars, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength, int *nentries, SCIP_CONS ***shortestlist)
 
static SCIP_RETCODE removeRedundantConss (SCIP *scip, SCIP_CONS *cons, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength, int *ndelconss)
 
static SCIP_DECL_SORTPTRCOMP (conssLogicorComp)
 
static SCIP_RETCODE addConsToOccurList (SCIP *scip, SCIP_CONS *cons, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int *occurlistsizes, int *occurlistlength, int occurlistsize)
 
static SCIP_RETCODE removeRedundantNonZeros (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *artvar, int artpos, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength, SCIP_EVENTHDLR *eventhdlr, int *nchgcoefs, SCIP_Bool *deleted)
 
static SCIP_RETCODE strengthenConss (SCIP *scip, SCIP_CONS **conss, int nconss, SCIP_HASHMAP *varstopos, SCIP_CONS ***occurlist, int *noccurlistentries, int occurlistlength, SCIP_EVENTHDLR *eventhdlr, int *ndelconss, int *nchgcoefs)
 
static SCIP_RETCODE prepareCons (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, unsigned char **entries, int *nentries, SCIP_Bool *redundant, int *nfixedvars, int *nchgcoefs, int *ndelconss, SCIP_Bool *cutoff)
 
static SCIP_RETCODE removeRedundantConssAndNonzeros (SCIP *scip, SCIP_CONS **conss, int nconss, unsigned char **entries, int *nentries, SCIP_EVENTHDLR *eventhdlr, SCIP_Bool usestrengthening, int *firstchange, int *nfixedvars, int *ndelconss, int *nchgcoefs, SCIP_Bool *cutoff)
 
static SCIP_RETCODE shortenConss (SCIP *scip, SCIP_EVENTHDLR *eventhdlr, SCIP_CONS **conss, int nconss, unsigned char **entries, int *nentries, int *nfixedvars, int *ndelconss, int *nchgcoefs, SCIP_Bool *cutoff)
 
static SCIP_RETCODE removeConstraintsDueToNegCliques (SCIP *scip, SCIP_CONSHDLR *conshdlr, SCIP_EVENTHDLR *eventhdlr, SCIP_CONS **conss, int nconss, unsigned char **entries, int *nentries, int *nfixedvars, int *ndelconss, int *nupgdconss, int *nchgcoefs, SCIP_Bool *cutoff)
 
static SCIP_RETCODE fixDeleteOrUpgradeCons (SCIP *scip, SCIP_CONS *cons, SCIP_EVENTHDLR *eventhdlr, SCIP_CONSHDLR *conshdlrlinear, int *nfixedvars, int *nchgbds, int *nchgcoefs, int *ndelconss, int *naddconss, int *nupgdconss, SCIP_Bool *cutoff)
 
static SCIP_RETCODE createNormalizedLogicor (SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars, SCIP_Real *vals, int mult, 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)
 
static SCIP_DECL_LINCONSUPGD (linconsUpgdLogicor)
 
static SCIP_DECL_CONSHDLRCOPY (conshdlrCopyLogicor)
 
static SCIP_DECL_CONSFREE (consFreeLogicor)
 
static SCIP_DECL_CONSINITPRE (consInitpreLogicor)
 
static SCIP_DECL_CONSEXITPRE (consExitpreLogicor)
 
static SCIP_DECL_CONSEXITSOL (consExitsolLogicor)
 
static SCIP_DECL_CONSDELETE (consDeleteLogicor)
 
static SCIP_DECL_CONSTRANS (consTransLogicor)
 
static SCIP_DECL_CONSINITLP (consInitlpLogicor)
 
static SCIP_DECL_CONSSEPALP (consSepalpLogicor)
 
static SCIP_DECL_CONSSEPASOL (consSepasolLogicor)
 
static SCIP_DECL_CONSENFOLP (consEnfolpLogicor)
 
static SCIP_DECL_CONSENFOPS (consEnfopsLogicor)
 
static SCIP_DECL_CONSCHECK (consCheckLogicor)
 
static SCIP_DECL_CONSPROP (consPropLogicor)
 
static SCIP_DECL_CONSPRESOL (consPresolLogicor)
 
static SCIP_DECL_CONSRESPROP (consRespropLogicor)
 
static SCIP_DECL_CONSLOCK (consLockLogicor)
 
static SCIP_DECL_CONSACTIVE (consActiveLogicor)
 
static SCIP_DECL_CONSDEACTIVE (consDeactiveLogicor)
 
static SCIP_DECL_CONSPRINT (consPrintLogicor)
 
static SCIP_DECL_CONSCOPY (consCopyLogicor)
 
static SCIP_DECL_CONSPARSE (consParseLogicor)
 
static SCIP_DECL_CONSGETVARS (consGetVarsLogicor)
 
static SCIP_DECL_CONSGETNVARS (consGetNVarsLogicor)
 
static SCIP_DECL_EVENTEXEC (eventExecLogicor)
 
static SCIP_DECL_CONFLICTEXEC (conflictExecLogicor)
 
SCIP_RETCODE SCIPincludeConshdlrLogicor (SCIP *scip)
 
SCIP_RETCODE SCIPcreateConsLogicor (SCIP *scip, SCIP_CONS **cons, const char *name, 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 SCIPcreateConsBasicLogicor (SCIP *scip, SCIP_CONS **cons, const char *name, int nvars, SCIP_VAR **vars)
 
SCIP_RETCODE SCIPaddCoefLogicor (SCIP *scip, SCIP_CONS *cons, SCIP_VAR *var)
 
int SCIPgetNVarsLogicor (SCIP *scip, SCIP_CONS *cons)
 
SCIP_VAR ** SCIPgetVarsLogicor (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetDualsolLogicor (SCIP *scip, SCIP_CONS *cons)
 
SCIP_Real SCIPgetDualfarkasLogicor (SCIP *scip, SCIP_CONS *cons)
 
SCIP_ROWSCIPgetRowLogicor (SCIP *scip, SCIP_CONS *cons)
 

Macro Definition Documentation

#define CONSHDLR_DESC   "logic or constraints"

Definition at line 36 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONSHDLR_SEPAPRIORITY   +10000

priority of the constraint handler for separation

Definition at line 37 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONSHDLR_ENFOPRIORITY   -2000000

priority of the constraint handler for constraint enforcing

Definition at line 38 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONSHDLR_CHECKPRIORITY   -2000000

priority of the constraint handler for checking feasibility

Definition at line 39 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONSHDLR_SEPAFREQ   0

frequency for separating cuts; zero means to separate only in the root node

Definition at line 40 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONSHDLR_PROPFREQ   1

frequency for propagating domains; zero means only preprocessing propagation

Definition at line 41 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#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 42 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONSHDLR_MAXPREROUNDS   -1

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

Definition at line 44 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONSHDLR_DELAYSEPA   FALSE

should separation method be delayed, if other separators found cuts?

Definition at line 45 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONSHDLR_DELAYPROP   FALSE

should propagation method be delayed, if other propagators found reductions?

Definition at line 46 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONSHDLR_DELAYPRESOL   FALSE

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

Definition at line 47 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONSHDLR_NEEDSCONS   TRUE

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

Definition at line 48 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONSHDLR_PROP_TIMING   SCIP_PROPTIMING_BEFORELP

Definition at line 50 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define LINCONSUPGD_PRIORITY   +800000

priority of the constraint handler for upgrading of linear constraints

Definition at line 52 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define EVENTHDLR_NAME   "logicor"

Definition at line 54 of file cons_logicor.c.

Referenced by SCIP_DECL_EVENTEXEC(), and SCIPincludeConshdlrLogicor().

#define EVENTHDLR_DESC   "event handler for logic or constraints"

Definition at line 55 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONFLICTHDLR_NAME   "logicor"

Definition at line 57 of file cons_logicor.c.

Referenced by SCIP_DECL_CONFLICTEXEC(), and SCIPincludeConshdlrLogicor().

#define CONFLICTHDLR_DESC   "conflict handler creating logic or constraints"

Definition at line 58 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define CONFLICTHDLR_PRIORITY   LINCONSUPGD_PRIORITY

Definition at line 59 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define DEFAULT_PRESOLPAIRWISE   TRUE

should pairwise constraint comparison be performed in presolving?

Definition at line 61 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define DEFAULT_STRENGTHEN   TRUE

should pairwise constraint comparison try to strengthen constraints by removing superflous non-zeros?

Definition at line 62 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define HASHSIZE_LOGICORCONS   131101

minimal size of hash table in logicor constraint tables

Definition at line 64 of file cons_logicor.c.

Referenced by detectRedundantConstraints().

#define DEFAULT_PRESOLUSEHASHING   TRUE

should hash table be used for detecting redundant constraints in advance

Definition at line 65 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define DEFAULT_DUALPRESOLVING   TRUE

should dual presolving steps be performed?

Definition at line 66 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define DEFAULT_NEGATEDCLIQUE   TRUE

should negated clique information be used in presolving

Definition at line 67 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define DEFAULT_IMPLICATIONS   TRUE

should we try to shrink the variables and derive global boundchanges by using cliques and implications

Definition at line 68 of file cons_logicor.c.

Referenced by SCIPincludeConshdlrLogicor().

#define AGEINCREASE (   n)    (1.0 + 0.2 * (n))

Definition at line 73 of file cons_logicor.c.

Referenced by processWatchedVars().

#define HASHTABLESIZE_FACTOR   5

Definition at line 2795 of file cons_logicor.c.

Referenced by removeRedundantConssAndNonzeros().

#define MAX_CONSLENGTH   200

Definition at line 3045 of file cons_logicor.c.

Referenced by shortenConss().

#define MAXCOMPARISONS   1000000

Definition at line 3208 of file cons_logicor.c.

Referenced by removeConstraintsDueToNegCliques().

Function Documentation

static SCIP_RETCODE lockRounding ( SCIP scip,
SCIP_CONS cons,
SCIP_VAR var 
)
static

installs rounding locks for the given variable in the given logic or constraint

Parameters
scipSCIP data structure
conslogic or constraint
varvariable of constraint entry

Definition at line 139 of file cons_logicor.c.

References FALSE, SCIP_CALL, SCIP_OKAY, SCIPlockVarCons(), and TRUE.

Referenced by addCoef().

static SCIP_RETCODE unlockRounding ( SCIP scip,
SCIP_CONS cons,
SCIP_VAR var 
)
static

removes rounding locks for the given variable in the given logic or constraint

Parameters
scipSCIP data structure
conslogic or constraint
varvariable of constraint entry

Definition at line 153 of file cons_logicor.c.

References FALSE, SCIP_CALL, SCIP_OKAY, SCIPunlockVarCons(), and TRUE.

Referenced by delCoefPos().

static SCIP_RETCODE conshdlrdataCreate ( SCIP scip,
SCIP_CONSHDLRDATA **  conshdlrdata,
SCIP_EVENTHDLR eventhdlr 
)
static

creates constraint handler data for logic or constraint handler

Parameters
scipSCIP data structure
conshdlrdatapointer to store the constraint handler data
eventhdlrevent handler

Definition at line 167 of file cons_logicor.c.

References NULL, SCIP_CALL, SCIP_OKAY, and SCIPallocMemory.

Referenced by SCIPincludeConshdlrLogicor().

static SCIP_RETCODE conshdlrdataFree ( SCIP scip,
SCIP_CONSHDLRDATA **  conshdlrdata 
)
static

frees constraint handler data for logic or constraint handler

Parameters
scipSCIP data structure
conshdlrdatapointer to the constraint handler data

Definition at line 190 of file cons_logicor.c.

References NULL, SCIP_OKAY, and SCIPfreeMemory.

Referenced by SCIP_DECL_CONSFREE().

static SCIP_RETCODE consdataEnsureVarsSize ( SCIP scip,
SCIP_CONSDATA consdata,
int  num 
)
static

ensures, that the vars array can store at least num entries

Parameters
scipSCIP data structure
consdatalogicor constraint data
numminimum number of entries to store

Definition at line 205 of file cons_logicor.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPcalcMemGrowSize(), and SCIPreallocBlockMemoryArray.

Referenced by addCoef().

static SCIP_RETCODE consdataCreate ( SCIP scip,
SCIP_CONSDATA **  consdata,
int  nvars,
SCIP_VAR **  vars 
)
static

creates a logic or constraint data object

Parameters
scipSCIP data structure
consdatapointer to store the logic or constraint data
nvarsnumber of variables in the constraint
varsvariables of the constraint

Definition at line 229 of file cons_logicor.c.

References FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIP_VARSTATUS_MULTAGGR, SCIPallocBlockMemory, SCIPcaptureVar(), SCIPduplicateBlockMemoryArray, SCIPgetTransformedVars(), SCIPisTransformed(), SCIPvarGetProbvar(), SCIPvarGetStatus(), and TRUE.

Referenced by SCIP_DECL_CONSTRANS(), and SCIPcreateConsLogicor().

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

frees a logic or constraint data

Parameters
scipSCIP data structure
consdatapointer to the logic or constraint

Definition at line 297 of file cons_logicor.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArrayNull, SCIPreleaseRow(), and SCIPreleaseVar().

Referenced by SCIP_DECL_CONSDELETE().

static SCIP_RETCODE consdataPrint ( SCIP scip,
SCIP_CONSDATA consdata,
FILE *  file,
SCIP_Bool  endline 
)
static

prints logic or constraint to file stream

Parameters
scipSCIP data structure
consdatalogic or constraint data
fileoutput file (or NULL for standard output)
endlineshould an endline be set?

Definition at line 328 of file cons_logicor.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPinfoMessage(), SCIPwriteVarsList(), and TRUE.

Referenced by applyFixings(), SCIP_DECL_CONSACTIVE(), SCIP_DECL_CONSDEACTIVE(), and SCIP_DECL_CONSPRINT().

static SCIP_RETCODE switchWatchedvars ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
int  watchedvar1,
int  watchedvar2 
)
static

stores the given variable numbers as watched variables, and updates the event processing

Parameters
scipSCIP data structure
conslogic or constraint
eventhdlrevent handler to call for the event processing
watchedvar1new first watched variable
watchedvar2new second watched variable

Definition at line 354 of file cons_logicor.c.

References NULL, SCIP_CALL, SCIP_EVENTTYPE_LBRELAXED, SCIP_EVENTTYPE_UBTIGHTENED, SCIP_OKAY, SCIPcatchVarEvent(), SCIPconsGetData(), and SCIPdropVarEvent().

Referenced by delCoefPos(), and processWatchedVars().

static SCIP_RETCODE delCoefPos ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
int  pos 
)
static

deletes coefficient at given position from logic or constraint data

Parameters
scipSCIP data structure
conslogic or constraint
eventhdlrevent handler to call for the event processing
posposition of coefficient to delete

Definition at line 495 of file cons_logicor.c.

References FALSE, NULL, SCIP_CALL, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIP_STAGE_INITPRESOLVE, SCIP_STAGE_PRESOLVING, SCIPconsGetData(), SCIPconsIsTransformed(), SCIPdropVarEvent(), SCIPenableConsPropagation(), SCIPgetStage(), SCIPreleaseVar(), SCIPvarIsTransformed(), switchWatchedvars(), TRUE, and unlockRounding().

Referenced by applyFixings(), dualPresolving(), mergeMultiples(), removeConstraintsDueToNegCliques(), removeRedundantNonZeros(), and shortenConss().

static SCIP_RETCODE dualPresolving ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
int *  nfixedvars,
int *  ndelconss,
int *  nchgcoefs,
SCIP_RESULT result 
)
static

in case a part (more than one variable) in the logic or constraint is independent of every else, we can perform dual reductions;

  • fix the variable with the smallest object coefficient to one if the constraint is not modifiable and all variable are independant
  • fix all independant variables with negative object coefficient to one
  • fix all remaining independant variables to zero

Note: the following dual reduction for logic or constraints is already performed by the presolver "dualfix"

  • if a variable in a set covering constraint is only locked by that constraint and has negative or zero objective coefficient than it can be fixed to one
Parameters
scipSCIP data structure
conssetppc constraint
eventhdlrevent handler to call for the event processing
nfixedvarspointer to count number of fixings
ndelconsspointer to count number of deleted constraints
nchgcoefspointer to count number of changed/deleted coefficients
resultpointer to store the result SCIP_SUCCESS, if presolving was performed

Definition at line 573 of file cons_logicor.c.

References delCoefPos(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_INVALID, SCIP_OKAY, SCIP_Real, SCIP_SUCCESS, SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsModifiable(), SCIPdebugMessage, SCIPdelCons(), SCIPfixVar(), SCIPinfinity(), SCIPisLT(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetNLocksDown(), SCIPvarGetNLocksUp(), SCIPvarGetObj(), SCIPvarGetProbvarBinary(), SCIPvarGetUbGlobal(), and SCIPvarIsActive().

Referenced by SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE applyFixings ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
SCIP_Bool redundant,
int *  nchgcoefs,
int *  naddconss,
int *  ndelconss 
)
static

deletes all zero-fixed variables, checks for variables fixed to one, replace all variables which are not active or not a negation of an active variable by there active or negation of an active counterpart

Parameters
scipSCIP data structure
conslogic or constraint
eventhdlrevent handler to call for the event processing
redundantreturns whether a variable fixed to one exists in the constraint
nchgcoefspointer to count number of changed/deleted coefficients
naddconsspointer to count number of added constraints, or NULL indicating we can not resolve multi-aggregations
ndelconsspointer to count number of deleted constraints, or NULL indicating we can not resolve multi-aggregations

Definition at line 807 of file cons_logicor.c.

References addCoef(), consdataPrint(), delCoefPos(), FALSE, MAX, NULL, SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_MULTAGGR, SCIP_VARSTATUS_NEGATED, SCIPaddCons(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsAdded(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsLinear(), SCIPdebug, SCIPdebugMessage, SCIPdebugPrintCons, SCIPdelCons(), SCIPerrorMessage, SCIPfreeBufferArray, SCIPgetBinvarRepresentatives(), SCIPgetProbvarLinearSum(), SCIPinfinity(), SCIPisEQ(), SCIPisFeasEQ(), SCIPisZero(), SCIPreallocBufferArray, SCIPreleaseCons(), SCIPsnprintf(), SCIPvarGetLbGlobal(), SCIPvarGetNegatedVar(), SCIPvarGetNegationVar(), SCIPvarGetStatus(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), SCIPvarIsBinary(), SCIPwarningMessage(), and TRUE.

Referenced by fixDeleteOrUpgradeCons(), prepareCons(), SCIP_DECL_CONSEXITPRE(), and SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE analyzeConflict ( SCIP scip,
SCIP_CONS cons 
)
static

analyzes conflicting assignment on given constraint, and adds conflict constraint to problem

Parameters
scipSCIP data structure
conslogic or constraint that detected the conflict

Definition at line 1060 of file cons_logicor.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_SOLVING, SCIPaddConflictBinvar(), SCIPanalyzeConflictCons(), SCIPconsGetData(), SCIPgetStage(), SCIPinitConflictAnalysis(), SCIPinProbing(), and SCIPisConflictAnalysisApplicable().

Referenced by processWatchedVars().

static SCIP_RETCODE disableCons ( SCIP scip,
SCIP_CONS cons 
)
static

disables or deletes the given constraint, depending on the current depth

Parameters
scipSCIP data structure
consbound disjunction constraint to be disabled

Definition at line 1090 of file cons_logicor.c.

References SCIP_CALL, SCIP_OKAY, SCIPconsGetName(), SCIPconsGetValidDepth(), SCIPdebugMessage, SCIPdelCons(), SCIPdisableCons(), and SCIPgetDepth().

Referenced by processWatchedVars().

static SCIP_RETCODE mergeMultiples ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
unsigned char **  entries,
int *  nentries,
SCIP_Bool redundant,
int *  nchgcoefs 
)
static

find pairs of negated variables in constraint: constraint is redundant find sets of equal variables in constraint: multiple entries of variable can be replaced by single entry

Parameters
scipSCIP data structure
conslogic or constraint
eventhdlrevent handler to call for the event processing
entriesarray to store whether two positions in constraints represent the same variable
nentriespointer for array size, if array will be to small it's corrected
redundantreturns whether a variable fixed to one exists in the constraint
nchgcoefspointer to count number of changed/deleted coefficients

Definition at line 1114 of file cons_logicor.c.

References delCoefPos(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_VARSTATUS_NEGATED, SCIP_VARTYPE_BINARY, SCIP_VARTYPE_IMPLINT, SCIP_VARTYPE_INTEGER, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMessage, SCIPfreeBufferArray, SCIPgetNBinVars(), SCIPgetNImplVars(), SCIPgetNIntVars(), SCIPvarGetName(), SCIPvarGetNegationVar(), SCIPvarGetProbindex(), SCIPvarGetStatus(), SCIPvarGetType(), SCIPvarIsActive(), SCIPvarIsBinary(), SCIPvarIsNegated(), and TRUE.

Referenced by prepareCons(), and SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE processWatchedVars ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
SCIP_Bool cutoff,
SCIP_Bool reduceddom,
SCIP_Bool addcut,
SCIP_Bool mustcheck 
)
static

checks constraint for violation only looking at the watched variables, applies fixings if possible

Parameters
scipSCIP data structure
conslogic or constraint to be processed
eventhdlrevent handler to call for the event processing
cutoffpointer to store TRUE, if the node can be cut off
reduceddompointer to store TRUE, if a domain reduction was found
addcutpointer to store whether this constraint must be added as a cut
mustcheckpointer to store whether this constraint must be checked for feasibility

Definition at line 1265 of file cons_logicor.c.

References AGEINCREASE, analyzeConflict(), CONSHDLR_NAME, disableCons(), FALSE, NULL, SCIP_Bool, SCIP_BRANCHDIR_DOWNWARDS, SCIP_CALL, SCIP_Longint, SCIP_LONGINT_MAX, SCIP_OKAY, SCIPaddConsAge(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPconsIsModifiable(), SCIPdebugMessage, SCIPdisableConsPropagation(), SCIPgetDepth(), SCIPinferBinvarCons(), SCIPisFeasEQ(), SCIPresetConsAge(), SCIPvarGetLbLocal(), SCIPvarGetName(), SCIPvarGetNBranchingsCurrentRun(), SCIPvarGetUbLocal(), switchWatchedvars(), and TRUE.

Referenced by enforcePseudo(), SCIP_DECL_CONSPROP(), and separateCons().

static SCIP_RETCODE checkCons ( SCIP scip,
SCIP_CONS cons,
SCIP_SOL sol,
SCIP_Bool violated 
)
static

checks constraint for violation, returns TRUE iff constraint is feasible

Parameters
scipSCIP data structure
conslogic or constraint to be checked
solprimal CIP solution
violatedpointer to store whether the given solution violates the constraint

Definition at line 1483 of file cons_logicor.c.

References FALSE, NULL, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPgetSolVal(), SCIPisFeasGE(), SCIPisFeasLE(), SCIPisFeasLT(), and SCIPvarIsBinary().

Referenced by enforcePseudo(), SCIP_DECL_CONSCHECK(), and separateCons().

static SCIP_RETCODE createRow ( SCIP scip,
SCIP_CONS cons 
)
static

creates an LP row in a logic or constraint data object

Parameters
scipSCIP data structure
conslogic or constraint

Definition at line 1526 of file cons_logicor.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPaddVarsToRowSameCoef(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsRemovable(), SCIPcreateEmptyRowCons(), and SCIPinfinity().

Referenced by addCut().

static SCIP_RETCODE addCut ( SCIP scip,
SCIP_CONS cons,
SCIP_SOL sol,
SCIP_Bool cutoff 
)
static

adds logic or constraint as cut to the LP

Parameters
scipSCIP data structure
conslogic or constraint
solprimal CIP solution, NULL for current LP solution
cutoffwhether a cutoff has been detected

Definition at line 1547 of file cons_logicor.c.

References createRow(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPaddCut(), SCIPconsGetData(), SCIPconsGetName(), SCIPdebugMessage, and SCIProwIsInLP().

Referenced by SCIP_DECL_CONSINITLP(), and separateCons().

static SCIP_RETCODE separateCons ( SCIP scip,
SCIP_CONS cons,
SCIP_SOL sol,
SCIP_EVENTHDLR eventhdlr,
SCIP_Bool cutoff,
SCIP_Bool separated,
SCIP_Bool reduceddom 
)
static

checks constraint for violation, and adds it as a cut if possible

Parameters
scipSCIP data structure
conslogic or constraint to be separated
solprimal CIP solution, NULL for current LP solution
eventhdlrevent handler to call for the event processing
cutoffpointer to store TRUE, if the node can be cut off
separatedpointer to store TRUE, if a cut was found
reduceddompointer to store TRUE, if a domain reduction was found

Definition at line 1581 of file cons_logicor.c.

References addCut(), checkCons(), CONSHDLR_NAME, FALSE, NULL, processWatchedVars(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPconsIsPropagationEnabled(), SCIPdebugMessage, SCIPgetRowLPFeasibility(), SCIPisFeasNegative(), SCIPresetConsAge(), SCIProwIsInLP(), and TRUE.

Referenced by SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSSEPALP(), and SCIP_DECL_CONSSEPASOL().

static SCIP_RETCODE enforcePseudo ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
SCIP_Bool cutoff,
SCIP_Bool infeasible,
SCIP_Bool reduceddom,
SCIP_Bool solvelp 
)
static

enforces the pseudo solution on the given constraint

Parameters
scipSCIP data structure
conslogic or constraint to be separated
eventhdlrevent handler to call for the event processing
cutoffpointer to store TRUE, if the node can be cut off
infeasiblepointer to store TRUE, if the constraint was infeasible
reduceddompointer to store TRUE, if a domain reduction was found
solvelppointer to store TRUE, if the LP has to be solved

Definition at line 1658 of file cons_logicor.c.

References checkCons(), CONSHDLR_NAME, FALSE, NULL, processWatchedVars(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPconsIsPropagationEnabled(), SCIPhasCurrentNodeLP(), SCIPresetConsAge(), and TRUE.

Referenced by SCIP_DECL_CONSENFOPS().

static void consdataSort ( SCIP_CONSDATA consdata)
static

sorts logicor constraint's variables by non-decreasing variable index

Parameters
consdatalinear constraint data

Definition at line 1717 of file cons_logicor.c.

References NULL, SCIP_Bool, SCIPsortedvecFindPtr(), SCIPsortPtr(), SCIPvarCompare(), and TRUE.

Referenced by detectRedundantConstraints(), removeRedundantConssAndNonzeros(), removeRedundantNonZeros(), and SCIP_DECL_HASHKEYEQ().

static SCIP_DECL_HASHGETKEY ( hashGetKeyLogicorcons  )
static

gets the key of the given element

Definition at line 1798 of file cons_logicor.c.

static SCIP_DECL_HASHKEYEQ ( hashKeyEqLogicorcons  )
static

returns TRUE iff both keys are equal; two constraints are equal if they have the same variables

Definition at line 1806 of file cons_logicor.c.

References consdataSort(), FALSE, NULL, SCIP_Bool, SCIPconsGetData(), SCIPvarCompare(), and TRUE.

static SCIP_DECL_HASHKEYVAL ( hashKeyValLogicorcons  )
static

returns the hash value of the key

Definition at line 1852 of file cons_logicor.c.

References NULL, SCIPconsGetData(), and SCIPvarGetIndex().

static SCIP_RETCODE detectRedundantConstraints ( SCIP scip,
BMS_BLKMEM blkmem,
SCIP_CONS **  conss,
int  nconss,
int *  firstchange,
int *  ndelconss 
)
static

compares each constraint with all other constraints for a possible duplication and removes duplicates using a hash table; also

See Also
removeRedundantConssAndNonzeros()
Parameters
scipSCIP data structure
blkmemblock memory
conssconstraint set
nconssnumber of constraints in constraint set
firstchangepointer to store first changed constraint
ndelconsspointer to count number of deleted constraints

Definition at line 1879 of file cons_logicor.c.

References consdataSort(), HASHSIZE_LOGICORCONS, MAX, NULL, SCIP_CALL, SCIP_OKAY, SCIPcalcHashtableSize(), SCIPconsGetData(), SCIPconsGetPos(), SCIPconsIsActive(), SCIPconsIsModifiable(), SCIPdelCons(), SCIPhashtableCreate(), SCIPhashtableFree(), SCIPhashtableInsert(), SCIPhashtableRetrieve(), and SCIPupdateConsFlags().

Referenced by SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE removeRedundantCons ( SCIP scip,
SCIP_CONS cons0,
SCIP_CONS cons1,
int *  ndelconss 
)
static

removes the redundant second constraint and updates the flags of the first one

Parameters
scipSCIP data structure
cons0constraint that should stay
cons1constraint that should be deleted
ndelconsspointer to count number of deleted constraints

Definition at line 1967 of file cons_logicor.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetName(), SCIPdebugMessage, SCIPdebugPrintCons, SCIPdelCons(), and SCIPupdateConsFlags().

Referenced by removeRedundantConss().

static unsigned int calcSignature ( SCIP_VAR **  vars,
int  nvars 
)
static

compute and return a signature for given variables

Parameters
varsvariables to calculate the signature for
nvarsnumber of variables to calculate the signature for

Definition at line 1994 of file cons_logicor.c.

References NULL, and SCIPvarGetIndex().

Referenced by consdataCalcSignature(), and removeRedundantNonZeros().

static void consdataCalcSignature ( SCIP_CONSDATA consdata)
static

compute the constraint signature which is used to detect constraints, that contain potentially the same set of variables

Parameters
consdatalogicor constraint data

Definition at line 2017 of file cons_logicor.c.

References calcSignature(), and TRUE.

Referenced by removeRedundantConssAndNonzeros(), and removeRedundantNonZeros().

static void removeConsFromOccurList ( SCIP_CONS cons,
SCIP_HASHMAP varstopos,
SCIP_CONS ***  occurlist,
int *  noccurlistentries,
int  occurlistlength 
)
static

remove a constraint from the column representation

Parameters
conslogicor constraint
varstoposmap for mapping variables to positions in the occurlist
occurlistcolumn representation of logicor constraints
noccurlistentriesarrray with number of constraints for each variable in the occurlist
occurlistlengthnumber of columns in the occurlist

Definition at line 2030 of file cons_logicor.c.

References NULL, SCIPconsGetData(), SCIPconsIsActive(), SCIPhashmapExists(), and SCIPhashmapGetImage().

Referenced by removeRedundantConss(), and removeRedundantNonZeros().

static void findShortestOccurlist ( SCIP_VAR **  vars,
int  nvars,
SCIP_HASHMAP varstopos,
SCIP_CONS ***  occurlist,
int *  noccurlistentries,
int  occurlistlength,
int *  nentries,
SCIP_CONS ***  shortestlist 
)
static

determine shortest constraint list in column representation

Parameters
varsvariables to find the shortestlist for
nvarsnumber of variables
varstoposmap for mapping variables to positions in the occurlist
occurlistcolumn representation of logicor constraints
noccurlistentriesarrray with number of constraints for each variable in the occurlist
occurlistlengthnumber of columns in the occurlist
nentriespointer to store the number of entries in the shortest list
shortestlistpointer to store smallest array with constraints

Definition at line 2090 of file cons_logicor.c.

References NULL, SCIPhashmapExists(), and SCIPhashmapGetImage().

Referenced by removeRedundantConss(), and removeRedundantNonZeros().

static SCIP_RETCODE removeRedundantConss ( SCIP scip,
SCIP_CONS cons,
SCIP_HASHMAP varstopos,
SCIP_CONS ***  occurlist,
int *  noccurlistentries,
int  occurlistlength,
int *  ndelconss 
)
static

run a pairwise comparison for detecting subset-constraints of other constraint while using a signature

Parameters
scipSCIP data structure
conslogicor constraint to check if it covers another
varstoposmap for mapping variables to positions in the occurlist
occurlistcolumn representation of logicor constraints
noccurlistentriesarrray with number of constraints for each variable in the occurlist
occurlistlengthnumber of columns in the occurlist
ndelconsspointer to store the number of deleted constraints

Definition at line 2145 of file cons_logicor.c.

References findShortestOccurlist(), NULL, removeConsFromOccurList(), removeRedundantCons(), SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsModifiable(), and SCIPvarCompare().

Referenced by removeRedundantConssAndNonzeros().

static SCIP_DECL_SORTPTRCOMP ( conssLogicorComp  )
static

compararer for sorting constraints after their number of variables

Definition at line 2263 of file cons_logicor.c.

References NULL, and SCIPconsGetData().

static SCIP_RETCODE addConsToOccurList ( SCIP scip,
SCIP_CONS cons,
SCIP_HASHMAP varstopos,
SCIP_CONS ***  occurlist,
int *  noccurlistentries,
int *  occurlistsizes,
int *  occurlistlength,
int  occurlistsize 
)
static

add a constraint to the column representation

Parameters
scipSCIP data structure
conslogicor constraint
varstoposmap for mapping variables to positions in the occurlist
occurlistcolumn representation of logicor constraints
noccurlistentriesarrray with number of constraints for each variable in the occurlist
occurlistsizesarray of sizes for each variable in the occurlist
occurlistlengthnumber of columns in the occurlist
occurlistsizesize of occurlist

Definition at line 2282 of file cons_logicor.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPcalcMemGrowSize(), SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPhashmapInsert(), SCIPreallocBufferArray, SCIPvarGetNegatedVar(), SCIPvarGetNLocksDown(), and SCIPvarIsActive().

Referenced by removeRedundantConssAndNonzeros().

static SCIP_RETCODE removeRedundantNonZeros ( SCIP scip,
SCIP_CONS cons,
SCIP_VAR artvar,
int  artpos,
SCIP_HASHMAP varstopos,
SCIP_CONS ***  occurlist,
int *  noccurlistentries,
int  occurlistlength,
SCIP_EVENTHDLR eventhdlr,
int *  nchgcoefs,
SCIP_Bool deleted 
)
static

run a pairwise comparison for the given variables against all constraits to detect redundant non-zeros in these constraints

Parameters
scipSCIP data structure
conslogicor constraint to check if it covers another
artvarartificial negated variable of constraint
artposposition to replace constraint variable with artvar
varstoposmap for mapping variables to positions in the occurlist
occurlistcolumn representation of logicor constraints
noccurlistentriesnumber of constraints for each variable in the occurlist
occurlistlengthnumber of columns in the occurlist
eventhdlrevent handler
nchgcoefspointer to store the number of deleted non-zeros
deletedpointer to store if cons will be deleted

Definition at line 2381 of file cons_logicor.c.

References calcSignature(), consdataCalcSignature(), consdataSort(), delCoefPos(), FALSE, findShortestOccurlist(), NULL, removeConsFromOccurList(), SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsActive(), SCIPconsIsModifiable(), SCIPdebugMessage, SCIPdebugPrintCons, SCIPdelCons(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPupdateConsFlags(), SCIPvarCompare(), SCIPvarGetName(), SCIPvarGetNegatedVar(), and TRUE.

Referenced by strengthenConss().

static SCIP_RETCODE strengthenConss ( SCIP scip,
SCIP_CONS **  conss,
int  nconss,
SCIP_HASHMAP varstopos,
SCIP_CONS ***  occurlist,
int *  noccurlistentries,
int  occurlistlength,
SCIP_EVENTHDLR eventhdlr,
int *  ndelconss,
int *  nchgcoefs 
)
static

find and remove redundant non-zero entries

Parameters
scipSCIP data structure
consssorted array of logicor constraint
nconssnumber of sorted constraints
varstoposmap for mapping variables to positions in the occurlist
occurlistcolumn representation of logicor constraints
noccurlistentriesnumber of constraints for each variable in the occurlist
occurlistlengthnumber of columns in the occurlist
eventhdlrevent handler to call for the event processing
ndelconsspointer to store the number of deleted constraints
nchgcoefspointer to store the number of remove coefficients

Definition at line 2624 of file cons_logicor.c.

References NULL, removeRedundantNonZeros(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsModifiable(), SCIPhashmapExists(), and SCIPvarGetNegatedVar().

Referenced by removeRedundantConssAndNonzeros().

static SCIP_RETCODE prepareCons ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
unsigned char **  entries,
int *  nentries,
SCIP_Bool redundant,
int *  nfixedvars,
int *  nchgcoefs,
int *  ndelconss,
SCIP_Bool cutoff 
)
static

prepares a constraint by removing fixings and merge it

Parameters
scipSCIP data structure
conslogic or constraint
eventhdlrevent handler to call for the event processing
entriesarray to store whether two positions in constraints represent the same variable
nentriespointer for array size, if array will be to small it's corrected
redundantreturns whether a variable fixed to one exists in the constraint
nfixedvarspointer to count number of fixings
nchgcoefspointer to count number of changed/deleted coefficients
ndelconsspointer to count number of deleted constraints
cutoffpointer to store, if cut off appeared

Definition at line 2715 of file cons_logicor.c.

References applyFixings(), FALSE, mergeMultiples(), NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsDeleted(), SCIPdebugMessage, SCIPdelCons(), SCIPfixVar(), and TRUE.

Referenced by removeConstraintsDueToNegCliques(), removeRedundantConssAndNonzeros(), and shortenConss().

static SCIP_RETCODE removeRedundantConssAndNonzeros ( SCIP scip,
SCIP_CONS **  conss,
int  nconss,
unsigned char **  entries,
int *  nentries,
SCIP_EVENTHDLR eventhdlr,
SCIP_Bool  usestrengthening,
int *  firstchange,
int *  nfixedvars,
int *  ndelconss,
int *  nchgcoefs,
SCIP_Bool cutoff 
)
static

find covered/subsumed constraints and redundant non-zero entries

covered: e.g.: c1: x1 + x2 + x3 >= 1 c2: x1 + x2 + x3 + x4 >= 1

strengthen: e.g.: c1: x1 + x2 + x3 >= 1 c2: x1 + x2 + ~x3 + x4 >= 1

=> c2: x1 + x2 + x4 >= 1

See Also
"Effective Preprocessing in SAT through Variable and Clause Elimination" by Niklas Eén and Armin Biere
Parameters
scipSCIP data structure
conssarray of logicor constraints
nconssnumber of logicor constraints
entriesarray to store whether two positions in constraints represent the same variable
nentriespointer for array size, if array will be to small it's corrected
eventhdlrevent handler to call for the event processing
usestrengtheningshould we try to strengthen constraints by removing superflous non-zeros?
firstchangepointer to store first changed constraint
nfixedvarspointer to count number of fixings
ndelconsspointer to store the number of deleted constraints
nchgcoefspointer to store the number of deleted coefficients
cutoffpointer to store, if cut off appeared

Definition at line 2812 of file cons_logicor.c.

References addConsToOccurList(), BMSclearMemoryArray, consdataCalcSignature(), consdataSort(), FALSE, HASHTABLESIZE_FACTOR, NULL, prepareCons(), removeRedundantConss(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPblkmem(), SCIPcalcHashtableSize(), SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsModifiable(), SCIPdebugMessage, SCIPduplicateBufferArray, SCIPfreeBufferArray, SCIPfreeBufferArrayNull, SCIPgetNContVars(), SCIPgetNVars(), SCIPhashmapCreate(), SCIPhashmapFree(), SCIPsortPtr(), strengthenConss(), and TRUE.

Referenced by SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE shortenConss ( SCIP scip,
SCIP_EVENTHDLR eventhdlr,
SCIP_CONS **  conss,
int  nconss,
unsigned char **  entries,
int *  nentries,
int *  nfixedvars,
int *  ndelconss,
int *  nchgcoefs,
SCIP_Bool cutoff 
)
static

try to tighten constraints by reducing the number of variables in the constraints using implications and cliques, also derive fixations through them,

See Also
SCIPshrinkDisjunctiveVarSet()
Parameters
scipSCIP data structure
eventhdlrevent handler to call for the event processing
conssall constraints
nconssnumber of constraints
entriesarray to store whether two positions in constraints represent the same variable
nentriespointer for array size, if array will be to small it's corrected
nfixedvarspointer to count number of fixings
ndelconsspointer to count number of deleted constraints
nchgcoefspointer to count number of changed/deleted coefficients
cutoffpointer to store, if cut off appeared

Definition at line 3051 of file cons_logicor.c.

References delCoefPos(), FALSE, MAX_CONSLENGTH, NULL, prepareCons(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_NEGATED, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsIsDeleted(), SCIPdebugMessage, SCIPdelCons(), SCIPfixVar(), SCIPfreeBufferArray, SCIPgetNContVars(), SCIPgetNVars(), SCIPshrinkDisjunctiveVarSet(), SCIPvarGetNegationVar(), SCIPvarGetStatus(), SCIPvarIsActive(), and TRUE.

Referenced by SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE removeConstraintsDueToNegCliques ( SCIP scip,
SCIP_CONSHDLR conshdlr,
SCIP_EVENTHDLR eventhdlr,
SCIP_CONS **  conss,
int  nconss,
unsigned char **  entries,
int *  nentries,
int *  nfixedvars,
int *  ndelconss,
int *  nupgdconss,
int *  nchgcoefs,
SCIP_Bool cutoff 
)
static

try to find a negated clique in a constraint which makes this constraint redundant but we need to keep the negated clique information alive, so we create a corresponding set-packing constraint

Parameters
scipSCIP data structure
conshdlrlogicor constraint handler
eventhdlrevent handler to call for the event processing
conssall constraints
nconssnumber of constraints
entriesarray to store whether two positions in constraints represent the same variable
nentriespointer for array size, if array will be to small it's corrected
nfixedvarspointer to count number of fixings
ndelconsspointer to count number of deleted constraints
nupgdconsspointer to count number of upgraded constraints
nchgcoefspointer to count number of changed/deleted coefficients
cutoffpointer to store, if cut off appeared

Definition at line 3214 of file cons_logicor.c.

References BMScopyMemoryArray, delCoefPos(), FALSE, MAXCOMPARISONS, NULL, prepareCons(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_VARSTATUS_NEGATED, SCIPaddCons(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsDeleted(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsSetpack(), SCIPdebugMessage, SCIPdebugPrintCons, SCIPdelCons(), SCIPfreeBufferArray, SCIPgetNCliques(), SCIPgetNContVars(), SCIPgetNImplications(), SCIPgetNVars(), SCIPisStopped(), SCIPreleaseCons(), SCIPvarGetName(), SCIPvarGetNCliques(), SCIPvarGetNegatedVar(), SCIPvarGetNegationVar(), SCIPvarGetNImpls(), SCIPvarGetStatus(), SCIPvarIsActive(), SCIPvarIsNegated(), SCIPvarsHaveCommonClique(), and TRUE.

Referenced by SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE fixDeleteOrUpgradeCons ( SCIP scip,
SCIP_CONS cons,
SCIP_EVENTHDLR eventhdlr,
SCIP_CONSHDLR conshdlrlinear,
int *  nfixedvars,
int *  nchgbds,
int *  nchgcoefs,
int *  ndelconss,
int *  naddconss,
int *  nupgdconss,
SCIP_Bool cutoff 
)
static

handle all cases with less than three variables in a logicor constraint

in case a constraint has zero variables left, we detected infeasibility in case a constraint has one variables left, we will fix it to one in case a constraint has two variables left, we will add the implication and upgrade it to a set-packing constraint

Parameters
scipSCIP data structure
conslogic or constraint
eventhdlrevent handler to call for the event processing
conshdlrlinearlinear constraint handler, or NULL
nfixedvarspointer to count number of fixings
nchgbdspointer to count number of tightened bounds
nchgcoefspointer to count number of changed/deleted coefficients
ndelconsspointer to count number of deleted constraints
naddconsspointer to count number of added constraints
nupgdconsspointer to count number of upgraded constraints
cutoffpointer to store TRUE, if the node can be cut off

Definition at line 3486 of file cons_logicor.c.

References applyFixings(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_MULTAGGR, SCIPaddClique(), SCIPaddCons(), SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsChecked(), SCIPconsIsDeleted(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsLinear(), SCIPcreateConsSetpack(), SCIPdebugMessage, SCIPdebugPrintCons, SCIPdelCons(), SCIPfixVar(), SCIPgetNegatedVar(), SCIPreleaseCons(), SCIPsnprintf(), SCIPvarGetName(), SCIPvarGetStatus(), and TRUE.

Referenced by SCIP_DECL_CONSPRESOL().

static SCIP_RETCODE createNormalizedLogicor ( SCIP scip,
SCIP_CONS **  cons,
const char *  name,
int  nvars,
SCIP_VAR **  vars,
SCIP_Real vals,
int  mult,
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 
)
static

creates and captures a normalized (with all coefficients +1) logic or constraint

Parameters
scipSCIP data structure
conspointer to hold the created constraint
namename of constraint
nvarsnumber of variables in the constraint
varsarray with variables of constraint entries
valsarray with coefficients (+1.0 or -1.0)
multmultiplier on the coefficients(+1 or -1)
initialshould the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'.
separateshould the constraint be separated during LP processing? Usually set to TRUE.
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.
propagateshould the constraint be propagated during node processing? Usually set to TRUE.
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.
removableshould the relaxation be removed from the LP due to aging or cleanup? Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'.
stickingatnodeshould the constraint always be kept at the node where it was added, even if it may be moved to a more global node? Usually set to FALSE. Set to TRUE to for constraints that represent node data.

Definition at line 3671 of file cons_logicor.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPcreateConsLogicor(), SCIPfreeBufferArray, and SCIPgetNegatedVar().

Referenced by SCIP_DECL_LINCONSUPGD().

static SCIP_DECL_CONSHDLRCOPY ( conshdlrCopyLogicor  )
static

copy method for constraint handler plugins (called when SCIP copies plugins)

Definition at line 3782 of file cons_logicor.c.

References CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetName(), SCIPincludeConshdlrLogicor(), and TRUE.

static SCIP_DECL_CONSFREE ( consFreeLogicor  )
static

destructor of constraint handler to free constraint handler data (called when SCIP is exiting)

Definition at line 3798 of file cons_logicor.c.

References CONSHDLR_NAME, conshdlrdataFree(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetName(), and SCIPconshdlrSetData().

static SCIP_DECL_CONSINITPRE ( consInitpreLogicor  )
static

presolving initialization method of constraint handler (called when presolving is about to begin)

Definition at line 3820 of file cons_logicor.c.

References NULL, SCIP_CALL, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIPcatchVarEvent(), SCIPconsGetData(), and SCIPconshdlrGetData().

static SCIP_DECL_CONSEXITPRE ( consExitpreLogicor  )
static

presolving deinitialization method of constraint handler (called after presolving has been finished)

Definition at line 3851 of file cons_logicor.c.

References applyFixings(), NULL, SCIP_Bool, SCIP_CALL, SCIP_EVENTTYPE_VARFIXED, SCIP_OKAY, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPconsIsDeleted(), and SCIPdropVarEvent().

static SCIP_DECL_CONSEXITSOL ( consExitsolLogicor  )
static

solving process deinitialization method of constraint handler (called before branch and bound process data is freed)

Definition at line 3889 of file cons_logicor.c.

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

static SCIP_DECL_CONSDELETE ( consDeleteLogicor  )
static
static SCIP_DECL_CONSINITLP ( consInitlpLogicor  )
static

LP initialization method of constraint handler (called before the initial LP relaxation at a node is solved)

Definition at line 3976 of file cons_logicor.c.

References addCut(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, and SCIPconsIsInitial().

static SCIP_DECL_CONSSEPALP ( consSepalpLogicor  )
static

separation method of constraint handler for LP solutions

Definition at line 3994 of file cons_logicor.c.

References CONSHDLR_NAME, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_SEPARATED, SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPdebugMessage, and separateCons().

static SCIP_DECL_CONSSEPASOL ( consSepasolLogicor  )
static

separation method of constraint handler for arbitrary primal solutions

Definition at line 4041 of file cons_logicor.c.

References CONSHDLR_NAME, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_SEPARATED, SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPdebugMessage, and separateCons().

static SCIP_DECL_CONSENFOLP ( consEnfolpLogicor  )
static

constraint enforcing method of constraint handler for LP solutions

Definition at line 4088 of file cons_logicor.c.

References CONSHDLR_NAME, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_FEASIBLE, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_SEPARATED, SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPdebugMessage, and separateCons().

static SCIP_DECL_CONSENFOPS ( consEnfopsLogicor  )
static

constraint enforcing method of constraint handler for pseudo solutions

Definition at line 4138 of file cons_logicor.c.

References CONSHDLR_NAME, enforcePseudo(), FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIP_REDUCEDDOM, SCIP_SOLVELP, SCIPconshdlrGetData(), SCIPconshdlrGetName(), and SCIPdebugMessage.

static SCIP_DECL_CONSCHECK ( consCheckLogicor  )
static
static SCIP_DECL_CONSPROP ( consPropLogicor  )
static
static SCIP_DECL_CONSRESPROP ( consRespropLogicor  )
static
static SCIP_DECL_CONSLOCK ( consLockLogicor  )
static

variable rounding lock method of constraint handler

Definition at line 4540 of file cons_logicor.c.

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

static SCIP_DECL_CONSACTIVE ( consActiveLogicor  )
static
static SCIP_DECL_CONSDEACTIVE ( consDeactiveLogicor  )
static
static SCIP_DECL_CONSPRINT ( consPrintLogicor  )
static

constraint display method of constraint handler

Definition at line 4640 of file cons_logicor.c.

References consdataPrint(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, and SCIPconsGetData().

static SCIP_DECL_CONSCOPY ( consCopyLogicor  )
static

constraint copying method of constraint handler

Definition at line 4654 of file cons_logicor.c.

References NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetName(), SCIPcopyConsLinear(), SCIPgetNVarsLogicor(), SCIPgetVarsLogicor(), and SCIPinfinity().

static SCIP_DECL_CONSPARSE ( consParseLogicor  )
static
static SCIP_DECL_CONSGETVARS ( consGetVarsLogicor  )
static

constraint method of constraint handler which returns the variables (if possible)

Definition at line 4775 of file cons_logicor.c.

References BMScopyMemoryArray, FALSE, NULL, SCIP_OKAY, SCIPconsGetData(), and TRUE.

static SCIP_DECL_CONSGETNVARS ( consGetNVarsLogicor  )
static

constraint method of constraint handler which returns the number of variables (if possible)

Definition at line 4797 of file cons_logicor.c.

References NULL, SCIP_OKAY, SCIPconsGetData(), and TRUE.

SCIP_RETCODE SCIPcreateConsLogicor ( SCIP scip,
SCIP_CONS **  cons,
const char *  name,
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 
)

creates and captures a logic or 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
nvarsnumber of variables in the constraint
varsarray with variables of constraint entries
initialshould the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'.
separateshould the constraint be separated during LP processing? Usually set to TRUE.
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.
propagateshould the constraint be propagated during node processing? Usually set to TRUE.
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.
removableshould the relaxation be removed from the LP due to aging or cleanup? Usually set to FALSE. Set to TRUE for 'lazy constraints' and 'user cuts'.
stickingatnodeshould the constraint always be kept at the node where it was added, even if it may be moved to a more global node? Usually set to FALSE. Set to TRUE to for constraints that represent node data.

Definition at line 5037 of file cons_logicor.c.

References consdataCreate(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_EVENTTYPE_VARFIXED, SCIP_INVALIDCALL, SCIP_OKAY, SCIP_STAGE_PRESOLVING, SCIPcatchVarEvent(), SCIPconshdlrGetData(), SCIPcreateCons(), SCIPerrorMessage, SCIPfindConshdlr(), SCIPgetStage(), and SCIPisTransformed().

Referenced by consdataLinearize(), createAndAddLinearCons(), createConflict(), createNormalizedLogicor(), extendToCover(), readCnf(), SCIP_DECL_CONFLICTEXEC(), SCIP_DECL_CONSPARSE(), SCIP_DECL_HEUREXEC(), SCIPcreateConsBasicLogicor(), and upgradeCons().

SCIP_RETCODE SCIPcreateConsBasicLogicor ( SCIP scip,
SCIP_CONS **  cons,
const char *  name,
int  nvars,
SCIP_VAR **  vars 
)

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

See Also
SCIPcreateConsLogicor() 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
nvarsnumber of variables in the constraint
varsarray with variables of constraint entries

Definition at line 5114 of file cons_logicor.c.

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

SCIP_RETCODE SCIPaddCoefLogicor ( SCIP scip,
SCIP_CONS cons,
SCIP_VAR var 
)

adds coefficient in logic or constraint

Parameters
scipSCIP data structure
conslogicor constraint
varvariable to add to the constraint

Definition at line 5131 of file cons_logicor.c.

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

Referenced by addCoefTerm(), and SCIPaddCoefPseudoboolean().

SCIP_Real SCIPgetDualsolLogicor ( SCIP scip,
SCIP_CONS cons 
)

gets the dual solution of the logic or constraint in the current LP

Parameters
scipSCIP data structure
consconstraint data

Definition at line 5196 of file cons_logicor.c.

References CONSHDLR_NAME, NULL, SCIP_INVALID, SCIPABORT, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPerrorMessage, and SCIProwGetDualsol().

SCIP_Real SCIPgetDualfarkasLogicor ( SCIP scip,
SCIP_CONS cons 
)

gets the dual Farkas value of the logic or constraint in the current infeasible LP

Parameters
scipSCIP data structure
consconstraint data

Definition at line 5220 of file cons_logicor.c.

References CONSHDLR_NAME, NULL, SCIP_INVALID, SCIPABORT, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), SCIPerrorMessage, and SCIProwGetDualfarkas().

SCIP_ROW* SCIPgetRowLogicor ( SCIP scip,
SCIP_CONS cons 
)

returns the linear relaxation of the given logic or constraint; may return NULL if no LP row was yet created; the user must not modify the row!

Parameters
scipSCIP data structure
consconstraint data

Definition at line 5246 of file cons_logicor.c.

References CONSHDLR_NAME, NULL, SCIPABORT, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetName(), and SCIPerrorMessage.