Matrix arguments of Intel^{®} MKL routines can be stored in either one or twodimensional arrays, using the following storage schemes:
Full storage
is the following obvious scheme:
a matrix A is stored in a twodimensional array
a
,
with the matrix element a_{ij}
stored in the array element
a(i,j)
.
If a matrix is triangular (upper or lower, as specified by the argument
uplo
),
only the elements of the relevant triangle are stored;
the remaining elements of the array need not be set.
Routines that handle symmetric or Hermitian matrices allow for either
the upper or lower triangle of the matrix to be stored in the corresponding
elements of the array:
uplo ='U'

a_{ij} is stored in
a(i,j)
for i < j ;
other elements of a
need not be set.

uplo ='L'

a_{ij} is stored in
a(i,j)
for j < i ;
other elements of a
need not be set.

Packed storage
allows you to store symmetric, Hermitian, or triangular matrices more compactly:
the relevant triangle (again, as specified by the argument
uplo
)
is packed by columns in a onedimensional array
ap
:
uplo ='U'

a_{ij} is stored in
ap(i+j*(j1)/2)
for i < j .

uplo ='L'

a_{ij} is stored in
ap(i+(2*nj)*(j1)/2)
for j < i .

In descriptions of LAPACK routines, arrays with packed matrices have names ending in p
.
Band storage is as follows:
an
m
byn
band matrix with
kl
nonzero subdiagonals and
ku
nonzero superdiagonals is stored compactly in a twodimensional array
ab
with kl+ku+1
rows and
n
columns.
Columns of the matrix are stored in the corresponding columns of the array,
and diagonals of the matrix are stored in rows of the array.
Thus,
a_{ij} is stored in
ab(ku+1+ij,j)
for max(n,jku
) < i
< min(n,j+kl
).
Use the band storage scheme only when
kl
and
ku
are much less than the matrix size
n
.
Although the routines work correctly for all values of
kl
and
ku
,
it is inefficient to use the band storage if your matrices are not really banded.
When a general band matrix is supplied for LU factorization,
space must be allowed to store
kl
additional superdiagonals generated by fillin as a result of row interchanges.
This means that the matrix is stored according to the above scheme,
but with kl+ku
superdiagonals.
Triangular band matrices are stored in the same format,
with either
kl
= 0
in the case of upper triangular, or
ku
= 0
in the case of lower triangular. For symmetric or Hermitian band matrices with
k
subdiagonals or superdiagonals, you need to store only the upper or lower triangle,
as specified by the argument
uplo
:
uplo ='U'

a_{ij} is stored in
ab(k+1+ij,j)
for max(1, jk ) < i < j .

uplo ='L'

a_{ij} is stored in
ab(1+ij,j)
for j < i < min(n,j+k ).

In descriptions of LAPACK routines, arrays that hold matrices in band storage have names ending in b
.
* Legal Information © 1999, 20022004, Intel Corporation