dual compensation presolver
This presolver looks for variables with i) objcoef >= 0 and exactly one downlock ii) objcoef <= 0 and exactly one uplock and fixes the variable in case i) at the lower bound and in case ii) at the upper bound if a combination of singleton continuous variables can compensate the downlock in case i) and the uplock in case ii).
Definition in file presol_dualcomp.c.
#include <stdio.h>
#include <assert.h>
#include <string.h>
#include "scip/pub_matrix.h"
#include "presol_dualcomp.h"
Go to the source code of this file.
Macros | |
#define | PRESOL_NAME "dualcomp" |
#define | PRESOL_DESC "compensate single up-/downlocks by singleton continuous variables" |
#define | PRESOL_PRIORITY -50 |
#define | PRESOL_MAXROUNDS -1 |
#define | PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE /* timing of the presolver (fast, medium, or exhaustive) */ |
#define | DEFAULT_COMP_ONLY_DIS_VARS FALSE |
Typedefs | |
typedef enum Fixingdirection | FIXINGDIRECTION |
typedef enum Lockcompensation | LOCKCOMPENSATION |
Enumerations | |
enum | Fixingdirection { FIXATLB = -1, NOFIX = 0, FIXATUB = 1, FIXATLB = -1, NOFIX = 0, FIXATUB = 1, FIXATLB = -1, NOFIX = 0, FIXATLB = -1, NOFIX = 0, FIXATUB = 1 } |
enum | Lockcompensation { COMPENSATE_DOWNLOCK = 0, COMPENSATE_UPLOCK = 1 } |
Functions | |
static SCIP_RETCODE | compensateVarLock (SCIP *scip, SCIP_MATRIX *matrix, int col, int row, SCIP_Real val, SCIP_Bool twosides, LOCKCOMPENSATION compensation, FIXINGDIRECTION *varstofix, int *nfixings) |
static | SCIP_DECL_PRESOLCOPY (presolCopyDualcomp) |
static | SCIP_DECL_PRESOLEXEC (presolExecDualcomp) |
static | SCIP_DECL_PRESOLFREE (presolFreeDualcomp) |
SCIP_RETCODE | SCIPincludePresolDualcomp (SCIP *scip) |
#define PRESOL_NAME "dualcomp" |
Definition at line 37 of file presol_dualcomp.c.
Referenced by SCIP_DECL_PRESOLCOPY(), and SCIPincludePresolDualcomp().
#define PRESOL_DESC "compensate single up-/downlocks by singleton continuous variables" |
Definition at line 38 of file presol_dualcomp.c.
Referenced by SCIPincludePresolDualcomp().
#define PRESOL_PRIORITY -50 |
priority of the presolver (>= 0: before, < 0: after constraint handlers)
Definition at line 44 of file presol_dualcomp.c.
Referenced by SCIPincludePresolDualcomp().
#define PRESOL_MAXROUNDS -1 |
maximal number of presolving rounds the presolver participates in (-1: no limit)
Definition at line 45 of file presol_dualcomp.c.
Referenced by SCIPincludePresolDualcomp().
#define PRESOL_TIMING SCIP_PRESOLTIMING_EXHAUSTIVE /* timing of the presolver (fast, medium, or exhaustive) */ |
Definition at line 46 of file presol_dualcomp.c.
Referenced by SCIPincludePresolDualcomp().
#define DEFAULT_COMP_ONLY_DIS_VARS FALSE |
should only discrete variables be compensated?
Definition at line 48 of file presol_dualcomp.c.
Referenced by SCIPincludePresolDualcomp().
typedef enum Fixingdirection FIXINGDIRECTION |
Definition at line 67 of file presol_dualcomp.c.
typedef enum Lockcompensation LOCKCOMPENSATION |
Definition at line 75 of file presol_dualcomp.c.
enum Fixingdirection |
type of fixing direction
Definition at line 61 of file presol_dualcomp.c.
enum Lockcompensation |
type of variable lock compensation
Enumerator | |
---|---|
COMPENSATE_DOWNLOCK | |
COMPENSATE_UPLOCK |
Definition at line 70 of file presol_dualcomp.c.
|
static |
try to compensate a variable with a single opposite lock by using singleton continuous variables
scip | SCIP main data structure |
matrix | matrix containing the constraints |
col | variable fixing candidate |
row | row index with opposite lock |
val | value of fixing candidate in the opposite lock constraint |
twosides | flag indicating that two sides are present |
compensation | type of lock compensation |
varstofix | array holding fixing information |
nfixings | number of possible fixings |
Definition at line 84 of file presol_dualcomp.c.
References COMPENSATE_DOWNLOCK, COMPENSATE_UPLOCK, FALSE, FIXATLB, FIXATUB, NOFIX, SCIP_Bool, SCIP_OKAY, SCIP_Real, SCIP_VARTYPE_CONTINUOUS, SCIPdebugMsg, SCIPisGT(), SCIPisInfinity(), SCIPisLE(), SCIPisLT(), SCIPmatrixGetColNDownlocks(), SCIPmatrixGetColNNonzs(), SCIPmatrixGetColNUplocks(), SCIPmatrixGetNColumns(), SCIPmatrixGetNRows(), SCIPmatrixGetRowIdxPtr(), SCIPmatrixGetRowLhs(), SCIPmatrixGetRowNNonzs(), SCIPmatrixGetRowRhs(), SCIPmatrixGetRowValPtr(), SCIPmatrixGetVar(), SCIPmatrixPrintRow(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetNLocksDown(), SCIPvarGetNLocksUp(), SCIPvarGetObj(), SCIPvarGetType(), SCIPvarGetUbGlobal(), and TRUE.
Referenced by SCIP_DECL_PRESOLEXEC().
|
static |
copy method for constraint handler plugins (called when SCIP copies plugins)
Definition at line 493 of file presol_dualcomp.c.
References PRESOL_NAME, SCIP_CALL, SCIP_OKAY, SCIPincludePresolDualcomp(), and SCIPpresolGetName().
|
static |
execution method of presolver
Definition at line 507 of file presol_dualcomp.c.
References BMSclearMemoryArray, COMPENSATE_DOWNLOCK, COMPENSATE_UPLOCK, compensateVarLock(), FALSE, FIXATLB, FIXATUB, SCIP_Bool, SCIP_CALL, SCIP_CUTOFF, SCIP_DIDNOTFIND, SCIP_DIDNOTRUN, SCIP_OKAY, SCIP_Real, SCIP_STAGE_PRESOLVING, SCIP_SUCCESS, SCIP_VARTYPE_CONTINUOUS, SCIPallocBufferArray, SCIPallowDualReds(), SCIPdebugMsg, SCIPfixVar(), SCIPfreeBufferArray, SCIPgetNActivePricers(), SCIPgetNContVars(), SCIPgetStage(), SCIPinProbing(), SCIPisEQ(), SCIPisGE(), SCIPisGT(), SCIPisInfinity(), SCIPisLE(), SCIPisLT(), SCIPisNLPEnabled(), SCIPisStopped(), SCIPisZero(), SCIPmatrixCreate(), SCIPmatrixFree(), SCIPmatrixGetColIdxPtr(), SCIPmatrixGetColNDownlocks(), SCIPmatrixGetColNNonzs(), SCIPmatrixGetColNUplocks(), SCIPmatrixGetColValPtr(), SCIPmatrixGetNColumns(), SCIPmatrixGetRowLhs(), SCIPmatrixGetRowRhs(), SCIPmatrixGetVar(), SCIPmatrixIsRowRhsInfinity(), SCIPpresolGetData(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetNLocksDown(), SCIPvarGetNLocksUp(), SCIPvarGetObj(), SCIPvarGetType(), SCIPvarGetUbGlobal(), and TRUE.
|
static |
destructor of presolver to free user data (called when SCIP is exiting)
Definition at line 798 of file presol_dualcomp.c.
References SCIP_OKAY, SCIPfreeBlockMemory, SCIPpresolGetData(), and SCIPpresolSetData().