Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-11-16 09:38:44

0001 // This file is part of Eigen, a lightweight C++ template library
0002 // for linear algebra.
0003 //
0004 // Copyright (C) 2012 Désiré Nuentsa-Wakam <desire.nuentsa_wakam@inria.fr>
0005 //
0006 // This Source Code Form is subject to the terms of the Mozilla
0007 // Public License v. 2.0. If a copy of the MPL was not distributed
0008 // with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
0009 
0010 /* 
0011  * NOTE: This file comes from a partly modified version of files slu_[s,d,c,z]defs.h
0012  * -- SuperLU routine (version 4.1) --
0013  * Univ. of California Berkeley, Xerox Palo Alto Research Center,
0014  * and Lawrence Berkeley National Lab.
0015  * November, 2010
0016  * 
0017  * Global data structures used in LU factorization -
0018  * 
0019  *   nsuper: #supernodes = nsuper + 1, numbered [0, nsuper].
0020  *   (xsup,supno): supno[i] is the supernode no to which i belongs;
0021  *  xsup(s) points to the beginning of the s-th supernode.
0022  *  e.g.   supno 0 1 2 2 3 3 3 4 4 4 4 4   (n=12)
0023  *          xsup 0 1 2 4 7 12
0024  *  Note: dfs will be performed on supernode rep. relative to the new 
0025  *        row pivoting ordering
0026  *
0027  *   (xlsub,lsub): lsub[*] contains the compressed subscript of
0028  *  rectangular supernodes; xlsub[j] points to the starting
0029  *  location of the j-th column in lsub[*]. Note that xlsub 
0030  *  is indexed by column.
0031  *  Storage: original row subscripts
0032  *
0033  *      During the course of sparse LU factorization, we also use
0034  *  (xlsub,lsub) for the purpose of symmetric pruning. For each
0035  *  supernode {s,s+1,...,t=s+r} with first column s and last
0036  *  column t, the subscript set
0037  *    lsub[j], j=xlsub[s], .., xlsub[s+1]-1
0038  *  is the structure of column s (i.e. structure of this supernode).
0039  *  It is used for the storage of numerical values.
0040  *  Furthermore,
0041  *    lsub[j], j=xlsub[t], .., xlsub[t+1]-1
0042  *  is the structure of the last column t of this supernode.
0043  *  It is for the purpose of symmetric pruning. Therefore, the
0044  *  structural subscripts can be rearranged without making physical
0045  *  interchanges among the numerical values.
0046  *
0047  *  However, if the supernode has only one column, then we
0048  *  only keep one set of subscripts. For any subscript interchange
0049  *  performed, similar interchange must be done on the numerical
0050  *  values.
0051  *
0052  *  The last column structures (for pruning) will be removed
0053  *  after the numercial LU factorization phase.
0054  *
0055  *   (xlusup,lusup): lusup[*] contains the numerical values of the
0056  *  rectangular supernodes; xlusup[j] points to the starting
0057  *  location of the j-th column in storage vector lusup[*]
0058  *  Note: xlusup is indexed by column.
0059  *  Each rectangular supernode is stored by column-major
0060  *  scheme, consistent with Fortran 2-dim array storage.
0061  *
0062  *   (xusub,ucol,usub): ucol[*] stores the numerical values of
0063  *  U-columns outside the rectangular supernodes. The row
0064  *  subscript of nonzero ucol[k] is stored in usub[k].
0065  *  xusub[i] points to the starting location of column i in ucol.
0066  *  Storage: new row subscripts; that is subscripts of PA.
0067  */
0068 
0069 #ifndef EIGEN_LU_STRUCTS
0070 #define EIGEN_LU_STRUCTS
0071 namespace Eigen {
0072 namespace internal {
0073   
0074 typedef enum {LUSUP, UCOL, LSUB, USUB, LLVL, ULVL} MemType; 
0075 
0076 template <typename IndexVector, typename ScalarVector>
0077 struct LU_GlobalLU_t {
0078   typedef typename IndexVector::Scalar StorageIndex; 
0079   IndexVector xsup; //First supernode column ... xsup(s) points to the beginning of the s-th supernode
0080   IndexVector supno; // Supernode number corresponding to this column (column to supernode mapping)
0081   ScalarVector  lusup; // nonzero values of L ordered by columns 
0082   IndexVector lsub; // Compressed row indices of L rectangular supernodes. 
0083   IndexVector xlusup; // pointers to the beginning of each column in lusup
0084   IndexVector xlsub; // pointers to the beginning of each column in lsub
0085   Index   nzlmax; // Current max size of lsub
0086   Index   nzlumax; // Current max size of lusup
0087   ScalarVector  ucol; // nonzero values of U ordered by columns 
0088   IndexVector usub; // row indices of U columns in ucol
0089   IndexVector xusub; // Pointers to the beginning of each column of U in ucol 
0090   Index   nzumax; // Current max size of ucol
0091   Index   n; // Number of columns in the matrix  
0092   Index   num_expansions; 
0093 };
0094 
0095 // Values to set for performance
0096 struct perfvalues {
0097   Index panel_size; // a panel consists of at most <panel_size> consecutive columns
0098   Index relax; // To control degree of relaxing supernodes. If the number of nodes (columns) 
0099                 // in a subtree of the elimination tree is less than relax, this subtree is considered 
0100                 // as one supernode regardless of the row structures of those columns
0101   Index maxsuper; // The maximum size for a supernode in complete LU
0102   Index rowblk; // The minimum row dimension for 2-D blocking to be used;
0103   Index colblk; // The minimum column dimension for 2-D blocking to be used;
0104   Index fillfactor; // The estimated fills factors for L and U, compared with A
0105 }; 
0106 
0107 } // end namespace internal
0108 
0109 } // end namespace Eigen
0110 #endif // EIGEN_LU_STRUCTS