Scippy

SoPlex

Sequential object-oriented simPlex

SLinSolverRational Class Referenceabstract

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. 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=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 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 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, 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 SLinSolverRationalclone () const =0
 clone function for polymorphism More...
 

Detailed Description

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 43 of file slinsolver_rational.h.

Member Enumeration Documentation

◆ Status

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 51 of file slinsolver_rational.h.

Constructor & Destructor Documentation

◆ SLinSolverRational()

default constructor

Definition at line 180 of file slinsolver_rational.h.

◆ ~SLinSolverRational()

virtual ~SLinSolverRational ( )
virtual

destructor

Definition at line 183 of file slinsolver_rational.h.

References SLinSolverRational::clone().

Member Function Documentation

◆ change()

virtual Status change ( int  idx,
const SVectorRational subst,
const SSVectorRational 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 SLUFactorRational.

◆ clear()

virtual void clear ( )
pure virtual

unloads any matrix.

Implemented in SLUFactorRational.

◆ clone()

virtual SLinSolverRational* clone ( ) const
pure virtual

clone function for polymorphism

Implemented in SLUFactorRational.

Referenced by SLinSolverRational::~SLinSolverRational().

◆ dim()

virtual int dim ( ) const
pure virtual

returns dimension of loaded matrix.

Implemented in SLUFactorRational.

◆ getFactorCount()

virtual int getFactorCount ( ) const
pure virtual

get number of factorizations

Implemented in SLUFactorRational.

◆ getName()

virtual const char* getName ( ) const
pure virtual

returns the name of the SLinSolverRational.

Implemented in SLUFactorRational.

◆ isConsistent()

virtual bool isConsistent ( ) const
pure virtual

consistency check.

Implemented in SLUFactorRational.

◆ load()

virtual Status load ( const SVectorRational vec[],
int  dim 
)
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.

◆ memory()

virtual int memory ( ) const
pure virtual

returns current memory consumption.

Implemented in SLUFactorRational.

◆ solve2right4update()

virtual void solve2right4update ( SSVectorRational x,
VectorRational y,
const SVectorRational b,
SSVectorRational d 
)
pure virtual

Solves \(Ax=b\) and \(Ay=d\).

Implemented in SLUFactorRational.

◆ solve3right4update()

virtual void solve3right4update ( SSVectorRational x,
VectorRational y,
VectorRational z,
const SVectorRational b,
SSVectorRational d,
SSVectorRational e 
)
pure virtual

Solves \(Ax=b\), \(Ay=d\) and \(Az=e\).

Implemented in SLUFactorRational.

◆ solveLeft() [1/4]

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

solves \(x^TA=b^T\).

Implemented in SLUFactorRational.

◆ solveLeft() [2/4]

virtual void solveLeft ( SSVectorRational x,
const SVectorRational b 
)
pure virtual

solves \(x^TA=b^T\).

Implemented in SLUFactorRational.

◆ solveLeft() [3/4]

virtual void solveLeft ( SSVectorRational x,
VectorRational two,
const SVectorRational b,
SSVectorRational rhs2 
)
pure virtual

solves \(x^TA=b^T\) and \(x^TA=rhs2^T\) internally using \(rhs2\).

Implemented in SLUFactorRational.

◆ solveLeft() [4/4]

virtual void solveLeft ( SSVectorRational x,
VectorRational y,
VectorRational z,
const SVectorRational b,
SSVectorRational d,
SSVectorRational e 
)
pure virtual

solves \(x^TA=b^T\), \(y^TA=d^T\) and \(z^TA=e^T\)

Implemented in SLUFactorRational.

◆ solveRight() [1/2]

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

Solves \(Ax=b\).

Implemented in SLUFactorRational.

◆ solveRight() [2/2]

virtual void solveRight ( SSVectorRational x,
const SVectorRational b 
)
pure virtual

Solves \(Ax=b\).

Implemented in SLUFactorRational.

◆ solveRight4update()

virtual void solveRight4update ( SSVectorRational x,
const SVectorRational 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 SLUFactorRational.

◆ stability()

virtual Rational 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 SLUFactorRational.

◆ statistics()

virtual std::string statistics ( ) const
pure virtual

returns statistical information in form of a string.

Implemented in SLUFactorRational.

◆ status()

virtual Status status ( ) const
pure virtual

returns the Status of the SLinSolverRational.

Implemented in SLUFactorRational.