Go to main content
Oracle® Developer Studio 12.6: Performance Library User's Guide

Exit Print View

Updated: July 2017
 
 

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.

General Band Matrix
General Band Matrix in Packed Storage
image:General Band Matrix
image:General Band Matrix in Packed Storage

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.

Triangular Band Matrix
Triangular Matrix in Unpacked Storage
Triangular Matrix in Packed Storage
image:Triangular Band Matrix
image:Triangular Matrix in Unpacked Storage
image:Triangular Matrix in 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.

Triangular Band Matrix
Triangular Band Matrix in Packed Storage
image:Triangular Band Matrix
image:Triangular Band Matrix in Packed Storage

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.

Symmetric Matrix
Symmetric Matrix in Unpacked Storage
Symmetric Matrix in Packed Storage
image:Symmetric Matrix
image:Symmetric Matrix in Unpacked Storage
image:Symmetric Matrix in Packed Storage

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.

Tridiagonal Matrix
Storage for Tridiagonal Matrix
image:A four-by-four Tridiagonal Matrix
image:Storage for Tridiagonal Matrix