A matrix is a rectangular array of either real or complex numbers. A matrix is denoted by a capital letter; its elements are denoted by the same lower case letter with row/column subscripts. Thus, the value of the element in row
Ais denoted by
. For example, a 3 by 4 matrix
A, is written as follows:
Note that with the above notation, we assume the standard Fortran programming language convention of starting array indices at 1 rather than the C programming language convention of starting them at 0.
A matrix in which all of the elements are real numbers is called a real matrix. A matrix that contains at least one complex number is called a complex matrix. A real or complex matrix
Awith the property that
i), is called a symmetric matrix. A complex matrix
Awith the property that
i)), is called a Hermitian matrix. Note that programs that manipulate symmetric and Hermitian matrices need only store half of the matrix values, since the values of the non-stored elements can be quickly reconstructed from the stored values.
A matrix that has the same number of rows as it has columns is referred to as a square matrix. The elements in a square matrix that have same row index and column index are called the diagonal elements of the matrix, or simply the diagonal of the matrix.
The transpose of a matrix
Ais the matrix obtained by “flipping” the elements of the array about its diagonal. That is, we exchange the elements
. For a complex matrix, if we both flip the elements about the diagonal and then take the complex conjugate of the element, the resulting matrix is called the Hermitian transpose or conjugate transpose of the original matrix. The transpose and Hermitian transpose of a matrix
Aare denoted by
A column vector, or simply a vector, is a
matrix, and a row vector is a
1 ×matrix. A real or complex matrix
Ais said to be positive definite if the vector-matrix product
is greater than zero for all non-zero vectors
x. A matrix that is not positive definite is referred to as indefinite.
An upper (or lower) triangular matrix, is a square matrix in which all elements below (or above) the diagonal are zero. A unit triangular matrix is an upper or lower triangular matrix with all 1's along the diagonal.
Pis called a permutation matrix if, for any matrix
A, the result of the matrix product
PAis identical to
Aexcept for interchanging the rows of
A. For a square matrix, it can be shown that if
PAis a permutation of the rows of
is the same permutation of the columns of
A. Additionally, it can be shown that the inverse of
In order to save space, a permutation matrix is usually stored as a linear array, called a permutation vector, rather than as an array. Specifically, if the permutation matrix maps the
i-th row of a matrix to the
j-th row, then the
i-th element of the permutation vector is
A matrix with non-zero elements only on the diagonal is called a diagonal matrix. As is the case with a permutation matrix, it is usually stored as a vector of values, rather than as a matrix.