class SPxBasis simplex basis
| | Basis descriptor
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | Basis status
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | Control Parameters
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | Inquiry Methods
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | Linear Algebra
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | Miscellaneous
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| | Modification. |
simplex basis. Consider the linear program as provided from class SPxLPwhere $c, l_c, u_c, x \in R^n$, $l_r, u_r \in R^m$ and $A \in R^{m \times n}$. Solving this LP with the simplex algorithm requires the definition of a basis. Such can be defined as a set of column vectors or a set of row vectors building a nonsingular matrix. We will refer to the first case as the columnwise representation and the latter case will be called the rowwise representation. In both cases, a basis is a set of vectors forming a nonsigular matrix. The dimension of the vectors is refferred to as the basis' dimension, whereas the number of vectors belonging to the LP is called the basis' codimension. Class SPxBasis is designed to represent a generic simplex basis, suitable for both representations. At any time the representation can be changed by calling method setRep().
Class SPxBasis provides methods for solving linear systems with the basis matrix. However, SPxBasis does not provide a linear solver by its own. Instead, a SLinSolver object must be loaded to a SPxBasis which will be called for solving linear systems.
SINGULAR
REGULAR
DUAL
PRIMAL
OPTIMAL
Variables and covariables may have a primal or dual Status. The first type specifies that a variable is set on a primal bound, while the later type indicates a dual variable to be set on a bound. If a row variable has a primal status, P_ON_UPPER say, this means that the upper bound of the inequality is set to be tight. Hence, in this case the upper bound must not be infinity.
Equivalently, if the status of a variable is dual, D_ON_UPPER say, it means that the dual variable corresponding to the upper bound inequality of this variable is set to 0.
For a column basis, primal Status's correspond to nonbasic variables, while dual ones are basic. This is reversed for a row basis. We will now reveil in more detail the significance of variable Status's.
Primal Variables
Let consider a range inequality $l_r \le a^T x \le u_r$ or bounds on
a variable $l_c \le x_c \le u_c$ The following table reveils what is
implied if the corresponding variable or covariable is assigned to a
primal Status:
| $l_c \le x_c \le u_c$ | Status($x_i$) | $l_r \le a^T x \le u_r$ |
| $x_c = u_c < \infty$ | P_ON_UPPER | $a^T x = u_r < \infty$ | $x_c = l_c > -\infty$ | P_ON_LOWER | $a^T x = l_r > -\infty$ | $-\infty < l_c = x_c = u_c < \infty$ | P_FIXED | $-\infty < l_r = a^T x = u_r < \infty$ | $-\infty = l_i < x_i=0 < u_i = \infty$ | P_FREE | $-\infty = l_r < a^T x = 0 < u_r = \infty$ |
Note that to determine if a variable with Status stat is set to its upper bound, on can compute the following test: (-stat | -P_ON_UPPER). This will yield true even if the variable is fixed, i.e. sitting on both bounds at the same time.
Dual Variables
In principle for implementing the Simplex algorithm it would suffice
to use only one dual Status. However, for performance reasons it
is advisable to introduce various dual Status types, reflecting
the structure of the bounds. Given an upper bound $u$ and a lower
bound $l$ of a constraint or variable, the following table indicates
the setting of the dual Status of this variable.
| $l \le ... \le u$ | Status |
| $-\infty < l \ne u < \infty$ | D_ON_BOTH | $-\infty < l \ne u = \infty$ | D_ON_UPPER | $-\infty = l \ne u < \infty$ | D_ON_LOWER | $-\infty < l = u < \infty$ | D_FREE | $-\infty = l \ne u = \infty$ | D_UNDEFINED |
Note that unbounded primal variables are reflected by an D_UNDEFINED dual variable, since no DUAL variables exist to them. To facilate the assignment of dual Status's, class SPxBasis provides methods dualStatus, dualColStatus and dualRowStatus.
P_ON_UPPER
P_FREE
P_FIXED
D_FREE
D_ON_UPPER
D_ON_LOWER
int nRows()
int dim()
int coDim()
Status& rowStatus( int i )
Status rowStatus( int i )
const Status* rowStatus( void )
Status& colStatus( int i )
Status colStatus( int i )
const Status* colStatus( void )
Status& status( int i )
Status status( int i )
const Status* status( void )
Status& coStatus( int i )
Status coStatus( int i )
const Status* coStatus( void )
Desc& desc()
Desc::Status dualColStatus( int i )
Desc::Status dualStatus( const SPxLP::SPxColId& id )
Desc::Status dualRowStatus( int i )
Desc::Status dualStatus( const SPxLP::SPxRowId& id )
Desc::Status dualStatus( const SPxLP::Id& id )
virtual void load( const Desc& )
virtual void readBasis( istream& in, NameSet& rowNames, NameSet& colNames )
double nonzeroFactor
SPxLP::Id baseId(int i)
const SVector& baseVec(int i)
SPxLP::Id lastEntered()
SPxLP::Id lastLeft()
int lastIndex()
int lastUpdate()
Vector& multWithBase( Vector& x)
If idx != 0 is given, upon return idx contains the indeces of
the nonzeros of the result vector. idx must be allocated to fit
enough indeces.
double stability()
void solve2( Vector& x, Vector& rhs )
void solve2( Vector& x, SSVector& rhs )
void solve2( SSVector& x, Vector& rhs )
void solve2( SSVector& x, SSVector& rhs )
void solve( Vector& x, const Vector& rhs )
void solve( Vector& x, const SVector& rhs )
void solve( SSVector& x, const SVector& rhs )
void solve( SSVector& x, const Vector& rhs )
void solve4update( SSVector& x, const SVector& rhs )
void solve4update(SSVector& x, Vector& y, const SVector& rhsx, SSVector& rhsy)
void coSolve2( Vector& x, Vector& rhs )
void coSolve2( Vector& x, SSVector& rhs )
void coSolve2( SSVector& x, Vector& rhs )
void coSolve2( SSVector& x, SSVector& rhs )
void coSolve( Vector& x, const Vector& rhs )
void coSolve( Vector& x, const SVector& rhs )
void coSolve( SSVector& x, const SVector& rhs )
void coSolve( SSVector& x, const Vector& rhs )
void coSolve( SSVector& x, Vector& y, const SVector& rhsx, SSVector& rhsy )
Modification.
void reDim()
void addedRows( int n )
void removedRow(int i)
void removedRows(int perm[])
void addedCols( int n )
void removedCol(int i)
Miscellaneous
virtual void change( int i, SPxLP::Id& id, const SVector* enterVec, const SSVector* eta=0 )
The basis Desc is not modified, since factor()
cannot know about how to set up the status of the involved variables
correctly.
A vector vec may be passed for a fast ETA update of the LU
factorization associated to the basis. It must be initialized with
the solution vector $x$ of the right linear system $Bx = b$ with the
entering vector as right hand side vetor $b$, where $B$ denotes the
basis matrix. This can be computed using method solve(b).
When using FAST updates, a vector upd may be passed for
improved performance. It must be initialized by a call to
factor->solveRightUpdate as described in SLinSolver. What
implementation is hidden behind FAST updates, depends on the
SLinSolver implementation class.
virtual int doFactorize()
virtual void factorize()
void setRep( )
void load( SLinSolver* solver )
void load( SoPlex* lp )
alphabetic index hierarchy of classes
generated by doc++