Scippy

SCIP

Solving Constraint Integer Programs

presol_dualcomp.c File Reference

Detailed Description

dual compensation presolver

Author
Dieter Weninger

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)
 

Macro Definition Documentation

◆ PRESOL_NAME

#define PRESOL_NAME   "dualcomp"

Definition at line 37 of file presol_dualcomp.c.

Referenced by SCIP_DECL_PRESOLCOPY(), and SCIPincludePresolDualcomp().

◆ PRESOL_DESC

#define PRESOL_DESC   "compensate single up-/downlocks by singleton continuous variables"

Definition at line 38 of file presol_dualcomp.c.

Referenced by SCIPincludePresolDualcomp().

◆ PRESOL_PRIORITY

#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().

◆ PRESOL_MAXROUNDS

#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().

◆ PRESOL_TIMING

#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().

◆ DEFAULT_COMP_ONLY_DIS_VARS

#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 Documentation

◆ FIXINGDIRECTION

Definition at line 67 of file presol_dualcomp.c.

◆ LOCKCOMPENSATION

Definition at line 75 of file presol_dualcomp.c.

Enumeration Type Documentation

◆ Fixingdirection

type of fixing direction

Enumerator
FIXATLB 

fix variable at lower bound

NOFIX 

do not fix variable

FIXATUB 

fix variable at upper bound

FIXATLB 

fix variable at lower bound

NOFIX 

do not fix variable

FIXATUB 

fix variable at upper bound

FIXATLB 
NOFIX 
FIXATLB 

fix variable at lower bound

NOFIX 

do not fix variable

FIXATUB 

fix variable at upper bound

Definition at line 61 of file presol_dualcomp.c.

◆ Lockcompensation

type of variable lock compensation

Enumerator
COMPENSATE_DOWNLOCK 
COMPENSATE_UPLOCK 

Definition at line 70 of file presol_dualcomp.c.

Function Documentation

◆ compensateVarLock()

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

try to compensate a variable with a single opposite lock by using singleton continuous variables

Parameters
scipSCIP main data structure
matrixmatrix containing the constraints
colvariable fixing candidate
rowrow index with opposite lock
valvalue of fixing candidate in the opposite lock constraint
twosidesflag indicating that two sides are present
compensationtype of lock compensation
varstofixarray holding fixing information
nfixingsnumber 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().

◆ SCIP_DECL_PRESOLCOPY()

static SCIP_DECL_PRESOLCOPY ( presolCopyDualcomp  )
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().

◆ SCIP_DECL_PRESOLEXEC()

◆ SCIP_DECL_PRESOLFREE()

static SCIP_DECL_PRESOLFREE ( presolFreeDualcomp  )
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().