Matrix Types
The general matrix is the most common type, and most operations
in the Oracle Developer Studio Performance Library operate on the
general matrix. In many cases, there are routines that will work
with the other types of matrices. For example, DGEMM computes
the product of two general matrices, and DTRMM computes
the product of a triangular matrix and a general matrix.
General Matrices
The storage of a general matrix is such that there is a one-to-one correspondence between the elements of the matrix and the elements of the array. Element Aij of matrix A is stored in element A(I,J) of the corresponding array A. The general matrix has no special storage scheme since each of its elements is stored explicitly. In contrast, only the nonzero upper-diagonal, diagonal, and lower-diagonal elements of a general band matrix are stored. The following example shows how a general band matrix is stored in a two-dimensional array. Array locations marked with x are not accessed.
Triangular Matrices
Two storage schemes exist for a triangular matrix. In the unpacked scheme where the matrix is stored in a two-dimensional array, there is a one-to-one correspondence between all elements of the matrix and the elements of the array, but zero entries in the matrix are neither set nor accessed in the array (denoted by x). In the packed storage scheme, nonzero elements of the matrix are packed by column in a one-dimensional array.
A triangular matrix can be stored using packed storage.
A triangular band matrix can be stored in packed storage using a two-dimensional array as shown below. Elements marked with x are not accessed.
Symmetric Matrices
A real symmetric or complex Hermitian matrix is similar to a triangular matrix in that only elements in its upper or lower triangle are explicitly stored in the corresponding elements of a two-dimensional array. The remaining elements of the array (denoted by x below) are neither set nor accessed. The active upper or lower triangle can also be packed by column into a one-dimensional array.
Tridiagonal Matrices
A tridiagonal matrix has nonzero elements only on the main diagonal, the first superdiagonal, and the first subdiagonal. It is stored using three one-dimensional arrays.