next up previous contents index
Next: Packed Storage Up: Matrix Storage Schemes Previous: Matrix Storage Schemes   Contents   Index


Conventional Storage

The default scheme for storing matrices is the obvious one described in subsection 5.1.6: a matrix A is stored in a two-dimensional array A, with matrix element aij stored in 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 accessed. The remaining elements of the array need not be set. Such elements are indicated by $\ast$ in the examples below. For example, when n = 4:

UPLO Triangular matrix A Storage in array A
`U' $
\left( \begin{array}{cccc}
a_{11} & a_{12} & a_{13} & a_{14} \\
& a_{22} & a_{23} & a_{24} \\
& & a_{33} & a_{34} \\
& & & a_{44}
\end{array} \right)
$ $
\begin{array}{cccc}
a_{11} & a_{12} & a_{13} & a_{14} \\
\ast & a_{22} & a_{...
...\\
\ast & \ast & a_{33} & a_{34} \\
\ast & \ast & \ast & a_{44}
\end{array}$
`L' $
\left( \begin{array}{cccc}
a_{11} & & & \\
a_{21} & a_{22} & & \\
a_{31} & a_{32} & a_{33} & \\
a_{41} & a_{42} & a_{43} & a_{44}
\end{array} \right)
$ $
\begin{array}{cccc}
a_{11} & \ast & \ast & \ast \\
a_{21} & a_{22} & \ast & \...
...{31} & a_{32} & a_{33} & \ast \\
a_{41} & a_{42} & a_{43} & a_{44}
\end{array}$

Similarly, if the matrix is upper Hessenberg, elements below the first subdiagonal need not be set.

Routines that handle symmetric or Hermitian matrices allow for either the upper or lower triangle of the matrix (as specified by UPLO) to be stored in the corresponding elements of the array; the remaining elements of the array need not be set. For example, when n = 4:

UPLO Hermitian matrix A Storage in array A
`U' $
\left( \begin{array}{cccc}
a_{11} & a_{12} & a_{13} & a_{14} \\
\bar{a}_{12} ...
...4} \\
\bar{a}_{14} & \bar{a}_{24} & \bar{a}_{34} & a_{44}
\end{array} \right)
$ $
\begin{array}{cccc}
a_{11} & a_{12} & a_{13} & a_{14} \\
\ast & a_{22} & a_{...
...\\
\ast & \ast & a_{33} & a_{34} \\
\ast & \ast & \ast & a_{44}
\end{array}$
`L' $
\left( \begin{array}{cccc}
a_{11} & \bar{a}_{21} & \bar{a}_{31} & \bar{a}_{41}...
..._{33} & \bar{a}_{43} \\
a_{41} & a_{42} & a_{43} & a_{44}
\end{array} \right)
$ $
\begin{array}{cccc}
a_{11} & \ast & \ast & \ast \\
a_{21} & a_{22} & \ast & \...
...{31} & a_{32} & a_{33} & \ast \\
a_{41} & a_{42} & a_{43} & a_{44}
\end{array}$


next up previous contents index
Next: Packed Storage Up: Matrix Storage Schemes Previous: Matrix Storage Schemes   Contents   Index
Susan Blackford
1999-10-01