
What you need to know to use these subprograms
CSR - Compressed sparse row. Given a sparse
•val(*) - Scalar array of length max(nnz,
•indx(*) - Integer array of length max(nnz,
•pntrb(*) - Integer array of length m such that pntrb(j) points to location in val( ) of the first nonzero element in row j.
•pntre(*) - Integer array of length m such that
Note that the above representation only requires each row of A to be stored in a contiguous portion of val( ). If matrix A is stored in the first nnz entries of val( ), a single array pntr( ) of length m+1 can be used instead of pntrb( ) and pntre( ) by having pntrb(i) = pntr(i) and pntre(i) = pntr(i+1).
The matrix in Table
Table
val= | 11 | 13 | 15 | 21 | 22 | 31 | 33 | 35 | 41 | 44 | 45 |
indx= | 1 | 3 | 5 | 1 | 2 | 1 | 3 | 5 | 1 | 4 | 5 |
pntrb= | 1 | 4 | 6 | 9 |
|
|
|
|
|
|
|
pntre= | 4 | 6 | 8 | 12 |
|
|
|
|
|
|
|
Optionally, a single array pntr( ) (instead of pntrb( ) and pntre( )) could be used:
pntr= | 1 | 4 | 6 | 9 | 12 |
MSR - Modified sparse row. The MSR format is a variation of the CSR format obtained by storing the main diagonal of the matrix in a specific array. Given a sparse
•diag(*) - Scalar array of length d containing the main diagonal of A, where d=min(m, k) is the number of elements in the main diagonal.
•val(*) - Scalar array of length max(nnz,
•indx(*) - Integer array of length max(nnz,
Chapter 4 Sparse BLAS Operations 427