LPRowSetBase< R > Class Template Reference Set of LP rows.Class LPRowSetBase implements a set of LPRowBase%s. Unless for memory limitations, any number of LPRowBases may be added to an LPRowSetBase. Single or multiple LPRowBases may be added to an LPRowSetBase, where each method add() comes with two different signatures. One with and one without a parameter, used for returning the Keys assigned to the new LPRowBases by the set. See DataKey for a more detailed description of the concept of keys. For the concept of renumbering LPRowBases within an LPRowSetBase after removal of some LPRows see DataSet. More...
Inheritance diagram for LPRowSetBase< R >:
![]()
Detailed Descriptiontemplate<class R>
|
|
explicit |
Default constructor.
The user can specify the initial maximum number of rows max
and the initial maximum number of nonzero entries memmax
. If these parameters are omitted, a default size is used. However, one can add an arbitrary number of rows to the LPRowSetBase, which may result in automated memory realllocation.
Definition at line 652 of file lprowsetbase.h.
LPRowSetBase | ( | const LPRowSetBase< R > & | rs | ) |
Copy constructor.
Definition at line 692 of file lprowsetbase.h.
LPRowSetBase | ( | const LPRowSetBase< S > & | rs | ) |
Copy constructor.
Definition at line 703 of file lprowsetbase.h.
|
virtual |
Destructor.
Definition at line 713 of file lprowsetbase.h.
void add | ( | const LPRowBase< R > & | row | ) |
Definition at line 319 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::add(), SPxLPBase< Real >::addRow(), SoPlex::addRowRational(), SPxLPBase< Real >::addRows(), SPxLPBase< Real >::doAddCols(), SPxLPBase< Real >::doAddRow(), SPxLPBase< Real >::doAddRows(), soplex::MPSreadRows(), and SPxLPBase< R >::readLPF().
Adds row
to LPRowSetBase.
Definition at line 326 of file lprowsetbase.h.
void add | ( | const R & | plhs, |
const SVectorBase< R > & | prowVector, | ||
const R & | prhs, | ||
const R & | pobj = 0 |
||
) |
Adds LPRowBase consisting of left hand side lhs
, row vector rowVector
, and right hand side rhs
to LPRowSetBase.
Definition at line 332 of file lprowsetbase.h.
void add | ( | const S * | lhsValue, |
const S * | rowValues, | ||
const int * | rowIndices, | ||
int | rowSize, | ||
const S * | rhsValue, | ||
const S * | objValue = 0 |
||
) |
Adds LPRowBase consisting of left hand side lhs
, row vector rowVector
, and right hand side rhs
to LPRowSetBase.
Definition at line 340 of file lprowsetbase.h.
void add | ( | DataKey & | newkey, |
const S * | lhsValue, | ||
const S * | rowValues, | ||
const int * | rowIndices, | ||
int | rowSize, | ||
const S * | rhsValue, | ||
const S * | objValue = 0 |
||
) |
Adds LPRowBase consisting of left hand side lhs
, row vector rowVector
, and right hand side rhs
to LPRowSetBase, with DataKey key
.
Definition at line 354 of file lprowsetbase.h.
void add | ( | DataKey & | newkey, |
const R & | newlhs, | ||
const SVectorBase< R > & | newrowVector, | ||
const R & | newrhs, | ||
const R & | newobj = 0 |
||
) |
Adds LPRowBase consisting of left hand side lhs
, row vector rowVector
, and right hand side rhs
to LPRowSetBase, with DataKey key
.
Definition at line 380 of file lprowsetbase.h.
void add | ( | const LPRowSetBase< R > & | newset | ) |
Definition at line 397 of file lprowsetbase.h.
void add | ( | DataKey | keys[], |
const LPRowSetBase< R > & | set | ||
) |
Adds all LPRowBases of set
to LPRowSetBase.
Definition at line 419 of file lprowsetbase.h.
void add2 | ( | const DataKey & | k, |
int | n, | ||
const int | idx[], | ||
const R | val[] | ||
) |
Adds n
nonzero (idx
, val
)-pairs to rowVector with DataKey k
.
Definition at line 442 of file lprowsetbase.h.
Referenced by SPxLPBase< Real >::addCol(), SPxLPBase< Real >::changeCol(), SPxLPBase< Real >::changeElement(), SPxLPBase< Real >::changeRow(), and SPxLPBase< Real >::doAddCol().
void add2 | ( | int | i, |
int | n, | ||
const int | idx[], | ||
const R | val[] | ||
) |
Adds n
nonzero (idx
, val
)-pairs to i
'th rowVector.
Definition at line 448 of file lprowsetbase.h.
void add2 | ( | int | i, |
int | n, | ||
const int | idx[], | ||
const S | val[] | ||
) |
Adds n
nonzero (idx
, val
)-pairs to i
'th rowVector.
Definition at line 455 of file lprowsetbase.h.
void clear | ( | ) |
Removes all LPRowBases.
Definition at line 565 of file lprowsetbase.h.
Referenced by SPxLPBase< Real >::clear().
SVectorBase<R>& create | ( | int | pnonzeros = 0 , |
const R & | plhs = 0 , |
||
const R & | prhs = 1 , |
||
const R & | pobj = 0 |
||
) |
Creates new LPRowBase with specified parameters and returns a reference to its row vector.
Definition at line 461 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::create().
SVectorBase<R>& create | ( | DataKey & | newkey, |
int | nonzeros = 0 , |
||
const R & | newlhs = 0 , |
||
const R & | newrhs = 1 , |
||
const R & | newobj = 0 |
||
) |
Creates new LPRowBase with specified parameters and returns a reference to its row vector.
Definition at line 468 of file lprowsetbase.h.
bool has | ( | const DataKey & | k | ) | const |
does DataKey k
belong to LPRowSetBase ?
Definition at line 302 of file lprowsetbase.h.
bool isConsistent | ( | ) | const |
Checks consistency.
Definition at line 622 of file lprowsetbase.h.
Referenced by SPxLPBase< Real >::isConsistent(), LPRowSetBase< Real >::LPRowSetBase(), and LPRowSetBase< Real >::operator=().
DataKey key | ( | int | i | ) | const |
Returns the DataKey of the i
'th LPRowBase in LPRowSetBase.
Definition at line 290 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::add().
const VectorBase<R>& lhs | ( | ) | const |
Returns the vector of lhs values.
Definition at line 93 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::add(), SoPlex::addRowsRational(), SoPlex::addRowsReal(), SPxLPBase< Real >::lhs(), soplex::MPSreadRanges(), soplex::MPSreadRhs(), LPRowSetBase< Real >::setType(), LPRowSetBase< Real >::type(), and LPRowSetBase< Real >::value().
const R& lhs | ( | int | i | ) | const |
Returns the lhs of the i
'th LPRowBase.
Definition at line 105 of file lprowsetbase.h.
const R& lhs | ( | const DataKey & | k | ) | const |
Returns the lhs of the LPRowBase with DataKey k
in LPRowSetBase.
Definition at line 117 of file lprowsetbase.h.
VectorBase<R>& lhs_w | ( | ) |
Returns the vector of lhs values.
Definition at line 99 of file lprowsetbase.h.
Referenced by SPxLPBase< Real >::changeLhs(), SPxLPBase< Real >::changeRange(), SPxLPBase< Real >::lhs_w(), soplex::MPSreadRanges(), soplex::MPSreadRhs(), and LPRowSetBase< Real >::setType().
R& lhs_w | ( | int | i | ) |
Returns the lhs of the i
'th LPRowBase.
Definition at line 111 of file lprowsetbase.h.
R& lhs_w | ( | const DataKey & | k | ) |
Returns the lhs of the LPRowBase with DataKey k
in LPRowSetBase.
Definition at line 123 of file lprowsetbase.h.
int max | ( | ) | const |
Returns the maximum number of LPRowBases that fit.
Definition at line 87 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::reMax().
int memMax | ( | ) | const |
Returns length of nonzero memory.
Definition at line 599 of file lprowsetbase.h.
void memPack | ( | ) |
Garbage collection in nonzero memory.
Definition at line 611 of file lprowsetbase.h.
void memRemax | ( | int | newmax | ) |
Reallocates memory to be able to store newmax
nonzeros.
Definition at line 605 of file lprowsetbase.h.
Referenced by SPxLPBase< Real >::addRows().
int memSize | ( | ) | const |
Returns number of used nonzero entries.
Definition at line 593 of file lprowsetbase.h.
int num | ( | ) | const |
Returns the number of LPRowBases in LPRowSetBase.
Definition at line 81 of file lprowsetbase.h.
Referenced by SoPlex::_addRowsReal(), LPRowSetBase< Real >::add(), SoPlex::addRowsRational(), SoPlex::addRowsReal(), LPRowSetBase< Real >::clear(), LPRowSetBase< Real >::create(), LPRowSetBase< Real >::isConsistent(), soplex::MPSreadCols(), soplex::MPSreadRows(), SPxLPBase< Real >::nRows(), SPxLPBase< R >::readLPF(), SPxLPBase< R >::readMPS(), and LPRowSetBase< Real >::remove().
int number | ( | const DataKey & | k | ) | const |
Returns the number of the LPRowBase with DataKey k
in LPRowSetBase.
Definition at line 296 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::lhs(), LPRowSetBase< Real >::lhs_w(), SPxLPBase< Real >::number(), LPRowSetBase< Real >::obj(), LPRowSetBase< Real >::obj_w(), LPRowSetBase< Real >::remove(), LPRowSetBase< Real >::rhs(), LPRowSetBase< Real >::rhs_w(), LPRowSetBase< Real >::type(), and LPRowSetBase< Real >::value().
const VectorBase<R>& obj | ( | ) | const |
Returns the vector of objective coefficients.
Definition at line 165 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::add(), SPxLPBase< Real >::getCol(), SPxLPBase< Real >::getCols(), SPxLPBase< Real >::getRowObj(), and SPxLPBase< Real >::maxRowObj().
const R& obj | ( | int | i | ) | const |
Returns the objective coefficient of the i
'th LPRowBase.
Definition at line 177 of file lprowsetbase.h.
const R& obj | ( | const DataKey & | k | ) | const |
Returns the objective coefficient of the LPRowBase with DataKey k
in LPRowSetBase.
Definition at line 189 of file lprowsetbase.h.
VectorBase<R>& obj_w | ( | ) |
Returns the vector of objective coefficients (writeable).
Definition at line 171 of file lprowsetbase.h.
Referenced by SPxLPBase< Real >::changeRowObj(), SPxLPBase< Real >::changeSense(), SPxLPBase< Real >::clearRowObjs(), and SPxLPBase< Real >::maxRowObj_w().
R& obj_w | ( | int | i | ) |
Returns the objective coefficient of the i
'th LPRowBase (writeable).
Definition at line 183 of file lprowsetbase.h.
R& obj_w | ( | const DataKey & | k | ) |
Returns the objective coefficient of the LPRowBase with DataKey k
in LPRowSetBase (writeable).
Definition at line 195 of file lprowsetbase.h.
LPRowSetBase<R>& operator= | ( | const LPRowSetBase< R > & | rs | ) |
Assignment operator.
Definition at line 659 of file lprowsetbase.h.
Referenced by SPxLPBase< Real >::operator=().
LPRowSetBase<R>& operator= | ( | const LPRowSetBase< S > & | rs | ) |
Assignment operator.
Definition at line 676 of file lprowsetbase.h.
void reMax | ( | int | newmax = 0 | ) |
Reallocates memory to be able to store newmax
LPRowBases.
Definition at line 584 of file lprowsetbase.h.
void remove | ( | int | i | ) |
Removes i
'th LPRowBase.
Definition at line 495 of file lprowsetbase.h.
Referenced by SPxLPBase< Real >::doRemoveRow(), and SPxLPBase< Real >::doRemoveRows().
void remove | ( | const DataKey & | k | ) |
Removes LPRowBase with DataKey k
.
Definition at line 507 of file lprowsetbase.h.
void remove | ( | int | perm[] | ) |
Removes multiple LPRowBases.
Definition at line 513 of file lprowsetbase.h.
void remove | ( | const int | nums[], |
int | n | ||
) |
Removes n
LPRowBases with row numbers given by nums
.
Definition at line 535 of file lprowsetbase.h.
void remove | ( | const int | nums[], |
int | n, | ||
int * | perm | ||
) |
Removes n
LPRowBases with row numbers given by nums
, Stores permutation of row indices in perm
.
Definition at line 543 of file lprowsetbase.h.
const VectorBase<R>& rhs | ( | ) | const |
Returns the vector of rhs values.
Definition at line 129 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::add(), SoPlex::addRowsRational(), SoPlex::addRowsReal(), soplex::MPSreadRanges(), soplex::MPSreadRhs(), SPxLPBase< Real >::rhs(), LPRowSetBase< Real >::setType(), LPRowSetBase< Real >::type(), and LPRowSetBase< Real >::value().
const R& rhs | ( | int | i | ) | const |
Returns the rhs of the i
'th LPRowBase.
Definition at line 141 of file lprowsetbase.h.
const R& rhs | ( | const DataKey & | k | ) | const |
Returns the rhs of the LPRowBase with DataKey k
in LPRowSetBase.
Definition at line 153 of file lprowsetbase.h.
VectorBase<R>& rhs_w | ( | ) |
Returns the vector of rhs values (writeable).
Definition at line 135 of file lprowsetbase.h.
Referenced by SPxLPBase< Real >::changeRange(), SPxLPBase< Real >::changeRhs(), soplex::MPSreadRanges(), soplex::MPSreadRhs(), SPxLPBase< Real >::rhs_w(), and LPRowSetBase< Real >::setType().
R& rhs_w | ( | int | i | ) |
Returns the rhs of the i
'th LPRowBase (writeable).
Definition at line 147 of file lprowsetbase.h.
R& rhs_w | ( | const DataKey & | k | ) |
Returns the rhs of the LPRowBase with DataKey k
in LPRowSetBase (writeable).
Definition at line 159 of file lprowsetbase.h.
|
protected |
Returns the complete SVSet.
Definition at line 67 of file lprowsetbase.h.
Referenced by SPxEquiliSC::scale(), and SPxGeometSC::scale().
const SVectorBase<R>& rowVector | ( | int | i | ) | const |
Returns the rowVector of the i
'th LPRowBase.
Definition at line 207 of file lprowsetbase.h.
Referenced by SPxLPBase< Real >::rowVector().
const SVectorBase<R>& rowVector | ( | const DataKey & | k | ) | const |
Returns the rowVector of the LPRowBase with DataKey k
.
Definition at line 219 of file lprowsetbase.h.
SVectorBase<R>& rowVector_w | ( | int | i | ) |
Returns a writable rowVector of the i
'th LPRowBase.
Definition at line 201 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::add2(), SPxLPBase< Real >::rowVector_w(), and LPRowSetBase< Real >::xtend().
SVectorBase<R>& rowVector_w | ( | const DataKey & | k | ) |
Returns a writable rowVector of the LPRowBase with DataKey k
.
Definition at line 213 of file lprowsetbase.h.
void setType | ( | int | i, |
typename LPRowBase< R >::Type | t | ||
) |
Changes the inequality type of row i
to type
.
Definition at line 244 of file lprowsetbase.h.
LPRowBase<R>::Type type | ( | int | i | ) | const |
Returns the inequalitiy type of the i
'th LPRowBase.
Definition at line 225 of file lprowsetbase.h.
Referenced by SPxLPBase< Real >::number(), SPxLPBase< Real >::rowType(), and LPRowSetBase< Real >::type().
Returns the inequality type of the LPRowBase with DataKey k
.
Definition at line 238 of file lprowsetbase.h.
const R& value | ( | int | i | ) | const |
Returns the value of the i'th
LPRowBase.
Definition at line 269 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::value().
const R& value | ( | const DataKey & | k | ) | const |
Returns the value of the LPRowBase with DataKey k
.
The value of a row depends on its type: if the inequality is of type "greater or equal", the value is the lhs of the row. Otherwise, the value is the rhs.
Definition at line 284 of file lprowsetbase.h.
void xtend | ( | int | n, |
int | newmax | ||
) |
Extends row n
to fit newmax
nonzeros.
Definition at line 430 of file lprowsetbase.h.
Referenced by SPxLPBase< Real >::addCols(), and SPxLPBase< Real >::doAddCols().
void xtend | ( | const DataKey & | pkey, |
int | pnewmax | ||
) |
Extends row with DataKey key
to fit newmax
nonzeros.
Definition at line 436 of file lprowsetbase.h.
|
friend |
Definition at line 46 of file lprowsetbase.h.
|
private |
vector of left hand sides (lower bounds) of LPRowBases.
Definition at line 54 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::lhs(), LPRowSetBase< Real >::lhs_w(), and LPRowSetBase< Real >::operator=().
|
private |
vector of objective coefficients.
Definition at line 56 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::obj(), LPRowSetBase< Real >::obj_w(), and LPRowSetBase< Real >::operator=().
|
private |
vector of right hand sides (upper bounds) of LPRowBases.
Definition at line 55 of file lprowsetbase.h.
Referenced by LPRowSetBase< Real >::operator=(), LPRowSetBase< Real >::rhs(), and LPRowSetBase< Real >::rhs_w().