HP MLIB User's Guide Vol. 1 7th Ed.

Chapter 4 Sparse BLAS Operations 425
What you need to know to use these subprograms
Point entry formats
COO - Coordinate. Given a sparse matrix A with nnz nonzero entries, the
COO format stores the entries of the matrix along with their corresponding row
and column indices. Three arrays are required for the COO representation:
val(*) - Scalar array of length nnz containing the matrix entries.
indx(*) - Integer array of length nnz containing row indices such that indx(i)
corresponds to the row index of val(i).
jndx(*) - Integer array of length nnz containing column indices such that
jndx(i) corresponds to the column index of val(i).
Consider, for example, the 4 x 5 matrix:
Table 4-3 4 x 5 Matrix
This matrix could be represented in COO format as:
Table 4-4 COO Format Matrix
CSC - Compressed sparse column. Given a sparse m-by-k matrix A with
nnz nonzero entries, the CSC format stores each column of A as a sparse vector.
Four arrays are required for the CSC representation:
val(*) - Scalar array of length max( nnz, pntre(k)-1 ) containing the nonzero
matrix entries.
indx(*) - Integer array of length max( nnz, pntre(k)-1 ) containing row
indices such that indx(i) corresponds to the row index of val(i).
pntrb(*) - Integer array of length k such that pntrb(j) points to location in
val( ) of the first nonzero element in column j.
pntre(*) - Integer array of length k such that pntre(j) -1 points to location in
val( ) of the last nonzero element in column j.
Note that the above representation only requires each column of A to be stored
in a contiguous portion of val( ). If matrix A is stored in the first nnz entries of
11 0 13 0 15
21 22 0 0 0
31 0 33 0 35
41 0 0 44 45
val= 11 13 15 21 22 31 33 35 41 44 45
indx= 11122333444
jndx= 13512135145