SparseLU_Structs.h
Go to the documentation of this file.
00001 // This file is part of Eigen, a lightweight C++ template library
00002 // for linear algebra.
00003 //
00004 // Copyright (C) 2012 Désiré Nuentsa-Wakam <desire.nuentsa_wakam@inria.fr>
00005 //
00006 // This Source Code Form is subject to the terms of the Mozilla
00007 // Public License v. 2.0. If a copy of the MPL was not distributed
00008 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
00009 
00010 /* 
00011  * NOTE: This file comes from a partly modified version of files slu_[s,d,c,z]defs.h
00012  * -- SuperLU routine (version 4.1) --
00013  * Univ. of California Berkeley, Xerox Palo Alto Research Center,
00014  * and Lawrence Berkeley National Lab.
00015  * November, 2010
00016  * 
00017  * Global data structures used in LU factorization -
00018  * 
00019  *   nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
00020  *   (xsup,supno): supno[i] is the supernode no to which i belongs;
00021  *  xsup(s) points to the beginning of the s-th supernode.
00022  *  e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
00023  *          xsup 0 1 2 4 7 12
00024  *  Note: dfs will be performed on supernode rep. relative to the new 
00025  *        row pivoting ordering
00026  *
00027  *   (xlsub,lsub): lsub[*] contains the compressed subscript of
00028  *  rectangular supernodes; xlsub[j] points to the starting
00029  *  location of the j-th column in lsub[*]. Note that xlsub 
00030  *  is indexed by column.
00031  *  Storage: original row subscripts
00032  *
00033  *      During the course of sparse LU factorization, we also use
00034  *  (xlsub,lsub) for the purpose of symmetric pruning. For each
00035  *  supernode {s,s+1,...,t=s+r} with first column s and last
00036  *  column t, the subscript set
00037  *    lsub[j], j=xlsub[s], .., xlsub[s+1]-1
00038  *  is the structure of column s (i.e. structure of this supernode).
00039  *  It is used for the storage of numerical values.
00040  *  Furthermore,
00041  *    lsub[j], j=xlsub[t], .., xlsub[t+1]-1
00042  *  is the structure of the last column t of this supernode.
00043  *  It is for the purpose of symmetric pruning. Therefore, the
00044  *  structural subscripts can be rearranged without making physical
00045  *  interchanges among the numerical values.
00046  *
00047  *  However, if the supernode has only one column, then we
00048  *  only keep one set of subscripts. For any subscript interchange
00049  *  performed, similar interchange must be done on the numerical
00050  *  values.
00051  *
00052  *  The last column structures (for pruning) will be removed
00053  *  after the numercial LU factorization phase.
00054  *
00055  *   (xlusup,lusup): lusup[*] contains the numerical values of the
00056  *  rectangular supernodes; xlusup[j] points to the starting
00057  *  location of the j-th column in storage vector lusup[*]
00058  *  Note: xlusup is indexed by column.
00059  *  Each rectangular supernode is stored by column-major
00060  *  scheme, consistent with Fortran 2-dim array storage.
00061  *
00062  *   (xusub,ucol,usub): ucol[*] stores the numerical values of
00063  *  U-columns outside the rectangular supernodes. The row
00064  *  subscript of nonzero ucol[k] is stored in usub[k].
00065  *  xusub[i] points to the starting location of column i in ucol.
00066  *  Storage: new row subscripts; that is subscripts of PA.
00067  */
00068 
00069 #ifndef EIGEN_LU_STRUCTS
00070 #define EIGEN_LU_STRUCTS
00071 namespace Eigen {
00072 namespace internal {
00073   
00074 typedef enum {LUSUP, UCOL, LSUB, USUB, LLVL, ULVL} MemType; 
00075 
00076 template <typename IndexVector, typename ScalarVector>
00077 struct LU_GlobalLU_t {
00078   typedef typename IndexVector::Scalar Index; 
00079   IndexVector xsup; //First supernode column ... xsup(s) points to the beginning of the s-th supernode
00080   IndexVector supno; // Supernode number corresponding to this column (column to supernode mapping)
00081   ScalarVector  lusup; // nonzero values of L ordered by columns 
00082   IndexVector lsub; // Compressed row indices of L rectangular supernodes. 
00083   IndexVector xlusup; // pointers to the beginning of each column in lusup
00084   IndexVector xlsub; // pointers to the beginning of each column in lsub
00085   Index   nzlmax; // Current max size of lsub
00086   Index   nzlumax; // Current max size of lusup
00087   ScalarVector  ucol; // nonzero values of U ordered by columns 
00088   IndexVector usub; // row indices of U columns in ucol
00089   IndexVector xusub; // Pointers to the beginning of each column of U in ucol 
00090   Index   nzumax; // Current max size of ucol
00091   Index   n; // Number of columns in the matrix  
00092   Index   num_expansions; 
00093 };
00094 
00095 // Values to set for performance
00096 template <typename Index>
00097 struct perfvalues {
00098   Index panel_size; // a panel consists of at most <panel_size> consecutive columns
00099   Index relax; // To control degree of relaxing supernodes. If the number of nodes (columns) 
00100                 // in a subtree of the elimination tree is less than relax, this subtree is considered 
00101                 // as one supernode regardless of the row structures of those columns
00102   Index maxsuper; // The maximum size for a supernode in complete LU
00103   Index rowblk; // The minimum row dimension for 2-D blocking to be used;
00104   Index colblk; // The minimum column dimension for 2-D blocking to be used;
00105   Index fillfactor; // The estimated fills factors for L and U, compared with A
00106 }; 
00107 
00108 } // end namespace internal
00109 
00110 } // end namespace Eigen
00111 #endif // EIGEN_LU_STRUCTS


acado
Author(s): Milan Vukov, Rien Quirynen
autogenerated on Sat Jun 8 2019 19:39:23