Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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 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 formatStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started