bkochuna / ners570f23-SpMV

1 stars 0 forks source link

Implement a matvec method for the ELL matrix class #32

Open KyleVaughn opened 11 months ago

KyleVaughn commented 11 months ago

Description:

The SpMV program performs sparse matrix multiplication for various formats, one of these formats is the ELL storage type, this method perform matrix-vector multiplication (Ax=B) when the sparse matrix storage format is ELL. This method will require the input matrix A, the input matrix will need to be stored in a ELL matrix type and will need ELL_row_ptrs and ELL_col_ptrsto accurately assign the matrix, it will also need a vecin and vecout to write the x and B vectors. The multiplication step would require x vector to be informed by the ELL_row_ptrs and ELL_col_ptrs to ensure elements are multiplied correctly.

Tasks:

Definition of done:

The vectorout should be outputted to the right location and the matrix vector multiplication should happen without errors. It should also pass the tests.

KyleVaughn commented 11 months ago

Review by @AnvayPradhan

Lazy-Beee commented 11 months ago

I would suggest using the function interface virtual fp_type* matvec(fp_type* vecin) and I'll add this to the SparseMatrix class.


Edit: change the api to avoid memory leak void matvec(fp_type* vecin, fp_type* vecout)

AnvayPradhan commented 11 months ago

Recommend ensuring ELL tests assembleStorage and disassembleStorage tests pass before testing this matvec method

prathameshnakhate commented 10 months ago

@AshrayMohit I have made ELL matrix class in the ell branch. I have implemented setCoefficient() method such that -1 entries in ColIdx and Val correspond to the zero entries in the matrix(represented by * in HW2 pdf).

I understand that this implementation will fail if the matrix has negative entries. In that case, we can decide on a different placeholder for the zero entry.

Just wanted to let you know since you will require this information while implementing the matvec method