next up previous

Exercise 8: Determination of the bandwidth and the non-zero values.

The features of the matrix A (symmetric, positive definitive, and sparse), resulting from a FE formulation, significantly affect the strategy for solving the system of equations. Write a program to calculate the bandwidth of the matrix A in A_transfer.dat and estimate the minimum size of the matrix (assuming double precision reals) based upon your bandwidth estimate. Now write a program to calculate the number of nonzero entries in the matrix A. You should find that the proportion of nonzero to zero entries is quite small. Because of the ``wasted space'' all those zeros take up, methods have been developed to store the matrix in a form such that one doesn't ever have to store a zero.

Referencing the chapter on Numerical Linear Algebra and the references therein, write a routine to store the matrix $A$ in a compressed format. Compare the size of the resulting size of the matrix (and/or vectors) with the original size.