6 #ifndef CoinStructuredModel_H 7 #define CoinStructuredModel_H 44 int addBlock(
const std::string &
rowBlock,
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) ;
95 int readSmps(
const char *filename,
96 bool keepNames =
false,
97 bool ignoreErrors =
false);
105 int decompose(
const CoinModel &model,
int type,
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,
118 double objectiveOffset=0.0);
125 inline int numberRowBlocks()
const 127 {
return numberRowBlocks_;}
130 {
return numberColumnBlocks_;}
133 {
return numberElementBlocks_;}
138 {
return rowBlockNames_[i];}
141 { rowBlockNames_[i] = name;}
143 int addRowBlock(
int numberRows,
const std::string &name) ;
145 int rowBlock(
const std::string &name)
const;
148 {
return columnBlockNames_[i];}
151 { columnBlockNames_[i] = name;}
153 int addColumnBlock(
int numberColumns,
const std::string &name) ;
158 {
return blockType_[i];}
161 {
return blocks_[i];}
169 int blockIndex(
int row,
int column)
const;
175 void setCoinModel(
CoinModel * block,
int iBlock);
177 void refresh(
int iBlock);
181 const double * & rowLower,
const double * & rowUpper,
182 const double * & columnLower,
const double * & columnUpper,
183 const double * & objective)
const;
186 return optimizationDirection_;
190 { optimizationDirection_=value;}
227 int numberRowBlocks_;
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.
int numberElementBlocks_
Current number of element blocks.
CoinBaseModel * block(int i) const
Return i'th block.
CoinBaseModel ** blocks_
Blocks.
This is a simple minded model which is stored in a format which makes it easier to construct and modi...
CoinModelBlockInfo * blockType_
Which parts of model are set in block.
int maximumElementBlocks_
Maximum number of element blocks.
std::vector< std::string > rowBlockNames_
Rowblock name.
struct CoinModelInfo2 CoinModelBlockInfo
This is a model which is made up of Coin(Structured)Model blocks.
const std::string & getRowBlock(int i) const
Return the i'th row block name.
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.
CoinModel ** coinModelBlocks_
CoinModel copies of blocks or NULL if original CoinModel.
Sparse Matrix Base Class.
double optimizationDirection() const
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore.
int numberColumnBlocks_
Current number of column blocks.
std::vector< std::string > columnBlockNames_
Columnblock name.
int numberColumnBlocks() const
Return number of column blocks.