Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Sparse BLAS CSC Matrix Storage Format

The compressed sparse column format (CSC) is similar to the CSR format, but the columns are used instead the rows. In other words, the CSC format is identical to the CSR format for the transposed matrix. The CSR format is specified by four arrays: values, columns, pointerB, and pointerE. The following table describes the arrays in terms of the values, row, and column positions of the non-zero elements in a sparse matrix A.

values

A real or complex array that contains the non-zero elements of A. Values of the non-zero elements of A are mapped into the values array using the column-major storage mapping.

rows

Element i of the integer array rows is the number of the row in A that contains the i-th value in the values array.

pointerB

Element j of this integer array gives the index of the element in the values array that is first non-zero element in a column j of A. Note that this index is equal to pointerB(j)-indexing for Inspector-executor Sparse BLAS CSC arrays.

pointerE

An integer array that contains column indices, such that pointerE(j)-indexing is the index of the element in the values array that is last non-zero element in a column j of A.

The length of the values and columns arrays is equal to the number of non-zero elements in A. The length of the pointerB and pointerE arrays is equal to the number of columns in A.

NOTE:

Note that the Intel® oneAPI Math Kernel Library (oneMKL) Sparse BLAS routines support the CSC format both with one-based indexing and zero-based indexing.

For example, consider matrix B:



It can be represented in the CSC format as:

Storage Arrays for a Matrix in CSC Format
one-based indexing                          
values = (1 -2 -4 -1 5 8 4 2 -3 6 7 4 -5)
rows = (1 2 4 1 2 5 3 4 1 3 4 3 5)
pointerB = (1 4 7 9 12)                
pointerE = (4 7 9 12 14)                
zero-based indexing                          
values = (1 -2 -4 -1 5 8 4 2 -3 6 7 4 -5)
rows = (0 1 3 0 1 4 2 3 0 2 3 2 4)
pointerB = (0 3 6 8 11)                
pointerE = (3 6 8 11 13)