CoinStructuredModel

CoinStructuredModel class documentation

Inheritance

Inherits from: CoinBaseModel

Public Methods

addBlock

add a block from a CoinModel using names given as parameters returns number of errors (e.g.

int addBlock(const std::string & rowBlock, const std::string & columnBlock, const CoinBaseModel & block)

Parameters:

addBlock

add a block from a CoinModel with names in model returns number of errors (e.g.

int addBlock(const CoinBaseModel & block)

Parameters:

addBlock

add a block from a CoinModel using names given as parameters returns number of errors (e.g.

int addBlock(const std::string & rowBlock, const std::string & columnBlock, CoinBaseModel * block)

Parameters:

addBlock

add a block using names

int addBlock(const std::string & rowBlock, const std::string & columnBlock, const CoinPackedMatrix & matrix, const double * rowLower, const double * rowUpper, const double * columnLower, const double * columnUpper, const double * objective)

Parameters:

writeMps

Write the problem in MPS format to a file with the given filename.

int writeMps(const char * filename, int compression = 0, int formatType = 0, int numberAcross = 2, bool keepStrings = false)

Parameters:

readSmps

Read SMPS model.

int readSmps(const char * filename, bool keepNames = false, bool ignoreErrors = false)

Parameters:

decompose

Decompose a CoinModel 1 - try D-W 2 - try Benders 3 - try Staircase Returns number of blocks or zero if no structure.

int decompose(const CoinModel & model, int type, int maxBlocks = 50, const char ** starts = NULL)

Parameters:

decompose

Decompose a model specified as arrays + CoinPackedMatrix 1 - try D-W 2 - try Benders 3 - try Staircase Returns number of blocks or zero if no structure.

int decompose(const CoinPackedMatrix & matrix, const double * rowLower, const double * rowUpper, const double * columnLower, const double * columnUpper, const double * objective, int type, int maxBlocks = 50, int * starts = NULL, double objectiveOffset = 0.0)

Parameters:

numberRowBlocks

Return number of row blocks.

int numberRowBlocks()

numberColumnBlocks

Return number of column blocks.

int numberColumnBlocks()

numberElementBlocks

Return number of elementBlocks.

int numberElementBlocks()

numberElements

Return number of elements.

CoinBigIndex numberElements()

getRowBlock

Return the i'th row block name.

const std::string & getRowBlock(int i)

Parameters:

setRowBlock

Set i'th row block name.

void setRowBlock(int i, const std::string & name)

Parameters:

addRowBlock

Add or check a row block name and number of rows.

int addRowBlock(int numberRows, const std::string & name)

Parameters:

rowBlock

Return a row block index given a row block name.

int rowBlock(const std::string & name)

Parameters:

getColumnBlock

Return i'th the column block name.

const std::string & getColumnBlock(int i)

Parameters:

setColumnBlock

Set i'th column block name.

void setColumnBlock(int i, const std::string & name)

Parameters:

addColumnBlock

Add or check a column block name and number of columns.

int addColumnBlock(int numberColumns, const std::string & name)

Parameters:

columnBlock

Return a column block index given a column block name.

int columnBlock(const std::string & name)

Parameters:

blockType

Return i'th block type.

const CoinModelBlockInfo & blockType(int i)

Parameters:

block

Return i'th block.

CoinBaseModel * block(int i)

Parameters:

block

Return block corresponding to row and column.

const CoinBaseModel * block(int row, int column)

Parameters:

coinBlock

Return i'th block as CoinModel (or NULL)

CoinModel * coinBlock(int i)

Parameters:

coinBlock

Return block corresponding to row and column as CoinModel.

const CoinBaseModel * coinBlock(int row, int column)

Parameters:

blockIndex

Return block number corresponding to row and column.

int blockIndex(int row, int column)

Parameters:

coinModelBlock

Return model as a CoinModel block and fill in info structure and update counts.

CoinModel * coinModelBlock(CoinModelBlockInfo & info)

Parameters:

setCoinModel

Sets given block into coinModelBlocks_.

void setCoinModel(CoinModel * block, int iBlock)

Parameters:

refresh

Refresh info in blockType_.

void refresh(int iBlock)

Parameters:

block

Fill pointers corresponding to row and column.

CoinModelBlockInfo block(int row, int column, const double *& rowLower, const double *& rowUpper, const double *& columnLower, const double *& columnUpper, const double *& objective)

Parameters:

optimizationDirection

Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.

double optimizationDirection()

setOptimizationDirection

Set direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.

void setOptimizationDirection(double value)

Parameters:

CoinStructuredModel

Default constructor.

 CoinStructuredModel()

CoinStructuredModel

Read a problem in MPS format from the given filename.

 CoinStructuredModel(const char * fileName, int decompose = 0, int maxBlocks = 50)

Parameters:

~CoinStructuredModel

Destructor.

 ~CoinStructuredModel()

CoinStructuredModel

The copy constructor.

 CoinStructuredModel(const CoinStructuredModel & )

Parameters:

operator=

=

CoinStructuredModel & operator=(const CoinStructuredModel & )

Parameters:

clone

Clone.

CoinBaseModel * clone()

Source

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