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>
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 Real | conditionEstimate (int type=0) const =0 |
return estimate for the condition number based on the diagonal of U 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 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 SSVector &b)=0 |
Solves \(Ax=b\). More... | |
virtual void | solveRight (SSVector &x, const SVector &b)=0 |
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 SSVector &b)=0 |
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 SLinSolver * | clone () const =0 |
clone function for polymorphism More... | |
Public Attributes | |
SPxOut * | spxout |
message handler More... | |
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.
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.
SLinSolver | ( | ) |
default constructor
Definition at line 203 of file slinsolver.h.
|
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().
|
pure virtual |
unloads any matrix.
Implemented in SLUFactor.
Referenced by SPxBasis::loadBasisSolver(), SPxBasis::loadDesc(), and SPxBasis::loadMatrixVecs().
|
pure virtual |
clone function for polymorphism
Implemented in SLUFactor.
Referenced by SPxBasis::operator=(), SPxBasis::SPxBasis(), and SLinSolver::~SLinSolver().
|
pure virtual |
return estimate for the condition number based on the diagonal of U
Implemented in SLUFactor.
Referenced by SPxBasis::getFastCondition().
|
pure virtual |
|
pure virtual |
|
pure virtual |
returns the name of the SLinSolver.
Implemented in SLUFactor.
|
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().
|
pure virtual |
returns current memory consumption.
Implemented in SLUFactor.
Referenced by SPxBasis::change(), and SPxBasis::factorize().
|
pure virtual |
sparse version of solving two systems of equations
Implemented in SLUFactor.
|
pure virtual |
Solves \(Ax=b\), \(Ay=d\) and \(Az=e\).
Implemented in SLUFactor.
Referenced by SPxBasis::solve4update().
|
pure virtual |
sparse version of solving three systems of equations
Implemented in SLUFactor.
solves \(x^TA=b^T\).
Implemented in SLUFactor.
Referenced by SPxBasis::condition(), and SPxBasis::coSolve().
sparse version of solving one system of equations with transposed basis matrix
Implemented in SLUFactor.
|
pure virtual |
solves \(x^TA=b^T\) and \(x^TA=rhs2^T\) internally using \(rhs2\).
Implemented in SLUFactor.
|
pure virtual |
sparse version of solving two systems of equations with transposed basis matrix
Implemented in SLUFactor.
|
pure virtual |
solves \(x^TA=b^T\), \(y^TA=d^T\) and \(z^TA=e^T\)
Implemented in SLUFactor.
|
pure virtual |
sparse version of solving three systems of equations with transposed basis matrix
Implemented in SLUFactor.
Solves \(Ax=b\).
Implemented in SLUFactor.
Referenced by SPxBasis::condition(), and SPxBasis::solve().
Solves \(Ax=b\).
Implemented in SLUFactor.
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().
|
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().
|
pure virtual |
returns statistical information in form of a string.
Implemented in SLUFactor.
Referenced by SPxBasis::statistics().
|
pure virtual |
SPxOut* spxout |
message handler
Definition at line 214 of file slinsolver.h.
Referenced by SLUFactor::assign(), SLUFactor::load(), SPxBasis::loadBasisSolver(), and SPxSolver::setBasisSolver().