Open KyleVaughn opened 11 months ago
Review by @AnvayPradhan
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)
Recommend ensuring ELL tests assembleStorage and disassembleStorage tests pass before testing this matvec method
@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
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
andELL_col_ptrs
to accurately assign the matrix, it will also need avecin
andvecout
to write the x and B vectors. The multiplication step would require x vector to be informed by theELL_row_ptrs
andELL_col_ptrs
to ensure elements are multiplied correctly.Tasks:
SpMV_ELL
.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.