SuperLU_DIST  4.0
superlu_dist on CPU and GPU clusters
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
supermatrix.h
Go to the documentation of this file.
1 
5 #ifndef __SUPERLU_SUPERMATRIX /* allow multiple inclusions */
6 #define __SUPERLU_SUPERMATRIX
7 
8 
9 /********************************************
10  * The matrix types are defined as follows. *
11  ********************************************/
12 typedef enum {
13  SLU_NC, /* column-wise, no supernode */
14  SLU_NCP, /* column-wise, column-permuted, no supernode
15  (The consecutive columns of nonzeros, after permutation,
16  may not be stored contiguously.) */
17  SLU_NR, /* row-wize, no supernode */
18  SLU_SC, /* column-wise, supernode */
19  SLU_SCP, /* supernode, column-wise, permuted */
20  SLU_SR, /* row-wise, supernode */
21  SLU_DN, /* Fortran style column-wise storage for dense matrix */
22  SLU_NR_loc /* distributed compressed row format */
23 } Stype_t;
24 
25 typedef enum {
26  SLU_S, /* single */
27  SLU_D, /* double */
28  SLU_C, /* single complex */
29  SLU_Z /* double complex */
30 } Dtype_t;
31 
32 typedef enum {
33  SLU_GE, /* general */
34  SLU_TRLU, /* lower triangular, unit diagonal */
35  SLU_TRUU, /* upper triangular, unit diagonal */
36  SLU_TRL, /* lower triangular */
37  SLU_TRU, /* upper triangular */
38  SLU_SYL, /* symmetric, store lower half */
39  SLU_SYU, /* symmetric, store upper half */
40  SLU_HEL, /* Hermitian, store lower half */
41  SLU_HEU /* Hermitian, store upper half */
42 } Mtype_t;
43 
44 typedef struct {
45  Stype_t Stype; /* Storage type: interprets the storage structure
46  pointed to by *Store. */
47  Dtype_t Dtype; /* Data type. */
48  Mtype_t Mtype; /* Matrix type: describes the mathematical property of
49  the matrix. */
50  int_t nrow; /* number of rows */
51  int_t ncol; /* number of columns */
52  void *Store; /* pointer to the actual storage of the matrix */
53 } SuperMatrix;
54 
55 /***********************************************
56  * The storage schemes are defined as follows. *
57  ***********************************************/
58 
59 /* Stype == SLU_NC (Also known as Harwell-Boeing sparse matrix format) */
60 typedef struct {
61  int_t nnz; /* number of nonzeros in the matrix */
62  void *nzval; /* pointer to array of nonzero values, packed by column */
63  int_t *rowind; /* pointer to array of row indices of the nonzeros */
64  int_t *colptr; /* pointer to array of beginning of columns in nzval[]
65  and rowind[] */
66  /* Note:
67  Zero-based indexing is used;
68  colptr[] has ncol+1 entries, the last one pointing
69  beyond the last column, so that colptr[ncol] = nnz. */
70 } NCformat;
71 
72 /* Stype == SLU_NR */
73 typedef struct {
74  int_t nnz; /* number of nonzeros in the matrix */
75  void *nzval; /* pointer to array of nonzero values, packed by raw */
76  int_t *colind; /* pointer to array of columns indices of the nonzeros */
77  int_t *rowptr; /* pointer to array of beginning of rows in nzval[]
78  and colind[] */
79  /* Note:
80  Zero-based indexing is used;
81  rowptr[] has nrow+1 entries, the last one pointing
82  beyond the last row, so that rowptr[nrow] = nnz. */
83 } NRformat;
84 
85 /* Stype == SLU_SC */
86 typedef struct {
87  int_t nnz; /* number of nonzeros in the matrix */
88  int_t nsuper; /* number of supernodes, minus 1 */
89  void *nzval; /* pointer to array of nonzero values, packed by column */
90  int_t *nzval_colptr;/* pointer to array of beginning of columns in nzval[] */
91  int_t *rowind; /* pointer to array of compressed row indices of
92  rectangular supernodes */
93  int_t *rowind_colptr;/* pointer to array of beginning of columns in rowind[] */
94  int_t *col_to_sup; /* col_to_sup[j] is the supernode number to which column
95  j belongs; mapping from column to supernode number. */
96  int_t *sup_to_col; /* sup_to_col[s] points to the start of the s-th
97  supernode; mapping from supernode number to column.
98  e.g.: col_to_sup: 0 1 2 2 3 3 3 4 4 4 4 4 4 (ncol=12)
99  sup_to_col: 0 1 2 4 7 12 (nsuper=4) */
100  /* Note:
101  Zero-based indexing is used;
102  nzval_colptr[], rowind_colptr[], col_to_sup and
103  sup_to_col[] have ncol+1 entries, the last one
104  pointing beyond the last column.
105  For col_to_sup[], only the first ncol entries are
106  defined. For sup_to_col[], only the first nsuper+2
107  entries are defined. */
108 } SCformat;
109 
110 /* Stype == SLU_SCP */
111 typedef struct {
112  int_t nnz; /* number of nonzeros in the matrix */
113  int_t nsuper; /* number of supernodes */
114  void *nzval; /* pointer to array of nonzero values, packed by column */
115  int_t *nzval_colbeg;/* nzval_colbeg[j] points to beginning of column j
116  in nzval[] */
117  int_t *nzval_colend;/* nzval_colend[j] points to one past the last element
118  of column j in nzval[] */
119  int_t *rowind; /* pointer to array of compressed row indices of
120  rectangular supernodes */
121  int_t *rowind_colbeg;/* rowind_colbeg[j] points to beginning of column j
122  in rowind[] */
123  int_t *rowind_colend;/* rowind_colend[j] points to one past the last element
124  of column j in rowind[] */
125  int_t *col_to_sup; /* col_to_sup[j] is the supernode number to which column
126  j belongs; mapping from column to supernode. */
127  int_t *sup_to_colbeg; /* sup_to_colbeg[s] points to the start of the s-th
128  supernode; mapping from supernode to column.*/
129  int_t *sup_to_colend; /* sup_to_colend[s] points to one past the end of the
130  s-th supernode; mapping from supernode number to
131  column.
132  e.g.: col_to_sup: 0 1 2 2 3 3 3 4 4 4 4 4 4 (ncol=12)
133  sup_to_colbeg: 0 1 2 4 7 (nsuper=4)
134  sup_to_colend: 1 2 4 7 12 */
135  /* Note:
136  Zero-based indexing is used;
137  nzval_colptr[], rowind_colptr[], col_to_sup and
138  sup_to_col[] have ncol+1 entries, the last one
139  pointing beyond the last column. */
140 } SCPformat;
141 
142 /* Stype == SLU_NCP */
143 typedef struct {
144  int_t nnz; /* number of nonzeros in the matrix */
145  void *nzval; /* pointer to array of nonzero values, packed by column */
146  int_t *rowind;/* pointer to array of row indices of the nonzeros */
147  /* Note: nzval[]/rowind[] always have the same length */
148  int_t *colbeg;/* colbeg[j] points to the beginning of column j in nzval[]
149  and rowind[] */
150  int_t *colend;/* colend[j] points to one past the last element of column
151  j in nzval[] and rowind[] */
152  /* Note:
153  Zero-based indexing is used;
154  The consecutive columns of the nonzeros may not be
155  contiguous in storage, because the matrix has been
156  postmultiplied by a column permutation matrix. */
157 } NCPformat;
158 
159 /* Stype == SLU_DN */
160 typedef struct {
161  int_t lda; /* leading dimension */
162  void *nzval; /* array of size lda*ncol to represent a dense matrix */
163 } DNformat;
164 
165 /* Stype == SLU_NR_loc (Distributed Compressed Row Format) */
166 typedef struct {
167  int_t nnz_loc; /* number of nonzeros in the local submatrix */
168  int_t m_loc; /* number of rows local to this processor */
169  int_t fst_row; /* global index of the first row */
170  void *nzval; /* pointer to array of nonzero values, packed by row */
171  int_t *rowptr; /* pointer to array of beginning of rows in nzval[]
172  and colind[] */
173  int_t *colind; /* pointer to array of column indices of the nonzeros */
174  /* Note:
175  Zero-based indexing is used;
176  rowptr[] has n_loc + 1 entries, the last one pointing
177  beyond the last row, so that rowptr[n_loc] = nnz_loc.*/
178 } NRformat_loc;
179 
180 
181 #endif /* __SUPERLU_SUPERMATRIX */
Definition: supermatrix.h:20
void * nzval
Definition: supermatrix.h:162
Definition: supermatrix.h:13
int_t nsuper
Definition: supermatrix.h:113
int_t * rowind
Definition: supermatrix.h:63
void * Store
Definition: supermatrix.h:52
Definition: supermatrix.h:143
int_t * sup_to_colend
Definition: supermatrix.h:129
int_t nnz
Definition: supermatrix.h:74
int_t nnz_loc
Definition: supermatrix.h:167
Definition: supermatrix.h:36
Definition: supermatrix.h:44
Definition: supermatrix.h:41
void * nzval
Definition: supermatrix.h:114
int_t * nzval_colbeg
Definition: supermatrix.h:115
Mtype_t Mtype
Definition: supermatrix.h:48
int_t * col_to_sup
Definition: supermatrix.h:94
Stype_t
Definition: supermatrix.h:12
int_t nnz
Definition: supermatrix.h:112
int_t nsuper
Definition: supermatrix.h:88
Definition: supermatrix.h:28
int_t * rowind_colbeg
Definition: supermatrix.h:121
void * nzval
Definition: supermatrix.h:62
Definition: supermatrix.h:38
Stype_t Stype
Definition: supermatrix.h:45
Definition: supermatrix.h:39
Definition: supermatrix.h:22
Definition: supermatrix.h:73
int_t * colind
Definition: supermatrix.h:173
Definition: supermatrix.h:17
int_t * nzval_colptr
Definition: supermatrix.h:90
Definition: supermatrix.h:14
Definition: supermatrix.h:19
int_t m_loc
Definition: supermatrix.h:168
int_t nnz
Definition: supermatrix.h:61
int_t * rowind_colend
Definition: supermatrix.h:123
Definition: supermatrix.h:40
Dtype_t Dtype
Definition: supermatrix.h:47
Definition: supermatrix.h:35
int_t * colend
Definition: supermatrix.h:150
Definition: supermatrix.h:27
void * nzval
Definition: supermatrix.h:170
Definition: supermatrix.h:60
int_t nrow
Definition: supermatrix.h:50
int_t * sup_to_col
Definition: supermatrix.h:96
Definition: supermatrix.h:86
Definition: supermatrix.h:34
Definition: supermatrix.h:33
int_t nnz
Definition: supermatrix.h:87
int_t fst_row
Definition: supermatrix.h:169
int_t * colind
Definition: supermatrix.h:76
int_t * rowptr
Definition: supermatrix.h:171
int_t * rowind
Definition: supermatrix.h:91
Definition: supermatrix.h:26
int_t * colbeg
Definition: supermatrix.h:148
Definition: supermatrix.h:37
Mtype_t
Definition: supermatrix.h:32
int_t * col_to_sup
Definition: supermatrix.h:125
int_t * rowind
Definition: supermatrix.h:119
int_t ncol
Definition: supermatrix.h:51
int_t * rowind_colptr
Definition: supermatrix.h:93
Definition: supermatrix.h:29
int_t nnz
Definition: supermatrix.h:144
Definition: supermatrix.h:21
void * nzval
Definition: supermatrix.h:89
int int_t
Definition: superlu_defs.h:37
Dtype_t
Definition: supermatrix.h:25
int_t * rowind
Definition: supermatrix.h:146
Definition: supermatrix.h:160
Definition: supermatrix.h:18
void * nzval
Definition: supermatrix.h:75
Definition: supermatrix.h:111
Definition: supermatrix.h:166
int_t lda
Definition: supermatrix.h:161
int_t * nzval_colend
Definition: supermatrix.h:117
int_t * colptr
Definition: supermatrix.h:64
int_t * rowptr
Definition: supermatrix.h:77
void * nzval
Definition: supermatrix.h:145
int_t * sup_to_colbeg
Definition: supermatrix.h:127