Scippy

SCIP

Solving Constraint Integer Programs

pub_matrix.h File Reference

Detailed Description

public methods for MILP matrix

Author
Dieter Weninger

Definition in file pub_matrix.h.

#include "scip/def.h"
#include "scip/type_var.h"
#include "scip/type_cons.h"
#include "scip/type_matrix.h"

Go to the source code of this file.

Functions

SCIP_RealSCIPmatrixGetColValPtr (SCIPMILPMATRIX *matrix, int col)
 
int * SCIPmatrixGetColIdxPtr (SCIPMILPMATRIX *matrix, int col)
 
int SCIPmatrixGetColNNonzs (SCIPMILPMATRIX *matrix, int col)
 
int SCIPmatrixGetNColumns (SCIPMILPMATRIX *matrix)
 
SCIP_Real SCIPmatrixGetColUb (SCIPMILPMATRIX *matrix, int col)
 
SCIP_Real SCIPmatrixGetColLb (SCIPMILPMATRIX *matrix, int col)
 
int SCIPmatrixGetColNUplocks (SCIPMILPMATRIX *matrix, int col)
 
int SCIPmatrixGetColNDownlocks (SCIPMILPMATRIX *matrix, int col)
 
SCIP_VARSCIPmatrixGetVar (SCIPMILPMATRIX *matrix, int col)
 
const char * SCIPmatrixGetColName (SCIPMILPMATRIX *matrix, int col)
 
SCIP_RealSCIPmatrixGetRowValPtr (SCIPMILPMATRIX *matrix, int row)
 
int * SCIPmatrixGetRowIdxPtr (SCIPMILPMATRIX *matrix, int row)
 
int SCIPmatrixGetRowNNonzs (SCIPMILPMATRIX *matrix, int row)
 
const char * SCIPmatrixGetRowName (SCIPMILPMATRIX *matrix, int row)
 
int SCIPmatrixGetNRows (SCIPMILPMATRIX *matrix)
 
SCIP_Real SCIPmatrixGetRowLhs (SCIPMILPMATRIX *matrix, int row)
 
SCIP_Real SCIPmatrixGetRowRhs (SCIPMILPMATRIX *matrix, int row)
 
SCIP_Bool SCIPmatrixIsRowRhsInfinity (SCIPMILPMATRIX *matrix, int row)
 
int SCIPmatrixGetNNonzs (SCIPMILPMATRIX *matrix)
 
SCIP_Real SCIPmatrixGetRowMinActivity (SCIPMILPMATRIX *matrix, int row)
 
SCIP_Real SCIPmatrixGetRowMaxActivity (SCIPMILPMATRIX *matrix, int row)
 
int SCIPmatrixGetRowNMinActNegInf (SCIPMILPMATRIX *matrix, int row)
 
int SCIPmatrixGetRowNMinActPosInf (SCIPMILPMATRIX *matrix, int row)
 
int SCIPmatrixGetRowNMaxActNegInf (SCIPMILPMATRIX *matrix, int row)
 
int SCIPmatrixGetRowNMaxActPosInf (SCIPMILPMATRIX *matrix, int row)
 
SCIP_CONSSCIPmatrixGetCons (SCIPMILPMATRIX *matrix, int row)
 
SCIP_Bool SCIPmatrixUplockConflict (SCIPMILPMATRIX *matrix, int col)
 
SCIP_Bool SCIPmatrixDownlockConflict (SCIPMILPMATRIX *matrix, int col)
 
SCIP_RETCODE SCIPmatrixCreate (SCIP *scip, SCIPMILPMATRIX **matrixptr, SCIP_Bool *initialized, SCIP_Bool *complete)
 
void SCIPmatrixFree (SCIP *scip, SCIPMILPMATRIX **matrix)
 
void SCIPmatrixPrintRow (SCIP *scip, SCIPMILPMATRIX *matrix, int row)
 
SCIP_RETCODE SCIPmatrixGetParallelRows (SCIP *scip, SCIPMILPMATRIX *matrix, SCIP_Real *scale, int *pclass)
 
SCIP_RETCODE SCIPmatrixGetParallelCols (SCIP *scip, SCIPMILPMATRIX *matrix, SCIP_Real *scale, int *pclass, SCIP_Bool *varineq)
 

Function Documentation

SCIP_Real* SCIPmatrixGetColValPtr ( SCIPMILPMATRIX matrix,
int  col 
)

get column based start pointer of values

Parameters
matrixmatrix instance
colcolumn index

Definition at line 1239 of file matrix.c.

References SCIPmilpMatrix::colmatbeg, SCIPmilpMatrix::colmatval, and NULL.

Referenced by calcColActivity(), dualBoundStrengthening(), findDominancePairs(), getDownlockRowIdx(), getMinColActWithoutBound(), getMinColActWithoutRow(), getUplockRowIdx(), isVarImpliedFree(), and numericalStable().

int* SCIPmatrixGetColIdxPtr ( SCIPMILPMATRIX matrix,
int  col 
)
int SCIPmatrixGetColNNonzs ( SCIPMILPMATRIX matrix,
int  col 
)
int SCIPmatrixGetColNUplocks ( SCIPMILPMATRIX matrix,
int  col 
)

get number of uplocks of column

Parameters
matrixmatrix instance
colcolumn index

Definition at line 1301 of file matrix.c.

References NULL, and SCIPmilpMatrix::nuplocks.

Referenced by detectDominatingVlbs(), findUplockAggregations(), getUplockRowIdx(), and SCIP_DECL_PRESOLEXEC().

int SCIPmatrixGetColNDownlocks ( SCIPMILPMATRIX matrix,
int  col 
)

get number of downlocks of column

Parameters
matrixmatrix instance
colcolumn index

Definition at line 1312 of file matrix.c.

References SCIPmilpMatrix::ndownlocks, and NULL.

Referenced by detectDominatingVubs(), findDownlockAggregations(), getDownlockRowIdx(), and SCIP_DECL_PRESOLEXEC().

const char* SCIPmatrixGetColName ( SCIPMILPMATRIX matrix,
int  col 
)

get name of column/variable

Parameters
matrixmatrix instance
colcolumn index

Definition at line 1334 of file matrix.c.

References NULL, SCIPvarGetName(), and SCIPmilpMatrix::vars.

const char* SCIPmatrixGetRowName ( SCIPMILPMATRIX matrix,
int  row 
)

get name of row

Parameters
matrixmatrix instance
rowrow index

Definition at line 1378 of file matrix.c.

References SCIPmilpMatrix::cons, NULL, and SCIPconsGetName().

SCIP_Real SCIPmatrixGetRowRhs ( SCIPMILPMATRIX matrix,
int  row 
)
int SCIPmatrixGetNNonzs ( SCIPMILPMATRIX matrix)

get number of non-zeros of matrix

Parameters
matrixmatrix instance

Definition at line 1431 of file matrix.c.

References SCIPmilpMatrix::nnonzs, and NULL.

SCIP_Real SCIPmatrixGetRowMinActivity ( SCIPMILPMATRIX matrix,
int  row 
)

get minimal activity of row

Parameters
matrixmatrix instance
rowrow index

Definition at line 1440 of file matrix.c.

References SCIPmilpMatrix::minactivity, and NULL.

Referenced by findDominancePairs(), getActivityResiduals(), getActivityResidualsLowerBound(), getActivityResidualsUpperBound(), getBinVarIdxInDownlockRow(), and getBinVarIdxInUplockRow().

SCIP_Real SCIPmatrixGetRowMaxActivity ( SCIPMILPMATRIX matrix,
int  row 
)

get maximal activity of row

Parameters
matrixmatrix instance
rowrow index

Definition at line 1451 of file matrix.c.

References SCIPmilpMatrix::maxactivity, and NULL.

Referenced by findDominancePairs(), getActivityResiduals(), getActivityResidualsLowerBound(), getActivityResidualsUpperBound(), getBinVarIdxInDownlockRow(), and getBinVarIdxInUplockRow().

int SCIPmatrixGetRowNMinActNegInf ( SCIPMILPMATRIX matrix,
int  row 
)

get number of negative infinities present within minimal activity

Parameters
matrixmatrix instance
rowrow index

Definition at line 1462 of file matrix.c.

References SCIPmilpMatrix::minactivityneginf, and NULL.

Referenced by findDominancePairs(), getActivityRelax(), getActivityResiduals(), getActivityResidualsLowerBound(), and getActivityResidualsUpperBound().

int SCIPmatrixGetRowNMinActPosInf ( SCIPMILPMATRIX matrix,
int  row 
)

get number of positive infinities present within minimal activity

Parameters
matrixmatrix instance
rowrow index

Definition at line 1473 of file matrix.c.

References SCIPmilpMatrix::minactivityposinf, and NULL.

Referenced by findDominancePairs(), getActivityRelax(), getActivityResiduals(), getActivityResidualsLowerBound(), and getActivityResidualsUpperBound().

int SCIPmatrixGetRowNMaxActNegInf ( SCIPMILPMATRIX matrix,
int  row 
)

get number of negative infinities present within maximal activity

Parameters
matrixmatrix instance
rowrow index

Definition at line 1484 of file matrix.c.

References SCIPmilpMatrix::maxactivityneginf, and NULL.

Referenced by findDominancePairs(), getActivityRelax(), getActivityResiduals(), getActivityResidualsLowerBound(), and getActivityResidualsUpperBound().

int SCIPmatrixGetRowNMaxActPosInf ( SCIPMILPMATRIX matrix,
int  row 
)

get number of positive infinities present within maximal activity

Parameters
matrixmatrix instance
rowrow index

Definition at line 1495 of file matrix.c.

References SCIPmilpMatrix::maxactivityposinf, and NULL.

Referenced by findDominancePairs(), getActivityRelax(), getActivityResiduals(), getActivityResidualsLowerBound(), and getActivityResidualsUpperBound().

SCIP_CONS* SCIPmatrixGetCons ( SCIPMILPMATRIX matrix,
int  row 
)

get constraint pointer for constraint representing row

Parameters
matrixmatrix instance
rowrow index

Definition at line 1506 of file matrix.c.

References SCIPmilpMatrix::cons, and NULL.

Referenced by detectDominatingVlbs(), detectDominatingVubs(), and SCIP_DECL_PRESOLEXEC().

SCIP_Bool SCIPmatrixUplockConflict ( SCIPMILPMATRIX matrix,
int  col 
)

get if conflicting uplocks of variable present

get if conflicting uplocks of a specific variable present

Parameters
matrixmatrix instance
colcolumn index

Definition at line 1517 of file matrix.c.

References NULL, SCIPmilpMatrix::nuplocks, SCIPvarGetNLocksUp(), and SCIPmilpMatrix::vars.

SCIP_Bool SCIPmatrixDownlockConflict ( SCIPMILPMATRIX matrix,
int  col 
)

get if conflicting downlocks of variable present

get if conflicting downlocks of a specific variable present

Parameters
matrixmatrix instance
colcolumn index

Definition at line 1528 of file matrix.c.

References SCIPmilpMatrix::ndownlocks, NULL, SCIPvarGetNLocksDown(), and SCIPmilpMatrix::vars.

SCIP_RETCODE SCIPmatrixCreate ( SCIP scip,
SCIPMILPMATRIX **  matrixptr,
SCIP_Bool initialized,
SCIP_Bool complete 
)

initialize matrix

Parameters
scipcurrent scip instance
matrixptrpointer to constraint matrix object to be initialized
initializedwas the initialization successful?
completeare all constraint represented within the matrix?

Definition at line 429 of file matrix.c.

References addConstraint(), BMSclearMemoryArray, calcActivityBounds(), SCIPmilpMatrix::colmatbeg, SCIPmilpMatrix::colmatcnt, SCIPmilpMatrix::colmatind, SCIPmilpMatrix::colmatval, SCIPmilpMatrix::cons, SCIPmilpMatrix::constype, CONSTYPE_KNAPSACK, CONSTYPE_LINEAR, CONSTYPE_LOGICOR, CONSTYPE_SETPPC, CONSTYPE_VARBOUND, FALSE, SCIPmilpMatrix::isrhsinfinite, SCIPmilpMatrix::lb, SCIPmilpMatrix::lhs, SCIPmilpMatrix::maxactivity, SCIPmilpMatrix::maxactivityneginf, SCIPmilpMatrix::maxactivityposinf, SCIPmilpMatrix::minactivity, SCIPmilpMatrix::minactivityneginf, SCIPmilpMatrix::minactivityposinf, SCIPmilpMatrix::ncols, SCIPmilpMatrix::ndownlocks, SCIPmilpMatrix::nnonzs, SCIPmilpMatrix::nrows, NULL, SCIPmilpMatrix::nuplocks, SCIPmilpMatrix::rhs, SCIPmilpMatrix::rowmatbeg, SCIPmilpMatrix::rowmatcnt, SCIPmilpMatrix::rowmatind, SCIPmilpMatrix::rowmatval, SCIP_Bool, SCIP_CALL, SCIP_ERROR, SCIP_Longint, SCIP_OKAY, SCIP_Real, SCIP_SETPPCTYPE_COVERING, SCIP_SETPPCTYPE_PACKING, SCIP_SETPPCTYPE_PARTITIONING, SCIPallocBuffer, SCIPallocBufferArray, SCIPallocClearMemoryArray, SCIPconshdlrGetCheckConss(), SCIPconshdlrGetName(), SCIPconshdlrGetNCheckConss(), SCIPconsIsTransformed(), SCIPdebugMessage, SCIPduplicateBufferArray, SCIPfreeBufferArray, SCIPgetCapacityKnapsack(), SCIPgetConshdlrs(), SCIPgetLhsLinear(), SCIPgetLhsVarbound(), SCIPgetNConshdlrs(), SCIPgetNConss(), SCIPgetNVars(), SCIPgetNVarsKnapsack(), SCIPgetNVarsLinear(), SCIPgetNVarsLogicor(), SCIPgetNVarsSetppc(), SCIPgetRhsLinear(), SCIPgetRhsVarbound(), SCIPgetTypeSetppc(), SCIPgetValsLinear(), SCIPgetVars(), SCIPgetVarsKnapsack(), SCIPgetVarsLinear(), SCIPgetVarsLogicor(), SCIPgetVarsSetppc(), SCIPgetVarVarbound(), SCIPgetVbdcoefVarbound(), SCIPgetVbdvarVarbound(), SCIPgetWeightsKnapsack(), SCIPinfinity(), SCIPisStopped(), SCIPreallocBufferArray, SCIPvarGetLbGlobal(), SCIPvarGetNLocksDown(), SCIPvarGetNLocksUp(), SCIPvarGetUbGlobal(), setColumnMajorFormat(), TRUE, SCIPmilpMatrix::ub, and SCIPmilpMatrix::vars.

Referenced by SCIP_DECL_PRESOLEXEC().

void SCIPmatrixFree ( SCIP scip,
SCIPMILPMATRIX **  matrix 
)

frees the constraint matrix

Parameters
scipcurrent SCIP instance
matrixconstraint matrix object

Definition at line 787 of file matrix.c.

References NULL, SCIPfreeBuffer, SCIPfreeBufferArray, SCIPfreeBufferArrayNull, and SCIPfreeMemoryArray.

Referenced by SCIP_DECL_PRESOLEXEC().

void SCIPmatrixPrintRow ( SCIP scip,
SCIPMILPMATRIX matrix,
int  row 
)

print one row of the MILP matrix

Parameters
scipcurrent SCIP instance
matrixconstraint matrix object
rowrow index

Definition at line 851 of file matrix.c.

References SCIPmilpMatrix::cons, SCIPmilpMatrix::lhs, SCIPmilpMatrix::rhs, SCIPmilpMatrix::rowmatbeg, SCIPmilpMatrix::rowmatcnt, SCIPmilpMatrix::rowmatind, SCIPmilpMatrix::rowmatval, SCIP_Real, SCIPconsGetName(), SCIPvarGetLbGlobal(), SCIPvarGetName(), SCIPvarGetUbGlobal(), and SCIPmilpMatrix::vars.

Referenced by getActivities().

SCIP_RETCODE SCIPmatrixGetParallelRows ( SCIP scip,
SCIPMILPMATRIX matrix,
SCIP_Real scale,
int *  pclass 
)

detect parallel rows, rhs/lhs are ignored

detect parallel rows of matrix. rhs/lhs are ignored.

Parameters
scipSCIP instance
matrixmatrix containing the constraints
scalescale factors of rows
pclassparallel row classes

Definition at line 883 of file matrix.c.

References BMSclearMemoryArray, SCIPmilpMatrix::colmatbeg, SCIPmilpMatrix::colmatcnt, SCIPmilpMatrix::colmatind, SCIPmilpMatrix::colmatval, SCIPmilpMatrix::ncols, SCIPmilpMatrix::nrows, NULL, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPisEQ(), SCIPsortIntIntReal(), SCIPsortRealInt(), and TRUE.

SCIP_RETCODE SCIPmatrixGetParallelCols ( SCIP scip,
SCIPMILPMATRIX matrix,
SCIP_Real scale,
int *  pclass,
SCIP_Bool varineq 
)

detect parallel rows, obj ignored

detect parallel rows of matrix. obj coefficients are ignored.

Parameters
scipSCIP instance
matrixmatrix containing the constraints
scalescale factors of cols
pclassparallel column classes
varineqindicating if variable is within an equation

Definition at line 1039 of file matrix.c.

References BMSclearMemoryArray, SCIPmilpMatrix::isrhsinfinite, SCIPmilpMatrix::ncols, SCIPmilpMatrix::nrows, NULL, SCIPmilpMatrix::rowmatbeg, SCIPmilpMatrix::rowmatcnt, SCIPmilpMatrix::rowmatind, SCIPmilpMatrix::rowmatval, SCIP_CALL, SCIP_OKAY, SCIP_Real, SCIPallocBufferArray, SCIPfreeBufferArray, SCIPisEQ(), SCIPsortIntIntReal(), SCIPsortRealInt(), and TRUE.