Scippy

SoPlex

Sequential object-oriented simPlex

SLinSolver Class Referenceabstract

Sparse Linear Solver virtual base class.Class SLinSolver provides a class for solving sparse linear systems with a matrix $A$ and arbitrary right-hand side vectors. For doing so, the matrix must be first loaded to an SLinSolver object as an array of pointers to the column SVectors of this matrix. More...

#include <slinsolver.h>

Inheritance diagram for SLinSolver:

Public Types

Types
enum  Status {
  OK = 0, INSTABLE = 1, SINGULAR = 2, UNLOADED = 4,
  ERROR = 8
}
 status flags of the SLinSolver class. More...
 

Public Member Functions

Miscellaneous
virtual const char * getName () const =0
 returns the name of the SLinSolver. More...
 
virtual Status status () const =0
 returns the Status of the SLinSolver. More...
 
virtual void clear ()=0
 unloads any matrix. More...
 
virtual int memory () const =0
 returns current memory consumption. More...
 
virtual int dim () const =0
 returns dimension of loaded matrix. More...
 
virtual Status load (const SVector *vec[], int dim)=0
 loads dim column vectors vec into the solver. More...
 
virtual Real stability () const =0
 returns a stability number (0: singularity, 1: perfect stability). More...
 
virtual std::string statistics () const =0
 returns statistical information in form of a string. More...
 
virtual Status change (int idx, const SVector &subst, const SSVector *eta=0)=0
 Substitute column idx with subst. More...
 
virtual bool isConsistent () const =0
 consistency check. More...
 
virtual int getFactorCount () const =0
 get number of factorizations More...
 
Solving linear systems

For solving linear systems with an SLinSolver object, it must have previously been loaded with the matrix to use.

Two types of systems can be solved $A x = b$ and $x^T A = b^T$. Method names related to the first and second type are solveRight() and solveLeft(), respectively.

The methods receive their right hand-side vector $b$ as a const parameter, that will hence be unchanged after termination.

Some methods are available with two parameters for right hand-side vectors. Then two system are solved in one method invocation. This should generally be faster than solving two systems seperately.

The result vector(s) are allways given as the first parameter(s). Two types of result vectors are supported, Vector and SSVector.

virtual void solveRight (Vector &x, const Vector &b)=0
 Solves $Ax=b$. More...
 
virtual void solveRight (SSVector &x, const SVector &b)=0
 Solves $Ax=b$. More...
 
virtual void solveRight4update (SSVector &x, const SVector &b)=0
 Solves $Ax=b$. Possibly sets up internal data structures suitable for an optimized subsequent change() call with $b$ as entering column. More...
 
virtual void solve2right4update (SSVector &x, Vector &y, const SVector &b, SSVector &d)=0
 Solves $Ax=b$ and $Ay=d$. More...
 
virtual void solve2right4update (SSVector &x, SSVector &y, const SVector &b, SSVector &d)=0
 sparse version of solving two systems of equations More...
 
virtual void solve3right4update (SSVector &x, Vector &y, Vector &z, const SVector &b, SSVector &d, SSVector &e)=0
 Solves $Ax=b$, $Ay=d$ and $Az=e$. More...
 
virtual void solve3right4update (SSVector &x, SSVector &y, SSVector &z, const SVector &b, SSVector &d, SSVector &e)=0
 sparse version of solving three systems of equations More...
 
virtual void solveLeft (Vector &x, const Vector &b)=0
 solves $x^TA=b^T$. More...
 
virtual void solveLeft (SSVector &x, const SVector &b)=0
 sparse version of solving one system of equations with transposed basis matrix More...
 
virtual void solveLeft (SSVector &x, Vector &two, const SVector &b, SSVector &rhs2)=0
 solves $x^TA=b^T$ and $x^TA=rhs2^T$ internally using $rhs2$. More...
 
virtual void solveLeft (SSVector &x, SSVector &two, const SVector &b, SSVector &rhs2)=0
 sparse version of solving two systems of equations with transposed basis matrix More...
 
virtual void solveLeft (SSVector &x, Vector &y, Vector &z, const SVector &b, SSVector &d, SSVector &e)=0
 solves $x^TA=b^T$, $y^TA=d^T$ and $z^TA=e^T$ More...
 
virtual void solveLeft (SSVector &x, SSVector &y, SSVector &z, const SVector &b, SSVector &d, SSVector &e)=0
 sparse version of solving three systems of equations with transposed basis matrix More...
 
Constructors / Destructors
 SLinSolver ()
 default constructor More...
 
virtual ~SLinSolver ()
 destructor More...
 
virtual SLinSolverclone () const =0
 clone function for polymorphism More...
 

Public Attributes

SPxOutspxout
 message handler More...
 

Detailed Description

Sparse Linear Solver virtual base class.

Class SLinSolver provides a class for solving sparse linear systems with a matrix $A$ and arbitrary right-hand side vectors. For doing so, the matrix must be first loaded to an SLinSolver object as an array of pointers to the column SVectors of this matrix.

Definition at line 43 of file slinsolver.h.

Member Enumeration Documentation

enum Status

status flags of the SLinSolver class.

Enumerator
OK 

The SLinSolver is ready for solving linear systems with the loaded matrix

INSTABLE 

The loaded matrix allows only for instable solutions to be computed

SINGULAR 

The loaded matrix is singular.

UNLOADED 

No matrix has yet been loaded.

ERROR 

An error has occurred.

Definition at line 51 of file slinsolver.h.

Constructor & Destructor Documentation

default constructor

Definition at line 198 of file slinsolver.h.

virtual ~SLinSolver ( )
virtual

destructor

Definition at line 202 of file slinsolver.h.

References SLinSolver::clone().

Member Function Documentation

virtual Status change ( int  idx,
const SVector subst,
const SSVector eta = 0 
)
pure virtual

Substitute column idx with subst.

The change method is used to modify the loaded matrix by substituting column idx with the new vector subst. One may also pass the optional parameter eta to the solution of solveRight() if readily availabble. This may improve on the performance of the update.

Implemented in SLUFactor.

Referenced by SPxBasis::change().

virtual void clear ( )
pure virtual

unloads any matrix.

Implemented in SLUFactor.

Referenced by SPxBasis::loadDesc(), SPxBasis::loadMatrixVecs(), and SPxBasis::loadSolver().

virtual SLinSolver* clone ( ) const
pure virtual

clone function for polymorphism

Implemented in SLUFactor.

Referenced by SPxBasis::operator=(), SPxBasis::SPxBasis(), and SLinSolver::~SLinSolver().

virtual int dim ( ) const
pure virtual

returns dimension of loaded matrix.

Implemented in SLUFactor.

virtual int getFactorCount ( ) const
pure virtual

get number of factorizations

Implemented in SLUFactor.

Referenced by SPxSolver::printDisplayLine().

virtual const char* getName ( ) const
pure virtual

returns the name of the SLinSolver.

Implemented in SLUFactor.

virtual bool isConsistent ( ) const
pure virtual

consistency check.

Implemented in SLUFactor.

Referenced by SPxBasis::isConsistent().

virtual Status load ( const SVector vec[],
int  dim 
)
pure virtual

loads dim column vectors vec into the solver.

Initializes SLinSolver for the solution of linear systems with the matrix consisting of dim column vectors given in vec.

Implemented in SLUFactor.

Referenced by SPxBasis::factorize().

virtual int memory ( ) const
pure virtual

returns current memory consumption.

Implemented in SLUFactor.

Referenced by SPxBasis::change(), and SPxBasis::factorize().

virtual void solve2right4update ( SSVector x,
Vector y,
const SVector b,
SSVector d 
)
pure virtual

Solves $Ax=b$ and $Ay=d$.

Implemented in SLUFactor.

Referenced by SPxBasis::solve4update().

virtual void solve2right4update ( SSVector x,
SSVector y,
const SVector b,
SSVector d 
)
pure virtual

sparse version of solving two systems of equations

Implemented in SLUFactor.

virtual void solve3right4update ( SSVector x,
Vector y,
Vector z,
const SVector b,
SSVector d,
SSVector e 
)
pure virtual

Solves $Ax=b$, $Ay=d$ and $Az=e$.

Implemented in SLUFactor.

Referenced by SPxBasis::solve4update().

virtual void solve3right4update ( SSVector x,
SSVector y,
SSVector z,
const SVector b,
SSVector d,
SSVector e 
)
pure virtual

sparse version of solving three systems of equations

Implemented in SLUFactor.

virtual void solveLeft ( Vector x,
const Vector b 
)
pure virtual

solves $x^TA=b^T$.

Implemented in SLUFactor.

Referenced by SPxBasis::condition(), and SPxBasis::coSolve().

virtual void solveLeft ( SSVector x,
const SVector b 
)
pure virtual

sparse version of solving one system of equations with transposed basis matrix

Implemented in SLUFactor.

virtual void solveLeft ( SSVector x,
Vector two,
const SVector b,
SSVector rhs2 
)
pure virtual

solves $x^TA=b^T$ and $x^TA=rhs2^T$ internally using $rhs2$.

Implemented in SLUFactor.

virtual void solveLeft ( SSVector x,
SSVector two,
const SVector b,
SSVector rhs2 
)
pure virtual

sparse version of solving two systems of equations with transposed basis matrix

Implemented in SLUFactor.

virtual void solveLeft ( SSVector x,
Vector y,
Vector z,
const SVector b,
SSVector d,
SSVector e 
)
pure virtual

solves $x^TA=b^T$, $y^TA=d^T$ and $z^TA=e^T$

Implemented in SLUFactor.

virtual void solveLeft ( SSVector x,
SSVector y,
SSVector z,
const SVector b,
SSVector d,
SSVector e 
)
pure virtual

sparse version of solving three systems of equations with transposed basis matrix

Implemented in SLUFactor.

virtual void solveRight ( Vector x,
const Vector b 
)
pure virtual

Solves $Ax=b$.

Implemented in SLUFactor.

Referenced by SPxBasis::condition(), and SPxBasis::solve().

virtual void solveRight ( SSVector x,
const SVector b 
)
pure virtual

Solves $Ax=b$.

Implemented in SLUFactor.

virtual void solveRight4update ( SSVector x,
const SVector b 
)
pure virtual

Solves $Ax=b$. Possibly sets up internal data structures suitable for an optimized subsequent change() call with $b$ as entering column.

Implemented in SLUFactor.

Referenced by SPxBasis::solve4update().

virtual Real stability ( ) const
pure virtual

returns a stability number (0: singularity, 1: perfect stability).

Returns a stability parameter between 0 and 1, where 0 indicates singularity, while 1 indicates perfect stability.

Implemented in SLUFactor.

Referenced by SPxBasis::change(), SPxBasis::factorize(), and SPxBasis::stability().

virtual std::string statistics ( ) const
pure virtual

returns statistical information in form of a string.

Implemented in SLUFactor.

Referenced by SPxBasis::statistics().

virtual Status status ( ) const
pure virtual

returns the Status of the SLinSolver.

Implemented in SLUFactor.

Referenced by SPxBasis::change().

Member Data Documentation

SPxOut* spxout

message handler

Definition at line 209 of file slinsolver.h.

Referenced by SLUFactor::assign(), SLUFactor::load(), SPxBasis::loadSolver(), and SPxSolver::setSolver().