Question: Solve this omework 8.5.1.1. When using iterative methods, the matrices are typically ery sparse. The question then is how to store a sparse matrix and

Solve thisSolve this omework 8.5.1.1. When using iterative methods, the matrices are typically

omework 8.5.1.1. When using iterative methods, the matrices are typically ery sparse. The question then is how to store a sparse matrix and how to erform a matrix-vector multiplication with it. One popular way is known as ompressed row storage that involves three arrays: - 1D array nzA (nonzero A) which stores the nonzero elements of matrix A. In this array, first all nonzero elements of the first row are stored, then the second row, etc. It has size (number of nonzeroes). - 1D array which is an integer array of size n+1 such that equals the index in array nzA where the first element of the first row is stored. then gives the index where the first element of the second row is stored, and so forth. equals Having this entry is convenient when you implement a matrix-vector multiplication with array - 1D array of size which holds the column indices of the corresponding elements in array 1. Write a function [nzA,ir,ic]= Create_Poisson_problem_nzA (N) that creates the matrix A in this sparse format. 2. Write a function y= SparsemvMult ( nzA, ir, ic, x) that computes y=Ax with the matrix A stored in the sparse format

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!