Sparse Linear Solver virtual base class with Rational precision. More...
#include <slinsolver_rational.h>
Public Types | |
Types | |
enum | Status { OK = 0 , INSTABLE = 1 , SINGULAR = 2 , UNLOADED = 4 , ERROR = 8 , TIME = 16 } |
status flags of the SLinSolverRational class. More... | |
Public Member Functions | |
Miscellaneous | |
virtual const char * | getName () const =0 |
returns the name of the SLinSolverRational. More... | |
virtual Status | status () const =0 |
returns the Status of the SLinSolverRational. 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 SVectorRational *vec[], int dim)=0 |
loads dim column vectors vec into the solver. More... | |
virtual Rational | 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 SVectorRational &subst, const SSVectorRational *eta=nullptr)=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 SLinSolverRational 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, VectorRational and SSVectorRational. | |
virtual void | solveRight (VectorRational &x, const VectorRational &b)=0 |
Solves \(Ax=b\). More... | |
virtual void | solveRight (SSVectorRational &x, const SVectorRational &b)=0 |
Solves \(Ax=b\). More... | |
virtual void | solveRight4update (SSVectorRational &x, const SVectorRational &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 (SSVectorRational &x, VectorRational &y, const SVectorRational &b, SSVectorRational &d)=0 |
Solves \(Ax=b\) and \(Ay=d\). More... | |
virtual void | solve3right4update (SSVectorRational &x, VectorRational &y, VectorRational &z, const SVectorRational &b, SSVectorRational &d, SSVectorRational &e)=0 |
Solves \(Ax=b\), \(Ay=d\) and \(Az=e\). More... | |
virtual void | solveLeft (VectorRational &x, const VectorRational &b)=0 |
solves \(x^TA=b^T\). More... | |
virtual void | solveLeft (SSVectorRational &x, const SVectorRational &b)=0 |
solves \(x^TA=b^T\). More... | |
virtual void | solveLeft (SSVectorRational &x, VectorRational &two, const SVectorRational &b, SSVectorRational &rhs2)=0 |
solves \(x^TA=b^T\) and \(x^TA=rhs2^T\) internally using \(rhs2\). More... | |
virtual void | solveLeft (SSVectorRational &x, VectorRational &y, VectorRational &z, const SVectorRational &b, SSVectorRational &d, SSVectorRational &e)=0 |
solves \(x^TA=b^T\), \(y^TA=d^T\) and \(z^TA=e^T\) More... | |
Constructors / Destructors | |
SLinSolverRational () | |
default constructor More... | |
virtual | ~SLinSolverRational () |
destructor More... | |
virtual SLinSolverRational * | clone () const =0 |
clone function for polymorphism More... | |
Sparse Linear Solver virtual base class with Rational precision.
Class SLinSolverRational 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 SLinSolverRational object as an array of pointers to the column SVectorsRational of this matrix.
Definition at line 52 of file slinsolver_rational.h.
enum Status |
status flags of the SLinSolverRational class.
Enumerator | |
---|---|
OK | The SLinSolverRational 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. |
TIME | The time limit has been hit. |
Definition at line 60 of file slinsolver_rational.h.
default constructor
Definition at line 190 of file slinsolver_rational.h.
|
virtual |
destructor
Definition at line 193 of file slinsolver_rational.h.
|
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 SLUFactorRational.
|
pure virtual |
unloads any matrix.
Implemented in SLUFactorRational.
|
pure virtual |
clone function for polymorphism
Implemented in SLUFactorRational.
|
pure virtual |
returns dimension of loaded matrix.
Implemented in SLUFactorRational.
|
pure virtual |
get number of factorizations
Implemented in SLUFactorRational.
|
pure virtual |
returns the name of the SLinSolverRational.
Implemented in SLUFactorRational.
|
pure virtual |
consistency check.
Implemented in SLUFactorRational.
|
pure virtual |
loads dim
column vectors vec
into the solver.
Initializes SLinSolverRational for the solution of linear systems with the matrix consisting of dim
column vectors given in vec
.
Implemented in SLUFactorRational.
|
pure virtual |
returns current memory consumption.
Implemented in SLUFactorRational.
|
pure virtual |
Solves \(Ax=b\) and \(Ay=d\).
Implemented in SLUFactorRational.
|
pure virtual |
Solves \(Ax=b\), \(Ay=d\) and \(Az=e\).
Implemented in SLUFactorRational.
|
pure virtual |
solves \(x^TA=b^T\).
Implemented in SLUFactorRational.
|
pure virtual |
solves \(x^TA=b^T\) and \(x^TA=rhs2^T\) internally using \(rhs2\).
Implemented in SLUFactorRational.
|
pure virtual |
solves \(x^TA=b^T\), \(y^TA=d^T\) and \(z^TA=e^T\)
Implemented in SLUFactorRational.
|
pure virtual |
solves \(x^TA=b^T\).
Implemented in SLUFactorRational.
|
pure virtual |
Solves \(Ax=b\).
Implemented in SLUFactorRational.
|
pure virtual |
Solves \(Ax=b\).
Implemented in SLUFactorRational.
|
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 SLUFactorRational.
|
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 SLUFactorRational.
|
pure virtual |
returns statistical information in form of a string.
Implemented in SLUFactorRational.
|
pure virtual |
returns the Status of the SLinSolverRational.
Implemented in SLUFactorRational.