1
#ifndef __SUPERLU_SUPERMATRIX /* allow multiple inclusions */
2
#define __SUPERLU_SUPERMATRIX
4
/********************************************
5
* The matrix types are defined as follows. *
6
********************************************/
8
SLU_NC, /* column-wise, no supernode */
9
SLU_NR, /* row-wize, no supernode */
10
SLU_SC, /* column-wise, supernode */
11
SLU_SR, /* row-wise, supernode */
12
SLU_NCP, /* column-wise, column-permuted, no supernode
13
(The consecutive columns of nonzeros, after permutation,
14
may not be stored contiguously.) */
15
SLU_DN /* Fortran style column-wise storage for dense matrix */
21
SLU_C, /* single complex */
22
SLU_Z /* double complex */
27
SLU_TRLU, /* lower triangular, unit diagonal */
28
SLU_TRUU, /* upper triangular, unit diagonal */
29
SLU_TRL, /* lower triangular */
30
SLU_TRU, /* upper triangular */
31
SLU_SYL, /* symmetric, store lower half */
32
SLU_SYU, /* symmetric, store upper half */
33
SLU_HEL, /* Hermitian, store lower half */
34
SLU_HEU /* Hermitian, store upper half */
38
Stype_t Stype; /* Storage type: interprets the storage structure
39
pointed to by *Store. */
40
Dtype_t Dtype; /* Data type. */
41
Mtype_t Mtype; /* Matrix type: describes the mathematical property of
43
int_t nrow; /* number of rows */
44
int_t ncol; /* number of columns */
45
void *Store; /* pointer to the actual storage of the matrix */
48
/***********************************************
49
* The storage schemes are defined as follows. *
50
***********************************************/
52
/* Stype == NC (Also known as Harwell-Boeing sparse matrix format) */
54
int_t nnz; /* number of nonzeros in the matrix */
55
void *nzval; /* pointer to array of nonzero values, packed by column */
56
int_t *rowind; /* pointer to array of row indices of the nonzeros */
57
int_t *colptr; /* pointer to array of beginning of columns in nzval[]
60
Zero-based indexing is used;
61
colptr[] has ncol+1 entries, the last one pointing
62
beyond the last column, so that colptr[ncol] = nnz. */
65
/* Stype == NR (Also known as row compressed storage (RCS). */
67
int_t nnz; /* number of nonzeros in the matrix */
68
void *nzval; /* pointer to array of nonzero values, packed by row */
69
int_t *colind; /* pointer to array of column indices of the nonzeros */
70
int_t *rowptr; /* pointer to array of beginning of rows in nzval[]
73
Zero-based indexing is used;
74
nzval[] and colind[] are of the same length, nnz;
75
rowptr[] has nrow+1 entries, the last one pointing
76
beyond the last column, so that rowptr[nrow] = nnz. */
81
int_t nnz; /* number of nonzeros in the matrix */
82
int_t nsuper; /* number of supernodes, minus 1 */
83
void *nzval; /* pointer to array of nonzero values, packed by column */
84
int_t *nzval_colptr;/* pointer to array of beginning of columns in nzval[] */
85
int_t *rowind; /* pointer to array of compressed row indices of
86
rectangular supernodes */
87
int_t *rowind_colptr;/* pointer to array of beginning of columns in rowind[] */
88
int_t *col_to_sup; /* col_to_sup[j] is the supernode number to which column
89
j belongs; mapping from column to supernode number. */
90
int_t *sup_to_col; /* sup_to_col[s] points to the start of the s-th
91
supernode; mapping from supernode number to column.
92
e.g.: col_to_sup: 0 1 2 2 3 3 3 4 4 4 4 4 4 (ncol=12)
93
sup_to_col: 0 1 2 4 7 12 (nsuper=4) */
95
Zero-based indexing is used;
96
nzval_colptr[], rowind_colptr[], col_to_sup and
97
sup_to_col[] have ncol+1 entries, the last one
98
pointing beyond the last column.
99
For col_to_sup[], only the first ncol entries are
100
defined. For sup_to_col[], only the first nsuper+2
101
entries are defined. */
106
int_t nnz; /* number of nonzeros in the matrix */
107
void *nzval; /* pointer to array of nonzero values, packed by column */
108
int_t *rowind;/* pointer to array of row indices of the nonzeros */
109
/* Note: nzval[]/rowind[] always have the same length */
110
int_t *colbeg;/* colbeg[j] points to the beginning of column j in nzval[]
112
int_t *colend;/* colend[j] points to one past the last element of column
113
j in nzval[] and rowind[] */
115
Zero-based indexing is used;
116
The consecutive columns of the nonzeros may not be
117
contiguous in storage, because the matrix has been
118
postmultiplied by a column permutation matrix. */
123
int_t lda; /* leading dimension */
124
void *nzval; /* array of size lda*ncol to represent a dense matrix */
129
/*********************************************************
130
* Macros used for easy access of sparse matrix entries. *
131
*********************************************************/
132
#define L_SUB_START(col) ( Lstore->rowind_colptr[col] )
133
#define L_SUB(ptr) ( Lstore->rowind[ptr] )
134
#define L_NZ_START(col) ( Lstore->nzval_colptr[col] )
135
#define L_FST_SUPC(superno) ( Lstore->sup_to_col[superno] )
136
#define U_NZ_START(col) ( Ustore->colptr[col] )
137
#define U_SUB(ptr) ( Ustore->rowind[ptr] )
140
#endif /* __SUPERLU_SUPERMATRIX */