next up previous
Next: Usage Up: ITPACK 2C: A FORTRAN Previous: Introduction

   
Sparse Matrix Storage

The sparse storage scheme used in ITPACK is a common one. It is a row-wise representation of the nonzero entries in the coefficient matrix of the linear system. For a nonsymmetric coefficient matrix, all of the nonzero values in each row are stored in a contiguous block of data in a real-valued array A(*). If the matrix is symmetric, computer memory can be saved by storing only the nonzero entries in each row on and above the main diagonal. For either nonsymmetric or symmetric sparse storage, associated column numbers are stored in an integer-valued array JA(*) such that ${\bf JA(K)}$ is the column number for the value ${\bf A(K)}$. A mapping vector IA(*) is used to denote the starting locations of each of the contiguous blocks. The beginning of the linear block for row I is given by ${\bf IA(I)}$, the end by ${\bf IA(I+1)-1}$, and its length by ${\bf IA(I+1)-IA(I)}$. Thus, IA(*) will contain ${\bf N+1}$ elements to accommodate a linear system of order N. The entries for each row may be stored in any order in the contiguous block for that row. For example, the coefficient matrix

\begin{displaymath}\left[\begin{array}{ccccc}
11. & 0. & 0. & 14. & 15. \\
0...
... 44. & 45. \\
15. & 0. & 0. & 45. & 55.
\end{array} \right]\end{displaymath}

would be represented in nonsymmetric sparse storage as

\begin{eqnarray*}{\bf A(*)} & = & [11.,14.,15.,22.,33.,14.,44.,45.,15.,45.,55.] ...
...& [1,4,5,2,3,1,4,5,1,4,5] \\
{\bf IA(*)} & = & [1,4,5,6,9,12]
\end{eqnarray*}


and in symmetric sparse storage as

\begin{eqnarray*}{\bf A(*)} & = & [11.,14.,15.,22.,33.,44.,45.,55.] \\
{\bf JA...
..., 4, 5, 2, 3, 4, 5, 5] \\
{\bf IA(*)} & = & [1, 4, 5, 6, 8, 9]
\end{eqnarray*}



next up previous
Next: Usage Up: ITPACK 2C: A FORTRAN Previous: Introduction