3.1 Matrix Classes
The BLAS exploit several types of matrix structure: symmetric, Hermitian,
triangular, and banded. We represent all these matrix classes by dense real or
complex matrix objects, with additional arguments that specify the structure.
-
Vector
- A real or complex n-vector is represented by a matrix of type ’d’ or
’z’ and length n, with the entries of the vector stored in column-major
order.
-
General matrix
- A general real or complex m by n matrix is represented by a
real or complex matrix of size (m, n).
-
Symmetric matrix
- A real or complex symmetric matrix of order n is represented
by a real or complex matrix of size (n, n), and a character argument uplo with
two possible values: ’L’ and ’U’. If uplo is ’L’, the lower triangular part of
the symmetric matrix is stored; if uplo is ’U’, the upper triangular part is
stored. A square matrix X of size (n, n) can therefore be used to represent the
symmetric matrices
-
Complex Hermitian matrix
- A complex Hermitian matrix of order n is
represented by a matrix of type ’z’ and size (n, n), and a character
argument uplo with the same meaning as for symmetric matrices. A
complex matrix X of size (n, n) can represent the Hermitian matrices
-
Triangular matrix
- A real or complex triangular matrix of order n is represented
by a real or complex matrix of size (n, n), and two character arguments: an
argument uplo with possible values ’L’ and ’U’ to distinguish between lower
and upper triangular matrices, and an argument diag with possible values ’U’
and ’N’ to distinguish between unit and non-unit triangular matrices. A
square matrix X of size (n, n) can represent the triangular matrices
-
General band matrix
- A general real or complex m by n band matrix
with kl subdiagonals and ku superdiagonals is represented by a real or
complex matrix X of size (kl + ku + 1, n), and the two integers m and kl.
The diagonals of the band matrix are stored in the rows of X, starting
at the top diagonal, and shifted horizontally so that the entries of
the kth column of the band matrix are stored in column k of X. A
matrix X of size (kl + ku + 1, n) therefore represents the m by n band
matrix
-
Symmetric band matrix
- A real or complex symmetric band matrix of order n
with k subdiagonals, is represented by a real or complex matrix X of size (k + 1,
n), and an argument uplo to indicate whether the subdiagonals (uplo is ’L’) or
superdiagonals (uplo is ’U’) are stored. The k + 1 diagonals are stored as rows
of X, starting at the top diagonal (i.e., the main diagonal if uplo is ’L’, or the
kth superdiagonal if uplo is ’U’) and shifted horizontally so that the entries of
the kth column of the band matrix are stored in column k of X. A
matrix X of size (k + 1, n) can therefore represent the band matrices
-
Hermitian band matrix
- A complex Hermitian band matrix of order n with k
subdiagonals is represented by a complex matrix of size (k + 1, n) and
an argument uplo, with the same meaning as for symmetric band
matrices. A matrix X of size (k + 1, n) can represent the band matrices
-
Triangular band matrix
- A triangular band matrix of order n with k subdiagonals
or superdiagonals is represented by a real complex matrix of size (k + 1, n) and
two character arguments uplo and diag, with similar conventions as for
symmetric band matrices. A matrix X of size (k + 1, n) can represent the band
matrices
When discussing BLAS functions in the following sections we will omit several less
important optional arguments that can be used to select submatrices for in-place
operations. The complete specification is documented in the docstrings of the source
code, and can be viewed with the pydoc help program.