|
CoinUtils
trunk
|
In many cases it is natural to build a model by adding one row at a time. More...
#include <CoinBuild.hpp>
Public Member Functions | |
Useful methods | |
| void | addRow (int numberInRow, const int *columns, const double *elements, double rowLower=-COIN_DBL_MAX, double rowUpper=COIN_DBL_MAX) |
| add a row | |
| void | addColumn (int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=COIN_DBL_MAX, double objectiveValue=0.0) |
| add a column | |
| void | addCol (int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=COIN_DBL_MAX, double objectiveValue=0.0) |
| add a column | |
| int | numberRows () const |
| Return number of rows or maximum found so far. | |
| int | numberColumns () const |
| Return number of columns or maximum found so far. | |
| CoinBigIndex | numberElements () const |
| Return number of elements. | |
| int | row (int whichRow, double &rowLower, double &rowUpper, const int *&indices, const double *&elements) const |
| Returns number of elements in a row and information in row. | |
| int | currentRow (double &rowLower, double &rowUpper, const int *&indices, const double *&elements) const |
| Returns number of elements in current row and information in row Used as rows may be stored in a chain. | |
| void | setCurrentRow (int whichRow) |
| Set current row. | |
| int | currentRow () const |
| Returns current row number. | |
| int | column (int whichColumn, double &columnLower, double &columnUpper, double &objectiveValue, const int *&indices, const double *&elements) const |
| Returns number of elements in a column and information in column. | |
| int | currentColumn (double &columnLower, double &columnUpper, double &objectiveValue, const int *&indices, const double *&elements) const |
| Returns number of elements in current column and information in column Used as columns may be stored in a chain. | |
| void | setCurrentColumn (int whichColumn) |
| Set current column. | |
| int | currentColumn () const |
| Returns current column number. | |
| int | type () const |
| Returns type. | |
Constructors, destructor | |
| CoinBuild () | |
| Default constructor. | |
| CoinBuild (int type) | |
| Constructor with type 0==for addRow, 1== for addColumn. | |
| ~CoinBuild () | |
| Destructor. | |
Copy method | |
| CoinBuild (const CoinBuild &) | |
| The copy constructor. | |
| CoinBuild & | operator= (const CoinBuild &) |
| = | |
In many cases it is natural to build a model by adding one row at a time.
In Coin this is inefficient so this class gives some help. An instance of CoinBuild can be built up more efficiently and then added to the Clp/OsiModel in one go.
It may be more efficient to have fewer arrays and re-allocate them but this should give a large gain over addRow.
I have now extended it to columns.
Definition at line 27 of file CoinBuild.hpp.
Default constructor.
| CoinBuild::CoinBuild | ( | int | type | ) |
Constructor with type 0==for addRow, 1== for addColumn.
Destructor.
| CoinBuild::CoinBuild | ( | const CoinBuild & | ) |
The copy constructor.
| void CoinBuild::addRow | ( | int | numberInRow, |
| const int * | columns, | ||
| const double * | elements, | ||
| double | rowLower = -COIN_DBL_MAX, |
||
| double | rowUpper = COIN_DBL_MAX |
||
| ) |
add a row
| void CoinBuild::addColumn | ( | int | numberInColumn, |
| const int * | rows, | ||
| const double * | elements, | ||
| double | columnLower = 0.0, |
||
| double | columnUpper = COIN_DBL_MAX, |
||
| double | objectiveValue = 0.0 |
||
| ) |
add a column
| void CoinBuild::addCol | ( | int | numberInColumn, |
| const int * | rows, | ||
| const double * | elements, | ||
| double | columnLower = 0.0, |
||
| double | columnUpper = COIN_DBL_MAX, |
||
| double | objectiveValue = 0.0 |
||
| ) | [inline] |
add a column
Definition at line 42 of file CoinBuild.hpp.
| int CoinBuild::numberRows | ( | ) | const [inline] |
Return number of rows or maximum found so far.
Definition at line 48 of file CoinBuild.hpp.
| int CoinBuild::numberColumns | ( | ) | const [inline] |
Return number of columns or maximum found so far.
Definition at line 51 of file CoinBuild.hpp.
| CoinBigIndex CoinBuild::numberElements | ( | ) | const [inline] |
Return number of elements.
Definition at line 54 of file CoinBuild.hpp.
| int CoinBuild::row | ( | int | whichRow, |
| double & | rowLower, | ||
| double & | rowUpper, | ||
| const int *& | indices, | ||
| const double *& | elements | ||
| ) | const |
Returns number of elements in a row and information in row.
| int CoinBuild::currentRow | ( | double & | rowLower, |
| double & | rowUpper, | ||
| const int *& | indices, | ||
| const double *& | elements | ||
| ) | const |
Returns number of elements in current row and information in row Used as rows may be stored in a chain.
| void CoinBuild::setCurrentRow | ( | int | whichRow | ) |
Set current row.
| int CoinBuild::currentRow | ( | ) | const |
Returns current row number.
| int CoinBuild::column | ( | int | whichColumn, |
| double & | columnLower, | ||
| double & | columnUpper, | ||
| double & | objectiveValue, | ||
| const int *& | indices, | ||
| const double *& | elements | ||
| ) | const |
Returns number of elements in a column and information in column.
| int CoinBuild::currentColumn | ( | double & | columnLower, |
| double & | columnUpper, | ||
| double & | objectiveValue, | ||
| const int *& | indices, | ||
| const double *& | elements | ||
| ) | const |
Returns number of elements in current column and information in column Used as columns may be stored in a chain.
| void CoinBuild::setCurrentColumn | ( | int | whichColumn | ) |
Set current column.
| int CoinBuild::currentColumn | ( | ) | const |
Returns current column number.
| int CoinBuild::type | ( | ) | const [inline] |
Returns type.
Definition at line 84 of file CoinBuild.hpp.
1.7.6.1