bkochuna / ners570f23-SpMV

1 stars 0 forks source link

Implement a matvec method for the COO matrix class #28

Open KyleVaughn opened 11 months ago

KyleVaughn commented 11 months ago

Description:

Add a matvec function to the SparseMatrix_COO class that conducts matrix-vector multiplication. The function takes the x vector and the A matrix (in COO) from function inputs and then conducts matrix-vector multiplication (Ax=b). The resulting b vector is stored in a newly created vector and returned as function output.

Tasks:

Definition of done:

The matvec method can conduct COO matrix-vector multiplication and passes the test.

Lazy-Beee commented 11 months ago

Edited the API to avoid memory leak: void matvec(fp_type vecin, fp_type vecout)

KyleVaughn commented 11 months ago

Review by @maxzog

maxzog commented 11 months ago

Review: The description and tasks are pretty clear in what the issue is and how it will be solved. I'm not a C++ programmer by trade so this comment may be moot, but perhaps it'd be helpful to describe where you will be creating the output vector and how it will be returned to the user. Does your function operate on a pointer to an output vector, does it take in the vector data (?), or does it create the vector in the function? For example, in HW2 we had to perform N multiplications - would your function have that capability by modifying an existing output vector or would the result of the output have to be cumulatively summed by the user?