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