bkochuna / ners570f23-SpMV

1 stars 0 forks source link

Add a COO view method #51

Open KyleVaughn opened 11 months ago

KyleVaughn commented 11 months ago

Description:

if the format is COO then this routine should print the i,j, and values (COO format); Optionally it could also print in matrix form | a1 b1 c1 d1 0 0 e1 | | a2 0 0 0 b2 c2 d2 | ................................. . . . | an bn 0 0 0 0 0 |

This method takes in the roIdx(:), colIdx(:), and value(:) as the input and prints the 2D matrix into a file with filename "COO_matrix.out"

Tasks:

Definition of done:

Must print the matrix with an appropriate format described above in a "COO_matrix.out"

KyleVaughn commented 11 months ago

Review by @lwh1106

lwh1106 commented 11 months ago

The description is quite clear! I love it! Recommend to mention the data type if you write the variables as inputs or outputs. I think you may use cout << rather than >>. Overall, the tasks look great!

lwh1106 commented 11 months ago

Yes, that's it! It looks great now~ Thank you!

zkjiaumich commented 10 months ago

@MeetMPatel Can you push your COO view method to the branch? Thanks!

MeetMPatel commented 10 months ago

Hi @zkjiaumich I will push my changes soon. I was reluctant to push it because of existing compilation error from someone else's commits.

MeetMPatel commented 10 months ago

Hi @zkjiaumich can you check my latest push? (I dont have error in the code part that I pushed). The person dealing with assemble disassemble has compilation errors.

Let me know.

zkjiaumich commented 10 months ago

Sure. I will let you know if there is any issue.

zkjiaumich commented 10 months ago

@MeetMPatel Hi, I tested your view method. Your output COO.out turned to be empty. Can you double check your code? Also, can you delete your "[" and "]" in the output file so that it would be easier for me to test. Thanks!

MeetMPatel commented 10 months ago

What is the error? as long as the I, J and val are finite sized arrays/pttrs it should print it. I can delete the "[" and "]". But I had brackets because of the keeping standard C++ format for the arrays. You could try to read and pass a character for left and right bracket? I did that in my DEN view test if you wanted a reference? Let me know.

Are you certain the construction and assembly routines (written by somebody else) were giving the intended results (if you ran it?) I double checked my code, but it should not print an empty array!

zkjiaumich commented 10 months ago

Your code looks right. It might be the assembly problem. Just let you know what I have in the test.

It would be better if you could delete "[" and "]" since I do not have much time now. I started the review this morning. Thanks!

MeetMPatel commented 10 months ago

No worries. I can remove the bracket for you.

MeetMPatel commented 10 months ago

Let me know if you see the changes. I commented out the "[" and "]".