constraint handler for pseudo Boolean constraints
The constraint handler deals with pseudo Boolean constraints. These are constraints of the form
\[\mbox{lhs} \leq \sum_{k=0}^m c_k \cdot x_k + \sum_{i=0}^n c_i \cdot \prod_{j \in I_i} x_j \leq \mbox{rhs} \]
where all x are binary and all c are integer
Definition in file cons_pseudoboolean.c.
#include "blockmemshell/memory.h"
#include "scip/cons_and.h"
#include "scip/cons_indicator.h"
#include "scip/cons_knapsack.h"
#include "scip/cons_linear.h"
#include "scip/cons_logicor.h"
#include "scip/cons_pseudoboolean.h"
#include "scip/cons_setppc.h"
#include "scip/cons_xor.h"
#include "scip/debug.h"
#include "scip/pub_cons.h"
#include "scip/pub_message.h"
#include "scip/pub_misc.h"
#include "scip/pub_misc_sort.h"
#include "scip/pub_var.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_numerics.h"
#include "scip/scip_param.h"
#include "scip/scip_prob.h"
#include "scip/scip_sol.h"
#include "scip/scip_var.h"
#include "scip/symmetry_graph.h"
#include <string.h>
Go to the source code of this file.
Data Structures | |
struct | ConsAndData |
Macros | |
#define | CONSHDLR_NAME "pseudoboolean" |
#define | CONSHDLR_DESC "constraint handler dealing with pseudo Boolean constraints" |
#define | CONSHDLR_ENFOPRIORITY -1000000 |
#define | CONSHDLR_CHECKPRIORITY -5000000 |
#define | CONSHDLR_EAGERFREQ 100 |
#define | CONSHDLR_MAXPREROUNDS -1 |
#define | CONSHDLR_NEEDSCONS TRUE |
#define | CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_MEDIUM |
#define | DEFAULT_DECOMPOSENORMALPBCONS FALSE |
#define | DEFAULT_DECOMPOSEINDICATORPBCONS TRUE |
#define | DEFAULT_SEPARATENONLINEAR TRUE |
#define | DEFAULT_PROPAGATENONLINEAR TRUE |
#define | DEFAULT_REMOVABLENONLINEAR TRUE |
#define | NONLINCONSUPGD_PRIORITY 60000 |
#define | HASHSIZE_PSEUDOBOOLEANNONLINEARTERMS 500 |
#define | checkConsConsistency(scip, cons) |
#define | MAXNVARS 10 /* note that this cannot be bigger than 31 */ |
Functions | |
static | SCIP_DECL_SORTPTRCOMP (resvarComp) |
static | SCIP_DECL_SORTPTRCOMP (resvarCompWithInactive) |
static | SCIP_DECL_HASHGETKEY (hashGetKeyAndConsDatas) |
static | SCIP_DECL_HASHKEYEQ (hashKeyEqAndConsDatas) |
static | SCIP_DECL_HASHKEYVAL (hashKeyValAndConsDatas) |
static SCIP_RETCODE | inithashmapandtable (SCIP *const scip, SCIP_CONSHDLRDATA **conshdlrdata) |
static SCIP_RETCODE | conshdlrdataCreate (SCIP *const scip, SCIP_CONSHDLRDATA **conshdlrdata) |
static SCIP_RETCODE | conshdlrdataFree (SCIP *const scip, SCIP_CONSHDLRDATA **conshdlrdata) |
static SCIP_RETCODE | getLinearConsNVars (SCIP *const scip, SCIP_CONS *const cons, SCIP_LINEARCONSTYPE const constype, int *const nvars) |
static SCIP_RETCODE | getLinearConsSides (SCIP *const scip, SCIP_CONS *const cons, SCIP_LINEARCONSTYPE const constype, SCIP_Real *const lhs, SCIP_Real *const rhs) |
static SCIP_RETCODE | getLinearConsVarsData (SCIP *const scip, SCIP_CONS *const cons, SCIP_LINEARCONSTYPE const constype, SCIP_VAR **const vars, SCIP_Real *const coefs, int *const nvars) |
static SCIP_RETCODE | getLinVarsAndAndRess (SCIP *const scip, SCIP_CONS *const cons, SCIP_VAR **const vars, SCIP_Real *const coefs, int const nvars, SCIP_VAR **const linvars, SCIP_Real *const lincoefs, int *const nlinvars, SCIP_VAR **const andress, SCIP_Real *const andcoefs, SCIP_Bool *const andnegs, int *const nandress) |
static SCIP_RETCODE | transformToOrig (SCIP *const scip, CONSANDDATA *consanddata, SCIP_CONSHDLRDATA *conshdlrdata) |
static SCIP_RETCODE | consdataCreate (SCIP *const scip, SCIP_CONSHDLR *const conshdlr, SCIP_CONSDATA **consdata, SCIP_CONS *const lincons, SCIP_LINEARCONSTYPE const linconstype, SCIP_CONS **const andconss, SCIP_Real *const andcoefs, SCIP_Bool *const andnegs, int const nandconss, SCIP_VAR *const indvar, SCIP_Real const weight, SCIP_Bool const issoftcons, SCIP_VAR *const intvar, SCIP_Real lhs, SCIP_Real rhs, SCIP_Bool check, SCIP_Bool transforming) |
static SCIP_RETCODE | consdataFree (SCIP *const scip, SCIP_CONSDATA **consdata, SCIP_Bool isorig, SCIP_CONSHDLRDATA *conshdlrdata) |
static SCIP_RETCODE | checkLocksAndRes (SCIP *const scip, SCIP_VAR *res) |
static SCIP_RETCODE | lockRoundingAndCons (SCIP *const scip, SCIP_CONS *const cons, CONSANDDATA *const consanddata, SCIP_Real const coef, SCIP_Real const lhs, SCIP_Real const rhs) |
static SCIP_RETCODE | unlockRoundingAndCons (SCIP *const scip, SCIP_CONS *const cons, CONSANDDATA *const consanddata, SCIP_Real const coef, SCIP_Real const lhs, SCIP_Real const rhs) |
static SCIP_RETCODE | consdataPrint (SCIP *const scip, SCIP_CONS *const cons, FILE *const file) |
static SCIP_RETCODE | createAndAddAndCons (SCIP *const scip, SCIP_CONSHDLR *const conshdlr, SCIP_VAR **const vars, int const nvars, SCIP_Bool const initial, SCIP_Bool const enforce, SCIP_Bool const check, SCIP_Bool const local, SCIP_Bool const modifiable, SCIP_Bool const dynamic, SCIP_Bool const stickingatnode, SCIP_CONS **const andcons) |
static SCIP_RETCODE | addCoefTerm (SCIP *const scip, SCIP_CONS *const cons, SCIP_VAR **const vars, int const nvars, SCIP_Real const val) |
static SCIP_RETCODE | chgLhsLinearCons (SCIP *const scip, SCIP_CONS *const cons, SCIP_LINEARCONSTYPE const constype, SCIP_Real const lhs) |
static SCIP_RETCODE | chgRhsLinearCons (SCIP *const scip, SCIP_CONS *const cons, SCIP_LINEARCONSTYPE const constype, SCIP_Real const rhs) |
static SCIP_RETCODE | chgLhs (SCIP *const scip, SCIP_CONS *const cons, SCIP_Real lhs) |
static SCIP_RETCODE | chgRhs (SCIP *const scip, SCIP_CONS *const cons, SCIP_Real rhs) |
static SCIP_RETCODE | createAndAddAnds (SCIP *const scip, SCIP_CONSHDLR *const conshdlr, SCIP_VAR **const *const terms, SCIP_Real *const termcoefs, int const nterms, int const *const ntermvars, SCIP_Bool const initial, SCIP_Bool const enforce, SCIP_Bool const check, SCIP_Bool const local, SCIP_Bool const modifiable, SCIP_Bool const dynamic, SCIP_Bool const stickingatnode, SCIP_CONS **const andconss, SCIP_Real *const andvals, SCIP_Bool *const andnegs, int *const nandconss) |
static SCIP_RETCODE | createAndAddLinearCons (SCIP *const scip, SCIP_CONSHDLR *const conshdlr, SCIP_VAR **const linvars, int const nlinvars, SCIP_Real *const linvals, SCIP_VAR **const andress, int const nandress, SCIP_Real const *const andvals, SCIP_Bool *const andnegs, SCIP_Real *const lhs, SCIP_Real *const rhs, SCIP_Bool const issoftcons, SCIP_Bool const initial, SCIP_Bool const separate, SCIP_Bool const enforce, SCIP_Bool const check, SCIP_Bool const propagate, SCIP_Bool const local, SCIP_Bool const modifiable, SCIP_Bool const dynamic, SCIP_Bool const removable, SCIP_Bool const stickingatnode, SCIP_CONS **const lincons, SCIP_LINEARCONSTYPE *const linconstype) |
static SCIP_RETCODE | checkOrigPbCons (SCIP *const scip, SCIP_CONS *const cons, SCIP_SOL *const sol, SCIP_Bool *const violated, SCIP_Bool const printreason) |
static SCIP_RETCODE | checkAndConss (SCIP *const scip, SCIP_CONSHDLR *const conshdlr, SCIP_SOL *const sol, SCIP_Bool *const violated) |
static SCIP_RETCODE | copyConsPseudoboolean (SCIP *const targetscip, SCIP_CONS **targetcons, SCIP *const sourcescip, SCIP_CONS *const sourcecons, const char *name, SCIP_HASHMAP *const varmap, SCIP_HASHMAP *const consmap, SCIP_Bool const initial, SCIP_Bool const separate, SCIP_Bool const enforce, SCIP_Bool const check, SCIP_Bool const propagate, SCIP_Bool const local, SCIP_Bool const modifiable, SCIP_Bool const dynamic, SCIP_Bool const removable, SCIP_Bool const stickingatnode, SCIP_Bool const global, SCIP_Bool *const valid) |
static SCIP_RETCODE | computeConsAndDataChanges (SCIP *const scip, SCIP_CONSHDLRDATA *const conshdlrdata) |
static SCIP_RETCODE | removeOldLocks (SCIP *const scip, SCIP_CONS *const cons, CONSANDDATA *const consanddata, SCIP_Real const coef, SCIP_Real const lhs, SCIP_Real const rhs) |
static SCIP_RETCODE | addNewLocks (SCIP *const scip, SCIP_CONS *const cons, CONSANDDATA *const consanddata, SCIP_Real const coef, SCIP_Real const lhs, SCIP_Real const rhs) |
static SCIP_RETCODE | correctLocksAndCaptures (SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, SCIP_Real const newlhs, SCIP_Real const newrhs, SCIP_VAR **const andress, SCIP_Real *const andcoefs, SCIP_Bool *const andnegs, int const nandress) |
static SCIP_RETCODE | addCliques (SCIP *const scip, SCIP_CONS *const cons, SCIP_Bool *const cutoff, int *const naggrvars, int *const nchgbds) |
static SCIP_RETCODE | propagateCons (SCIP *const scip, SCIP_CONS *const cons, SCIP_Bool *const cutoff, int *const ndelconss) |
static SCIP_RETCODE | updateAndConss (SCIP *const scip, SCIP_CONS *const cons) |
static SCIP_RETCODE | correctConshdlrdata (SCIP *const scip, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss) |
static SCIP_RETCODE | updateConsanddataUses (SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss) |
static SCIP_RETCODE | checkSolution (SCIP *const scip, SCIP_VAR **const vars, int const nvars, SCIP_Bool *const values, SCIP_VAR **const linvars, SCIP_Real *const lincoefs, int const nlinvars, SCIP_Real const constant, SCIP_Real const side, CONSANDDATA **const consanddatas, SCIP_Real *const consanddatacoefs, SCIP_Bool *const consanddatanegs, int const nconsanddatas, int const cnt, int *const xortype) |
static SCIP_RETCODE | tryUpgradingXor (SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss, int *const naddconss, int *const nfixedvars, int *const nchgcoefs, int *const nchgsides, SCIP_Bool *const cutoff) |
static SCIP_RETCODE | tryUpgradingLogicor (SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss, int *const naddconss, int *const nfixedvars, int *const nchgcoefs, int *const nchgsides, SCIP_Bool *const cutoff) |
static SCIP_RETCODE | tryUpgradingSetppc (SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss, int *const naddconss, int *const nfixedvars, int *const nchgcoefs, int *const nchgsides, SCIP_Bool *const cutoff) |
static SCIP_RETCODE | tryUpgrading (SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss, int *const naddconss, int *const nfixedvars, int *const nchgcoefs, int *const nchgsides, SCIP_Bool *const cutoff) |
static SCIP_RETCODE | findAggregation (SCIP *const scip, SCIP_CONS *const cons, SCIP_CONSHDLRDATA *const conshdlrdata, int *const ndelconss, int *const naggrvars, SCIP_Bool *const cutoff) |
static SCIP_RETCODE | addSymmetryInformation (SCIP *scip, SYM_SYMTYPE symtype, SCIP_CONS *cons, SYM_GRAPH *graph, SCIP_Bool *success) |
static | SCIP_DECL_CONSHDLRCOPY (conshdlrCopyPseudoboolean) |
static | SCIP_DECL_CONSFREE (consFreePseudoboolean) |
static | SCIP_DECL_CONSINIT (consInitPseudoboolean) |
static | SCIP_DECL_CONSINITPRE (consInitprePseudoboolean) |
static | SCIP_DECL_CONSDELETE (consDeletePseudoboolean) |
static | SCIP_DECL_CONSTRANS (consTransPseudoboolean) |
static | SCIP_DECL_CONSENFOLP (consEnfolpPseudoboolean) |
static | SCIP_DECL_CONSENFORELAX (consEnforelaxPseudoboolean) |
static | SCIP_DECL_CONSENFOPS (consEnfopsPseudoboolean) |
static | SCIP_DECL_CONSCHECK (consCheckPseudoboolean) |
static | SCIP_DECL_CONSPRESOL (consPresolPseudoboolean) |
static | SCIP_DECL_CONSLOCK (consLockPseudoboolean) |
static | SCIP_DECL_CONSPRINT (consPrintPseudoboolean) |
static | SCIP_DECL_CONSCOPY (consCopyPseudoboolean) |
static | SCIP_DECL_CONSPARSE (consParsePseudoboolean) |
static | SCIP_DECL_CONSGETVARS (consGetVarsPseudoboolean) |
static | SCIP_DECL_CONSGETNVARS (consGetNVarsPseudoboolean) |
static | SCIP_DECL_CONSGETPERMSYMGRAPH (consGetPermsymGraphPseudoboolean) |
static | SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH (consGetSignedPermsymGraphPseudoboolean) |
SCIP_RETCODE | SCIPincludeConshdlrPseudoboolean (SCIP *scip) |
SCIP_RETCODE | SCIPcreateConsPseudobooleanWithConss (SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_CONS *lincons, SCIP_LINEARCONSTYPE linconstype, SCIP_CONS **andconss, SCIP_Real *andcoefs, int nandconss, SCIP_VAR *indvar, SCIP_Real weight, SCIP_Bool issoftcons, SCIP_VAR *intvar, SCIP_Real lhs, SCIP_Real rhs, 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 | SCIPcreateConsPseudoboolean (SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR **linvars, int nlinvars, SCIP_Real *linvals, SCIP_VAR ***terms, int nterms, int *ntermvars, SCIP_Real *termvals, SCIP_VAR *indvar, SCIP_Real weight, SCIP_Bool issoftcons, SCIP_VAR *intvar, SCIP_Real lhs, SCIP_Real rhs, 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 | SCIPcreateConsBasicPseudoboolean (SCIP *scip, SCIP_CONS **cons, const char *name, SCIP_VAR **linvars, int nlinvars, SCIP_Real *linvals, SCIP_VAR ***terms, int nterms, int *ntermvars, SCIP_Real *termvals, SCIP_VAR *indvar, SCIP_Real weight, SCIP_Bool issoftcons, SCIP_VAR *intvar, SCIP_Real lhs, SCIP_Real rhs) |
SCIP_RETCODE | SCIPaddCoefPseudoboolean (SCIP *const scip, SCIP_CONS *const cons, SCIP_VAR *const var, SCIP_Real const val) |
SCIP_RETCODE | SCIPaddTermPseudoboolean (SCIP *const scip, SCIP_CONS *const cons, SCIP_VAR **const vars, int const nvars, SCIP_Real const val) |
SCIP_VAR * | SCIPgetIndVarPseudoboolean (SCIP *const scip, SCIP_CONS *const cons) |
SCIP_CONS * | SCIPgetLinearConsPseudoboolean (SCIP *const scip, SCIP_CONS *const cons) |
SCIP_LINEARCONSTYPE | SCIPgetLinearConsTypePseudoboolean (SCIP *const scip, SCIP_CONS *const cons) |
int | SCIPgetNLinVarsWithoutAndPseudoboolean (SCIP *const scip, SCIP_CONS *const cons) |
SCIP_RETCODE | SCIPgetLinDatasWithoutAndPseudoboolean (SCIP *const scip, SCIP_CONS *const cons, SCIP_VAR **const linvars, SCIP_Real *const lincoefs, int *const nlinvars) |
SCIP_RETCODE | SCIPgetAndDatasPseudoboolean (SCIP *const scip, SCIP_CONS *const cons, SCIP_CONS **const andconss, SCIP_Real *const andcoefs, int *const nandconss) |
int | SCIPgetNAndsPseudoboolean (SCIP *const scip, SCIP_CONS *const cons) |
SCIP_RETCODE | SCIPchgLhsPseudoboolean (SCIP *const scip, SCIP_CONS *const cons, SCIP_Real const lhs) |
SCIP_RETCODE | SCIPchgRhsPseudoboolean (SCIP *const scip, SCIP_CONS *const cons, SCIP_Real const rhs) |
SCIP_Real | SCIPgetLhsPseudoboolean (SCIP *const scip, SCIP_CONS *const cons) |
SCIP_Real | SCIPgetRhsPseudoboolean (SCIP *const scip, SCIP_CONS *const cons) |
#define CONSHDLR_NAME "pseudoboolean" |
Definition at line 77 of file cons_pseudoboolean.c.
#define CONSHDLR_DESC "constraint handler dealing with pseudo Boolean constraints" |
Definition at line 78 of file cons_pseudoboolean.c.
#define CONSHDLR_ENFOPRIORITY -1000000 |
priority of the constraint handler for constraint enforcing
Definition at line 79 of file cons_pseudoboolean.c.
#define CONSHDLR_CHECKPRIORITY -5000000 |
priority of the constraint handler for checking feasibility
Definition at line 80 of file cons_pseudoboolean.c.
#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 81 of file cons_pseudoboolean.c.
#define CONSHDLR_MAXPREROUNDS -1 |
maximal number of presolving rounds the constraint handler participates in (-1: no limit)
Definition at line 83 of file cons_pseudoboolean.c.
#define CONSHDLR_NEEDSCONS TRUE |
should the constraint handler be skipped, if no constraints are available?
Definition at line 84 of file cons_pseudoboolean.c.
#define CONSHDLR_PRESOLTIMING SCIP_PRESOLTIMING_MEDIUM |
presolving timing of the constraint handler (fast, medium, or exhaustive)
Definition at line 86 of file cons_pseudoboolean.c.
#define DEFAULT_DECOMPOSENORMALPBCONS FALSE |
decompose every normal pseudo boolean constraint into a "linear" constraint and "and" constraints
Definition at line 88 of file cons_pseudoboolean.c.
Referenced by SCIPincludeConshdlrPseudoboolean().
#define DEFAULT_DECOMPOSEINDICATORPBCONS TRUE |
decompose every soft pseudo boolean constraint into "indicator" constraints and "and" constraints
Definition at line 89 of file cons_pseudoboolean.c.
Referenced by SCIPincludeConshdlrPseudoboolean().
#define DEFAULT_SEPARATENONLINEAR TRUE |
if decomposed, should the nonlinear constraints be separated during LP processing
Definition at line 91 of file cons_pseudoboolean.c.
Referenced by SCIPincludeConshdlrPseudoboolean().
#define DEFAULT_PROPAGATENONLINEAR TRUE |
if decomposed, should the nonlinear constraints be propagated during node processing
Definition at line 92 of file cons_pseudoboolean.c.
Referenced by SCIPincludeConshdlrPseudoboolean().
#define DEFAULT_REMOVABLENONLINEAR TRUE |
if decomposed, should the nonlinear constraints be removable
Definition at line 93 of file cons_pseudoboolean.c.
Referenced by SCIPincludeConshdlrPseudoboolean().
#define NONLINCONSUPGD_PRIORITY 60000 |
priority of upgrading nonlinear constraints
Definition at line 94 of file cons_pseudoboolean.c.
#define HASHSIZE_PSEUDOBOOLEANNONLINEARTERMS 500 |
minimal size of hash table in and constraint tables
Definition at line 102 of file cons_pseudoboolean.c.
Referenced by inithashmapandtable().
#define checkConsConsistency | ( | scip, | |
cons ) |
Definition at line 1023 of file cons_pseudoboolean.c.
Referenced by addCliques(), SCIPchgLhsPseudoboolean(), SCIPchgRhsPseudoboolean(), SCIPgetAndDatasPseudoboolean(), SCIPgetLhsPseudoboolean(), SCIPgetLinDatasWithoutAndPseudoboolean(), SCIPgetNAndsPseudoboolean(), SCIPgetNLinVarsWithoutAndPseudoboolean(), SCIPgetRhsPseudoboolean(), and tryUpgradingXor().
#define MAXNVARS 10 /* note that this cannot be bigger than 31 */ |
Definition at line 5364 of file cons_pseudoboolean.c.
Referenced by checkSolution(), and tryUpgradingXor().
typedef struct ConsAndData CONSANDDATA |
Definition at line 169 of file cons_pseudoboolean.c.
|
static |
comparison method for sorting and-resultants according to their problem index, which is used instead of the original index because the implicit resultants are shuffled when creating the constraints that otherwise results in shuffled problem copies, if an and-resultant is fixed, it will be put in front with respect to its original index if an and-resultant is negated, it will be put in front of its negation counterpart
Definition at line 243 of file cons_pseudoboolean.c.
References assert(), SCIP_Bool, SCIPvarGetIndex(), SCIPvarGetNegatedVar(), SCIPvarGetProbindex(), and SCIPvarIsNegated().
|
static |
comparison method for sorting consanddatas according to the problem index of their corresponding and-resultants, if a consanddata object is deleted, it is handled like it has an inactive resultant, so this will be put in front while sorting
Definition at line 284 of file cons_pseudoboolean.c.
References assert(), ConsAndData::cons, ConsAndData::istransformed, NULL, ConsAndData::origcons, SCIPconsIsDeleted(), and SCIPgetResultantAnd().
|
static |
gets the key of the given element
Definition at line 327 of file cons_pseudoboolean.c.
|
static |
returns TRUE iff both keys are equal; two non-linear terms are equal if they have the same variables
Definition at line 335 of file cons_pseudoboolean.c.
References assert(), ConsAndData::cons, FALSE, NULL, ConsAndData::nvars, SCIPvarCompare(), SCIPvarGetIndex(), TRUE, and ConsAndData::vars.
|
static |
returns the hash value of the key
Definition at line 396 of file cons_pseudoboolean.c.
References assert(), NULL, ConsAndData::nvars, SCIPhashFour, SCIPvarGetIndex(), and ConsAndData::vars.
|
static |
initializes the hashmap and -table used in this constraint handler data for artificial variables and specific and-constraint data objects
scip | SCIP data structure |
conshdlrdata | pointer to store the constraint handler data |
Definition at line 429 of file cons_pseudoboolean.c.
References assert(), HASHSIZE_PSEUDOBOOLEANNONLINEARTERMS, NULL, SCIP_CALL, SCIP_OKAY, SCIPblkmem(), SCIPhashmapCreate(), SCIPhashtableCreate(), and TRUE.
Referenced by SCIPcreateConsPseudoboolean(), and SCIPcreateConsPseudobooleanWithConss().
|
static |
creates constraint handler data for pseudo boolean constraint handler
scip | SCIP data structure |
conshdlrdata | pointer to store the constraint handler data |
Definition at line 461 of file cons_pseudoboolean.c.
References assert(), FALSE, NULL, SCIP_CALL, SCIP_OKAY, SCIPallocBlockMemory, and SCIPallocBlockMemoryArray.
Referenced by SCIPincludeConshdlrPseudoboolean().
|
static |
frees constraint handler data for pseudo boolean constraint handler
scip | SCIP data structure |
conshdlrdata | pointer to the constraint handler data |
Definition at line 496 of file cons_pseudoboolean.c.
References assert(), FALSE, NULL, SCIP_OKAY, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPhashmapFree(), and SCIPhashtableFree().
Referenced by SCIP_DECL_CONSFREE().
|
static |
gets number of variables in linear constraint
scip | SCIP data structure |
cons | linear constraint |
constype | linear constraint type |
nvars | pointer to store number variables of linear constraint |
Definition at line 535 of file cons_pseudoboolean.c.
References assert(), NULL, nvars, SCIP_INVALIDDATA, SCIP_LINEARCONSTYPE_INVALIDCONS, SCIP_LINEARCONSTYPE_KNAPSACK, SCIP_LINEARCONSTYPE_LINEAR, SCIP_LINEARCONSTYPE_LOGICOR, SCIP_LINEARCONSTYPE_SETPPC, SCIP_OKAY, SCIPerrorMessage, SCIPgetNVarsKnapsack(), SCIPgetNVarsLinear(), SCIPgetNVarsLogicor(), and SCIPgetNVarsSetppc().
Referenced by addCliques(), checkOrigPbCons(), chgLhs(), chgRhs(), consdataCreate(), consdataPrint(), copyConsPseudoboolean(), correctLocksAndCaptures(), findAggregation(), SCIP_DECL_CONSGETNVARS(), SCIP_DECL_CONSGETVARS(), SCIP_DECL_CONSINITPRE(), SCIP_DECL_CONSPRESOL(), SCIPgetLinDatasWithoutAndPseudoboolean(), tryUpgrading(), tryUpgradingLogicor(), and tryUpgradingXor().
|
static |
gets sides of linear constraint
scip | SCIP data structure |
cons | linear constraint |
constype | linear constraint type |
lhs | pointer to store left hand side of linear constraint |
rhs | pointer to store right hand side of linear constraint |
Definition at line 578 of file cons_pseudoboolean.c.
References SCIP_INVALIDDATA, SCIP_LINEARCONSTYPE_INVALIDCONS, SCIP_LINEARCONSTYPE_KNAPSACK, SCIP_LINEARCONSTYPE_LINEAR, SCIP_LINEARCONSTYPE_LOGICOR, SCIP_LINEARCONSTYPE_SETPPC, SCIP_OKAY, SCIP_Real, SCIP_SETPPCTYPE_COVERING, SCIP_SETPPCTYPE_PACKING, SCIP_SETPPCTYPE_PARTITIONING, SCIPerrorMessage, SCIPgetCapacityKnapsack(), SCIPgetLhsLinear(), SCIPgetRhsLinear(), SCIPgetTypeSetppc(), and SCIPinfinity().
Referenced by checkOrigPbCons(), chgLhs(), chgRhs(), consdataPrint(), copyConsPseudoboolean(), SCIP_DECL_CONSINITPRE(), and SCIP_DECL_CONSPRESOL().
|
static |
gets variables and coefficients of linear constraint
scip | SCIP data structure |
cons | linear constraint |
constype | linear constraint type |
vars | array to store variables of linear constraint |
coefs | array to store coefficient of linear constraint, or NULL |
nvars | pointer to store number variables of linear constraint |
Definition at line 641 of file cons_pseudoboolean.c.
References assert(), NULL, nvars, SCIP_INVALIDDATA, SCIP_LINEARCONSTYPE_INVALIDCONS, SCIP_LINEARCONSTYPE_KNAPSACK, SCIP_LINEARCONSTYPE_LINEAR, SCIP_LINEARCONSTYPE_LOGICOR, SCIP_LINEARCONSTYPE_SETPPC, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIPerrorMessage, SCIPgetNVarsKnapsack(), SCIPgetNVarsLinear(), SCIPgetNVarsLogicor(), SCIPgetNVarsSetppc(), SCIPgetValsLinear(), SCIPgetVarsKnapsack(), SCIPgetVarsLinear(), SCIPgetVarsLogicor(), SCIPgetVarsSetppc(), SCIPgetWeightsKnapsack(), and vars.
Referenced by addCliques(), checkOrigPbCons(), chgLhs(), chgRhs(), consdataPrint(), copyConsPseudoboolean(), findAggregation(), SCIP_DECL_CONSGETNVARS(), SCIP_DECL_CONSGETVARS(), SCIP_DECL_CONSINITPRE(), SCIP_DECL_CONSPRESOL(), SCIPgetLinDatasWithoutAndPseudoboolean(), tryUpgradingLogicor(), and tryUpgradingXor().
|
static |
splits up into original linear variables and artificial and-resultants
scip | SCIP data structure |
cons | pseudoboolean constraint |
vars | all variables of linear constraint |
coefs | all coefficients of linear constraint, or NULL |
nvars | number of all variables of linear constraint |
linvars | array to store not and-resultant variables of linear constraint, or NULL |
lincoefs | array to store coefficients of not and-resultant variables of linear constraint, or NULL |
nlinvars | pointer to store number of not and-resultant variables, or NULL |
andress | array to store and-resultant variables of linear constraint, or NULL |
andcoefs | array to store coefficients of and-resultant variables of linear constraint, or NULL |
andnegs | array to store negation status of and-resultant variables of linear constraint, or NULL |
nandress | pointer to store number of and-resultant variables, or NULL |
Definition at line 791 of file cons_pseudoboolean.c.
References assert(), ConsAndData::cons, ConsAndData::istransformed, NULL, nvars, SCIP_Bool, SCIP_OKAY, SCIP_Real, SCIPconsGetHdlr(), SCIPconshdlrGetData(), SCIPconsIsDeleted(), SCIPconsIsOriginal(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPvarGetNegationVar(), SCIPvarIsNegated(), and vars.
Referenced by addCliques(), chgLhs(), chgRhs(), findAggregation(), SCIP_DECL_CONSGETNVARS(), SCIP_DECL_CONSGETVARS(), SCIP_DECL_CONSPRESOL(), SCIPgetLinDatasWithoutAndPseudoboolean(), tryUpgradingLogicor(), and tryUpgradingXor().
|
static |
transforming transformed consanddata object back to original space, if an corresponding original constraint exists, also clearing all transformed data, i.e. releasing transformed variables
scip | SCIP data structure |
consanddata | consanddata object |
conshdlrdata | constraint handler data |
Definition at line 1031 of file cons_pseudoboolean.c.
References assert(), FALSE, ConsAndData::isoriginal, ConsAndData::istransformed, ConsAndData::newvars, ConsAndData::nnewvars, ConsAndData::noriguses, NULL, ConsAndData::nuses, ConsAndData::nvars, ConsAndData::origcons, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPduplicateBlockMemoryArray, SCIPfreeBlockMemoryArrayNull, SCIPgetNVarsAnd(), SCIPgetResultantAnd(), SCIPgetVarsAnd(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPhashtableExists(), SCIPhashtableRetrieve(), SCIPreleaseVar(), SCIPsortPtr(), SCIPvarIsTransformed(), ConsAndData::snewvars, ConsAndData::svars, TRUE, and ConsAndData::vars.
Referenced by consdataFree(), correctConshdlrdata(), and updateConsanddataUses().
|
static |
creates a pseudo boolean constraint data
scip | SCIP data structure |
conshdlr | pseudoboolean constraint handler |
consdata | pointer to linear constraint data |
lincons | linear constraint with artificial and-resultants representing this pseudoboolean constraint |
linconstype | type of linear constraint |
andconss | array of and-constraints which occur in this pseudoboolean constraint |
andcoefs | coefficients of and-constraints |
andnegs | negation status of and-constraints (or NULL, if no negated resultants) |
nandconss | number of and-constraints |
indvar | indicator variable if it's a soft constraint, or NULL |
weight | weight of the soft constraint, if it is one |
issoftcons | is this a soft constraint |
intvar | a artificial variable which was added only for the objective function, if this variable is not NULL this constraint (without this integer variable) describes the objective function |
lhs | left hand side of row |
rhs | right hand side of row |
check | is the new constraint a check constraint? |
transforming | are we called by CONSTRANS |
Definition at line 1162 of file cons_pseudoboolean.c.
References assert(), c, FALSE, getLinearConsNVars(), NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_LINEARCONSTYPE_INVALIDCONS, SCIP_OKAY, SCIP_Real, SCIP_STAGE_PROBLEM, SCIPallocBlockMemory, SCIPallocBlockMemoryArray, SCIPallocBufferArray, SCIPallocClearBlockMemoryArray, SCIPcaptureVar(), SCIPconshdlrGetData(), SCIPconsIsTransformed(), SCIPduplicateBlockMemoryArray, SCIPerrorMessage, SCIPfreeBufferArray, SCIPgetResultantAnd(), SCIPgetStage(), SCIPgetTransformedVar(), SCIPgetTransformedVars(), SCIPhashmapGetImage(), SCIPinfinity(), SCIPisGT(), SCIPisInfinity(), SCIPisTransformed(), SCIPisZero(), SCIPsetConsChecked(), SCIPsortPtr(), SCIPsortPtrPtrRealBool(), SCIPtransformCons(), TRUE, and vars.
Referenced by SCIP_DECL_CONSTRANS(), SCIPcreateConsPseudoboolean(), and SCIPcreateConsPseudobooleanWithConss().
|
static |
free a pseudo boolean constraint data
scip | SCIP data structure |
consdata | pointer to linear constraint data |
isorig | are we freeing an original constraint? |
conshdlrdata | constraint handler data |
Definition at line 1400 of file cons_pseudoboolean.c.
References assert(), c, ConsAndData::noriguses, NULL, ConsAndData::nuses, ConsAndData::nvars, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsIsOriginal(), SCIPfreeBlockMemory, SCIPfreeBlockMemoryArrayNull, SCIPgetNVarsAnd(), SCIPgetResultantAnd(), SCIPgetVarsAnd(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPhashmapRemove(), SCIPhashtableExists(), SCIPhashtableRemove(), SCIPhashtableRetrieve(), SCIPreleaseCons(), SCIPvarIsOriginal(), ConsAndData::svars, transformToOrig(), TRUE, ConsAndData::vars, and vars.
Referenced by SCIP_DECL_CONSDELETE().
|
static |
check the locks of an AND resultant and removes it from all global structures if the resultant is not locked anymore
scip | SCIP data structure |
res | resultant of AND constraint |
Definition at line 1629 of file cons_pseudoboolean.c.
References assert(), NULL, SCIP_CALL, SCIP_LOCKTYPE_MODEL, SCIP_OKAY, SCIP_STAGE_FREETRANS, SCIPgetStage(), SCIPremoveVarFromGlobalStructures(), SCIPvarGetNLocksDownType(), SCIPvarGetNLocksUpType(), and SCIPvarIsActive().
Referenced by SCIP_DECL_CONSLOCK(), and unlockRoundingAndCons().
|
static |
installs rounding locks for the given and-constraint associated with given coefficient
scip | SCIP data structure |
cons | pseudoboolean constraint |
consanddata | CONSANDDATA object for which we want to add the locks |
coef | coefficient which led to old locks |
lhs | left hand side |
rhs | right hand side |
Definition at line 1649 of file cons_pseudoboolean.c.
References assert(), ConsAndData::cons, ConsAndData::newvars, ConsAndData::nnewvars, NULL, ConsAndData::nvars, nvars, SCIP_Bool, SCIP_CALL, SCIP_LOCKTYPE_CONFLICT, SCIP_OKAY, SCIP_Real, SCIPconsIsLocked(), SCIPconsIsLockedType(), SCIPgetResultantAnd(), SCIPisInfinity(), SCIPisLE(), SCIPisPositive(), SCIPlockVarCons(), TRUE, ConsAndData::vars, and vars.
Referenced by addCoefTerm(), and addNewLocks().
|
static |
removes rounding locks for the given and-constraint associated with given coefficient
scip | SCIP data structure |
cons | pseudoboolean constraint |
consanddata | CONSANDDATA object for which we want to delete the locks |
coef | coefficient which led to old locks |
lhs | left hand side which led to old locks |
rhs | right hand side which led to old locks |
Definition at line 1718 of file cons_pseudoboolean.c.
References assert(), checkLocksAndRes(), ConsAndData::cons, NULL, ConsAndData::nvars, nvars, SCIP_Bool, SCIP_CALL, SCIP_LOCKTYPE_CONFLICT, SCIP_OKAY, SCIP_Real, SCIPconsIsLocked(), SCIPconsIsLockedType(), SCIPgetResultantAnd(), SCIPisInfinity(), SCIPisLE(), SCIPisPositive(), SCIPunlockVarCons(), TRUE, ConsAndData::vars, and vars.
Referenced by correctLocksAndCaptures(), and removeOldLocks().
|
static |
prints pseudoboolean constraint in CIP format to file stream
scip | SCIP data structure |
cons | pseudoboolean constraint |
file | output file (or NULL for standard output) |
Definition at line 1787 of file cons_pseudoboolean.c.
References assert(), ConsAndData::cons, getLinearConsNVars(), getLinearConsSides(), getLinearConsVarsData(), NULL, nvars, ConsAndData::origcons, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), SCIPconsIsOriginal(), SCIPfreeBufferArray, SCIPgetNVarsAnd(), SCIPgetVarsAnd(), SCIPhashmapGetImage(), SCIPinfoMessage(), SCIPisInfinity(), SCIPisLE(), SCIPisZero(), SCIPvarGetNegatedVar(), SCIPvarGetObj(), SCIPvarIsBinary(), SCIPwriteVarName(), SCIPwriteVarsPolynomial(), TRUE, var, and vars.
Referenced by SCIP_DECL_CONSPRINT().
|
static |
creates and/or adds the resultant for a given term
scip | SCIP data structure |
conshdlr | pseudoboolean constraint handler |
vars | array of variables to get and-constraints for |
nvars | number of variables to get and-constraints for |
initial | should the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'. |
enforce | should the constraint be enforced during node processing? TRUE for model constraints, FALSE for additional, redundant constraints. |
check | should the constraint be checked for feasibility? TRUE for model constraints, FALSE for additional, redundant constraints. |
local | is constraint only valid locally? Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. |
modifiable | is constraint modifiable (subject to column generation)? Usually set to FALSE. In column generation applications, set to TRUE if pricing adds coefficients to this constraint. |
dynamic | is constraint subject to aging? Usually set to FALSE. Set to TRUE for own cuts which are seperated as constraints. |
stickingatnode | should 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. |
andcons | pointer to store and-constraint |
Definition at line 1956 of file cons_pseudoboolean.c.
References ARTIFICIALVARNAMEPREFIX, assert(), ConsAndData::cons, CONSHDLR_NAME, FALSE, ConsAndData::isoriginal, ConsAndData::istransformed, ConsAndData::newvars, ConsAndData::nnewvars, ConsAndData::noriguses, NULL, ConsAndData::nuses, ConsAndData::nvars, nvars, ConsAndData::origcons, propagate, SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_BINARY, SCIPABORT, SCIPaddCons(), SCIPaddVar(), SCIPallocBlockMemory, SCIPcalcMemGrowSize(), SCIPcaptureCons(), SCIPcaptureVar(), SCIPchgAndConsCheckFlagWhenUpgr(), SCIPchgAndConsRemovableFlagWhenUpgr(), SCIPchgVarBranchPriority(), SCIPconshdlrGetData(), SCIPcreateConsAnd(), SCIPcreateVar(), SCIPdebugAddSolVal, SCIPdebugGetSolVal, SCIPdebugPrintCons, SCIPduplicateBlockMemoryArray, SCIPensureBlockMemoryArray, SCIPerrorMessage, SCIPfreeBlockMemory, SCIPfreeBlockMemoryArray, SCIPgetBoolParam(), SCIPgetResultantAnd(), SCIPhashmapExists(), SCIPhashmapInsert(), SCIPhashtableInsert(), SCIPhashtableRetrieve(), SCIPisFeasEQ(), SCIPisFeasZero(), SCIPisTransformed(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsnprintf(), SCIPsortPtr(), SCIPvarGetName(), SCIPvarIsOriginal(), SCIPvarIsTransformedOrigvar(), ConsAndData::snewvars, ConsAndData::svars, TRUE, ConsAndData::vars, and vars.
Referenced by addCoefTerm(), and createAndAddAnds().
|
static |
adds a term to the given pseudoboolean constraint
scip | SCIP data structure |
cons | pseudoboolean constraint |
vars | variables of the nonlinear term |
nvars | number of variables of the nonlinear term |
val | coefficient of constraint entry |
Definition at line 2192 of file cons_pseudoboolean.c.
References assert(), createAndAddAndCons(), FALSE, lockRoundingAndCons(), NULL, nvars, SCIP_CALL, SCIP_INVALIDDATA, SCIP_LINEARCONSTYPE_INVALIDCONS, SCIP_LINEARCONSTYPE_KNAPSACK, SCIP_LINEARCONSTYPE_LINEAR, SCIP_LINEARCONSTYPE_LOGICOR, SCIP_LINEARCONSTYPE_SETPPC, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIPaddCoefKnapsack(), SCIPaddCoefLinear(), SCIPaddCoefLogicor(), SCIPaddCoefSetppc(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconshdlrGetData(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsStickingAtNode(), SCIPensureBlockMemoryArray, SCIPerrorMessage, SCIPgetResultantAnd(), SCIPhashmapGetImage(), SCIPisEQ(), SCIPisIntegral(), SCIPisPositive(), SCIPisZero(), TRUE, and vars.
Referenced by SCIPaddTermPseudoboolean().
|
static |
changes left hand side of linear constraint
scip | SCIP data structure |
cons | linear constraint |
constype | linear constraint type |
lhs | new left hand side of linear constraint |
Definition at line 2295 of file cons_pseudoboolean.c.
References SCIP_CALL, SCIP_INVALIDDATA, SCIP_LINEARCONSTYPE_INVALIDCONS, SCIP_LINEARCONSTYPE_KNAPSACK, SCIP_LINEARCONSTYPE_LINEAR, SCIP_LINEARCONSTYPE_LOGICOR, SCIP_LINEARCONSTYPE_SETPPC, SCIP_OKAY, SCIP_Real, SCIPchgLhsLinear(), and SCIPerrorMessage.
Referenced by chgLhs().
|
static |
changes right hand side of linear constraint
scip | SCIP data structure |
cons | linear constraint |
constype | linear constraint type |
rhs | new right hand side of linear constraint |
Definition at line 2326 of file cons_pseudoboolean.c.
References SCIP_CALL, SCIP_INVALIDDATA, SCIP_LINEARCONSTYPE_INVALIDCONS, SCIP_LINEARCONSTYPE_KNAPSACK, SCIP_LINEARCONSTYPE_LINEAR, SCIP_LINEARCONSTYPE_LOGICOR, SCIP_LINEARCONSTYPE_SETPPC, SCIP_OKAY, SCIP_Real, SCIPchgRhsLinear(), and SCIPerrorMessage.
Referenced by chgRhs().
|
static |
sets left hand side of linear constraint
scip | SCIP data structure |
cons | linear constraint |
lhs | new left hand side |
Definition at line 2357 of file cons_pseudoboolean.c.
References assert(), c, chgLhsLinearCons(), ConsAndData::cons, FALSE, getLinearConsNVars(), getLinearConsSides(), getLinearConsVarsData(), getLinVarsAndAndRess(), NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_LOCKTYPE_CONFLICT, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsIsLocked(), SCIPconsIsLockedType(), SCIPconsIsTransformed(), SCIPfreeBufferArray, SCIPgetNVarsAnd(), SCIPgetVarsAnd(), SCIPinfinity(), SCIPisEQ(), SCIPisInfinity(), SCIPisLE(), SCIPisLT(), SCIPisPositive(), SCIPlockVarCons(), SCIPunlockVarCons(), TRUE, and vars.
Referenced by SCIPchgLhsPseudoboolean().
|
static |
sets right hand side of pseudoboolean constraint
scip | SCIP data structure |
cons | linear constraint |
rhs | new right hand side |
Definition at line 2528 of file cons_pseudoboolean.c.
References assert(), c, chgRhsLinearCons(), ConsAndData::cons, FALSE, getLinearConsNVars(), getLinearConsSides(), getLinearConsVarsData(), getLinVarsAndAndRess(), NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_LOCKTYPE_CONFLICT, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsIsLocked(), SCIPconsIsLockedType(), SCIPconsIsTransformed(), SCIPfreeBufferArray, SCIPgetNVarsAnd(), SCIPgetVarsAnd(), SCIPinfinity(), SCIPisEQ(), SCIPisGT(), SCIPisInfinity(), SCIPisLE(), SCIPisPositive(), SCIPlockVarCons(), SCIPunlockVarCons(), TRUE, and vars.
Referenced by SCIPchgRhsPseudoboolean().
|
static |
create and-constraints and get all and-resultants
scip | SCIP data structure |
conshdlr | pseudoboolean constraint handler |
terms | array of term variables to get and-constraints for |
termcoefs | array of coefficients for and-constraints |
nterms | number of terms to get and-constraints for |
ntermvars | array of number of variable in each term |
initial | should the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'. |
enforce | should the constraint be enforced during node processing? TRUE for model constraints, FALSE for additional, redundant constraints. |
check | should the constraint be checked for feasibility? TRUE for model constraints, FALSE for additional, redundant constraints. |
local | is constraint only valid locally? Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. |
modifiable | is constraint modifiable (subject to column generation)? Usually set to FALSE. In column generation applications, set to TRUE if pricing adds coefficients to this constraint. |
dynamic | is constraint subject to aging? Usually set to FALSE. Set to TRUE for own cuts which are seperated as constraints. |
stickingatnode | should 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. |
andconss | array to store all created and-constraints for given terms |
andvals | array to store all coefficients of and-constraints |
andnegs | array to store negation status of and-constraints |
nandconss | number of created and constraints |
Definition at line 2699 of file cons_pseudoboolean.c.
References assert(), createAndAddAndCons(), FALSE, nterms, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, and SCIPisZero().
Referenced by SCIPcreateConsPseudoboolean().
|
static |
created linear constraint of pseudo boolean constraint
scip | SCIP data structure |
conshdlr | pseudoboolean constraint handler |
linvars | linear variables |
nlinvars | number of linear variables |
linvals | linear coefficients |
andress | and-resultant variables |
nandress | number of and-resultant variables |
andvals | and-resultant coefficients |
andnegs | and-resultant negation status |
lhs | pointer to left hand side of linear constraint |
rhs | pointer to right hand side of linear constraint |
issoftcons | is this a soft constraint |
initial | should the LP relaxation of constraint be in the initial LP? Usually set to TRUE. Set to FALSE for 'lazy constraints'. |
separate | should the constraint be separated during LP processing? Usually set to TRUE. |
enforce | should the constraint be enforced during node processing? TRUE for model constraints, FALSE for additional, redundant constraints. |
check | should the constraint be checked for feasibility? TRUE for model constraints, FALSE for additional, redundant constraints. |
propagate | should the constraint be propagated during node processing? Usually set to TRUE. |
local | is constraint only valid locally? Usually set to FALSE. Has to be set to TRUE, e.g., for branching constraints. |
modifiable | is constraint modifiable (subject to column generation)? Usually set to FALSE. In column generation applications, set to TRUE if pricing adds coefficients to this constraint. |
dynamic | is constraint subject to aging? Usually set to FALSE. Set to TRUE for own cuts which are seperated as constraints. |
removable | should 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'. |
stickingatnode | should 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. |
lincons | pointer to store created linear constraint |
linconstype | pointer to store the type of the linear constraint |
Definition at line 2767 of file cons_pseudoboolean.c.
References assert(), FALSE, NULL, nvars, propagate, SCIP_Bool, SCIP_CALL, SCIP_LINEARCONSTYPE_INVALIDCONS, SCIP_LINEARCONSTYPE_KNAPSACK, SCIP_LINEARCONSTYPE_LINEAR, SCIP_LINEARCONSTYPE_LOGICOR, SCIP_LINEARCONSTYPE_SETPPC, SCIP_Longint, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPaddCoefLinear(), SCIPaddCons(), SCIPallocBufferArray, SCIPcaptureCons(), SCIPconsAddUpgradeLocks(), SCIPconshdlrGetData(), SCIPcreateConsKnapsack(), SCIPcreateConsLinear(), SCIPcreateConsLogicor(), SCIPcreateConsSetcover(), SCIPcreateConsSetpack(), SCIPcreateConsSetpart(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPfeasFloor(), SCIPfindConshdlr(), SCIPfreeBufferArray, SCIPgetNegatedVar(), SCIPinfinity(), SCIPisEQ(), SCIPisFeasIntegral(), SCIPisInfinity(), SCIPisIntegral(), SCIPisPositive(), SCIPisZero(), SCIPreleaseCons(), SCIPsnprintf(), SCIPwarningMessage(), and TRUE.
Referenced by SCIPcreateConsPseudoboolean().
|
static |
checks one original pseudoboolean constraint for feasibility of given solution
scip | SCIP data structure |
cons | pseudo boolean constraint |
sol | solution to be checked, or NULL for current solution |
violated | pointer to store whether the constraint is violated |
printreason | should violation of constraint be printed |
Definition at line 3397 of file cons_pseudoboolean.c.
References assert(), ConsAndData::cons, FALSE, getLinearConsNVars(), getLinearConsSides(), getLinearConsVarsData(), i, NULL, nvars, ConsAndData::origcons, SCIP_Bool, SCIP_CALL, SCIP_LINEARCONSTYPE_INVALIDCONS, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconsIsOriginal(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPfreeBufferArray, SCIPgetNVarsAnd(), SCIPgetResultantAnd(), SCIPgetSolVal(), SCIPgetVarsAnd(), SCIPhashmapGetImage(), SCIPinfoMessage(), SCIPisFeasGT(), SCIPisFeasLT(), SCIPisInfinity(), SCIPisLE(), SCIPprintCons(), SCIPrelDiff(), SCIPupdateSolConsViolation(), SCIPvarGetNegatedVar(), sol, TRUE, var, and vars.
Referenced by SCIP_DECL_CONSCHECK().
|
static |
checks all and-constraints inside the pseudoboolean constraint handler for feasibility of given solution or current solution
scip | SCIP data structure |
conshdlr | pseudo boolean constraint handler |
sol | solution to be checked, or NULL for current solution |
violated | pointer to store whether the constraint is violated |
Definition at line 3584 of file cons_pseudoboolean.c.
References assert(), c, FALSE, MAX3, NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPconshdlrGetData(), SCIPgetNVarsAnd(), SCIPgetResultantAnd(), SCIPgetSolVal(), SCIPgetVarsAnd(), SCIPincConsAge(), SCIPisFeasPositive(), SCIPresetConsAge(), sol, TRUE, and vars.
Referenced by SCIP_DECL_CONSCHECK(), SCIP_DECL_CONSENFOLP(), SCIP_DECL_CONSENFOPS(), and SCIP_DECL_CONSENFORELAX().
|
static |
creates by copying and captures a linear constraint
targetscip | target SCIP data structure |
targetcons | pointer to store the created target constraint |
sourcescip | source SCIP data structure |
sourcecons | source constraint which will be copied |
name | name of constraint |
varmap | a SCIP_HASHMAP mapping variables of the source SCIP to corresponding variables of the target SCIP |
consmap | a hashmap to store the mapping of source constraints to the corresponding target constraints |
initial | should the LP relaxation of constraint be in the initial LP? |
separate | should the constraint be separated during LP processing? |
enforce | should the constraint be enforced during node processing? |
check | should the constraint be checked for feasibility? |
propagate | should the constraint be propagated during node processing? |
local | is constraint only valid locally? |
modifiable | is constraint modifiable (subject to column generation)? |
dynamic | is constraint subject to aging? |
removable | should the relaxation be removed from the LP due to aging or cleanup? |
stickingatnode | should the constraint always be kept at the node where it was added, even if it may be moved to a more global node? |
global | create a global or a local copy? |
valid | pointer to store if the copying was valid |
Definition at line 3670 of file cons_pseudoboolean.c.
References assert(), c, ConsAndData::cons, CONSHDLR_NAME, FALSE, getLinearConsNVars(), getLinearConsSides(), getLinearConsVarsData(), NULL, ConsAndData::origcons, propagate, SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_LINEARCONSTYPE_INVALIDCONS, SCIP_LINEARCONSTYPE_KNAPSACK, SCIP_LINEARCONSTYPE_LINEAR, SCIP_LINEARCONSTYPE_LOGICOR, SCIP_LINEARCONSTYPE_SETPPC, SCIP_OKAY, SCIP_Real, SCIP_VERBLEVEL_MINIMAL, SCIPallocBufferArray, SCIPblkmem(), SCIPconsGetData(), SCIPconsGetHdlr(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPconsIsChecked(), SCIPconsIsDeleted(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsOriginal(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsPseudobooleanWithConss(), SCIPerrorMessage, SCIPfindConshdlr(), SCIPfreeBufferArray, SCIPfreeBufferArrayNull, SCIPgetConsCopy(), SCIPgetResultantAnd(), SCIPgetVarCopy(), SCIPhashmapGetImage(), SCIPhashtableCreate(), SCIPhashtableExists(), SCIPhashtableFree(), SCIPhashtableInsert(), SCIPisConsCompressionEnabled(), SCIPreleaseCons(), SCIPverbMessage(), TRUE, and valid.
Referenced by SCIP_DECL_CONSCOPY().
|
static |
compute all changes in consanddatas array
scip | SCIP data structure |
conshdlrdata | pseudoboolean constraint handler data |
Definition at line 3963 of file cons_pseudoboolean.c.
References assert(), BMScopyMemoryArray, c, ConsAndData::cons, FALSE, ConsAndData::istransformed, ConsAndData::newvars, ConsAndData::nnewvars, NULL, ConsAndData::nuses, ConsAndData::nvars, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPcaptureVar(), SCIPconsIsDeleted(), SCIPensureBlockMemoryArray, SCIPgetNVarsAnd(), SCIPgetVarsAnd(), SCIPisAndConsSorted(), SCIPsortAndCons(), SCIPvarGetIndex(), ConsAndData::snewvars, TRUE, ConsAndData::vars, and vars.
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
remove old locks
scip | SCIP data structure |
cons | pseudoboolean constraint |
consanddata | CONSANDDATA object for which we want to delete the locks and the capture of the corresponding and-constraint |
coef | coefficient which led to old locks |
lhs | left hand side which led to old locks |
rhs | right hand side which led to old locks |
Definition at line 4087 of file cons_pseudoboolean.c.
References assert(), ConsAndData::cons, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPisInfinity(), SCIPisLE(), and unlockRoundingAndCons().
Referenced by correctLocksAndCaptures(), and updateConsanddataUses().
|
static |
add new locks
scip | SCIP data structure |
cons | pseudoboolean constraint |
consanddata | CONSANDDATA object for which we want to delete the locks and the capture of the corresponding and-constraint |
coef | coefficient which lead to new locks |
lhs | left hand side which lead to new locks |
rhs | right hand side which lead to new locks |
Definition at line 4115 of file cons_pseudoboolean.c.
References assert(), ConsAndData::cons, lockRoundingAndCons(), NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPisInfinity(), and SCIPisLE().
Referenced by correctLocksAndCaptures().
|
static |
update all locks inside this constraint and all captures on all and-constraints
scip | SCIP data structure |
cons | pseudoboolean constraint |
conshdlrdata | pseudoboolean constraint handler data |
newlhs | new left hand side of pseudoboolean constraint |
newrhs | new right hand side of pseudoboolean constraint |
andress | new and-resultants in pseudoboolean constraint |
andcoefs | new and-resultants-coeffcients in pseudoboolean constraint |
andnegs | new negation status of and-resultants in pseudoboolean constraint |
nandress | number of current and-resultants in pseudoboolean constraint |
Definition at line 4143 of file cons_pseudoboolean.c.
References addNewLocks(), assert(), c, ConsAndData::cons, FALSE, getLinearConsNVars(), NULL, ConsAndData::nuses, removeOldLocks(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBlockMemoryArray, SCIPconsGetData(), SCIPconsIsDeleted(), SCIPfreeBlockMemoryArray, SCIPgetResultantAnd(), SCIPhashmapExists(), SCIPhashmapGetImage(), SCIPisEQ(), SCIPisInfinity(), SCIPisLE(), SCIPisZero(), SCIPsortPtrRealBool(), SCIPvarGetIndex(), SCIPvarGetNegatedVar(), SCIPvarGetProbindex(), SCIPvarIsNegated(), TRUE, and unlockRoundingAndCons().
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
adds cliques of the pseudoboolean constraint to the global clique table
scip | SCIP data structure |
cons | pseudoboolean constraint |
cutoff | pointer to store whether the node can be cut off |
naggrvars | pointer to count the number of aggregated variables |
nchgbds | pointer to count the number of performed bound changes |
Definition at line 4502 of file cons_pseudoboolean.c.
References assert(), c, checkConsConsistency, ConsAndData::cons, cutoff, FALSE, getLinearConsNVars(), getLinearConsVarsData(), getLinVarsAndAndRess(), ConsAndData::newvars, ConsAndData::nnewvars, NULL, ConsAndData::nvars, nvars, SCIP_Bool, SCIP_CALL, SCIP_LINEARCONSTYPE_INVALIDCONS, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_VARSTATUS_NEGATED, SCIPaddClique(), SCIPaddCons(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsActive(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsSetpack(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPfreeBufferArray, SCIPgetResultantAnd(), SCIPreleaseCons(), SCIPsnprintf(), SCIPvarGetName(), SCIPvarGetNegatedVar(), SCIPvarGetNegationVar(), SCIPvarGetStatus(), SCIPvarIsActive(), SCIPvarIsNegated(), SCIPvarsHaveCommonClique(), TRUE, ConsAndData::vars, and vars.
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
propagation method for pseudoboolean constraints
scip | SCIP data structure |
cons | knapsack constraint |
cutoff | pointer to store whether the node can be cut off |
ndelconss | pointer to count number of deleted constraints |
Definition at line 4904 of file cons_pseudoboolean.c.
References assert(), cutoff, FALSE, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsDeleted(), SCIPdelConsLocal(), and TRUE.
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
update and-constraint flags due to pseudoboolean constraint flags
scip | SCIP data structure |
cons | pseudoboolean constraint |
Definition at line 4943 of file cons_pseudoboolean.c.
References assert(), c, ConsAndData::cons, NULL, SCIP_CALL, SCIP_OKAY, SCIPconsGetData(), SCIPconsIsActive(), SCIPconsIsChecked(), and SCIPsetConsChecked().
Referenced by SCIP_DECL_CONSINITPRE(), and SCIP_DECL_CONSPRESOL().
|
static |
delete unused information in constraint handler data
scip | SCIP data structure |
conshdlrdata | pseudoboolean constraint handler data |
ndelconss | pointer to count number of deleted constraints |
Definition at line 4987 of file cons_pseudoboolean.c.
References assert(), c, ConsAndData::cons, FALSE, i, ConsAndData::istransformed, ConsAndData::newvars, ConsAndData::nnewvars, ConsAndData::noriguses, NULL, ConsAndData::nuses, ConsAndData::nvars, nvars, ConsAndData::origcons, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIP_VARSTATUS_COLUMN, SCIP_VARSTATUS_FIXED, SCIP_VARSTATUS_LOOSE, SCIPallocBufferArray, SCIPconsIsDeleted(), SCIPdelCons(), SCIPfreeBufferArray, SCIPgetFixedVars(), SCIPgetNFixedVars(), SCIPgetNVars(), SCIPgetProbvarLinearSum(), SCIPgetResultantAnd(), SCIPhashmapExists(), SCIPhashmapRemove(), SCIPhashtableExists(), SCIPhashtableRemove(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPsetConsChecked(), SCIPsetConsInitial(), SCIPvarGetStatus(), ConsAndData::snewvars, ConsAndData::svars, transformToOrig(), TRUE, ConsAndData::vars, and w.
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
update the uses counter of consandata objects which are used in pseudoboolean constraint, that were deleted and probably delete and-constraints
scip | SCIP data structure |
cons | pseudoboolean constraint |
conshdlrdata | pseudoboolean constraint handler data |
ndelconss | pointer to store number of deleted constraints |
Definition at line 5244 of file cons_pseudoboolean.c.
References assert(), c, ConsAndData::cons, FALSE, ConsAndData::istransformed, NULL, ConsAndData::nuses, ConsAndData::origcons, removeOldLocks(), SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_VARSTATUS_COLUMN, SCIP_VARSTATUS_LOOSE, SCIPconsGetData(), SCIPconsIsChecked(), SCIPconsIsDeleted(), SCIPdelCons(), SCIPgetResultantAnd(), SCIPhashmapExists(), SCIPhashmapRemove(), SCIPhashtableExists(), SCIPhashtableRemove(), SCIPreleaseCons(), SCIPsetConsChecked(), SCIPsetConsInitial(), SCIPvarGetStatus(), transformToOrig(), and TRUE.
Referenced by findAggregation(), and tryUpgrading().
|
static |
calculate result for a given pseudoboolean constraint with given values, this is used to decide whether a pseudoboolean constraint can be upgrade to an XOR constraint
scip | SCIP data structure |
vars | all variables which occur |
nvars | number of all variables which appear in the pseudoboolean constraint |
values | values of all variables which appear in the pseudoboolean constraint |
linvars | linear variables |
lincoefs | linear coefficients |
nlinvars | number of linear variables |
constant | offset to the linear part |
side | side of pseudoboolean constraint |
consanddatas | all consanddata objects in a constraint |
consanddatacoefs | nonlinear coefficients |
consanddatanegs | negation status of and resultants in pseudo-boolean constraint |
nconsanddatas | number of all consanddata objects |
cnt | number of variables set to 1 |
xortype | pointer to save the possible xor type if a solution was valid and does not violate the old xortype |
Definition at line 5370 of file cons_pseudoboolean.c.
References assert(), BMSclearMemoryArray, c, FALSE, ConsAndData::istransformed, MAXNVARS, ConsAndData::newvars, ConsAndData::nnewvars, NULL, ConsAndData::nvars, nvars, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPABORT, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPgetBinvarRepresentatives(), SCIPisEQ(), SCIPisZero(), SCIPsortedvecFindPtr(), SCIPsortPtr(), SCIPsortPtrBool(), SCIPvarGetNegatedVar(), SCIPvarGetNegationVar(), SCIPvarIsNegated(), TRUE, var, ConsAndData::vars, and vars.
Referenced by tryUpgradingXor().
|
static |
try upgrading pseudoboolean linear constraint to an XOR constraint and/or remove possible and-constraints
scip | SCIP data structure |
cons | pseudoboolean constraint |
conshdlrdata | pseudoboolean constraint handler data |
ndelconss | pointer to store number of deleted constraints |
naddconss | pointer to count number of added constraints |
nfixedvars | pointer to store number of fixed variables |
nchgcoefs | pointer to store number of changed coefficients constraints |
nchgsides | pointer to store number of changed sides constraints |
cutoff | pointer to store if a cutoff happened |
Definition at line 5544 of file cons_pseudoboolean.c.
References assert(), BMSclearMemoryArray, c, checkConsConsistency, checkSolution(), cutoff, FALSE, getLinearConsNVars(), getLinearConsVarsData(), getLinVarsAndAndRess(), ConsAndData::istransformed, MAXNVARS, ConsAndData::newvars, ConsAndData::nnewvars, NULL, ConsAndData::nvars, nvars, SCIP_Bool, SCIP_CALL, SCIP_LINEARCONSTYPE_LINEAR, SCIP_LINEARCONSTYPE_SETPPC, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPaddCons(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsXor(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), SCIPduplicateBufferArray, SCIPfreeBufferArray, SCIPgetBinvarRepresentatives(), SCIPgetProbvarLinearSum(), SCIPisEQ(), SCIPisZero(), SCIPreleaseCons(), SCIPsnprintf(), SCIPsortPtr(), SCIPvarGetIndex(), SCIPvarGetLbGlobal(), SCIPvarGetNegationVar(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), SCIPvarIsNegated(), TRUE, var, ConsAndData::vars, and vars.
Referenced by tryUpgrading().
|
static |
try upgrading pseudoboolean logicor constraint to a linear constraint and/or remove possible and-constraints
scip | SCIP data structure |
cons | pseudoboolean constraint |
conshdlrdata | pseudoboolean constraint handler data |
ndelconss | pointer to store number of deleted constraints |
naddconss | pointer to count number of added constraints |
nfixedvars | pointer to store number of fixed variables |
nchgcoefs | pointer to store number of changed coefficients constraints |
nchgsides | pointer to store number of changed sides constraints |
cutoff | pointer to store if a cutoff happened |
Definition at line 5835 of file cons_pseudoboolean.c.
References assert(), c, cutoff, getLinearConsNVars(), getLinearConsVarsData(), getLinVarsAndAndRess(), ConsAndData::istransformed, ConsAndData::newvars, ConsAndData::nnewvars, NULL, ConsAndData::nvars, nvars, SCIP_Bool, SCIP_CALL, SCIP_LINEARCONSTYPE_LOGICOR, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPaddCoefLinear(), SCIPaddCons(), SCIPallocBufferArray, SCIPchgLhsLinear(), SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsLinear(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), SCIPduplicateBufferArray, SCIPfixVar(), SCIPfreeBufferArray, SCIPinfinity(), SCIPisEQ(), SCIPreleaseCons(), SCIPsnprintf(), SCIPvarGetIndex(), TRUE, ConsAndData::vars, and vars.
Referenced by tryUpgrading().
|
static |
try upgrading pseudoboolean setppc constraint to a linear constraint and/or remove possible and-constraints
scip | SCIP data structure |
cons | pseudoboolean constraint |
conshdlrdata | pseudoboolean constraint handler data |
ndelconss | pointer to store number of deleted constraints |
naddconss | pointer to count number of added constraints |
nfixedvars | pointer to store number of fixed variables |
nchgcoefs | pointer to store number of changed coefficients constraints |
nchgsides | pointer to store number of changed sides constraints |
cutoff | pointer to store if a cutoff happened |
Definition at line 6347 of file cons_pseudoboolean.c.
References assert(), c, ConsAndData::cons, cutoff, ConsAndData::newvars, ConsAndData::nnewvars, NULL, ConsAndData::nvars, nvars, SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_LINEARCONSTYPE_SETPPC, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_SETPPCTYPE_COVERING, SCIP_SETPPCTYPE_PACKING, SCIP_SETPPCTYPE_PARTITIONING, SCIPaddCoefLinear(), SCIPaddCons(), SCIPchgRhsLinear(), SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsLinear(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), SCIPduplicateBufferArray, SCIPerrorMessage, SCIPfixVar(), SCIPfreeBufferArray, SCIPgetResultantAnd(), SCIPgetTypeSetppc(), SCIPinfinity(), SCIPisLE(), SCIPreleaseCons(), SCIPsnprintf(), SCIPvarGetIndex(), TRUE, ConsAndData::vars, and vars.
Referenced by tryUpgrading().
|
static |
try upgrading pseudoboolean constraint to a linear constraint and/or remove possible and-constraints
scip | SCIP data structure |
cons | pseudoboolean constraint |
conshdlrdata | pseudoboolean constraint handler data |
ndelconss | pointer to store number of upgraded constraints |
naddconss | pointer to count number of added constraints |
nfixedvars | pointer to store number of fixed variables |
nchgcoefs | pointer to store number of changed coefficients constraints |
nchgsides | pointer to store number of changed sides constraints |
cutoff | pointer to store if a cutoff happened |
Definition at line 6823 of file cons_pseudoboolean.c.
References assert(), cutoff, getLinearConsNVars(), NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_LINEARCONSTYPE_INVALIDCONS, SCIP_LINEARCONSTYPE_KNAPSACK, SCIP_LINEARCONSTYPE_LINEAR, SCIP_LINEARCONSTYPE_LOGICOR, SCIP_LINEARCONSTYPE_SETPPC, SCIP_OKAY, SCIPconsAddUpgradeLocks(), SCIPconsGetData(), SCIPconsGetNUpgradeLocks(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPdelCons(), SCIPerrorMessage, TRUE, tryUpgradingLogicor(), tryUpgradingSetppc(), tryUpgradingXor(), and updateConsanddataUses().
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
check if we can aggregated some variables
scip | SCIP data structure |
cons | pseudoboolean constraint |
conshdlrdata | pseudoboolean constraint handler data |
ndelconss | pointer to store number of upgraded constraints |
naggrvars | pointer to store number of aggregated variables |
cutoff | pointer to store if a cutoff happened |
Definition at line 6921 of file cons_pseudoboolean.c.
References assert(), BMSclearMemoryArray, c, cutoff, FALSE, getLinearConsNVars(), getLinearConsVarsData(), getLinVarsAndAndRess(), i, ConsAndData::newvars, ConsAndData::nnewvars, NULL, ConsAndData::nvars, nvars, SCIP_Bool, SCIP_CALL, SCIP_LINEARCONSTYPE_SETPPC, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIP_SETPPCTYPE_PARTITIONING, SCIPaddCons(), SCIPaggregateVars(), SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsModifiable(), SCIPcreateConsAnd(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), SCIPfreeBufferArray, SCIPgetBinvarRepresentatives(), SCIPgetTypeSetppc(), SCIPisEQ(), SCIPreleaseCons(), SCIPsnprintf(), SCIPsortedvecFindPtr(), SCIPsortPtrBool(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetNegatedVar(), SCIPvarGetNegationVar(), SCIPvarGetUbGlobal(), SCIPvarIsActive(), SCIPvarIsNegated(), TRUE, updateConsanddataUses(), var, ConsAndData::vars, and vars.
Referenced by SCIP_DECL_CONSPRESOL().
|
static |
adds symmetry information of constraint to a symmetry detection graph
scip | SCIP pointer |
symtype | type of symmetries that need to be added |
cons | constraint |
graph | symmetry detection graph |
success | pointer to store whether symmetry information could be added |
Definition at line 7359 of file cons_pseudoboolean.c.
References assert(), c, FALSE, i, NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_LINEARCONSTYPE_KNAPSACK, SCIP_LINEARCONSTYPE_LINEAR, SCIP_LINEARCONSTYPE_LOGICOR, SCIP_LINEARCONSTYPE_SETPPC, SCIP_OKAY, SCIP_Real, SCIPaddSymgraphConsnode(), SCIPaddSymgraphEdge(), SCIPaddSymgraphOpnode(), SCIPaddSymgraphVarAggregation(), SCIPallocBufferArray, SCIPconsGetData(), SCIPfreeBufferArray, SCIPgetIndVarPseudoboolean(), SCIPgetLhsPseudoboolean(), SCIPgetLinearConsPseudoboolean(), SCIPgetLinearConsTypePseudoboolean(), SCIPgetNVars(), SCIPgetNVarsKnapsack(), SCIPgetNVarsLinear(), SCIPgetNVarsLogicor(), SCIPgetNVarsSetppc(), SCIPgetRhsPseudoboolean(), SCIPgetSymActiveVariables(), SCIPgetValsLinear(), SCIPgetVarsKnapsack(), SCIPgetVarsLinear(), SCIPgetVarsLogicor(), SCIPgetVarsSetppc(), SCIPgetWeightsKnapsack(), SCIPisTransformed(), SYM_CONSOPTYPE_PB_AND, SYM_CONSOPTYPE_PB_LINEAR, SYM_CONSOPTYPE_PB_OBJ, SYM_CONSOPTYPE_PB_SOFT, TRUE, and vars.
Referenced by SCIP_DECL_CONSGETPERMSYMGRAPH(), and SCIP_DECL_CONSGETSIGNEDPERMSYMGRAPH().
|
static |
copy method for constraint handler plugins (called when SCIP copies plugins)
Definition at line 7715 of file cons_pseudoboolean.c.
References assert(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetName(), SCIPincludeConshdlrPseudoboolean(), TRUE, and valid.
|
static |
destructor of constraint handler to free constraint handler data (called when SCIP is exiting)
Definition at line 7731 of file cons_pseudoboolean.c.
References assert(), CONSHDLR_NAME, conshdlrdataFree(), NULL, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetName(), and SCIPconshdlrSetData().
|
static |
initialization method of constraint handler (called after problem was transformed)
Definition at line 7753 of file cons_pseudoboolean.c.
References assert(), c, CONSHDLR_NAME, NULL, nvars, SCIP_CALL, SCIP_OKAY, SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPconsIsTransformed(), SCIPdebugMsg, SCIPgetResultantAnd(), SCIPhashmapExists(), SCIPhashmapInsert(), SCIPvarGetIndex(), SCIPvarGetName(), SCIPvarIsTransformed(), and vars.
|
static |
presolving initialization method of constraint handler (called when presolving is about to begin)
Definition at line 7811 of file cons_pseudoboolean.c.
References assert(), c, CONSHDLR_NAME, FALSE, getLinearConsNVars(), getLinearConsSides(), getLinearConsVarsData(), NULL, nvars, SCIP_Bool, SCIP_CALL, SCIP_MAXSTRLEN, SCIP_OKAY, SCIP_Real, SCIPaddCoefLinear(), SCIPaddCons(), SCIPallocBufferArray, SCIPconsAddUpgradeLocks(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPconsIsAdded(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsIndicator(), SCIPcreateConsLinear(), SCIPdebugPrintCons, SCIPdelCons(), SCIPfreeBufferArray, SCIPgetNegatedVar(), SCIPinfinity(), SCIPisInfinity(), SCIPisLE(), SCIPreleaseCons(), SCIPsnprintf(), SCIPwarningMessage(), TRUE, updateAndConss(), and vars.
|
static |
frees specific constraint data
Definition at line 8098 of file cons_pseudoboolean.c.
References assert(), c, consdataFree(), CONSHDLR_NAME, NULL, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPconshdlrGetData(), SCIPconshdlrGetName(), and SCIPconsIsOriginal().
|
static |
transforms constraint data into data belonging to the transformed problem
Definition at line 8141 of file cons_pseudoboolean.c.
References assert(), c, consdataCreate(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, SCIP_STAGE_TRANSFORMING, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsOriginal(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateCons(), SCIPfreeBufferArray, SCIPgetStage(), and TRUE.
|
static |
constraint enforcing method of constraint handler for LP solutions
Definition at line 8193 of file cons_pseudoboolean.c.
References assert(), checkAndConss(), CONSHDLR_NAME, FALSE, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, and SCIPconshdlrGetName().
|
static |
constraint enforcing method of constraint handler for relaxation solutions
Definition at line 8218 of file cons_pseudoboolean.c.
References assert(), checkAndConss(), CONSHDLR_NAME, FALSE, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIPconshdlrGetName(), and sol.
|
static |
constraint enforcing method of constraint handler for pseudo solutions
Definition at line 8243 of file cons_pseudoboolean.c.
References assert(), checkAndConss(), CONSHDLR_NAME, FALSE, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, and SCIPconshdlrGetName().
|
static |
feasibility check method of constraint handler for integral solutions
Definition at line 8268 of file cons_pseudoboolean.c.
References assert(), c, checkAndConss(), checkOrigPbCons(), CONSHDLR_NAME, NULL, result, SCIP_Bool, SCIP_CALL, SCIP_FEASIBLE, SCIP_INFEASIBLE, SCIP_OKAY, SCIPconsGetData(), SCIPconshdlrGetName(), SCIPconsIsOriginal(), SCIPgetSolVal(), SCIPisEQ(), and sol.
|
static |
presolving method of constraint handler
Definition at line 8320 of file cons_pseudoboolean.c.
References addCliques(), assert(), c, computeConsAndDataChanges(), CONSHDLR_NAME, correctConshdlrdata(), correctLocksAndCaptures(), cutoff, FALSE, findAggregation(), getLinearConsNVars(), getLinearConsSides(), getLinearConsVarsData(), getLinVarsAndAndRess(), NULL, nvars, propagateCons(), result, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_OKAY, SCIP_Real, SCIP_SUCCESS, SCIPallocBufferArray, SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetData(), SCIPconshdlrGetName(), SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsModifiable(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), SCIPfreeBufferArray, SCIPisInfinity(), SCIPisLE(), SCIPisStopped(), TRUE, tryUpgrading(), updateAndConss(), and vars.
|
static |
variable rounding lock method of constraint handler
Definition at line 8513 of file cons_pseudoboolean.c.
References assert(), c, checkLocksAndRes(), ConsAndData::cons, CONSHDLR_NAME, FALSE, ConsAndData::istransformed, ConsAndData::newvars, ConsAndData::nnewvars, NULL, ConsAndData::nvars, SCIP_Bool, SCIP_CALL, SCIP_LOCKTYPE_MODEL, SCIP_OKAY, SCIP_Real, SCIPaddVarLocksType(), SCIPconsGetData(), SCIPconsGetName(), SCIPconshdlrGetName(), SCIPdebugMsg, SCIPfreeBlockMemoryArrayNull, SCIPgetResultantAnd(), SCIPisInfinity(), SCIPisLE(), SCIPisPositive(), ConsAndData::snewvars, ConsAndData::svars, and ConsAndData::vars.
|
static |
constraint display method of constraint handler
Definition at line 8661 of file cons_pseudoboolean.c.
References assert(), consdataPrint(), CONSHDLR_NAME, NULL, SCIP_CALL, SCIP_OKAY, and SCIPconshdlrGetName().
|
static |
constraint copying method of constraint handler
Definition at line 8675 of file cons_pseudoboolean.c.
References assert(), copyConsPseudoboolean(), FALSE, NULL, propagate, SCIP_CALL, SCIP_OKAY, SCIPconsGetName(), and valid.
|
static |
constraint parsing method of constraint handler
Definition at line 8701 of file cons_pseudoboolean.c.
References assert(), FALSE, i, MAX, nterms, NULL, propagate, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_READERROR, SCIP_Real, SCIPallocBufferArray, SCIPcreateConsPseudoboolean(), SCIPerrorMessage, SCIPfreeBufferArray, SCIPfreeParseVarsPolynomialData(), SCIPinfinity(), SCIPisInfinity(), SCIPisZero(), SCIPparseReal(), SCIPparseVarName(), SCIPparseVarsPolynomial(), SCIPskipSpace(), SCIPstrncpy(), SCIPvarGetName(), SCIPvarGetNegatedVar(), SCIPvarGetObj(), and TRUE.
|
static |
constraint method of constraint handler which returns the variables (if possible)
Definition at line 9051 of file cons_pseudoboolean.c.
References assert(), BMScopyMemoryArray, ConsAndData::cons, FALSE, getLinearConsNVars(), getLinearConsVarsData(), getLinVarsAndAndRess(), ConsAndData::istransformed, NULL, nvars, ConsAndData::origcons, r, SCIP_Bool, SCIP_CALL, SCIP_INVALIDDATA, SCIP_OKAY, SCIPallocBufferArray, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPconsIsDeleted(), SCIPconsIsTransformed(), SCIPfreeBufferArray, SCIPgetNVarsAnd(), SCIPgetVarsAnd(), SCIPhashmapGetImage(), TRUE, and vars.
|
static |
constraint method of constraint handler which returns the number of variables (if possible)
Definition at line 9217 of file cons_pseudoboolean.c.
References assert(), ConsAndData::cons, getLinearConsNVars(), getLinearConsVarsData(), getLinVarsAndAndRess(), ConsAndData::istransformed, NULL, nvars, ConsAndData::origcons, r, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIPallocBufferArray, SCIPconsGetData(), SCIPconshdlrGetData(), SCIPconsIsDeleted(), SCIPconsIsTransformed(), SCIPfreeBufferArray, SCIPgetNVarsAnd(), SCIPhashmapGetImage(), and TRUE.
|
static |
constraint handler method which returns the permutation symmetry detection graph of a constraint
Definition at line 9339 of file cons_pseudoboolean.c.
References addSymmetryInformation(), SCIP_CALL, SCIP_OKAY, and SYM_SYMTYPE_PERM.
|
static |
constraint handler method which returns the signed permutation symmetry detection graph of a constraint
Definition at line 9348 of file cons_pseudoboolean.c.
References addSymmetryInformation(), SCIP_CALL, SCIP_OKAY, and SYM_SYMTYPE_SIGNPERM.