Sparse BLAS Diagonal Matrix Storage
Format
If the sparse matrix has diagonals containing only zero elements, then the diagonal storage format can be used to reduce the amount of information needed to locate the non-zero elements. This storage format is particularly useful in many applications where the matrix arises from a finite element or finite difference discretization. The diagonal storage format is specified by two arrays:
Intel® oneAPI Math Kernel Library
values
and
distance
, and
two parameters:
ndiag
, which is
the number of non-empty diagonals, and
lval
, which is
the declared leading dimension in the calling (sub)programs. The following
table describes the arrays
values
and
distance
:
- values
- A real or complex two-dimensional array is dimensioned aslvalbyndiag. Each column of it contains the non-zero elements of certain diagonal ofA. The key point of the storage is that each element invaluesretains the row number of the original matrix. To achieve this diagonals in the lower triangular part of the matrix are padded from the top, and those in the upper triangular part are padded from the bottom. Note that the value ofis the number of elements to be padded for diagonaldistance[i]i.
- distance
- An integer array with dimensionndiag. Elementiof the arraydistanceis the distance betweeni-diagonal and the main diagonal. The distance is positive if the diagonal is above the main diagonal, and negative if the diagonal is below the main diagonal. The main diagonal has a distance equal to zero.
The above matrix
C
can be
represented in the diagonal storage format as follows:

where the asterisks denote padded elements.
When storing symmetric, Hermitian, or skew-symmetric
matrices, it is necessary to store only the upper or the lower triangular part
of the matrix.
For the triangular solver routines elements of the array
Intel® oneAPI Math Kernel Library
distance
must be
sorted in increasing order. In all other cases the diagonals and distances can
be stored in arbitrary order.