bkochuna / ners570f24-SpMV

3 stars 0 forks source link

Add a CSR view method #37

Open KyleVaughn opened 2 weeks ago

KyleVaughn commented 2 weeks ago

Description:

Add a method which prints a CSR matrix. The input to this method could be the full matrix, or the matrix given in COO format. In this issue, you will recognize the input format of the sparse matrix, and you will convert it to CSR format with the row_index, col_index, and value vectors. The output should be a read-only view of the matrix that dynamically generates these matrices from the input format. This method should not change the input parameters.

Tasks:

1) Ensure that the vectors are initialized properly. 2) Write a method that converts a dense or sparse matrix to CSR format. 3) Ensure that this method handles edge cases, including symmetric matrices and matrices with rows of zeros. 4) Write a function within the class to print the matrix in CSR format. The print values should be the 3 vectors.

Definition of done:

This issue is considered done when all the tasks are complete. The given implementation should output a read-only representation of a matrix in CSR format. This is considered done when it is ready for unit testing, including testing on the symmetric and 'row of zeros' cases.

rsshast commented 1 week ago

I am assigned to this issue

xianyu2023umich commented 3 days ago

I'm reviewing it seems good to me. Point 3 reminds me to add symmetric case in my part that I forgot to so -- thx :-)

rsshast commented 2 days ago

Hi. This method is ready for review. I also created the branch "implementation-CSR", and committed my changes there. This could be useful for anyone using the CSR method.