gateextraction presolver
Definition in file presol_gateextraction.c.
#include <assert.h>#include <string.h>#include "scip/presol_gateextraction.h"#include "scip/cons_setppc.h"#include "scip/cons_logicor.h"#include "scip/cons_and.h"Go to the source code of this file.
Macros | |
| #define | PRESOL_NAME "gateextraction" |
| #define | PRESOL_DESC "presolver extracting gate(and)-constraints" |
| #define | PRESOL_PRIORITY 1000000 |
| #define | PRESOL_MAXROUNDS -1 |
| #define | PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE /* timing of the presolver (fast, medium, or exhaustive) */ |
| #define | HASHSIZE_LOGICORCONS 500 |
| #define | HASHSIZE_SETPPCCONS 500 |
| #define | DEFAULT_ONLYSETPART FALSE |
| #define | DEFAULT_SEARCHEQUATIONS TRUE |
| #define | DEFAULT_SORTING 1 |
Typedefs | |
| typedef struct HashData | HASHDATA |
Functions | |
| static | SCIP_DECL_HASHKEYEQ (hashdataKeyEqCons) |
| static | SCIP_DECL_HASHKEYVAL (hashdataKeyValCons) |
| static | SCIP_DECL_HASHKEYEQ (setppcHashdataKeyEqCons) |
| static | SCIP_DECL_HASHKEYVAL (setppcHashdataKeyValCons) |
| static void | presoldataInit (SCIP_PRESOLDATA *presoldata) |
| static SCIP_RETCODE | presoldataInitHashtables (SCIP *scip, SCIP_PRESOLDATA *presoldata) |
| static SCIP_RETCODE | createPresoldata (SCIP *scip, SCIP_PRESOLDATA *presoldata, SCIP_CONS **setppcs, int nsetppcs, SCIP_CONS **logicors, int nlogicors) |
| static SCIP_RETCODE | cleanupHashDatas (SCIP *scip, SCIP_PRESOLDATA *presoldata) |
| static SCIP_RETCODE | correctPresoldata (SCIP *scip, SCIP_PRESOLDATA *presoldata, SCIP_CONS **setppcs, int nsetppcs, SCIP_CONS **logicors, int nlogicors) |
| static SCIP_RETCODE | extractGates (SCIP *scip, SCIP_PRESOLDATA *presoldata, int pos, SCIP_HASHMAP *varmap, SCIP_CONS **gateconss, SCIP_VAR **activevars, SCIP_VAR **posresultants, HASHDATA *hashdata, int *ndelconss, int *naddconss) |
| static | SCIP_DECL_PRESOLCOPY (presolCopyGateextraction) |
| static | SCIP_DECL_PRESOLFREE (presolFreeGateextraction) |
| static | SCIP_DECL_PRESOLEXIT (presolExitGateextraction) |
| static | SCIP_DECL_PRESOLINITPRE (presolInitpreGateextraction) |
| static | SCIP_DECL_PRESOLEXITPRE (presolExitpreGateextraction) |
| static | SCIP_DECL_PRESOLEXEC (presolExecGateextraction) |
| SCIP_RETCODE | SCIPincludePresolGateextraction (SCIP *scip) |
| #define PRESOL_NAME "gateextraction" |
Definition at line 32 of file presol_gateextraction.c.
| #define PRESOL_DESC "presolver extracting gate(and)-constraints" |
Definition at line 33 of file presol_gateextraction.c.
| #define PRESOL_PRIORITY 1000000 |
priority of the presolver (>= 0: before, < 0: after constraint handlers); combined with propagators
Definition at line 34 of file presol_gateextraction.c.
| #define PRESOL_MAXROUNDS -1 |
maximal number of presolving rounds the presolver participates in (-1: no limit)
Definition at line 35 of file presol_gateextraction.c.
| #define PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE /* timing of the presolver (fast, medium, or exhaustive) */ |
Definition at line 36 of file presol_gateextraction.c.
| #define HASHSIZE_LOGICORCONS 500 |
minimal size of hash table in logicor constraint tables
Definition at line 38 of file presol_gateextraction.c.
Referenced by presoldataInitHashtables().
| #define HASHSIZE_SETPPCCONS 500 |
minimal size of hash table in setppc constraint tables
Definition at line 39 of file presol_gateextraction.c.
Referenced by presoldataInitHashtables().
| #define DEFAULT_ONLYSETPART FALSE |
should only set-partitioning constraints be extracted and no and-constraints
Definition at line 41 of file presol_gateextraction.c.
| #define DEFAULT_SEARCHEQUATIONS TRUE |
should we try to extract set-partitioning constraint out of one logicor and one corresponding set-packing constraint
Definition at line 42 of file presol_gateextraction.c.
| #define DEFAULT_SORTING 1 |
order logicor contraints to extract big-gates before smaller ones (-1), do not order them (0) or order them to extract smaller gates at first (1)
Definition at line 47 of file presol_gateextraction.c.
Definition at line 93 of file presol_gateextraction.c.
|
static |
returns TRUE iff both keys are equal; two constraints are equal if they have the same pointer
Definition at line 134 of file presol_gateextraction.c.
|
static |
returns the hash value of the key
Definition at line 178 of file presol_gateextraction.c.
|
static |
returns TRUE iff both keys are equal; two constraints are equal if they have the same pointer
Definition at line 197 of file presol_gateextraction.c.
|
static |
returns the hash value of the key
Definition at line 242 of file presol_gateextraction.c.
|
static |
initialize gateextraction presolver data
| presoldata | data object of presolver |
Definition at line 258 of file presol_gateextraction.c.
|
static |
initialize gateextraction hashtables
| scip | SCIP data structure |
| presoldata | data object of presolver |
Definition at line 284 of file presol_gateextraction.c.
References createPresoldata(), FALSE, HASHSIZE_LOGICORCONS, HASHSIZE_SETPPCCONS, SCIP_CALL, SCIP_OKAY, SCIPblkmem(), and SCIPhashtableCreate().
|
static |
create useful set-packing information by adding new set-packing constraints with two variables
| scip | SCIP data structure |
| presoldata | data object of presolver |
| setppcs | active setppc constraints |
| nsetppcs | number of active setppc constraints |
| logicors | active logicor constraints |
| nlogicors | number of active logicor constraints |
Definition at line 321 of file presol_gateextraction.c.
References cleanupHashDatas(), MAX, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_SETPPCTYPE_PACKING, SCIP_VARSTATUS_FIXED, SCIP_VARSTATUS_MULTAGGR, SCIPallocBlockMemoryArray, SCIPallocBufferArray, SCIPcaptureCons(), SCIPcaptureVar(), SCIPconsIsActive(), SCIPconsIsModifiable(), SCIPduplicateBlockMemoryArray, SCIPfreeBlockMemoryArray, SCIPfreeBufferArray, SCIPgetBinvarRepresentative(), SCIPgetNVarsLogicor(), SCIPgetNVarsSetppc(), SCIPgetTypeSetppc(), SCIPgetVarsSetppc(), SCIPhashtableInsert(), SCIPvarGetIndex(), SCIPvarGetStatus(), and TRUE.
Referenced by correctPresoldata(), and presoldataInitHashtables().
|
static |
remove old setppchashdatas objects, so that the allocated memory will stay low
| scip | SCIP data structure |
| presoldata | data object of presolver |
Definition at line 470 of file presol_gateextraction.c.
References correctPresoldata(), FALSE, SCIP_Bool, SCIP_CALL, SCIP_OKAY, SCIP_SETPPCTYPE_PACKING, SCIP_VARSTATUS_FIXED, SCIP_VARSTATUS_MULTAGGR, SCIPconsIsActive(), SCIPconsIsDeleted(), SCIPconsIsModifiable(), SCIPfreeBlockMemoryArray, SCIPgetBinvarRepresentative(), SCIPgetNVarsSetppc(), SCIPgetTypeSetppc(), SCIPhashtableExists(), SCIPhashtableInsert(), SCIPhashtableRemove(), SCIPreleaseCons(), SCIPreleaseVar(), SCIPvarGetStatus(), TRUE, and HashData::vars.
Referenced by correctPresoldata(), and createPresoldata().
|
static |
refresh useful set-packing information, delete redundant constraints and add new constraints
| scip | SCIP data structure |
| presoldata | data object of presolver |
| setppcs | active setppc constraints |
| nsetppcs | number of active setppc constraints |
| logicors | active setppc constraints |
| nlogicors | number of active setppc constraints |
Definition at line 570 of file presol_gateextraction.c.
References cleanupHashDatas(), createPresoldata(), extractGates(), SCIP_Bool, SCIP_CALL, SCIP_NOMEMORY, SCIP_OKAY, SCIP_SETPPCTYPE_PACKING, SCIP_VARSTATUS_FIXED, SCIP_VARSTATUS_MULTAGGR, SCIPcalcMemGrowSize(), SCIPcaptureCons(), SCIPcaptureVar(), SCIPconsIsActive(), SCIPconsIsModifiable(), SCIPduplicateBlockMemoryArray, SCIPfreeBlockMemoryArray, SCIPgetBinvarRepresentative(), SCIPgetNVarsLogicor(), SCIPgetNVarsSetppc(), SCIPgetTypeSetppc(), SCIPgetVarsSetppc(), SCIPhashtableExists(), SCIPhashtableInsert(), SCIPhashtableRemove(), SCIPhashtableRemoveAll(), SCIPreallocBlockMemoryArray, SCIPreleaseCons(), SCIPvarGetIndex(), SCIPvarGetStatus(), and TRUE.
Referenced by cleanupHashDatas().
|
static |
extract and-constraints and set-partitioning constraints
| scip | SCIP data structure |
| presoldata | data object of presolver |
| pos | position of logicor in usefullogicor array to presolve |
| varmap | variable map mapping inactive variables to their active representation |
| gateconss | allocated memory for all gate-constraints |
| activevars | allocated memory for active variables |
| posresultants | allocated memory for all possible resultant variables |
| hashdata | allocated memory for a hashdata object |
| ndelconss | pointer to store number of deleted constraints |
| naddconss | pointer to store number of added constraints |
Definition at line 784 of file presol_gateextraction.c.
References HashData::cons, HashData::nvars, SCIP_Bool, SCIP_CALL, SCIP_DECL_PRESOLCOPY(), SCIP_MAXSTRLEN, SCIP_OKAY, SCIPaddCons(), SCIPallocBufferArray, SCIPconsIsActive(), SCIPconsIsChecked(), SCIPconsIsDynamic(), SCIPconsIsEnforced(), SCIPconsIsInitial(), SCIPconsIsLocal(), SCIPconsIsModifiable(), SCIPconsIsPropagated(), SCIPconsIsRemovable(), SCIPconsIsSeparated(), SCIPconsIsStickingAtNode(), SCIPcreateConsAnd(), SCIPcreateConsSetpart(), SCIPdebugMsg, SCIPdebugPrintCons, SCIPdelCons(), SCIPfreeBufferArray, SCIPgetBinvarRepresentative(), SCIPgetNegatedVar(), SCIPgetNVarsLogicor(), SCIPgetVarsLogicor(), SCIPhashmapGetImage(), SCIPhashmapInsert(), SCIPhashtableRemove(), SCIPhashtableRetrieve(), SCIPreleaseCons(), SCIPsnprintf(), SCIPsortPtr(), SCIPvarCompare(), SCIPvarGetIndex(), SCIPvarGetLbLocal(), SCIPvarGetNegatedVar(), SCIPvarGetNLocksDown(), SCIPvarGetNLocksUp(), SCIPvarGetUbLocal(), SCIPvarIsActive(), SCIPvarIsNegated(), and HashData::vars.
Referenced by correctPresoldata().
|
static |
copy method for constraint handler plugins (called when SCIP copies plugins)
Definition at line 1117 of file presol_gateextraction.c.
Referenced by extractGates().
|
static |
destructor of presolver to free user data (called when SCIP is exiting)
Definition at line 1132 of file presol_gateextraction.c.
|
static |
deinitialization method of presolver (called before transformed problem is freed)
Definition at line 1159 of file presol_gateextraction.c.
|
static |
presolving initialization method of presolver (called when presolving is about to begin)
Definition at line 1237 of file presol_gateextraction.c.
References SCIP_OKAY.
|
static |
presolving deinitialization method of presolver (called after presolving has been finished)
Definition at line 1245 of file presol_gateextraction.c.
|
static |
execution method of presolver
Definition at line 1253 of file presol_gateextraction.c.