6 #ifndef CoinStructuredModel_H 7 #define CoinStructuredModel_H 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) ;
96 bool keepNames =
false,
97 bool ignoreErrors =
false);
106 int maxBlocks=50,
const char ** starts=NULL);
114 const double * rowLower,
const double * rowUpper,
115 const double * columnLower,
const double * columnUpper,
116 const double * objective,
int type,
int maxBlocks=50,
127 {
return numberRowBlocks_;}
130 {
return numberColumnBlocks_;}
133 {
return numberElementBlocks_;}
138 {
return rowBlockNames_[i];}
141 { rowBlockNames_[i] = name;}
145 int rowBlock(
const std::string &name)
const;
148 {
return columnBlockNames_[i];}
151 { columnBlockNames_[i] = name;}
158 {
return blockType_[i];}
161 {
return blocks_[i];}
181 const double * & rowLower,
const double * & rowUpper,
182 const double * & columnLower,
const double * & columnUpper,
183 const double * & objective)
const;
227 int numberRowBlocks_;
230 int numberColumnBlocks_;
232 int numberElementBlocks_;
234 int maximumElementBlocks_;
236 std::vector<std::string> rowBlockNames_;
238 std::vector<std::string> columnBlockNames_;
void refresh(int iBlock)
Refresh info in blockType_.
int rowBlock(const std::string &name) const
Return a row block index given a row block name.
This is a model which is made up of Coin(Structured)Model blocks.
double optimizationDirection_
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
virtual ~CoinStructuredModel()
Destructor.
int numberColumns() const
Return number of columns.
int numberRows() const
Return number of rows.
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
CoinStructuredModel & operator=(const CoinStructuredModel &)
=
const CoinModelBlockInfo & blockType(int i) const
Return i'th block type.
void setCoinModel(CoinModel *block, int iBlock)
Sets given block into coinModelBlocks_.
const std::string & getColumnBlock(int i) const
Return i'th the column block 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 decompose(const CoinModel &model, int type, int maxBlocks=50, const char **starts=NULL)
Decompose a CoinModel 1 - try D-W 2 - try Benders 3 - try Staircase Returns number of blocks or zero ...
int addColumnBlock(int numberColumns, const std::string &name)
Add or check a column block name and number of columns.
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.
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
int numberColumnBlocks() const
Return number of column blocks.
CoinBaseModel * block(int i) const
Return i'th block.
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.
virtual CoinBaseModel * clone() const
Clone.
Sparse Matrix Base Class.
CoinStructuredModel()
Default constructor.
int readSmps(const char *filename, bool keepNames=false, bool ignoreErrors=false)
Read SMPS model.
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...
CoinBigIndex numberElements() const
Return number of elements.
double objectiveOffset() const
Returns the (constant) objective offset This is the RHS entry for the objective row.
CoinBigIndex numberElementBlocks() const
Return number of elementBlocks.
int blockIndex(int row, int column) const
Return block number corresponding to row and column.
CoinModel * coinBlock(int i) const
Return i'th block as CoinModel (or NULL)
const std::string & getRowBlock(int i) const
Return the i'th row block name.