39 #define MINSTABILITY REAL(4e-2) 124 int rsize = rhs.
size();
179 int rsize = rhs.
size();
245 int rsize = rhs.
size();
247 int rsize2 = rhs2.
size();
308 int rsize = rhs.
size();
310 int rsize2 = rhs2.
size();
424 int rn = rhs2.
size();
618 for(
int i = 1; i <
dim(); ++i)
622 if(absdiag < mindiag)
625 if(absdiag > maxdiag)
629 result = maxdiag / mindiag;
637 for(
int i = 1; i <
dim(); ++i)
646 for(
int i = 1; i <
dim(); ++i)
658 s <<
"Factorizations : " << std::setw(10) <<
getFactorCount() << std::endl
659 <<
" Time spent : " << std::setw(10) << std::fixed << std::setprecision(
661 <<
"Solves : " << std::setw(10) <<
getSolveCount() << std::endl
662 <<
" Time spent : " << std::setw(10) <<
getSolveTime() << std::endl;
969 assert(old.
l.
ridx != 0);
970 assert(old.
l.
rbeg != 0);
990 assert(old.
l.
ridx == 0);
991 assert(old.
l.
rbeg == 0);
1343 assert(th <
REAL(1.0));
1347 else if(
LT(th,
REAL(0.9)))
1349 else if(
LT(th,
REAL(0.999)))
1352 assert(th <
REAL(1.0));
1360 assert(matrix != 0);
1468 FILE* fl = fopen(
"dump.lp",
"w");
1469 std::cout <<
"DSLUFA03 Basis:\n";
1472 for(i = 0; i <
dim(); ++i)
1473 j += matrix[i]->size();
1474 for(i = 0; i <
dim(); ++i)
1476 for(j = 0; j < matrix[i]->
size(); ++j)
1477 fprintf(fl,
"%8d %8d %16g\n",
1478 i + 1, matrix[i]->index(j) + 1, matrix[i]->
value(j));
1481 std::cout <<
"DSLUFA04 LU-Factors:" << std::endl;
1485 <<
"\tstability = " <<
stability() << std::endl;
1495 #ifdef ENABLE_CONSISTENCY_CHECKS Rational spxAbs(const Rational &r)
Absolute.
int * len
used nonzeros per row vectors
int updateType
type of updates to be used.
int getSolveCount() const
number of solves performed
DVector vec
Temporary vector.
void updateNoClear(int p_col, const Real *p_work, const int *p_idx, int num)
Dring list
Double linked ringlist of vector indices in the order they appear in the column file.
void solve2right4update(SSVector &x, Vector &y, const SVector &b, SSVector &d)
Solves and .
void reDim(int newdim, const bool setZero=true)
Resets DVectorBase's dimension to newdim.
int * max
maximum available nonzeros per row: start[i] + max[i] == start[elem[i].next->idx] len[i] <= max[i]...
SPxOut * spxout
message handler
std::string statistics() const
int vSolveRight4update(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn, Real *forest, int *forestNum, int *forestIdx)
Status load(const SVector *vec[], int dim)
Memory allocation routines.
void vSolveRight4update3sparse(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int &rn, Real eps2, Real *vec2, int *idx2, Real *rhs2, int *ridx2, int &rn2, Real eps3, Real *vec3, int *idx3, Real *rhs3, int *ridx3, int &rn3, Real *forest, int *forestNum, int *forestIdx)
sparse version of above method
SSVectorBase< R > & assign(const SVectorBase< S > &rhs)
Assigns only the elements of rhs.
UpdateType uptype
the current UpdateType.
SSVector ssvec
Temporary semi-sparse vector.
int size() const
Number of used indices.
struct soplex::CLUFactor::U::Col col
void solveLeft(Vector &x, const Vector &b)
sparse version of solving one system of equations with transposed basis matrix
Real epsilon
|x| < epsililon is considered to be 0.
int * start
starting positions in val and idx
Real * rval
values of rows of L
Exception classes for SoPlex.
Real minStability
minimum stability to achieve by setting threshold.
Real getFactorTime() const
time spent in factorizations
Real maxabs
maximum abs number in L and U
bool LT(Real a, Real b, Real eps=Param::epsilon())
returns true iff a < b + eps
int vSolveRight4update3(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn, Real *vec2, Real eps2, Real *rhs2, int *ridx2, int rn2, Real *vec3, Real eps3, Real *rhs3, int *ridx3, int rn3, Real *forest, int *forestNum, int *forestIdx)
void unSetup()
Makes SSVectorBase not setup.
Implementation of Sparse Linear Solver.
virtual ~SLUFactor()
destructor.
void solveRight4update(SSVector &x, const SVector &b)
Solves .
void vSolveLeft3sparse(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int &rn, Real *vec2, int *idx2, Real *rhs2, int *ridx2, int &rn2, Real *vec3, int *idx3, Real *rhs3, int *ridx3, int &rn3)
sparse version of solving 3 systems of equations
Real lastThreshold
pivoting threshold of last factorization
int size
size of array idx
int getFactorCount() const
number of factorizations performed
R & value(int n)
Reference to value of n 'th nonzero.
int * rorig
original row permutation
void update(int p_col, Real *p_work, const int *p_idx, int num)
Dring * elem
Array of ring elements.
void solveLeft(Real *vec, Real *rhs)
Real initMaxabs
maximum abs number in initail Matrix
Timer * solveTime
Time spent in solves.
int vSolveLeft2(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn, Real *vec2, Real *rhs2, int *ridx2, int rn2)
Real * diag
Array of pivot elements.
Sparse Linear Solver virtual base class.Class SLinSolver provides a class for solving sparse linear s...
Perm row
row permutation matrices
void solveRight(Vector &x, const Vector &b)
Solves .
int * altIndexMem()
Returns array indices.
Dring * elem
Array of ring elements.
Perm col
column permutation matrices
int * orig
orig[p] original index from p
Real minThreshold
minimum threshold to use.
Real lMemMult
factor of minimum Memory * number of nonzeros
Wrapper for different output streams and verbosity levels.
void changeEta(int idx, SSVector &eta)
Exception class for out of memory exceptions.This class is derived from the SoPlex exception base cla...
virtual void start()=0
start timer, resume accounting user, system and real time.
Real * work
Working array: must always be left as 0!
void forestUpdate(int col, Real *work, int num, int *nonz)
Performs the Forrest-Tomlin update of the LU factorization.
virtual Real stop()=0
stop timer, return accounted user time.
void spx_alloc(T &p, int n=1)
Allocate memory.
R * altValues()
Returns array values.
R * get_ptr()
Conversion to C-style pointer.
int * len
used nonzeros per column vector
SLUFactor()
default constructor.
int solveCount
Number of solves.
const R * values() const
Returns array values.
bool isConsistent() const
consistency check.
int size
size of arrays val and idx
SLinSolver::Status stat
Status indicator.
int used
used entries of arrays idx and val
void solveLright(Real *vec)
int startSize
size of array start
int factorCount
Number of factorizations.
Real * val
hold nonzero values: this is only initialized in the end of the factorization with DEFAULT updates...
void clear()
Clears vector.
int firstUnused
number of first unused L vector
Real conditionEstimate(int type=0) const
return condition number estimate based on the diagonal of U
SLUFactor & operator=(const SLUFactor &old)
assignment operator.
static Timer * createTimer(Timer::TYPE ttype)
create timers and allocate memory for them
void vSolveRight4update2sparse(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int &rn, Real eps2, Real *vec2, int *idx2, Real *rhs2, int *ridx2, int &rn2, Real *forest, int *forestNum, int *forestIdx)
sparse version of above method
int thedim
dimension of factorized matrix
const int * indexMem() const
Returns array indices.
struct soplex::CLUFactor::U::Row row
#define MSG_INFO3(spxout, x)
Prints out message x if the verbosity level is at least SPxOut::INFO3.
int * start
starting positions in val and idx
bool usetup
TRUE iff update vector has been setup.
void reDim(int newdim)
Resets dimension to newdim.
Debugging, floating point type and parameter definitions.
void setSize(int n)
Sets number of nonzeros (thereby unSetup SSVectorBase).
int size
size of arrays val and idx
bool EQ(Real a, Real b, Real eps=Param::epsilon())
returns true iff |a-b| <= eps
R * get_ptr()
Only used in slufactor.cpp.
void spx_realloc(T &p, int n)
Change amount of allocated memory.
int * idx
indices of L vectors
void factor(const SVector **vec, Real threshold, Real eps)
epsilon for zero detection
int * perm
perm[i] permuted index from i
bool isConsistent() const
Implementation of Sparse Linear Solver.This class implements a SLinSolver interface by using the spar...
void setup_and_assign(SSVectorBase< S > &rhs)
Sets up rhs vector, and assigns it.
int size() const
Returns the number of nonzeros.
Everything should be within this namespace.
void assign(const SLUFactor &old)
used to implement the assignment operator
int vSolveLeft(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn)
R getEpsilon() const
Returns the non-zero epsilon used.
void solve3right4update(SSVector &x, Vector &y, Vector &z, const SVector &b, SSVector &d, SSVector &e)
Solves , and .
int firstUpdate
number of first update L vector
int vSolveLeft3(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn, Real *vec2, Real *rhs2, int *ridx2, int rn2, Real *vec3, Real *rhs3, int *ridx3, int rn3)
Real rowMemMult
factor of minimum Memory * number of nonzeros
Dring list
Double linked ringlist of vector indices in the order they appear in the row file.
int vSolveRight4update2(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn, Real *vec2, Real eps2, Real *rhs2, int *ridx2, int rn2, Real *forest, int *forestNum, int *forestIdx)
Timer * factorTime
Time spent in factorizations.
void clear()
Set vector to 0.
void forceSetup()
Forces setup status.
int * idx
hold row indices of nonzeros
int * ridx
indices of rows of L
Real colMemMult
factor of minimum Memory * number of nonzeros
#define MAXUPDATES
maximum nr. of factorization updates allowed before refactorization.
int * max
maximum available nonzeros per colunn: start[i] + max[i] == start[elem[i].next->idx] len[i] <= max[i]...
Real getSolveTime() const
time spent in solves
int * row
column indices of L vectors
void dump() const
prints the LU factorization to stdout.
void vSolveLeft2sparse(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int &rn, Real *vec2, int *idx2, Real *rhs2, int *ridx2, int &rn2)
sparse version of solving 2 systems of equations
int * rbeg
start of rows in rval and ridx
void solveRight(Real *vec, Real *rhs)
int nzCnt
number of nonzeros in U
Real * val
hold nonzero values
int * rperm
original row permutation
int * start
starting positions in val and idx
VectorBase< R > & assign(const SVectorBase< S > &vec)
Assign values of vec.
int * idx
hold column indices of nonzeros
int used
used entries of array idx
Status
status flags of the SLinSolver class.
static Real epsilonFactorization()
No matrix has yet been loaded.
Status change(int idx, const SVector &subst, const SSVector *eta=0)
SSVector forest
? Update vector set up by solveRight4update() and solve2right4update()
Wrapper for the system time query methods.
Real * val
values of L vectors
void spx_free(T &p)
Release memory.
static Real betterThreshold(Real th)
SLinSolver::Status Status
for convenience
virtual TYPE type()=0
return type of timer