Scippy

SoPlex

Sequential object-oriented simPlex

clufactor.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
2 /* */
3 /* This file is part of the class library */
4 /* SoPlex --- the Sequential object-oriented simPlex. */
5 /* */
6 /* Copyright (C) 1996-2019 Konrad-Zuse-Zentrum */
7 /* fuer Informationstechnik Berlin */
8 /* */
9 /* SoPlex is distributed under the terms of the ZIB Academic Licence. */
10 /* */
11 /* You should have received a copy of the ZIB Academic License */
12 /* along with SoPlex; see the file COPYING. If not email to soplex@zib.de. */
13 /* */
14 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /**@file clufactor.h
17  * @brief Implementation of sparse LU factorization.
18  */
19 #ifndef _CLUFACTOR_H_
20 #define _CLUFACTOR_H_
21 
22 #include "soplex/spxdefines.h"
23 #include "soplex/slinsolver.h"
24 #include "soplex/timer.h"
25 #include "soplex/svector.h"
26 
27 #define WITH_L_ROWS 1
28 
29 namespace soplex
30 {
31 /**@brief Implementation of sparse LU factorization.
32  * @ingroup Algo
33  *
34  * This class implements a sparse LU factorization with either
35  * FOREST-TOMLIN or ETA updates, using dynamic Markowitz pivoting.
36  */
37 class CLUFactor
38 {
39 public:
40 
41  //----------------------------------------
42  /**@name Public types */
43  //@{
44  /** Doubly linked ring structure for garbage collection of column or
45  * row file in working matrix.
46  */
47  struct Dring
48  {
51  int idx;
52  };
53 
54  /// Pivot Ring
55  class Pring
56  {
57  public:
58  Pring* next; ///<
59  Pring* prev; ///<
60  int idx; ///< index of pivot row
61  int pos; ///< position of pivot column in row
62  int mkwtz; ///< markowitz number of pivot
63 
64  Pring() : next(0), prev(0) ///< constructor
65  {
66  mkwtz = -1;
67  idx = -1;
68  pos = -1;
69  }
70 
71  private:
72  Pring(const Pring&); ///< blocked copy constructor
73  Pring& operator= (const Pring&); ///< blocked assignment operator
74  };
75  //@}
76 
77 protected:
78 
79  //----------------------------------------
80  /**@name Protected types */
81  //@{
82  /// Temporary data structures.
83  class Temp
84  {
85  public:
86  int* s_mark; ///< marker
87  Real* s_max; ///< maximum absolute value per row (or -1)
88  int* s_cact; ///< lengths of columns of active submatrix
89  int stage; ///< stage of the structure
90  Pring pivots; ///< ring of selected pivot rows
91  Pring* pivot_col; ///< column index handlers for Real linked list
92  Pring* pivot_colNZ; ///< lists for columns to number of nonzeros
93  Pring* pivot_row; ///< row index handlers for Real linked list
94  Pring* pivot_rowNZ; ///< lists for rows to number of nonzeros
95 
96  Temp(); ///< constructor
97  ~Temp(); ///< destructor
98  void init(int p_dim); ///< initialization
99  void clear(); ///< clears the structure
100 
101  private:
102  Temp(const Temp&); ///< blocked copy constructor
103  Temp& operator= (const Temp&); ///< blocked assignment operator
104  };
105 
106  /// Data structures for saving the row and column permutations.
107  struct Perm
108  {
109  int* orig; ///< orig[p] original index from p
110  int* perm; ///< perm[i] permuted index from i
111  };
112 
113  /// Data structures for saving the working matrix and U factor.
114  struct U
115  {
116  ///
117  struct Row
118  {
119  Dring list; /*!< \brief Double linked ringlist of vector
120  indices in the order they appear
121  in the row file */
122  Dring* elem; ///< %Array of ring elements.
123  int size; ///< size of arrays val and idx
124  int used; ///< used entries of arrays idx and val
125  Real* val; ///< hold nonzero values
126  int* idx; ///< hold column indices of nonzeros
127  int* start; ///< starting positions in val and idx
128  int* len; ///< used nonzeros per row vectors
129  int* max; /*!< \brief maximum available nonzeros per row:
130  start[i] + max[i] == start[elem[i].next->idx]
131  len[i] <= max[i]. */
132  } row;
133 
134  ///
135  struct Col
136  {
137  Dring list; /*!< \brief Double linked ringlist of vector
138  indices in the order they appear
139  in the column file */
140  Dring* elem; ///< %Array of ring elements.
141  int size; ///< size of array idx
142  int used; ///< used entries of array idx
143  int* idx; ///< hold row indices of nonzeros
144  Real* val; /*!< \brief hold nonzero values: this is only initialized
145  in the end of the factorization with DEFAULT
146  updates. */
147  int* start; ///< starting positions in val and idx
148  int* len; ///< used nonzeros per column vector
149  int* max; /*!< \brief maximum available nonzeros per colunn:
150  start[i] + max[i] == start[elem[i].next->idx]
151  len[i] <= max[i]. */
152  } col;
153  };
154 
155 
156  /// Data structures for saving the working matrix and L factor.
157  struct L
158  {
159  int size; ///< size of arrays val and idx
160  Real* val; ///< values of L vectors
161  int* idx; ///< indices of L vectors
162  int startSize; ///< size of array start
163  int firstUpdate; ///< number of first update L vector
164  int firstUnused; ///< number of first unused L vector
165  int* start; ///< starting positions in val and idx
166  int* row; ///< column indices of L vectors
167  int updateType; ///< type of updates to be used.
168 
169  /* The following arrays have length |firstUpdate|, since they keep
170  * rows of the L-vectors occuring during the factorization (without
171  * updates), only:
172  */
173  Real* rval; ///< values of rows of L
174  int* ridx; ///< indices of rows of L
175  int* rbeg; ///< start of rows in rval and ridx
176  int* rorig; ///< original row permutation
177  int* rperm; ///< original row permutation
178  };
179  //@}
180 
181  //----------------------------------------
182  /**@name Protected data */
183  //@{
184  SLinSolver::Status stat; ///< Status indicator.
185 
186  int thedim; ///< dimension of factorized matrix
187  int nzCnt; ///< number of nonzeros in U
188  Real initMaxabs; ///< maximum abs number in initail Matrix
189  Real maxabs; ///< maximum abs number in L and U
190 
191  Real rowMemMult; ///< factor of minimum Memory * number of nonzeros
192  Real colMemMult; ///< factor of minimum Memory * number of nonzeros
193  Real lMemMult; ///< factor of minimum Memory * number of nonzeros
194 
195  Perm row; ///< row permutation matrices
196  Perm col; ///< column permutation matrices
197 
198  L l; ///< L matrix
199  Real* diag; ///< Array of pivot elements
200  U u; ///< U matrix
201 
202  Real* work; ///< Working array: must always be left as 0!
203 
204  Timer* factorTime; ///< Time spent in factorizations
205  int factorCount; ///< Number of factorizations
206  //@}
207 
208 private:
209 
210  //----------------------------------------
211  /**@name Private data */
212  //@{
213  Temp temp; ///< Temporary storage
214  //@}
215 
216  //----------------------------------------
217  /**@name Solving
218  These helper methods are used during the factorization process.
219  The solve*-methods solve lower and upper triangular systems from
220  the left or from the right, respectively The methods with '2' in
221  the end solve two systems at the same time. The methods with
222  "Eps" in the end consider elements smaller then the passed epsilon
223  as zero.
224  */
225  //@{
226  ///
227  void solveUright(Real* wrk, Real* vec) const;
228  ///
229  int solveUrightEps(Real* vec, int* nonz, Real eps, Real* rhs);
230  ///
231  void solveUright2(Real* work1, Real* vec1, Real* work2, Real* vec2);
232  ///
233  int solveUright2eps(Real* work1, Real* vec1, Real* work2, Real* vec2, int* nonz, Real eps);
234  ///
235  void solveLright2(Real* vec1, Real* vec2);
236  ///
237  void solveUpdateRight(Real* vec);
238  ///
239  void solveUpdateRight2(Real* vec1, Real* vec2);
240  ///
241  void solveUleft(Real* work, Real* vec);
242  ///
243  void solveUleft2(Real* work1, Real* vec1, Real* work2, Real* vec2);
244  ///
245  int solveLleft2forest(Real* vec1, int* /* nonz */, Real* vec2, Real /* eps */);
246  ///
247  void solveLleft2(Real* vec1, int* /* nonz */, Real* vec2, Real /* eps */);
248  ///
249  int solveLleftForest(Real* vec, int* /* nonz */, Real /* eps */);
250  ///
251  void solveLleft(Real* vec) const;
252  ///
253  int solveLleftEps(Real* vec, int* nonz, Real eps);
254  ///
255  void solveUpdateLeft(Real* vec);
256  ///
257  void solveUpdateLeft2(Real* vec1, Real* vec2);
258 
259  void inline updateSolutionVectorLright(Real change, int j, Real& vec, int* idx, int& nnz);
260  ///
261  void vSolveLright(Real* vec, int* ridx, int& rn, Real eps);
262  ///
263  void vSolveLright2(Real* vec, int* ridx, int& rn, Real eps,
264  Real* vec2, int* ridx2, int& rn2, Real eps2);
265  ///
266  void vSolveLright3(Real* vec, int* ridx, int& rn, Real eps,
267  Real* vec2, int* ridx2, int& rn2, Real eps2,
268  Real* vec3, int* ridx3, int& rn3, Real eps3);
269  ///
270  int vSolveUright(Real* vec, int* vidx, Real* rhs, int* ridx, int rn, Real eps);
271  ///
272  void vSolveUrightNoNZ(Real* vec, Real* rhs, int* ridx, int rn, Real eps);
273  ///
274  int vSolveUright2(Real* vec, int* vidx, Real* rhs, int* ridx, int rn, Real eps,
275  Real* vec2, Real* rhs2, int* ridx2, int rn2, Real eps2);
276  ///
277  int vSolveUpdateRight(Real* vec, int* ridx, int n, Real eps);
278  ///
279  void vSolveUpdateRightNoNZ(Real* vec, Real /*eps*/);
280  ///
281  int solveUleft(Real eps, Real* vec, int* vecidx, Real* rhs, int* rhsidx, int rhsn);
282  ///
283  void solveUleftNoNZ(Real eps, Real* vec, Real* rhs, int* rhsidx, int rhsn);
284  ///
285  int solveLleftForest(Real eps, Real* vec, int* nonz, int n);
286  ///
287  void solveLleftForestNoNZ(Real* vec);
288  ///
289  int solveLleft(Real eps, Real* vec, int* nonz, int rn);
290  ///
291  void solveLleftNoNZ(Real* vec);
292  ///
293  int solveUpdateLeft(Real eps, Real* vec, int* nonz, int n);
294 
295  ///
296  void forestPackColumns();
297  ///
298  void forestMinColMem(int size);
299  ///
300  void forestReMaxCol(int col, int len);
301 
302  ///
303  void initPerm();
304  ///
305  void initFactorMatrix(const SVector** vec, const Real eps);
306  ///
307  void minLMem(int size);
308  ///
309  void setPivot(const int p_stage, const int p_col, const int p_row, const Real val);
310  ///
311  void colSingletons();
312  ///
313  void rowSingletons();
314 
315  ///
316  void initFactorRings();
317  ///
318  void freeFactorRings();
319 
320  ///
321  int setupColVals();
322  ///
323  void setupRowVals();
324 
325  ///
326  void eliminateRowSingletons();
327  ///
328  void eliminateColSingletons();
329  ///
330  void selectPivots(Real threshold);
331  ///
332  int updateRow(int r, int lv, int prow, int pcol, Real pval, Real eps);
333 
334  ///
335  void eliminatePivot(int prow, int pos, Real eps);
336  ///
337  void eliminateNucleus(const Real eps, const Real threshold);
338  ///
339  void minRowMem(int size);
340  ///
341  void minColMem(int size);
342  ///
343  void remaxCol(int p_col, int len);
344  ///
345  void packRows();
346  ///
347  void packColumns();
348  ///
349  void remaxRow(int p_row, int len);
350  ///
351  int makeLvec(int p_len, int p_row);
352  //@}
353 
354 protected:
355 
356  //----------------------------------------
357  /**@name Solver methods */
358  //@{
359  ///
360  void solveLright(Real* vec);
361  ///
362  int solveRight4update(Real* vec, int* nonz, Real eps, Real* rhs,
363  Real* forest, int* forestNum, int* forestIdx);
364  ///
365  void solveRight(Real* vec, Real* rhs);
366  ///
367  int solveRight2update(Real* vec1, Real* vec2, Real* rhs1,
368  Real* rhs2, int* nonz, Real eps, Real* forest, int* forestNum, int* forestIdx);
369  ///
370  void solveRight2(Real* vec1, Real* vec2, Real* rhs1, Real* rhs2);
371  ///
372  void solveLeft(Real* vec, Real* rhs);
373  ///
374  int solveLeftEps(Real* vec, Real* rhs, int* nonz, Real eps);
375  ///
376  int solveLeft2(Real* vec1, int* nonz, Real* vec2, Real eps, Real* rhs1, Real* rhs2);
377 
378  ///
379  int vSolveRight4update(Real eps,
380  Real* vec, int* idx, /* result */
381  Real* rhs, int* ridx, int rn, /* rhs & Forest */
382  Real* forest, int* forestNum, int* forestIdx);
383  ///
384  int vSolveRight4update2(Real eps,
385  Real* vec, int* idx, /* result1 */
386  Real* rhs, int* ridx, int rn, /* rhs1 */
387  Real* vec2, Real eps2, /* result2 */
388  Real* rhs2, int* ridx2, int rn2, /* rhs2 */
389  Real* forest, int* forestNum, int* forestIdx);
390  /// sparse version of above method
392  Real eps, Real* vec, int* idx, /* result1 */
393  Real* rhs, int* ridx, int& rn, /* rhs1 */
394  Real eps2, Real* vec2, int* idx2, /* result2 */
395  Real* rhs2, int* ridx2, int& rn2, /* rhs2 */
396  Real* forest, int* forestNum, int* forestIdx);
397  ///
398  int vSolveRight4update3(Real eps,
399  Real* vec, int* idx, /* result1 */
400  Real* rhs, int* ridx, int rn, /* rhs1 */
401  Real* vec2, Real eps2, /* result2 */
402  Real* rhs2, int* ridx2, int rn2, /* rhs2 */
403  Real* vec3, Real eps3, /* result3 */
404  Real* rhs3, int* ridx3, int rn3, /* rhs3 */
405  Real* forest, int* forestNum, int* forestIdx);
406  /// sparse version of above method
408  Real eps, Real* vec, int* idx, /* result1 */
409  Real* rhs, int* ridx, int& rn, /* rhs1 */
410  Real eps2, Real* vec2, int* idx2, /* result2 */
411  Real* rhs2, int* ridx2, int& rn2, /* rhs2 */
412  Real eps3, Real* vec3, int* idx3, /* result3 */
413  Real* rhs3, int* ridx3, int& rn3, /* rhs3 */
414  Real* forest, int* forestNum, int* forestIdx);
415  ///
416  void vSolveRightNoNZ(Real* vec, Real eps, /* result */
417  Real* rhs, int* ridx, int rn); /* rhs */
418  ///
419  int vSolveLeft(Real eps,
420  Real* vec, int* idx, /* result */
421  Real* rhs, int* ridx, int rn); /* rhs */
422  ///
423  void vSolveLeftNoNZ(Real eps,
424  Real* vec, /* result */
425  Real* rhs, int* ridx, int rn); /* rhs */
426  ///
427  int vSolveLeft2(Real eps,
428  Real* vec, int* idx, /* result */
429  Real* rhs, int* ridx, int rn, /* rhs */
430  Real* vec2, /* result2 */
431  Real* rhs2, int* ridx2, int rn2); /* rhs2 */
432  /// sparse version of solving 2 systems of equations
433  void vSolveLeft2sparse(Real eps,
434  Real* vec, int* idx, /* result */
435  Real* rhs, int* ridx, int& rn, /* rhs */
436  Real* vec2, int* idx2, /* result2 */
437  Real* rhs2, int* ridx2, int& rn2); /* rhs2 */
438  ///
439  int vSolveLeft3(Real eps,
440  Real* vec, int* idx, /* result */
441  Real* rhs, int* ridx, int rn, /* rhs */
442  Real* vec2, /* result2 */
443  Real* rhs2, int* ridx2, int rn2, /* rhs2 */
444  Real* vec3, /* result3 */
445  Real* rhs3, int* ridx3, int rn3); /* rhs3 */
446  /// sparse version of solving 3 systems of equations
447  void vSolveLeft3sparse(Real eps,
448  Real* vec, int* idx, /* result */
449  Real* rhs, int* ridx, int& rn, /* rhs */
450  Real* vec2, int* idx2, /* result2 */
451  Real* rhs2, int* ridx2, int& rn2, /* rhs2 */
452  Real* vec3, int* idx3, /* result2 */
453  Real* rhs3, int* ridx3, int& rn3); /* rhs2 */
454 
455  void forestUpdate(int col, Real* work, int num, int* nonz);
456 
457  void update(int p_col, Real* p_work, const int* p_idx, int num);
458  void updateNoClear(int p_col, const Real* p_work, const int* p_idx, int num);
459 
460  ///
461  void factor(const SVector** vec, ///< Array of column vector pointers
462  Real threshold, ///< pivoting threshold
463  Real eps); ///< epsilon for zero detection
464  //@}
465 
466  //----------------------------------------
467  /**@name Debugging */
468  //@{
469  ///
470  void dump() const;
471 
472  ///
473  bool isConsistent() const;
474  //@}
475 };
476 
477 } // namespace soplex
478 #endif // _CLUFACTOR_H_
void solveUleft(Real *work, Real *vec)
Definition: clufactor.cpp:3611
int * len
used nonzeros per row vectors
Definition: clufactor.h:128
void solveLleft(Real *vec) const
Definition: clufactor.cpp:3910
int updateType
type of updates to be used.
Definition: clufactor.h:167
void solveUpdateRight2(Real *vec1, Real *vec2)
Definition: clufactor.cpp:3460
void updateNoClear(int p_col, const Real *p_work, const int *p_idx, int num)
Definition: clufactor.cpp:1321
int solveUright2eps(Real *work1, Real *vec1, Real *work2, Real *vec2, int *nonz, Real eps)
Definition: clufactor.cpp:3208
void vSolveLright3(Real *vec, int *ridx, int &rn, Real eps, Real *vec2, int *ridx2, int &rn2, Real eps2, Real *vec3, int *ridx3, int &rn3, Real eps3)
Definition: clufactor.cpp:4804
int solveRight2update(Real *vec1, Real *vec2, Real *rhs1, Real *rhs2, int *nonz, Real eps, Real *forest, int *forestNum, int *forestIdx)
Definition: clufactor.cpp:3557
Dring list
Double linked ringlist of vector indices in the order they appear in the column file.
Definition: clufactor.h:137
int * max
maximum available nonzeros per row: start[i] + max[i] == start[elem[i].next->idx] len[i] <= max[i]...
Definition: clufactor.h:129
int vSolveRight4update(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn, Real *forest, int *forestNum, int *forestIdx)
Definition: clufactor.cpp:5510
void forestMinColMem(int size)
Definition: clufactor.cpp:2895
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
Definition: clufactor.cpp:5926
Pring * pivot_rowNZ
lists for rows to number of nonzeros
Definition: clufactor.h:94
int * start
starting positions in val and idx
Definition: clufactor.h:147
int solveLleftForest(Real *vec, int *, Real)
Definition: clufactor.cpp:3880
Real * rval
values of rows of L
Definition: clufactor.h:173
void solveUleftNoNZ(Real eps, Real *vec, Real *rhs, int *rhsidx, int rhsn)
Definition: clufactor.cpp:4283
Real maxabs
maximum abs number in L and U
Definition: clufactor.h:189
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)
Definition: clufactor.cpp:5778
Data structures for saving the row and column permutations.
Definition: clufactor.h:107
U u
U matrix.
Definition: clufactor.h:200
void minRowMem(int size)
Definition: clufactor.cpp:2870
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
Definition: clufactor.cpp:6194
Real * s_max
maximum absolute value per row (or -1)
Definition: clufactor.h:87
int size
size of array idx
Definition: clufactor.h:141
int * rorig
original row permutation
Definition: clufactor.h:176
void update(int p_col, Real *p_work, const int *p_idx, int num)
Definition: clufactor.cpp:1277
L l
L matrix.
Definition: clufactor.h:198
void solveUright(Real *wrk, Real *vec) const
Definition: clufactor.cpp:3084
Dring * elem
Array of ring elements.
Definition: clufactor.h:122
void solveLeft(Real *vec, Real *rhs)
Definition: clufactor.cpp:4143
Real initMaxabs
maximum abs number in initail Matrix
Definition: clufactor.h:188
Sparse Linear Solver virtual base class.
int mkwtz
markowitz number of pivot
Definition: clufactor.h:62
Pring * pivot_col
column index handlers for Real linked list
Definition: clufactor.h:91
int vSolveLeft2(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn, Real *vec2, Real *rhs2, int *ridx2, int rn2)
Definition: clufactor.cpp:6102
Real * diag
Array of pivot elements.
Definition: clufactor.h:199
Perm row
row permutation matrices
Definition: clufactor.h:195
Dring * elem
Array of ring elements.
Definition: clufactor.h:140
Perm col
column permutation matrices
Definition: clufactor.h:196
void solveUpdateRight(Real *vec)
Definition: clufactor.cpp:3428
Data structures for saving the working matrix and L factor.
Definition: clufactor.h:157
int * orig
orig[p] original index from p
Definition: clufactor.h:109
int solveRight4update(Real *vec, int *nonz, Real eps, Real *rhs, Real *forest, int *forestNum, int *forestIdx)
Definition: clufactor.cpp:3519
void vSolveLright(Real *vec, int *ridx, int &rn, Real eps)
Definition: clufactor.cpp:4627
Real lMemMult
factor of minimum Memory * number of nonzeros
Definition: clufactor.h:193
void minColMem(int size)
Definition: clufactor.cpp:2885
void eliminateRowSingletons()
Definition: clufactor.cpp:1877
Real * work
Working array: must always be left as 0!
Definition: clufactor.h:202
void forestUpdate(int col, Real *work, int num, int *nonz)
Performs the Forrest-Tomlin update of the LU factorization.
Definition: clufactor.cpp:712
void solveLleftForestNoNZ(Real *vec)
Definition: clufactor.cpp:4410
int * len
used nonzeros per column vector
Definition: clufactor.h:148
void solveUpdateLeft2(Real *vec1, Real *vec2)
Definition: clufactor.cpp:4052
double Real
Definition: spxdefines.h:218
int solveLleftEps(Real *vec, int *nonz, Real eps)
Definition: clufactor.cpp:3957
int size
size of arrays val and idx
Definition: clufactor.h:159
void solveUright2(Real *work1, Real *vec1, Real *work2, Real *vec2)
Definition: clufactor.cpp:3147
SLinSolver::Status stat
Status indicator.
Definition: clufactor.h:184
Pring * pivot_row
row index handlers for Real linked list
Definition: clufactor.h:93
int used
used entries of arrays idx and val
Definition: clufactor.h:124
void solveLright(Real *vec)
Definition: clufactor.cpp:3288
void vSolveUpdateRightNoNZ(Real *vec, Real)
Definition: clufactor.cpp:5472
Sparse vectors.
int startSize
size of array start
Definition: clufactor.h:162
void vSolveLright2(Real *vec, int *ridx, int &rn, Real eps, Real *vec2, int *ridx2, int &rn2, Real eps2)
Definition: clufactor.cpp:4695
Pring * pivot_colNZ
lists for columns to number of nonzeros
Definition: clufactor.h:92
int factorCount
Number of factorizations.
Definition: clufactor.h:205
Real * val
hold nonzero values: this is only initialized in the end of the factorization with DEFAULT updates...
Definition: clufactor.h:144
int stage
stage of the structure
Definition: clufactor.h:89
int pos
position of pivot column in row
Definition: clufactor.h:61
int firstUnused
number of first unused L vector
Definition: clufactor.h:164
Temp temp
Temporary storage.
Definition: clufactor.h:213
void setPivot(const int p_stage, const int p_col, const int p_row, const Real val)
Definition: clufactor.cpp:267
void solveUpdateLeft(Real *vec)
Definition: clufactor.cpp:4022
void eliminateNucleus(const Real eps, const Real threshold)
Definition: clufactor.cpp:2526
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
Definition: clufactor.cpp:5698
int thedim
dimension of factorized matrix
Definition: clufactor.h:186
int * start
starting positions in val and idx
Definition: clufactor.h:127
Debugging, floating point type and parameter definitions.
int size
size of arrays val and idx
Definition: clufactor.h:123
void dump() const
Definition: clufactor.cpp:2824
int * idx
indices of L vectors
Definition: clufactor.h:161
void factor(const SVector **vec, Real threshold, Real eps)
epsilon for zero detection
Definition: clufactor.cpp:2767
int * perm
perm[i] permuted index from i
Definition: clufactor.h:110
bool isConsistent() const
Definition: clufactor.cpp:2946
void eliminateColSingletons()
Definition: clufactor.cpp:1998
Implementation of sparse LU factorization.This class implements a sparse LU factorization with either...
Definition: clufactor.h:37
void solveUleft2(Real *work1, Real *vec1, Real *work2, Real *vec2)
Definition: clufactor.cpp:3645
Everything should be within this namespace.
Timer class.
void vSolveRightNoNZ(Real *vec, Real eps, Real *rhs, int *ridx, int rn)
Definition: clufactor.cpp:6022
void remaxRow(int p_row, int len)
Definition: clufactor.cpp:415
int vSolveLeft(Real eps, Real *vec, int *idx, Real *rhs, int *ridx, int rn)
Definition: clufactor.cpp:6074
int solveLleft2forest(Real *vec1, int *, Real *vec2, Real)
Definition: clufactor.cpp:3712
void vSolveLeftNoNZ(Real eps, Real *vec, Real *rhs, int *ridx, int rn)
Definition: clufactor.cpp:6227
int firstUpdate
number of first update L vector
Definition: clufactor.h:163
Pring pivots
ring of selected pivot rows
Definition: clufactor.h:90
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)
Definition: clufactor.cpp:6158
Real rowMemMult
factor of minimum Memory * number of nonzeros
Definition: clufactor.h:191
void solveLright2(Real *vec1, Real *vec2)
Definition: clufactor.cpp:3349
Dring list
Double linked ringlist of vector indices in the order they appear in the row file.
Definition: clufactor.h:119
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)
Definition: clufactor.cpp:5578
Timer * factorTime
Time spent in factorizations.
Definition: clufactor.h:204
int solveLeft2(Real *vec1, int *nonz, Real *vec2, Real eps, Real *rhs1, Real *rhs2)
Definition: clufactor.cpp:4178
int solveLeftEps(Real *vec, Real *rhs, int *nonz, Real eps)
Definition: clufactor.cpp:4161
void vSolveUrightNoNZ(Real *vec, Real *rhs, int *ridx, int rn, Real eps)
Definition: clufactor.cpp:5083
void forestReMaxCol(int col, int len)
Definition: clufactor.cpp:613
int * idx
hold row indices of nonzeros
Definition: clufactor.h:143
int idx
index of pivot row
Definition: clufactor.h:60
void eliminatePivot(int prow, int pos, Real eps)
Definition: clufactor.cpp:2430
void remaxCol(int p_col, int len)
Definition: clufactor.cpp:544
int * ridx
indices of rows of L
Definition: clufactor.h:174
int vSolveUright2(Real *vec, int *vidx, Real *rhs, int *ridx, int rn, Real eps, Real *vec2, Real *rhs2, int *ridx2, int rn2, Real eps2)
Definition: clufactor.cpp:5187
Real colMemMult
factor of minimum Memory * number of nonzeros
Definition: clufactor.h:192
int updateRow(int r, int lv, int prow, int pcol, Real pval, Real eps)
Definition: clufactor.cpp:2294
int vSolveUpdateRight(Real *vec, int *ridx, int n, Real eps)
Definition: clufactor.cpp:5428
int * max
maximum available nonzeros per colunn: start[i] + max[i] == start[elem[i].next->idx] len[i] <= max[i]...
Definition: clufactor.h:149
int makeLvec(int p_len, int p_row)
Definition: clufactor.cpp:2918
void updateSolutionVectorLright(Real change, int j, Real &vec, int *idx, int &nnz)
Definition: clufactor.cpp:4608
int * row
column indices of L vectors
Definition: clufactor.h:166
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
Definition: clufactor.cpp:6131
void minLMem(int size)
Definition: clufactor.cpp:2906
int * rbeg
start of rows in rval and ridx
Definition: clufactor.h:175
int * s_cact
lengths of columns of active submatrix
Definition: clufactor.h:88
void solveRight(Real *vec, Real *rhs)
Definition: clufactor.cpp:3548
void initFactorMatrix(const SVector **vec, const Real eps)
Definition: clufactor.cpp:1391
void solveLleft2(Real *vec1, int *, Real *vec2, Real)
Definition: clufactor.cpp:3778
void forestPackColumns()
Definition: clufactor.cpp:360
int nzCnt
number of nonzeros in U
Definition: clufactor.h:187
void selectPivots(Real threshold)
Definition: clufactor.cpp:2075
Real * val
hold nonzero values
Definition: clufactor.h:125
int * rperm
original row permutation
Definition: clufactor.h:177
int * start
starting positions in val and idx
Definition: clufactor.h:165
int * idx
hold column indices of nonzeros
Definition: clufactor.h:126
int used
used entries of array idx
Definition: clufactor.h:142
void solveRight2(Real *vec1, Real *vec2, Real *rhs1, Real *rhs2)
Definition: clufactor.cpp:3593
Status
status flags of the SLinSolver class.
Definition: slinsolver.h:51
int vSolveUright(Real *vec, int *vidx, Real *rhs, int *ridx, int rn, Real eps)
Definition: clufactor.cpp:4975
Temporary data structures.
Definition: clufactor.h:83
Data structures for saving the working matrix and U factor.
Definition: clufactor.h:114
int * s_mark
marker
Definition: clufactor.h:86
Wrapper for the system time query methods.
Definition: timer.h:76
int solveUrightEps(Real *vec, int *nonz, Real eps, Real *rhs)
Definition: clufactor.cpp:3104
Real * val
values of L vectors
Definition: clufactor.h:160
void solveLleftNoNZ(Real *vec)
Definition: clufactor.cpp:4542