Assignment 1: Sparse Matrix Multiplication

Write a C++ program to

1.      Read two sparse square matrices, where two matrices are given as

n : size of matrix – matrix A

m : number of non-zero elements

row1, col1, value1

row2, col2, value2

rowm, colm, valuem

n : size of matrix – matrix B

m : number of non-zero elements

row1, col1, value1

row2, col2, value2

rowm, colm, valuem

 

2.      Multiply them without converting to normal matrix

3.      Convert the result matrix to normal matrix and write it as

n  : size of matrix

a11, a12, . . ., a1n

a21, a22, . . ., a2n

an1, an2, . . ., ann

 

The input file for two matrices is matrix.inp and the output file should be matrix.out.

 

Due date: Delayed to Sept 30 (6 pm).

Submission: The program should be submitted via ESPA site. You may find sample data about input and output in ESPA site. The manual will be given at  http://lik.pnu.kr/DataStructures/2019/ESPA%20User%20Menual(DS2019)%20Eng.ver.pdf.