Sun S3L 3.0 Programming and Reference Guide

S3L_SPARSE_CSR - Compressed Sparse Row Format

The S3L_SPARSE_CSR files also consist of three sections. The first two sections are the same as in S3L_SPARSE_COO files. The third section stores the sparse matrix in the arrays a, ja, and ia. As with S3L_SPARSE_COO, array a stores the nnz elements of the matrix. ja, an integer array, contains the column indices of the nonzeros and ia, also an integer array, contains pointers to the beginning of each row in arrays a and ja.

For example, the same 4x6 sparse matrix used in previous examples could be stored under S3L_SPARSE_CSR in the manner shown in (using zero-based indexing).

% Example: 4x6 sparse matrix in an S3L_SPARSE_CSR file,
% zero-based indexing:
%
%
4       6       8
0    2    4    5    8
0    3    4    1    2    0    5    3
3.140000   200.400000   -0.600000   27.000000
-0.010000   -0.031000   314.000000   0.080000