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:
colIndex(int)
isBinary
Return true if variable is binary.
bool isBinary(int colIndex)
Parameters:
colIndex(int)
isInteger
Return true if column is integer.
bool isInteger(int colIndex)
Parameters:
colIndex(int)
isIntegerNonBinary
Return true if variable is general integer.
bool isIntegerNonBinary(int colIndex)
Parameters:
colIndex(int)
isFreeBinary
Return true if variable is binary and not fixed at either bound.
bool isFreeBinary(int colIndex)
Parameters:
colIndex(int)
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:
matrix(const CoinPackedMatrix &)collb(const double *)colub(const double *)obj(const double *)rowlb(const double *)rowub(const double *)makeRowCopy(bool)
setNumCols
Set number of columns.
void setNumCols(int value)
Parameters:
value(int)
setNumRows
Set number of rows.
void setNumRows(int value)
Parameters:
value(int)
setNumElements
Set number of nonzero elements.
void setNumElements(int value)
Parameters:
value(int)
setNumIntegers
Set number of integer variables.
void setNumIntegers(int value)
Parameters:
value(int)
setColLower
Set pointer to array[getNumCols()] of column lower bounds.
void setColLower(const double * array, bool copyIn = true)
Parameters:
array(const double *)copyIn(bool)
setColUpper
Set pointer to array[getNumCols()] of column upper bounds.
void setColUpper(const double * array, bool copyIn = true)
Parameters:
array(const double *)copyIn(bool)
setRowLower
Set pointer to array[getNumRows()] of row lower bounds.
void setRowLower(const double * array, bool copyIn = true)
Parameters:
array(const double *)copyIn(bool)
setRowUpper
Set pointer to array[getNumRows()] of row upper bounds.
void setRowUpper(const double * array, bool copyIn = true)
Parameters:
array(const double *)copyIn(bool)
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:
array(const double *)copyIn(bool)
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:
array(const double *)copyIn(bool)
setObjSense
Set objective function sense (1 for min (default), -1 for max)
void setObjSense(double value)
Parameters:
value(double)
setColType
Set colType array ('B', 'I', or 'C' for Binary, Integer and Continuous)
void setColType(const char * array, bool copyIn = true)
Parameters:
array(const char *)copyIn(bool)
setMatrixByRow
Set pointer to row-wise copy of current matrix.
void setMatrixByRow(const CoinPackedMatrix * matrix, bool copyIn = true)
Parameters:
matrix(const CoinPackedMatrix *)copyIn(bool)
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:
matrix(const CoinPackedMatrix *)copyIn(bool)
setOriginalMatrixByRow
Set pointer to row-wise copy of "original" matrix.
void setOriginalMatrixByRow(const CoinPackedMatrix * matrix, bool copyIn = true)
Parameters:
matrix(const CoinPackedMatrix *)copyIn(bool)
setOriginalMatrixByCol
Set pointer to column-wise copy of "original" matrix.
void setOriginalMatrixByCol(const CoinPackedMatrix * matrix, bool copyIn = true)
Parameters:
matrix(const CoinPackedMatrix *)copyIn(bool)
setColSolution
Set pointer to array[getNumCols()] of primal variable values.
void setColSolution(const double * array, bool copyIn = true)
Parameters:
array(const double *)copyIn(bool)
setRowPrice
Set pointer to array[getNumRows()] of dual variable values.
void setRowPrice(const double * array, bool copyIn = true)
Parameters:
array(const double *)copyIn(bool)
setReducedCost
Set a pointer to array[getNumCols()] of reduced costs.
void setReducedCost(const double * array, bool copyIn = true)
Parameters:
array(const double *)copyIn(bool)
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:
array(const double *)copyIn(bool)
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:
array(const double *)copyIn(bool)
setInfinity
Set solver's value for infinity.
void setInfinity(double value)
Parameters:
value(double)
setObjValue
Set objective function value (including any rhs offset)
void setObjValue(double value)
Parameters:
value(double)
setObjOffset
Set objective offset i.e. sum c sub j * x subj -objValue = objOffset.
void setObjOffset(double value)
Parameters:
value(double)
setDualTolerance
Set dual tolerance.
void setDualTolerance(double value)
Parameters:
value(double)
setPrimalTolerance
Set primal tolerance.
void setPrimalTolerance(double value)
Parameters:
value(double)
setIntegerTolerance
Set integer tolerance.
void setIntegerTolerance(double value)
Parameters:
value(double)
setIntegerUpperBound
Set integer upper bound i.e. best solution * getObjSense.
void setIntegerUpperBound(double value)
Parameters:
value(double)
setIntegerLowerBound
Set integer lower bound i.e. best possible solution * getObjSense.
void setIntegerLowerBound(double value)
Parameters:
value(double)
CoinSnapshot
Default Constructor.
CoinSnapshot()
CoinSnapshot
Copy constructor.
CoinSnapshot(const CoinSnapshot & )
Parameters:
- `` (const CoinSnapshot &)
operator=
Assignment operator.
CoinSnapshot & operator=(const CoinSnapshot & rhs)
Parameters:
rhs(const CoinSnapshot &)
~CoinSnapshot
Destructor.
~CoinSnapshot()
Source
Header: layer-0/CoinUtils/src/CoinSnapshot.hpp