Question: Part 1: Matrix Multiplication. (50) 1. Use the code makematrix.cpp (included with the assignment) to create matrices of different sizes and sparsity. You can assume

 Part 1: Matrix Multiplication. (50) 1. Use the code makematrix.cpp (included

with the assignment) to create matrices of different sizes and sparsity. Youcan assume the matrices to be square. Compare the time to multiply

Part 1: Matrix Multiplication. (50) 1. Use the code makematrix.cpp (included with the assignment) to create matrices of different sizes and sparsity. You can assume the matrices to be square. Compare the time to multiply two matrices using (i) standard matrix multiplication O(n3); (ii) Strassen's method and (iii) sparse matrix multiplication. Question a. Experiment 1. Change the matrix sizes as follows 20, 30, 100, 500, 1000 keeping sparsity=0 Experiment 2. For matrix size =20 change sparsity=0, 10, 50, 80 Experiment 3. For matrix size =500 change sparsity=0, 10, 50, 80 For each experiment test all the three methods, on the set of matrices and show your results as histograms. (3*10=20) In 1-2 paragraphs discuss your findings (5) Question b. Develop and implement an algorithm that can take in the matrix dimensions and sparsity and identify the best method to use. Test your algorithm for a subset of matrices from experiments from Experiments 1-3. Explain your algorithm clearly in english and as a pseudocode (10) Provide some results of your algorithms and discuss the results in 1-2 paragraphs (5). // Makematrix.cpp // // // Created by Bhowmick, Sanjukta on 1/20/20. // #include #include #include #include #include using namespace std; int main(int arge, char *argv[]) { if (arge 100) sparsity=100;} //Get the numbers srand(time(NULL)); int k=0; int zs-ceil(rows*cols* (double)sparsity/100.00); /mber of zeros. int A[rows][cols]; for (int i=0;i #include #include #include #include using namespace std; int main(int arge, char *argv[]) { if (arge 100) sparsity=100;} //Get the numbers srand(time(NULL)); int k=0; int zs-ceil(rows*cols* (double)sparsity/100.00); /mber of zeros. int A[rows][cols]; for (int i=0;i

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!