GCG 4.1.1 (dev)

Generic Column Generation

Loading...
Searching...
No Matches
zerohalf_selector.c File Reference

Detailed Description

{0,1/2}-cuts separator

Author
Leona Gottwald
Manuel Kutschka
Kati Wolter

{0,1/2}-Chvátal-Gomory cuts separator. It solves the following separation problem: Consider an integer program

\[\min \{ c^T x : Ax \leq b, x \geq 0, x \mbox{ integer} \} \]

and a fractional solution \(x^*\) of its LP relaxation. Find a weightvector \(u\) whose entries \(u_i\) are either 0 or \(\frac{1}{2}\) such that the following inequality is valid for all integral solutions and violated by \(x^*\):

\[\lfloor(u^T A) x \rfloor \leq \lfloor u^T b\rfloor \]

References:

  • Alberto Caprara, Matteo Fischetti. {0,1/2}-Chvatal-Gomory cuts. Math. Programming, Volume 74, p221–235, 1996.
  • Arie M. C. A. Koster, Adrian Zymolka and Manuel Kutschka.
    Algorithms to separate {0,1/2}-Chvatal-Gomory cuts. Algorithms - ESA 2007: 15th Annual European Symposium, Eilat, Israel, October 8-10, 2007,
    Proceedings. Lecture Notes in Computer Science, Volume 4698, p. 693–704, 2007.
  • Arie M. C. A. Koster, Adrian Zymolka and Manuel Kutschka.
    Algorithms to separate {0,1/2}-Chvatal-Gomory cuts (Extended Version).
    ZIB Report 07-10, Zuse Institute Berlin, 2007. http://www.zib.de/Publications/Reports/ZR-07-10.pdf
  • Manuel Kutschka. Algorithmen zur Separierung von {0,1/2}-Schnitten. Diplomarbeit. Technische Universitaet Berlin, 2007.

Definition in file zerohalf_selector.c.

#include "string.h"
#include "scip/sepa_zerohalf.h"
#include "scip/cutsel_hybrid.h"
#include "gcg/zerohalf_selector.h"
#include "gcg/gcg.h"

Go to the source code of this file.

Data Structures

struct  TransIntRow
struct  Mod2Row
struct  Mod2Col
struct  Mod2Matrix

Macros

#define MAXDNOM   1000LL
#define MAXSCALE   1000.0
#define MAXREDUCTIONROUNDS   100
#define BOUNDSWITCH   0.5
#define MAXAGGRLEN(nvars)
#define ROWIND_TYPE   unsigned int
#define ORIG_RHS   0u
#define ORIG_LHS   1u
#define TRANSROW   2u
#define UNIQUE_INDEX(rowind)
#define COLINFO_GET_MOD2COL(x)
#define COLINFO_GET_RHSOFFSET(x)
#define COLINFO_CREATE(mod2col, rhsoffset)
#define NONZERO(x)

Functions

SCIP_RETCODE GCGcreateCutIndicesFromRowindex (SCIP *scip, GCG_CUTINDICES **cutindices, int nindices, ROWINDEX *rowindex)
SCIP_RETCODE GCGcreateCutIndicesFromArray (SCIP *scip, GCG_CUTINDICES **cutindices, int nindices, int *indices)
SCIP_RETCODE GCGfreeCutIndices (SCIP *scip, GCG_CUTINDICES **cutindices)
static void checkRow (MOD2_ROW *row)
static SCIP_DECL_SORTPTRCOMP (compareColIndex)
static SCIP_DECL_SORTPTRCOMP (compareRowSlack)
static int mod2 (SCIP *scip, SCIP_Real val)
static void getIntegralScalar (SCIP_Real val, SCIP_Real scalar, SCIP_Real mindelta, SCIP_Real maxdelta, SCIP_Real *sval, SCIP_Real *intval)
static SCIP_RETCODE transformNonIntegralRow (SCIP *scip, SCIP_SOL *sol, SCIP_Bool allowlocal, SCIP_Real maxslack, int sign, SCIP_Bool local, int rank, int rowlen, SCIP_Real *rowvals, SCIP_COL **rowcols, SCIP_Real rhs, int *intvarpos, TRANSINTROW *introw, SCIP_Bool *success)
static SCIP_RETCODE mod2MatrixTransformContRows (GCG *gcg, SCIP_SOL *sol, GCG_ZEROHALFDATA *zhdata, MOD2_MATRIX *mod2matrix, SCIP_Bool allowlocal, SCIP_Real maxslack)
static SCIP_RETCODE mod2MatrixAddCol (SCIP *scip, MOD2_MATRIX *mod2matrix, SCIP_HASHMAP *origvar2col, SCIP_VAR *origvar, SCIP_Real solval, int rhsoffset)
static SCIP_RETCODE mod2colLinkRow (BMS_BLKMEM *blkmem, MOD2_COL *col, MOD2_ROW *row)
static SCIP_RETCODE mod2colUnlinkRow (MOD2_COL *col, MOD2_ROW *row)
static void mod2rowUnlinkCol (MOD2_ROW *row, MOD2_COL *col)
static SCIP_RETCODE mod2MatrixAddOrigRow (SCIP *scip, BMS_BLKMEM *blkmem, MOD2_MATRIX *mod2matrix, SCIP_HASHMAP *origcol2col, SCIP_ROW *origrow, SCIP_Real slack, ROWIND_TYPE side, int rhsmod2)
static SCIP_RETCODE mod2MatrixAddTransRow (SCIP *scip, MOD2_MATRIX *mod2matrix, SCIP_HASHMAP *origcol2col, int transrowind)
static void destroyMod2Matrix (GCG *gcg, MOD2_MATRIX *mod2matrix)
static SCIP_RETCODE buildMod2Matrix (GCG *gcg, SCIP_SOL *sol, GCG_ZEROHALFDATA *zhdata, BMS_BLKMEM *blkmem, MOD2_MATRIX *mod2matrix, SCIP_Bool allowlocal, SCIP_Real maxslack)
static SCIP_DECL_HASHKEYEQ (columnsEqual)
static SCIP_DECL_HASHKEYVAL (columnGetSignature)
static SCIP_DECL_HASHKEYEQ (rowsEqual)
static SCIP_DECL_HASHKEYVAL (rowGetSignature)
static SCIP_RETCODE mod2matrixRemoveRow (SCIP *scip, MOD2_MATRIX *mod2matrix, MOD2_ROW *row)
static void mod2matrixRemoveCol (SCIP *scip, MOD2_MATRIX *mod2matrix, MOD2_COL *col)
static SCIP_RETCODE mod2matrixPreprocessColumns (SCIP *scip, MOD2_MATRIX *mod2matrix, GCG_ZEROHALFDATA *zhdata)
static SCIP_Real computeMaxViolation (MOD2_ROW *row)
static SCIP_RETCODE mod2matrixPreprocessRows (SCIP *scip, SCIP_SOL *sol, MOD2_MATRIX *mod2matrix, GCG_ZEROHALFDATA *zhdata, SCIP_Bool allowlocal, GCG_CUTINDICES ***cutindices, int *ncutindices, int maxcuts)
static SCIP_RETCODE mod2rowAddRow (GCG *gcg, BMS_BLKMEM *blkmem, MOD2_MATRIX *mod2matrix, MOD2_ROW *row, MOD2_ROW *rowtoadd)
SCIP_RETCODE GCGselectConstraintsZeroHalf (GCG *gcg, SCIP_SOL *sol, SCIP_Bool allowlocal, int depth, GCG_ZEROHALFDATA *zhdata, int ncalls, int maxcuts, GCG_CUTINDICES ***cutindices, int *ncutindices)

Macro Definition Documentation

◆ MAXDNOM

#define MAXDNOM   1000LL

Definition at line 68 of file zerohalf_selector.c.

Referenced by transformNonIntegralRow().

◆ MAXSCALE

#define MAXSCALE   1000.0

Definition at line 69 of file zerohalf_selector.c.

Referenced by transformNonIntegralRow().

◆ MAXREDUCTIONROUNDS

#define MAXREDUCTIONROUNDS   100

maximum number of rounds to perform reductions on the mod 2 system

Definition at line 72 of file zerohalf_selector.c.

Referenced by GCGselectConstraintsZeroHalf().

◆ BOUNDSWITCH

#define BOUNDSWITCH   0.5

threshold for bound switching

Definition at line 73 of file zerohalf_selector.c.

Referenced by buildMod2Matrix().

◆ MAXAGGRLEN

#define MAXAGGRLEN ( nvars)
Value:
((int)(0.1*(nvars)+1000))
int nvars

Definition at line 74 of file zerohalf_selector.c.

◆ ROWIND_TYPE

#define ROWIND_TYPE   unsigned int

enum for different types of row indices in ROWINDEX structure

Definition at line 84 of file zerohalf_selector.c.

Referenced by mod2MatrixAddOrigRow().

◆ ORIG_RHS

#define ORIG_RHS   0u

Definition at line 85 of file zerohalf_selector.c.

Referenced by buildMod2Matrix().

◆ ORIG_LHS

#define ORIG_LHS   1u

Definition at line 86 of file zerohalf_selector.c.

Referenced by buildMod2Matrix().

◆ TRANSROW

#define TRANSROW   2u

Definition at line 87 of file zerohalf_selector.c.

Referenced by mod2MatrixAddTransRow().

◆ UNIQUE_INDEX

#define UNIQUE_INDEX ( rowind)
Value:
(3*(rowind).index + (rowind).type)

Definition at line 90 of file zerohalf_selector.c.

Referenced by mod2rowAddRow().

◆ COLINFO_GET_MOD2COL

#define COLINFO_GET_MOD2COL ( x)
Value:
((MOD2_COL*) (((uintptr_t)(x)) & ~((uintptr_t)1)))
SCIP_VAR ** x
struct Mod2Col MOD2_COL

Definition at line 223 of file zerohalf_selector.c.

Referenced by mod2MatrixAddOrigRow(), and mod2MatrixAddTransRow().

◆ COLINFO_GET_RHSOFFSET

#define COLINFO_GET_RHSOFFSET ( x)
Value:
((int) (((uintptr_t)(x)) & ((uintptr_t)1)))

Definition at line 224 of file zerohalf_selector.c.

Referenced by mod2MatrixAddOrigRow(), and mod2MatrixAddTransRow().

◆ COLINFO_CREATE

#define COLINFO_CREATE ( mod2col,
rhsoffset )
Value:
((void*) (((uintptr_t)(mod2col)) | ((uintptr_t)(rhsoffset))))

Definition at line 225 of file zerohalf_selector.c.

Referenced by buildMod2Matrix(), and mod2MatrixAddCol().

◆ NONZERO

#define NONZERO ( x)
Value:
(COPYSIGN(1e-100, (x)) + (x))
#define COPYSIGN

Definition at line 1519 of file zerohalf_selector.c.

Function Documentation

◆ GCGcreateCutIndicesFromRowindex()

SCIP_RETCODE GCGcreateCutIndicesFromRowindex ( SCIP * scip,
GCG_CUTINDICES ** cutindices,
int nindices,
ROWINDEX * rowindex )

data of separator create an instance of cut indices

create an instance of cut indices

Parameters
scipSCIP data structure (master problem)
cutindicespointer to store cutindices
nindicesnumber of indices
rowindexindices

Definition at line 154 of file zerohalf_selector.c.

References assert(), GCGcreateCutIndicesFromRowindex(), i, RowIndex::index, and SCIP_CALL().

Referenced by GCGcreateCutIndicesFromRowindex(), GCGselectConstraintsZeroHalf(), and mod2matrixPreprocessRows().

◆ GCGcreateCutIndicesFromArray()

SCIP_RETCODE GCGcreateCutIndicesFromArray ( SCIP * scip,
GCG_CUTINDICES ** cutindices,
int nindices,
int * indices )

create an instance of cut indices

Parameters
scipSCIP data structure (master problem)
cutindicespointer to store cutindices
nindicesnumber of indices
indicesindices

Definition at line 181 of file zerohalf_selector.c.

References assert(), GCGcreateCutIndicesFromArray(), and SCIP_CALL().

Referenced by GCGcreateCutIndicesFromArray(), selectConstraintsEnumerate(), and selectConstraintsRandom().

◆ GCGfreeCutIndices()

SCIP_RETCODE GCGfreeCutIndices ( SCIP * scip,
GCG_CUTINDICES ** cutindices )

free an instance of cut indices

Parameters
scipSCIP data structure (master problem)
cutindicespointer to cutindices

Definition at line 200 of file zerohalf_selector.c.

References assert(), GCGfreeCutIndices(), and SCIPfreeBufferArray().

Referenced by GCGfreeCutIndices(), and SCIP_DECL_SEPAEXECLP().

◆ checkRow()

◆ SCIP_DECL_SORTPTRCOMP() [1/2]

SCIP_DECL_SORTPTRCOMP ( compareColIndex )
static

compare to mod 2 columns by there index

Definition at line 252 of file zerohalf_selector.c.

References Mod2Col::index.

◆ SCIP_DECL_SORTPTRCOMP() [2/2]

SCIP_DECL_SORTPTRCOMP ( compareRowSlack )
static

comparison function for slack of mod 2 rows

Definition at line 270 of file zerohalf_selector.c.

References Mod2Row::maxsolval, Mod2Row::nnonzcols, and Mod2Row::slack.

◆ mod2()

int mod2 ( SCIP * scip,
SCIP_Real val )
static

take integral real value modulo 2

Parameters
scipscip data structure
valvalue to take mod 2

Definition at line 308 of file zerohalf_selector.c.

References assert(), and mod2().

Referenced by buildMod2Matrix(), mod2(), mod2MatrixAddOrigRow(), and mod2MatrixAddTransRow().

◆ getIntegralScalar()

void getIntegralScalar ( SCIP_Real val,
SCIP_Real scalar,
SCIP_Real mindelta,
SCIP_Real maxdelta,
SCIP_Real * sval,
SCIP_Real * intval )
static

returns the integral value for the given scaling parameters, see SCIPcalcIntegralScalar()

Parameters
valvalue that should be scaled to an integral value
scalarscalar that should be tried
mindeltaminimal relative allowed difference of scaled coefficient s*c and integral i
maxdeltamaximal relative allowed difference of scaled coefficient s*c and integral i
svalpointer to store the scaled value
intvalpointer to store the scaled integral value

Definition at line 320 of file zerohalf_selector.c.

References assert(), and getIntegralScalar().

Referenced by getIntegralScalar(), and transformNonIntegralRow().

◆ transformNonIntegralRow()

SCIP_RETCODE transformNonIntegralRow ( SCIP * scip,
SCIP_SOL * sol,
SCIP_Bool allowlocal,
SCIP_Real maxslack,
int sign,
SCIP_Bool local,
int rank,
int rowlen,
SCIP_Real * rowvals,
SCIP_COL ** rowcols,
SCIP_Real rhs,
int * intvarpos,
TRANSINTROW * introw,
SCIP_Bool * success )
static

Tries to transform a non-integral row into an integral row that can be used in zerohalf separation

Parameters
scipscip data structure
solsolution to separate, or NULL for LP solution
allowlocalshould local cuts be allowed
maxslackmaximum slack allowed for transformed row
sign+1 or -1 scale to select the side of the row
localis the row only valid locally?
rankrank of row
rowlenlength of row
rowvalscoefficients of columns in row
rowcolscolumns of row
rhsright hand side of row
intvarposclean buffer array of size SCIPgetNVars that will be clean when the function returns
introwpointer to return transformed row
successpointer to return whether the transformation succeeded

Definition at line 352 of file zerohalf_selector.c.

References assert(), getIntegralScalar(), i, TransIntRow::len, TransIntRow::local, MAXDNOM, MAXSCALE, TransIntRow::rank, TransIntRow::rhs, SCIP_CALL(), TransIntRow::size, TransIntRow::slack, sol, solval, success, transformNonIntegralRow(), TransIntRow::vals, TransIntRow::varinds, and vars.

Referenced by mod2MatrixTransformContRows(), and transformNonIntegralRow().

◆ mod2MatrixTransformContRows()

SCIP_RETCODE mod2MatrixTransformContRows ( GCG * gcg,
SCIP_SOL * sol,
GCG_ZEROHALFDATA * zhdata,
MOD2_MATRIX * mod2matrix,
SCIP_Bool allowlocal,
SCIP_Real maxslack )
static

Tries to transform non-integral rows into an integral form by using simple and variable bounds

Parameters
gcgGCG data structure
solsolution to separate, or NULL for LP solution
zhdatazerohalf separator data
mod2matrixmod2 matrix structure
allowlocalshould local cuts be allowed
maxslackmaximum slack allowed for mod 2 rows

Definition at line 642 of file zerohalf_selector.c.

References assert(), GCG_ZeroHalfData::densityoffset, GCGgetMasterprob(), i, GCG_ZeroHalfData::masterconss, GCG_ZeroHalfData::maxrowdensity, mod2MatrixTransformContRows(), GCG_ZeroHalfData::nmasterconss, Mod2Matrix::ntransintrows, SCIP_CALL(), SCIPfreeBufferArray(), sol, success, transformNonIntegralRow(), and Mod2Matrix::transintrows.

Referenced by buildMod2Matrix(), and mod2MatrixTransformContRows().

◆ mod2MatrixAddCol()

SCIP_RETCODE mod2MatrixAddCol ( SCIP * scip,
MOD2_MATRIX * mod2matrix,
SCIP_HASHMAP * origvar2col,
SCIP_VAR * origvar,
SCIP_Real solval,
int rhsoffset )
static

adds new column to the mod 2 matrix

Parameters
scipSCIP datastructure
mod2matrixmod 2 matrix
origvar2colhash map for mapping of problem variables to mod 2 columns
origvarproblem variable to create mod 2 column for
solvalsolution value of problem variable
rhsoffsetoffset in right hand side due complementation (mod 2)

Definition at line 757 of file zerohalf_selector.c.

References assert(), COLINFO_CREATE, Mod2Matrix::cols, Mod2Matrix::colssize, Mod2Col::index, mod2MatrixAddCol(), Mod2Matrix::ncols, Mod2Col::nonzrows, Mod2Col::pos, SCIP_CALL(), Mod2Col::solval, and solval.

Referenced by buildMod2Matrix(), and mod2MatrixAddCol().

◆ mod2colLinkRow()

SCIP_RETCODE mod2colLinkRow ( BMS_BLKMEM * blkmem,
MOD2_COL * col,
MOD2_ROW * row )
static

links row to mod 2 column

Parameters
blkmemblock memory shell
colmod 2 column
rowmod 2 row

Definition at line 790 of file zerohalf_selector.c.

References assert(), Mod2Row::maxsolval, mod2colLinkRow(), Mod2Col::nonzrows, SCIP_CALL(), and Mod2Col::solval.

Referenced by mod2colLinkRow(), mod2MatrixAddOrigRow(), mod2MatrixAddTransRow(), and mod2rowAddRow().

◆ mod2colUnlinkRow()

SCIP_RETCODE mod2colUnlinkRow ( MOD2_COL * col,
MOD2_ROW * row )
static

unlinks row from mod 2 column

Parameters
colmod 2 column
rowmod 2 row

Definition at line 807 of file zerohalf_selector.c.

References assert(), i, mod2colUnlinkRow(), Mod2Col::nonzrows, and SCIP_CALL().

Referenced by mod2colUnlinkRow(), mod2matrixRemoveRow(), and mod2rowAddRow().

◆ mod2rowUnlinkCol()

void mod2rowUnlinkCol ( MOD2_ROW * row,
MOD2_COL * col )
static

unlinks row from mod 2 column

Parameters
rowmod 2 row
colmod 2 column

Definition at line 833 of file zerohalf_selector.c.

References assert(), i, Mod2Row::maxsolval, mod2rowUnlinkCol(), Mod2Row::nnonzcols, Mod2Row::nonzcols, and Mod2Col::solval.

Referenced by mod2matrixRemoveCol(), and mod2rowUnlinkCol().

◆ mod2MatrixAddOrigRow()

SCIP_RETCODE mod2MatrixAddOrigRow ( SCIP * scip,
BMS_BLKMEM * blkmem,
MOD2_MATRIX * mod2matrix,
SCIP_HASHMAP * origcol2col,
SCIP_ROW * origrow,
SCIP_Real slack,
ROWIND_TYPE side,
int rhsmod2 )
static

adds a SCIP_ROW to the mod 2 matrix

Parameters
scipscip data structure
blkmemblock memory shell
mod2matrixmodulo 2 matrix
origcol2colhashmap to retrieve the mod 2 column from a SCIP_COL
origroworiginal SCIP row
slackslack of row
sideside of row that is used for mod 2 row, must be ORIG_RHS or ORIG_LHS
rhsmod2modulo 2 value of the row's right hand side

Definition at line 860 of file zerohalf_selector.c.

References checkRow(), COLINFO_GET_MOD2COL, COLINFO_GET_RHSOFFSET, i, Mod2Row::index, RowIndex::index, Mod2Row::maxsolval, mod2(), mod2colLinkRow(), mod2MatrixAddOrigRow(), Mod2Row::nnonzcols, Mod2Row::nonzcols, Mod2Row::nonzcolssize, Mod2Row::nrowinds, Mod2Matrix::nrows, Mod2Matrix::nzeroslackrows, Mod2Row::rhs, ROWIND_TYPE, Mod2Row::rowinds, Mod2Row::rowindssize, Mod2Matrix::rows, Mod2Matrix::rowssize, SCIP_CALL(), Mod2Row::slack, and RowIndex::type.

Referenced by buildMod2Matrix(), and mod2MatrixAddOrigRow().

◆ mod2MatrixAddTransRow()

SCIP_RETCODE mod2MatrixAddTransRow ( SCIP * scip,
MOD2_MATRIX * mod2matrix,
SCIP_HASHMAP * origcol2col,
int transrowind )
static

◆ destroyMod2Matrix()

◆ buildMod2Matrix()

SCIP_RETCODE buildMod2Matrix ( GCG * gcg,
SCIP_SOL * sol,
GCG_ZEROHALFDATA * zhdata,
BMS_BLKMEM * blkmem,
MOD2_MATRIX * mod2matrix,
SCIP_Bool allowlocal,
SCIP_Real maxslack )
static

build the modulo 2 matrix from all integral rows in the LP, and non-integral rows if the transformation to an integral row succeeds

Parameters
gcgGCG data structure
solsolution to separate, or NULL for LP solution
zhdatazerohalf separator data
blkmemblock memory shell
mod2matrixmod 2 matrix
allowlocalshould local cuts be allowed
maxslackmaximum slack allowed for mod 2 rows

Definition at line 1065 of file zerohalf_selector.c.

References assert(), BOUNDSWITCH, buildMod2Matrix(), COLINFO_CREATE, Mod2Matrix::cols, Mod2Matrix::colssize, GCG_ZeroHalfData::densityoffset, GCGgetMasterprob(), i, GCG_ZeroHalfData::masterconss, GCG_ZeroHalfData::maxrowdensity, mod2(), mod2MatrixAddCol(), mod2MatrixAddOrigRow(), mod2MatrixAddTransRow(), mod2MatrixTransformContRows(), Mod2Matrix::ncols, nintvars, GCG_ZeroHalfData::nmasterconss, Mod2Matrix::nrows, Mod2Matrix::ntransintrows, Mod2Matrix::nzeroslackrows, ORIG_LHS, ORIG_RHS, Mod2Matrix::rows, Mod2Matrix::rowssize, SCIP_CALL(), SCIPfreeBufferArray(), sol, and vars.

Referenced by buildMod2Matrix(), and GCGselectConstraintsZeroHalf().

◆ SCIP_DECL_HASHKEYEQ() [1/2]

SCIP_DECL_HASHKEYEQ ( columnsEqual )
static

Definition at line 1267 of file zerohalf_selector.c.

References i, and Mod2Col::nonzrows.

◆ SCIP_DECL_HASHKEYVAL() [1/2]

SCIP_DECL_HASHKEYVAL ( columnGetSignature )
static

Definition at line 1294 of file zerohalf_selector.c.

References i, and Mod2Col::nonzrows.

◆ SCIP_DECL_HASHKEYEQ() [2/2]

SCIP_DECL_HASHKEYEQ ( rowsEqual )
static

Definition at line 1319 of file zerohalf_selector.c.

References assert(), i, Mod2Row::nnonzcols, Mod2Row::nonzcols, and Mod2Row::rhs.

◆ SCIP_DECL_HASHKEYVAL() [2/2]

SCIP_DECL_HASHKEYVAL ( rowGetSignature )
static

◆ mod2matrixRemoveRow()

SCIP_RETCODE mod2matrixRemoveRow ( SCIP * scip,
MOD2_MATRIX * mod2matrix,
MOD2_ROW * row )
static

removes a row from the mod 2 matrix

Parameters
scipscip data structure
mod2matrixthe mod 2 matrix
rowmod 2 row

Definition at line 1366 of file zerohalf_selector.c.

References checkRow(), i, mod2colUnlinkRow(), mod2matrixRemoveRow(), Mod2Row::nnonzcols, Mod2Row::nonzcols, Mod2Row::nonzcolssize, Mod2Matrix::nrows, Mod2Matrix::nzeroslackrows, Mod2Row::pos, Mod2Row::rowinds, Mod2Row::rowindssize, Mod2Matrix::rows, SCIP_CALL(), and Mod2Row::slack.

Referenced by mod2matrixPreprocessRows(), and mod2matrixRemoveRow().

◆ mod2matrixRemoveCol()

void mod2matrixRemoveCol ( SCIP * scip,
MOD2_MATRIX * mod2matrix,
MOD2_COL * col )
static

removes a column from the mod 2 matrix

Parameters
scipscip data structure
mod2matrixthe mod 2 matrix
cola column in the mod 2 matrix

Definition at line 1402 of file zerohalf_selector.c.

References assert(), Mod2Matrix::cols, i, mod2matrixRemoveCol(), mod2rowUnlinkCol(), Mod2Matrix::ncols, Mod2Col::nonzrows, and Mod2Col::pos.

Referenced by GCGselectConstraintsZeroHalf(), mod2matrixPreprocessColumns(), and mod2matrixRemoveCol().

◆ mod2matrixPreprocessColumns()

SCIP_RETCODE mod2matrixPreprocessColumns ( SCIP * scip,
MOD2_MATRIX * mod2matrix,
GCG_ZEROHALFDATA * zhdata )
static

◆ computeMaxViolation()

SCIP_Real computeMaxViolation ( MOD2_ROW * row)
static

computes maximal violation that can be achieved for zerohalf cuts where this row particiaptes

Parameters
rowmod 2 row

Definition at line 1523 of file zerohalf_selector.c.

References computeMaxViolation(), and Mod2Row::slack.

Referenced by computeMaxViolation(), GCGselectConstraintsZeroHalf(), and mod2matrixPreprocessRows().

◆ mod2matrixPreprocessRows()

SCIP_RETCODE mod2matrixPreprocessRows ( SCIP * scip,
SCIP_SOL * sol,
MOD2_MATRIX * mod2matrix,
GCG_ZEROHALFDATA * zhdata,
SCIP_Bool allowlocal,
GCG_CUTINDICES *** cutindices,
int * ncutindices,
int maxcuts )
static

remove rows that are (a) zero (b) identical to other rows (keep the one with smallest slack) (c) have slack greater than 1 (d) for zero rows with 1 as rhs and slack less than 1, we can directly generate a cut and remove the row (Lemma 4)

Parameters
scipscip data structure
solsolution to separate, or NULL for LP solution
mod2matrixthe mod 2 matrix
allowlocalshould local cuts be allowed

Definition at line 1539 of file zerohalf_selector.c.

References assert(), checkRow(), computeMaxViolation(), GCGcreateCutIndicesFromRowindex(), i, GCG_ZeroHalfData::infeasible, GCG_ZeroHalfData::minviol, mod2matrixPreprocessRows(), mod2matrixRemoveRow(), Mod2Row::nnonzcols, Mod2Row::nonzcols, GCG_ZeroHalfData::nreductions, Mod2Row::nrowinds, Mod2Matrix::nrows, Mod2Row::pos, Mod2Row::rhs, Mod2Row::rowinds, Mod2Matrix::rows, SCIP_CALL(), Mod2Row::slack, and sol.

Referenced by GCGselectConstraintsZeroHalf(), and mod2matrixPreprocessRows().

◆ mod2rowAddRow()

SCIP_RETCODE mod2rowAddRow ( GCG * gcg,
BMS_BLKMEM * blkmem,
MOD2_MATRIX * mod2matrix,
MOD2_ROW * row,
MOD2_ROW * rowtoadd )
static

◆ GCGselectConstraintsZeroHalf()