SoPlex
|
Implementation of Sparse Linear Solver with Rational precision. More...
#include <slufactor_rational.h>
Public Types | |
Types | |
enum | UpdateType { ETA = 0 , FOREST_TOMLIN } |
Specifies how to perform change method. More... | |
typedef SLinSolverRational::Status | Status |
for convenience | |
![]() | |
enum | Status { OK = 0 , INSTABLE = 1 , SINGULAR = 2 , UNLOADED = 4 , ERROR = 8 , TIME = 16 } |
status flags of the SLinSolverRational class. More... | |
Public Member Functions | |
Update type | |
UpdateType | utype () const |
returns the current update type uptype. | |
void | setUtype (UpdateType tp) |
sets update type. | |
void | setMarkowitz (const Rational &m) |
sets minimum Markowitz threshold. | |
Rational | markowitz () |
returns Markowitz threshold. | |
Derived from SLinSolverRational | |
See documentation of SLinSolverRational for a documentation of these methods. | |
void | clear () |
int | dim () const |
int | memory () const |
const char * | getName () const |
Status | status () const |
Rational | stability () const |
std::string | statistics () const |
Status | load (const SVectorRational *vec[], int dim) |
Solve | |
void | solveRight (VectorRational &x, const VectorRational &b) |
Solves \(Ax=b\). | |
void | solveRight (SSVectorRational &x, const SVectorRational &b) |
Solves \(Ax=b\). | |
void | solveRight4update (SSVectorRational &x, const SVectorRational &b) |
Solves \(Ax=b\). | |
void | solve2right4update (SSVectorRational &x, VectorRational &y, const SVectorRational &b, SSVectorRational &d) |
Solves \(Ax=b\) and \(Ay=d\). | |
void | solve3right4update (SSVectorRational &x, VectorRational &y, VectorRational &z, const SVectorRational &b, SSVectorRational &d, SSVectorRational &e) |
Solves \(Ax=b\), \(Ay=d\) and \(Az=e\). | |
void | solveLeft (VectorRational &x, const VectorRational &b) |
Solves \(Ax=b\). | |
void | solveLeft (SSVectorRational &x, const SVectorRational &b) |
Solves \(Ax=b\). | |
void | solveLeft (SSVectorRational &x, VectorRational &y, const SVectorRational &b, SSVectorRational &d) |
Solves \(Ax=b\) and \(Ay=d\). | |
void | solveLeft (SSVectorRational &x, VectorRational &y, VectorRational &z, const SVectorRational &b, SSVectorRational &d, SSVectorRational &e) |
Solves \(Ax=b\), \(Ay=d\) and \(Az=e\). | |
Status | change (int idx, const SVectorRational &subst, const SSVectorRational *eta=nullptr) |
Miscellaneous | |
Real | getFactorTime () const |
time spent in factorizations | |
void | setTimeLimit (const Real limit) |
set time limit on factorization | |
void | resetFactorTime () |
reset FactorTime | |
int | getFactorCount () const |
number of factorizations performed | |
Real | getSolveTime () const |
time spent in solves | |
void | resetSolveTime () |
reset SolveTime | |
int | getSolveCount () const |
number of solves performed | |
void | resetCounters () |
reset timers and counters | |
void | dump () const |
prints the LU factorization to stdout. | |
bool | isConsistent () const |
consistency check. | |
Constructors / Destructors | |
SLUFactorRational () | |
default constructor. | |
SLUFactorRational & | operator= (const SLUFactorRational &old) |
assignment operator. | |
SLUFactorRational (const SLUFactorRational &old) | |
copy constructor. | |
virtual | ~SLUFactorRational () |
destructor. | |
virtual SLinSolverRational * | clone () const |
clone function for polymorphism | |
![]() | |
SLinSolverRational () | |
default constructor | |
virtual | ~SLinSolverRational () |
destructor | |
Protected Member Functions | |
Protected helpers | |
void | freeAll () |
void | changeEta (int idx, SSVectorRational &eta) |
void | init () |
![]() | |
void | solveLright (Rational *vec) |
int | solveRight4update (Rational *vec, int *nonz, Rational *rhs, Rational *forest, int *forestNum, int *forestIdx) |
void | solveRight (Rational *vec, Rational *rhs) |
int | solveRight2update (Rational *vec1, Rational *vec2, Rational *rhs1, Rational *rhs2, int *nonz, Rational *forest, int *forestNum, int *forestIdx) |
void | solveRight2 (Rational *vec1, Rational *vec2, Rational *rhs1, Rational *rhs2) |
void | solveLeft (Rational *vec, Rational *rhs) |
int | solveLeftEps (Rational *vec, Rational *rhs, int *nonz) |
int | solveLeft2 (Rational *vec1, int *nonz, Rational *vec2, Rational *rhs1, Rational *rhs2) |
int | vSolveRight4update (Rational *vec, int *idx, Rational *rhs, int *ridx, int rn, Rational *forest, int *forestNum, int *forestIdx) |
int | vSolveRight4update2 (Rational *vec, int *idx, Rational *rhs, int *ridx, int rn, Rational *vec2, Rational *rhs2, int *ridx2, int rn2, Rational *forest, int *forestNum, int *forestIdx) |
int | vSolveRight4update3 (Rational *vec, int *idx, Rational *rhs, int *ridx, int rn, Rational *vec2, Rational *rhs2, int *ridx2, int rn2, Rational *vec3, Rational *rhs3, int *ridx3, int rn3, Rational *forest, int *forestNum, int *forestIdx) |
void | vSolveRightNoNZ (Rational *vec2, Rational *rhs2, int *ridx2, int rn2) |
int | vSolveLeft (Rational *vec, int *idx, Rational *rhs, int *ridx, int rn) |
void | vSolveLeftNoNZ (Rational *vec, Rational *rhs, int *ridx, int rn) |
int | vSolveLeft2 (Rational *vec, int *idx, Rational *rhs, int *ridx, int rn, Rational *vec2, Rational *rhs2, int *ridx2, int rn2) |
int | vSolveLeft3 (Rational *vec, int *idx, Rational *rhs, int *ridx, int rn, Rational *vec2, Rational *rhs2, int *ridx2, int rn2, Rational *vec3, Rational *rhs3, int *ridx3, int rn3) |
void | forestUpdate (int col, Rational *work, int num, int *nonz) |
void | update (int p_col, Rational *p_work, const int *p_idx, int num) |
void | updateNoClear (int p_col, const Rational *p_work, const int *p_idx, int num) |
void | factor (const SVectorRational **vec, const Rational &threshold) |
void | dump () const |
bool | isConsistent () const |
Protected Attributes | |
Protected data | |
bool | usetup |
TRUE iff update vector has been setup. | |
UpdateType | uptype |
the current UpdateType. | |
SSVectorRational | eta |
SSVectorRational | forest |
? Update vector set up by solveRight4update() and solve2right4update() | |
Rational | lastThreshold |
pivoting threshold of last factorization | |
Control Parameters | |
Rational | minThreshold |
minimum threshold to use. | |
Rational | minStability |
minimum stability to achieve by setting threshold. | |
Timer * | solveTime |
Time spent in solves. | |
Timer::TYPE | timerType |
int | solveCount |
Number of solves. | |
![]() | |
SLinSolverRational::Status | stat |
Status indicator. | |
int | thedim |
dimension of factorized matrix | |
int | nzCnt |
number of nonzeros in U | |
Rational | initMaxabs |
maximum abs number in initail Matrix | |
Rational | maxabs |
maximum abs number in L and U | |
Real | rowMemMult |
factor of minimum Memory * number of nonzeros | |
Real | colMemMult |
factor of minimum Memory * number of nonzeros | |
Real | lMemMult |
factor of minimum Memory * number of nonzeros | |
Perm | row |
row permutation matrices | |
Perm | col |
column permutation matrices | |
L | l |
L matrix. | |
VectorRational | diag |
Array of pivot elements. | |
U | u |
U matrix. | |
Rational * | work |
Working array: must always be left as 0! | |
Timer * | factorTime |
Time spent in factorizations. | |
int | factorCount |
Number of factorizations. | |
Real | timeLimit |
Time limit on factorization or solves. | |
Private Member Functions | |
Private helpers | |
void | assign (const SLUFactorRational &old) |
used to implement the assignment operator | |
Private Attributes | |
Private data | |
VectorRational | vec |
Temporary vector. | |
SSVectorRational | ssvec |
Temporary semi-sparse vector. | |
Implementation of Sparse Linear Solver with Rational precision.
This class implements a SLinSolverRational interface by using the sparse LU factorization implemented in CLUFactorRational.
Definition at line 50 of file slufactor_rational.h.
typedef SLinSolverRational::Status Status |
for convenience
Definition at line 64 of file slufactor_rational.h.
enum UpdateType |
Specifies how to perform change method.
Enumerator | |
---|---|
ETA | |
FOREST_TOMLIN |
Definition at line 58 of file slufactor_rational.h.
default constructor.
Definition at line 288 of file slufactor_rational.h.
References CLUFactorRational::col, TimerFactory::createTimer(), CLUFactorRational::diag, eta, CLUFactorRational::factorCount, CLUFactorRational::factorTime, forest, FOREST_TOMLIN, freeAll(), init(), isConsistent(), CLUFactorRational::l, minThreshold, CLUFactorRational::nzCnt, CLUFactorRational::row, solveCount, solveTime, soplex::spx_alloc(), ssvec, CLUFactorRational::thedim, CLUFactorRational::timeLimit, timerType, CLUFactorRational::u, uptype, usetup, vec, and CLUFactorRational::work.
Referenced by assign(), clone(), operator=(), and SLUFactorRational().
SLUFactorRational | ( | const SLUFactorRational & | old | ) |
copy constructor.
Definition at line 446 of file slufactor_rational.h.
References assign(), CLUFactorRational::col, TimerFactory::createTimer(), eta, CLUFactorRational::factorTime, forest, freeAll(), isConsistent(), CLUFactorRational::l, CLUFactorRational::row, SLinSolverRational::SLinSolverRational(), SLUFactorRational(), solveCount, solveTime, ssvec, timerType, CLUFactorRational::u, usetup, and vec.
|
virtual |
destructor.
|
private |
used to implement the assignment operator
References SLUFactorRational().
Referenced by operator=(), and SLUFactorRational().
|
virtual |
Implements SLinSolverRational.
References eta.
|
protected |
References eta.
|
virtual |
Implements SLinSolverRational.
|
virtual |
clone function for polymorphism
Implements SLinSolverRational.
Definition at line 498 of file slufactor_rational.h.
References SLinSolverRational::SLinSolverRational(), and SLUFactorRational().
|
virtual |
Implements SLinSolverRational.
Definition at line 173 of file slufactor_rational.h.
References CLUFactorRational::thedim.
Referenced by load().
void dump | ( | ) | const |
prints the LU factorization to stdout.
|
protected |
Referenced by operator=(), SLUFactorRational(), and SLUFactorRational().
|
virtual |
number of factorizations performed
Implements SLinSolverRational.
Definition at line 250 of file slufactor_rational.h.
References CLUFactorRational::factorCount.
Real getFactorTime | ( | ) | const |
time spent in factorizations
Definition at line 235 of file slufactor_rational.h.
References CLUFactorRational::factorTime.
|
virtual |
Implements SLinSolverRational.
Definition at line 183 of file slufactor_rational.h.
int getSolveCount | ( | ) | const |
number of solves performed
Definition at line 265 of file slufactor_rational.h.
References solveCount.
Real getSolveTime | ( | ) | const |
|
protected |
Referenced by SLUFactorRational().
|
virtual |
consistency check.
Implements SLinSolverRational.
Referenced by operator=(), SLUFactorRational(), and SLUFactorRational().
|
virtual |
Implements SLinSolverRational.
Rational markowitz | ( | ) |
returns Markowitz threshold.
Definition at line 158 of file slufactor_rational.h.
References lastThreshold.
|
virtual |
Implements SLinSolverRational.
Definition at line 178 of file slufactor_rational.h.
References CLUFactorRational::l, and CLUFactorRational::nzCnt.
SLUFactorRational & operator= | ( | const SLUFactorRational & | old | ) |
assignment operator.
Definition at line 415 of file slufactor_rational.h.
References assign(), eta, forest, freeAll(), isConsistent(), SLUFactorRational(), ssvec, and vec.
void resetCounters | ( | ) |
reset timers and counters
Definition at line 270 of file slufactor_rational.h.
References CLUFactorRational::factorCount, CLUFactorRational::factorTime, solveCount, and solveTime.
void resetFactorTime | ( | ) |
reset FactorTime
Definition at line 245 of file slufactor_rational.h.
References CLUFactorRational::factorTime.
void resetSolveTime | ( | ) |
void setMarkowitz | ( | const Rational & | m | ) |
sets minimum Markowitz threshold.
Definition at line 138 of file slufactor_rational.h.
References lastThreshold, and minThreshold.
void setTimeLimit | ( | const Real | limit | ) |
set time limit on factorization
Definition at line 240 of file slufactor_rational.h.
References CLUFactorRational::timeLimit.
void setUtype | ( | UpdateType | tp | ) |
sets update type.
The new UpdateType becomes valid only after the next call to method load().
Definition at line 132 of file slufactor_rational.h.
References uptype.
|
virtual |
Solves \(Ax=b\) and \(Ay=d\).
Implements SLinSolverRational.
|
virtual |
Solves \(Ax=b\), \(Ay=d\) and \(Az=e\).
Implements SLinSolverRational.
|
virtual |
Solves \(Ax=b\).
Implements SLinSolverRational.
|
virtual |
Solves \(Ax=b\) and \(Ay=d\).
Implements SLinSolverRational.
|
virtual |
Solves \(Ax=b\), \(Ay=d\) and \(Az=e\).
Implements SLinSolverRational.
|
virtual |
Solves \(Ax=b\).
Implements SLinSolverRational.
|
virtual |
Solves \(Ax=b\).
Implements SLinSolverRational.
|
virtual |
Solves \(Ax=b\).
Implements SLinSolverRational.
|
virtual |
Solves \(Ax=b\).
Implements SLinSolverRational.
|
virtual |
Implements SLinSolverRational.
|
virtual |
Implements SLinSolverRational.
|
virtual |
Implements SLinSolverRational.
Definition at line 188 of file slufactor_rational.h.
References CLUFactorRational::stat.
UpdateType utype | ( | ) | const |
returns the current update type uptype.
Definition at line 123 of file slufactor_rational.h.
References uptype.
|
protected |
Definition at line 83 of file slufactor_rational.h.
Referenced by change(), changeEta(), operator=(), SLUFactorRational(), and SLUFactorRational().
|
protected |
? Update vector set up by solveRight4update() and solve2right4update()
Definition at line 85 of file slufactor_rational.h.
Referenced by operator=(), SLUFactorRational(), and SLUFactorRational().
|
protected |
pivoting threshold of last factorization
Definition at line 86 of file slufactor_rational.h.
Referenced by markowitz(), and setMarkowitz().
|
protected |
minimum stability to achieve by setting threshold.
Definition at line 95 of file slufactor_rational.h.
|
protected |
minimum threshold to use.
Definition at line 93 of file slufactor_rational.h.
Referenced by setMarkowitz(), and SLUFactorRational().
|
protected |
Number of solves.
Definition at line 100 of file slufactor_rational.h.
Referenced by getSolveCount(), resetCounters(), SLUFactorRational(), and SLUFactorRational().
|
protected |
Time spent in solves.
Definition at line 97 of file slufactor_rational.h.
Referenced by getSolveTime(), resetCounters(), resetSolveTime(), SLUFactorRational(), and SLUFactorRational().
|
private |
Temporary semi-sparse vector.
Definition at line 73 of file slufactor_rational.h.
Referenced by operator=(), SLUFactorRational(), and SLUFactorRational().
|
protected |
Definition at line 98 of file slufactor_rational.h.
Referenced by SLUFactorRational(), and SLUFactorRational().
|
protected |
the current UpdateType.
Definition at line 82 of file slufactor_rational.h.
Referenced by getName(), setUtype(), SLUFactorRational(), and utype().
|
protected |
TRUE iff update vector has been setup.
Definition at line 81 of file slufactor_rational.h.
Referenced by SLUFactorRational(), and SLUFactorRational().
|
private |
Temporary vector.
Definition at line 72 of file slufactor_rational.h.
Referenced by load(), operator=(), SLUFactorRational(), and SLUFactorRational().