CoinSnapshot

NON Abstract Base Class for interfacing with cut generators or branching code or ... It is designed to be snapshot of a problem at a node in tree.

NON Abstract Base Class for interfacing with cut generators or branching code or ... It is designed to be snapshot of a problem at a node in tree.

Description

The class may or may not own the arrays - see owned_ Querying a problem that has no data associated with it will result in zeros for the number of rows and columns, and NULL pointers from the methods that return arrays.

Public Methods

getNumCols

Get number of columns.

int getNumCols()

getNumRows

Get number of rows.

int getNumRows()

getNumElements

Get number of nonzero elements.

int getNumElements()

getNumIntegers

Get number of integer variables.

int getNumIntegers()

getColLower

Get pointer to array[getNumCols()] of column lower bounds.

const double * getColLower()

getColUpper

Get pointer to array[getNumCols()] of column upper bounds.

const double * getColUpper()

getRowLower

Get pointer to array[getNumRows()] of row lower bounds.

const double * getRowLower()

getRowUpper

Get pointer to array[getNumRows()] of row upper bounds.

const double * getRowUpper()

getRightHandSide

Get pointer to array[getNumRows()] of row right-hand sides This gives same results as OsiSolverInterface for useful cases If getRowUpper()[i] != infinity then getRightHandSide()[i] == getRowUpper()[i] else getRightHandSide()[i] == getRowLower()[i].

const double * getRightHandSide()

getObjCoefficients

Get pointer to array[getNumCols()] of objective function coefficients.

const double * getObjCoefficients()

getObjSense

Get objective function sense (1 for min (default), -1 for max)

double getObjSense()

isContinuous

Return true if variable is continuous.

bool isContinuous(int colIndex)

Parameters:

isBinary

Return true if variable is binary.

bool isBinary(int colIndex)

Parameters:

isInteger

Return true if column is integer.

bool isInteger(int colIndex)

Parameters:

isIntegerNonBinary

Return true if variable is general integer.

bool isIntegerNonBinary(int colIndex)

Parameters:

isFreeBinary

Return true if variable is binary and not fixed at either bound.

bool isFreeBinary(int colIndex)

Parameters:

getColType

Get colType array ('B', 'I', or 'C' for Binary, Integer and Continuous)

const char * getColType()

getMatrixByRow

Get pointer to row-wise copy of current matrix.

const CoinPackedMatrix * getMatrixByRow()

getMatrixByCol

Get pointer to column-wise copy of current matrix.

const CoinPackedMatrix * getMatrixByCol()

getOriginalMatrixByRow

Get pointer to row-wise copy of "original" matrix.

const CoinPackedMatrix * getOriginalMatrixByRow()

getOriginalMatrixByCol

Get pointer to column-wise copy of "original" matrix.

const CoinPackedMatrix * getOriginalMatrixByCol()

getColSolution

Get pointer to array[getNumCols()] of primal variable values.

const double * getColSolution()

getRowPrice

Get pointer to array[getNumRows()] of dual variable values.

const double * getRowPrice()

getReducedCost

Get a pointer to array[getNumCols()] of reduced costs.

const double * getReducedCost()

getRowActivity

Get pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vector).

const double * getRowActivity()

getDoNotSeparateThis

Get pointer to array[getNumCols()] of primal variable values which should not be separated (for debug)

const double * getDoNotSeparateThis()

getInfinity

Get solver's value for infinity.

double getInfinity()

getObjValue

Get objective function value - includinbg any offset i.e.

double getObjValue()

getObjOffset

Get objective offset i.e. sum c sub j * x subj -objValue = objOffset.

double getObjOffset()

getDualTolerance

Get dual tolerance.

double getDualTolerance()

getPrimalTolerance

Get primal tolerance.

double getPrimalTolerance()

getIntegerTolerance

Get integer tolerance.

double getIntegerTolerance()

getIntegerUpperBound

Get integer upper bound i.e. best solution * getObjSense.

double getIntegerUpperBound()

getIntegerLowerBound

Get integer lower bound i.e. best possible solution * getObjSense.

double getIntegerLowerBound()

loadProblem

Load in an problem by copying the arguments (the constraints on the rows are given by lower and upper bounds).

void loadProblem(const CoinPackedMatrix & matrix, const double * collb, const double * colub, const double * obj, const double * rowlb, const double * rowub, bool makeRowCopy = false)

Parameters:

setNumCols

Set number of columns.

void setNumCols(int value)

Parameters:

setNumRows

Set number of rows.

void setNumRows(int value)

Parameters:

setNumElements

Set number of nonzero elements.

void setNumElements(int value)

Parameters:

setNumIntegers

Set number of integer variables.

void setNumIntegers(int value)

Parameters:

setColLower

Set pointer to array[getNumCols()] of column lower bounds.

void setColLower(const double * array, bool copyIn = true)

Parameters:

setColUpper

Set pointer to array[getNumCols()] of column upper bounds.

void setColUpper(const double * array, bool copyIn = true)

Parameters:

setRowLower

Set pointer to array[getNumRows()] of row lower bounds.

void setRowLower(const double * array, bool copyIn = true)

Parameters:

setRowUpper

Set pointer to array[getNumRows()] of row upper bounds.

void setRowUpper(const double * array, bool copyIn = true)

Parameters:

setRightHandSide

Set pointer to array[getNumRows()] of row right-hand sides This gives same results as OsiSolverInterface for useful cases If getRowUpper()[i] != infinity then getRightHandSide()[i] == getRowUpper()[i] else getRightHandSide()[i] == getRowLower()[i].

void setRightHandSide(const double * array, bool copyIn = true)

Parameters:

createRightHandSide

Create array[getNumRows()] of row right-hand sides using existing information This gives same results as OsiSolverInterface for useful cases If getRowUpper()[i] != infinity then getRightHandSide()[i] == getRowUpper()[i] else getRightHandSide()[i] == getRowLower()[i].

void createRightHandSide()

setObjCoefficients

Set pointer to array[getNumCols()] of objective function coefficients.

void setObjCoefficients(const double * array, bool copyIn = true)

Parameters:

setObjSense

Set objective function sense (1 for min (default), -1 for max)

void setObjSense(double value)

Parameters:

setColType

Set colType array ('B', 'I', or 'C' for Binary, Integer and Continuous)

void setColType(const char * array, bool copyIn = true)

Parameters:

setMatrixByRow

Set pointer to row-wise copy of current matrix.

void setMatrixByRow(const CoinPackedMatrix * matrix, bool copyIn = true)

Parameters:

createMatrixByRow

Create row-wise copy from MatrixByCol.

void createMatrixByRow()

setMatrixByCol

Set pointer to column-wise copy of current matrix.

void setMatrixByCol(const CoinPackedMatrix * matrix, bool copyIn = true)

Parameters:

setOriginalMatrixByRow

Set pointer to row-wise copy of "original" matrix.

void setOriginalMatrixByRow(const CoinPackedMatrix * matrix, bool copyIn = true)

Parameters:

setOriginalMatrixByCol

Set pointer to column-wise copy of "original" matrix.

void setOriginalMatrixByCol(const CoinPackedMatrix * matrix, bool copyIn = true)

Parameters:

setColSolution

Set pointer to array[getNumCols()] of primal variable values.

void setColSolution(const double * array, bool copyIn = true)

Parameters:

setRowPrice

Set pointer to array[getNumRows()] of dual variable values.

void setRowPrice(const double * array, bool copyIn = true)

Parameters:

setReducedCost

Set a pointer to array[getNumCols()] of reduced costs.

void setReducedCost(const double * array, bool copyIn = true)

Parameters:

setRowActivity

Set pointer to array[getNumRows()] of row activity levels (constraint matrix times the solution vector).

void setRowActivity(const double * array, bool copyIn = true)

Parameters:

setDoNotSeparateThis

Set pointer to array[getNumCols()] of primal variable values which should not be separated (for debug)

void setDoNotSeparateThis(const double * array, bool copyIn = true)

Parameters:

setInfinity

Set solver's value for infinity.

void setInfinity(double value)

Parameters:

setObjValue

Set objective function value (including any rhs offset)

void setObjValue(double value)

Parameters:

setObjOffset

Set objective offset i.e. sum c sub j * x subj -objValue = objOffset.

void setObjOffset(double value)

Parameters:

setDualTolerance

Set dual tolerance.

void setDualTolerance(double value)

Parameters:

setPrimalTolerance

Set primal tolerance.

void setPrimalTolerance(double value)

Parameters:

setIntegerTolerance

Set integer tolerance.

void setIntegerTolerance(double value)

Parameters:

setIntegerUpperBound

Set integer upper bound i.e. best solution * getObjSense.

void setIntegerUpperBound(double value)

Parameters:

setIntegerLowerBound

Set integer lower bound i.e. best possible solution * getObjSense.

void setIntegerLowerBound(double value)

Parameters:

CoinSnapshot

Default Constructor.

 CoinSnapshot()

CoinSnapshot

Copy constructor.

 CoinSnapshot(const CoinSnapshot & )

Parameters:

operator=

Assignment operator.

CoinSnapshot & operator=(const CoinSnapshot & rhs)

Parameters:

~CoinSnapshot

Destructor.

 ~CoinSnapshot()

Source

Header: layer-0/CoinUtils/src/CoinSnapshot.hpp