### Matrix Storage Schemes

Matrix arguments of Intel® MKL routines can be stored in either one- or two-dimensional arrays, using the following storage schemes:

Full storage is the following obvious scheme: a matrix A is stored in a two-dimensional array `a`, with the matrix element aij 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'` aij is stored in `a(i,j)` for `i` < `j`; other elements of `a` need not be set. `uplo ='L'` aij 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 one-dimensional array `ap`:

 `uplo ='U'` aij is stored in `ap(i+j*(j-1)/2)` for `i` < `j`. `uplo ='L'` aij is stored in `ap(i+(2*n-j)*(j-1)/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`-by-`n` band matrix with `kl` non-zero sub-diagonals and `ku` non-zero super-diagonals is stored compactly in a two-dimensional 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, aij is stored in `ab(ku+1+i-j,j)` for max(`n,j-ku`< `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 super-diagonals generated by fill-in as a result of row interchanges. This means that the matrix is stored according to the above scheme, but with `kl+ku` super-diagonals.

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` sub-diagonals or super-diagonals, you need to store only the upper or lower triangle, as specified by the argument `uplo`:

 `uplo ='U'` aij is stored in `ab(k+1+i-j,j)` for max(1, `j-k`) < `i` < `j`. `uplo ='L'` aij is stored in `ab(1+i-j,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, 2002-2004, Intel Corporation