CoinPresolveMatrix

Augments CoinPrePostsolveMatrix with information about the problem that is only needed during presolve.

Augments CoinPrePostsolveMatrix with information about the problem that is only needed during presolve.

Inheritance

Inherits from: CoinPrePostsolveMatrix

Description

For problem manipulation, this class adds a row-major matrix representation, linked lists that allow for easy manipulation of the matrix when applying presolve transforms, and vectors to track row and column processing status (changed, needs further processing, change prohibited) For problem representation, this class adds information about variable type (integer or continuous), an objective offset, and a feasibility tolerance. NOTE that the anyInteger_ and anyProhibited_ flags are independent of the vectors used to track this information for individual variables (integerType_ and rowChanged_ and colChanged_, respectively). NOTE also that at the end of presolve the column-major and row-major matrix representations are loosely packed (i.e., there may be gaps between columns in the bulk storage arrays). NOTE that while you might think that CoinPresolve is prepared to handle minimisation or maximisation, it's unlikely that this still works. This is a good thing: better to convert objective coefficients and duals once, before starting presolve, rather than doing it over and over in each transform that considers dual variables.

Public Methods

change_bias

Adjust objective function constant offset.

void change_bias(double change_amount)

Parameters:

statistics

Say we want statistics - also set time.

void statistics()

feasibilityTolerance

Return feasibility tolerance.

double feasibilityTolerance()

setFeasibilityTolerance

Set feasibility tolerance.

void setFeasibilityTolerance(double val)

Parameters:

status

Returns problem status (0 = feasible, 1 = infeasible, 2 = unbounded)

int status()

setStatus

Set problem status.

void setStatus(int status)

Parameters:

setPass

Set pass number.

void setPass(int pass = 0)

Parameters:

setMaximumSubstitutionLevel

Set Maximum substitution level (normally 3)

void setMaximumSubstitutionLevel(int level)

Parameters:

recomputeSums

Recompute row lhs bounds.

int recomputeSums(int whichRow)

Parameters:

initializeStuff

Allocate scratch arrays.

void initializeStuff()

deleteStuff

Free scratch arrays.

void deleteStuff()

setMatrix

Load the cofficient matrix.

void setMatrix(const CoinPackedMatrix * mtx)

Parameters:

countEmptyRows

Count number of empty rows.

int countEmptyRows()

setVariableType

Set variable type information for a single variable.

void setVariableType(int i, int variableType)

Parameters:

setVariableType

Set variable type information for all variables.

void setVariableType(const unsigned char * variableType, int lenParam)

Parameters:

setVariableType

Set the type of all variables.

void setVariableType(bool allIntegers, int lenParam)

Parameters:

setAnyInteger

Set a flag for presence (true) or absence (false) of integer variables.

void setAnyInteger(bool anyInteger = true)

Parameters:

getRowStarts

Get row start vector for row-major packed matrix.

const CoinBigIndex * getRowStarts()

getColIndicesByRow

Get vector of column indices for row-major packed matrix.

const int * getColIndicesByRow()

getElementsByRow

Get vector of elements for row-major packed matrix.

const double * getElementsByRow()

isInteger

Check for integrality of the specified variable.

bool isInteger(int i)

Parameters:

anyInteger

Check if there are any integer variables.

bool anyInteger()

presolveOptions

Picks up any special options.

int presolveOptions()

setPresolveOptions

Sets any special options (see presolveOptions_)

void setPresolveOptions(int value)

Parameters:

initColsToDo

Initialise the column ToDo lists.

void initColsToDo()

stepColsToDo

Step column ToDo lists.

int stepColsToDo()

numberColsToDo

Return the number of columns on the colsToDo_ list.

int numberColsToDo()

colChanged

Has column been changed?

bool colChanged(int i)

Parameters:

unsetColChanged

Mark column as not changed.

void unsetColChanged(int i)

Parameters:

setColChanged

Mark column as changed.

void setColChanged(int i)

Parameters:

addCol

Mark column as changed and add to list of columns to process next.

void addCol(int i)

Parameters:

colProhibited

Test if column is eligible for preprocessing.

bool colProhibited(int i)

Parameters:

colProhibited2

Test if column is eligible for preprocessing.

bool colProhibited2(int i)

Parameters:

setColProhibited

Mark column as ineligible for preprocessing.

void setColProhibited(int i)

Parameters:

colUsed

Test if column is marked as used.

bool colUsed(int i)

Parameters:

setColUsed

Mark column as used.

void setColUsed(int i)

Parameters:

unsetColUsed

Mark column as unused.

void unsetColUsed(int i)

Parameters:

colInfinite

Has column infinite ub (originally)

bool colInfinite(int i)

Parameters:

unsetColInfinite

Mark column as not infinite ub (originally)

void unsetColInfinite(int i)

Parameters:

setColInfinite

Mark column as infinite ub (originally)

void setColInfinite(int i)

Parameters:

colCanTouch

Test if column can be touched at all.

bool colCanTouch(int i)

Parameters:

colCanTouch2

Test if column can be touched at all.

bool colCanTouch2(int i)

Parameters:

setColLeaveTotallyAlone

Mark column as totally ineligible for preprocessing.

void setColLeaveTotallyAlone(int i)

Parameters:

initRowsToDo

Initialise the row ToDo lists.

void initRowsToDo()

stepRowsToDo

Step row ToDo lists.

int stepRowsToDo()

numberRowsToDo

Return the number of rows on the rowsToDo_ list.

int numberRowsToDo()

rowChanged

Has row been changed?

bool rowChanged(int i)

Parameters:

unsetRowChanged

Mark row as not changed.

void unsetRowChanged(int i)

Parameters:

setRowChanged

Mark row as changed.

void setRowChanged(int i)

Parameters:

addRow

Mark row as changed and add to list of rows to process next.

void addRow(int i)

Parameters:

rowProhibited

Test if row is eligible for preprocessing.

bool rowProhibited(int i)

Parameters:

rowProhibited2

Test if row is eligible for preprocessing.

bool rowProhibited2(int i)

Parameters:

setRowProhibited

Mark row as ineligible for preprocessing.

void setRowProhibited(int i)

Parameters:

rowUsed

Test if row is marked as used.

bool rowUsed(int i)

Parameters:

setRowUsed

Mark row as used.

void setRowUsed(int i)

Parameters:

unsetRowUsed

Mark row as unused.

void unsetRowUsed(int i)

Parameters:

anyProhibited

Check if there are any prohibited rows or columns.

bool anyProhibited()

setAnyProhibited

Set a flag for presence of prohibited rows or columns.

void setAnyProhibited(bool val = true)

Parameters:

CoinPresolveMatrix

Native constructor

 CoinPresolveMatrix(int ncols_alloc, int nrows_alloc, CoinBigIndex nelems_alloc)

Parameters:

~CoinPresolveMatrix

Destructor.

 ~CoinPresolveMatrix()

presolve_no_dups

Check column-major and/or row-major matrices for duplicate entries in the major vectors.

void presolve_no_dups(const CoinPresolveMatrix * preObj, bool doCol = true, bool doRow = true)

Parameters:

Check the links which track storage order for major vectors in the bulk storage area.

void presolve_links_ok(const CoinPresolveMatrix * preObj, bool doCol = true, bool doRow = true)

Parameters:

presolve_no_zeros

Check for explicit zeros in the column- and/or row-major matrices.

void presolve_no_zeros(const CoinPresolveMatrix * preObj, bool doCol = true, bool doRow = true)

Parameters:

presolve_consistent

Checks for equivalence of the column- and row-major matrices.

void presolve_consistent(const CoinPresolveMatrix * preObj, bool chkvals = true)

Parameters:

presolve_check_sol

Check primal solution and architectural variable status.

void presolve_check_sol(const CoinPresolveMatrix * preObj, int chkColSol = 2, int chkRowAct = 1, int chkStatus = 1)

Parameters:

presolve_check_nbasic

Check for the proper number of basic variables.

void presolve_check_nbasic(const CoinPresolveMatrix * preObj)

Parameters:

Source

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