Question: 1. (10 pts) Write a script that will read the matrix A from the file matrix. atx using the function scipy. do. mmread. This function


1. (10 pts) Write a script that will read the matrix A from the file matrix. atx using the function scipy. do. mmread. This function will store the matrix in a sparse format. For more information about sparse matrices look the module scipy. sparse. For your convenience try to convert the matrix into NumPy array- 2. (30 pts) Write a function cholesky and bandcholeaky implementing the Cholesky and the banded Cholesky factorizations respectively. 3. (20 pts) Use your functions to factorize the matrix A. Compare your functions with PYTHON 's function numpy . linalg - cholesky. You may need to change to format of the matrix though. 4. (20 pts) Write functions solve and bandsolve to solve the linear system Ar = & with by = 2joy. To verify the accuracy of the results, compute the norm of the error [2 - 2| where f is the numerical solution while a is the exact solution, Le. r, = 1 for all i = 1. ... .n. You may use any norm among the norms II . /1. I - 12. | - - 5. (30 pts) Improve your code by using symmetric band storage. Specifically, taking advantage of the symmetry and the banded structure of the matrix, store the main diagonal and all the left diagonals in the rows of a new p x n (dense) matrix As using the formula: A(1+i- jj) = A(i.j), for jig min(n,j + p). For example, when n = 5 and p = 2 the matrix is being stored in the 3 x 5 matrix Ay: IED OSE 6. (10 pts) Compare the efficiency of all these methods. Among other Indicators present the CPU time required for each implementation
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
