Sparse Matrices ( Due 29 Mar 2013 )

There are lots of situations where you will have to use a sparse matrix. We have developed two representations of sparse matrices in class. You will complete the implementation and run the test cases.

The first program that you will complete is TestDenseMatrix.py. The program is almost complete. You will implement the __str__() function that will return a 2-D representation of the matrix with the numbers in neat columns right justified.

In both the TestSparseMatix_1.py and TestSparseMatrix_2.py you will do similar implementations.

The tests for both the programs are similar. You may always write other auxiliary or helper functions if you need them.

For all three programs you will the use the same test cases from the file matrix.txt. But your programs should be general enough to handle matrices of any size.

Use the turnin program to submit the three files - TestDenseMatrix.py, TestSparseMatrix_1.py and TestSparseMatrix_2.py. The proctor should receive your work by 11 PM on Friday, 29 Mar 2013. There will be substantial penalties if you do not adhere to the guidelines.

References