6 #ifndef CoinStructuredModel_H
7 #define CoinStructuredModel_H
55 int addBlock(
const std::string & rowBlock,
56 const std::string & columnBlock,
60 int addBlock(
const std::string & rowBlock,
61 const std::string & columnBlock,
63 const double * rowLower,
const double * rowUpper,
64 const double * columnLower,
const double * columnUpper,
65 const double * objective);
92 int writeMps(
const char *filename,
int compression = 0,
93 int formatType = 0,
int numberAcross = 2,
bool keepStrings=
false) ;
109 const double * rowLower,
const double * rowUpper,
110 const double * columnLower,
const double * columnUpper,
111 const double * objective,
int type,
int maxBlocks=50,
139 int rowBlock(
const std::string &name)
const;
175 const double * & rowLower,
const double * & rowUpper,
176 const double * & columnLower,
const double * & columnUpper,
177 const double * & objective)
const;
void refresh(int iBlock)
Refresh info in blockType_.
This is a model which is made up of Coin(Structured)Model blocks.
const CoinModelBlockInfo & blockType(int i) const
Return i'th block type.
CoinBigIndex numberElementBlocks() const
Return number of elementBlocks.
double optimizationDirection_
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
int numberElementBlocks_
Current number of element blocks.
virtual ~CoinStructuredModel()
Destructor.
CoinBaseModel * block(int i) const
Return i'th block.
int fillInfo(CoinModelBlockInfo &info, const CoinModel *block)
Fill in info structure and update counts Returns number of inconsistencies on border.
CoinBaseModel ** blocks_
Blocks.
virtual CoinBaseModel * clone() const
Clone.
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
CoinStructuredModel & operator=(const CoinStructuredModel &)
=
CoinModelBlockInfo * blockType_
Which parts of model are set in block.
int maximumElementBlocks_
Maximum number of element blocks.
CoinModel * coinBlock(int i) const
Return i'th block as CoinModel (or NULL)
void setCoinModel(CoinModel *block, int iBlock)
Sets given block into coinModelBlocks_.
std::vector< std::string > rowBlockNames_
Rowblock name.
struct CoinModelInfo2 CoinModelBlockInfo
This is a model which is made up of Coin(Structured)Model blocks.
int columnBlock(const std::string &name) const
Return a column block index given a column block name.
int numberColumns() const
Return number of columns.
int addColumnBlock(int numberColumns, const std::string &name)
Add or check a column block name and number of columns.
const std::string & getRowBlock(int i) const
Return the i'th row block name.
CoinModel * coinModelBlock(CoinModelBlockInfo &info)
Return model as a CoinModel block and fill in info structure and update counts.
int addRowBlock(int numberRows, const std::string &name)
Add or check a row block name and number of rows.
int numberRowBlocks() const
Return number of row blocks.
const std::string & getColumnBlock(int i) const
Return i'th the column block name.
void setRowBlock(int i, const std::string &name)
Set i'th row block name.
void setColumnBlock(int i, const std::string &name)
Set i'th column block name.
void setOptimizationDirection(double value)
Set direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
int writeMps(const char *filename, int compression=0, int formatType=0, int numberAcross=2, bool keepStrings=false)
Write the problem in MPS format to a file with the given filename.
CoinModel ** coinModelBlocks_
CoinModel copies of blocks or NULL if original CoinModel.
Sparse Matrix Base Class.
CoinStructuredModel()
Default constructor.
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
int addBlock(const std::string &rowBlock, const std::string &columnBlock, const CoinBaseModel &block)
add a block from a CoinModel using names given as parameters returns number of errors (e...
int decompose(const CoinModel &model, int type, int maxBlocks=50)
Decompose a CoinModel 1 - try D-W 2 - try Benders 3 - try Staircase Returns number of blocks or zero ...
int numberColumnBlocks_
Current number of column blocks.
int blockIndex(int row, int column) const
Return block number corresponding to row and column.
double objectiveOffset() const
Returns the (constant) objective offset This is the RHS entry for the objective row.
int numberRows() const
Return number of rows.
std::vector< std::string > columnBlockNames_
Columnblock name.
CoinBigIndex numberElements() const
Return number of elements.
int rowBlock(const std::string &name) const
Return a row block index given a row block name.
int numberColumnBlocks() const
Return number of column blocks.
int numberRowBlocks_
Current number of row blocks.