5903 Intro Scientific Prog:
MatrixB: Specification
- Basic Matrix Algebra for Sparse and Full matrices. Procedures need to be provided to
- Read sparse matrices in the ".5903SparseMatrix" format from a file.
- Read full matrices using the spec from the earlier assignment.
- Write matrices in both sparse and full formats. Two seperate procedures is good.
- Check that the sparse matrix file is ordered.
- Order a file for writing to the sparse matrix format.
- Convert from Sparse representation to Full representation.
- Compute matrix matrix (with vector as a special case of a single rowed matrix) products in all combinations
- Full.Full
- Full.Sparse
- Sparse.Full
- Sparse.Sparse
- Test your code on small samples. I will provide them on request but it should be simple enough to make your own.
- You should organize your code into seperate files and
make the "makefile" reasonably compact. Provide some estimate of
the operation count in the header for the factorization algorithm.
- 5903SparseMatrix storage format: As we decided the format for
an mxn sparse matrix is an array of m pointers to m rows. Each
row is a strcuture composed of: an integer-giving the length of the
row; an integer giving the number of non-zero entries in the row; and
two arrays (one of j and one of f values) containing the non-zero
values.
or: skip the full row length in the row spec and just pass it in the sparsematrix structure!
- 5903SparseMatrix file format: As we decided the format (with m and n
integers) is where is and js give the position of the float values f.
5903SparseMatrix \n
m \t n \t float \n
i1 \t j1 \t f1 \n
i2 \t j2 \t f2 \n
i3 \t j3 \t f3 \n
i4 \t j4 \t f4 \n
...