Add an ELL matrix class, which is a child class of the SparseMatrix class.
ELL format involves padding the non-zero elements to a 2D array and a transposition process to improve the code performance. Although it might occupy more memory than other formats when the rows have highly variable numbers of non-zero elements, ELL always keeps the elements aligned in a simple way that doesn't explicitly need row pointers. ELL format makes it easy to implement the multiplication and evenly divide the job into pieces for parallel computing.
The job of this issue is to implement the construction of ELL matrix class including several attributes and methods so that the code can 1. get more adapted to matrices with similar n of nonzeros per row, and 2. get prepared for future development of parallel computing.
Tasks:
[ ] Define a class ELLMatrix as a child class of SparseMatrix.
[ ] Declare the following attributes:
(size-t) nrows: number of rows
(size-t) nnzs: number of non-zeros
(size-t) lmax: maximum row length (maximum num of non-zeros in one row)
std::vector col_idx: the vector for the column indices of non-zeros (after padding and transposition)
std::vector values: the vector for the values of non-zeros (after padding and transposition)
[ ] Constructors:
[ ] Default constructor: construct a 1x1 identity matrix (nrows=nnzs=lmax=1,col_idx=[0],values=[1])
[ ] Parameterized constructor: read arguments, allocate variables and set up ELL matrix using methods below.
[ ] Also a deconstructor: deallocate the allocated variables and free memory.
[ ] Implement the methods to do the following:
[ ] Figure out the maximum row length.
[ ] Pad and transpose the original data and get ELL col_idx and values.
[ ] Getters: get the private variables including integer attributes and specific position of col_idx and values vectors.
[ ] Display: a void method to show the vector and see if the code did it right.
[ ] Write comments everywhere.
[ ] Check for potential incorrect usage and display what to do.
[ ] Make sure it doesn't corrupt any existing things and it passes compilation.
Definition of done:
[ ] I've done everything above.
[ ] I can construct (both default and parameterized) the ELL class, get the variables and display what I get.
[ ] Naive tests (e.g. identity) pass although this is for the test part.
Description:
Add an ELL matrix class, which is a child class of the SparseMatrix class.
ELL format involves padding the non-zero elements to a 2D array and a transposition process to improve the code performance. Although it might occupy more memory than other formats when the rows have highly variable numbers of non-zero elements, ELL always keeps the elements aligned in a simple way that doesn't explicitly need row pointers. ELL format makes it easy to implement the multiplication and evenly divide the job into pieces for parallel computing.
The job of this issue is to implement the construction of ELL matrix class including several attributes and methods so that the code can 1. get more adapted to matrices with similar n of nonzeros per row, and 2. get prepared for future development of parallel computing.
Tasks:
[ ] Define a class ELLMatrix as a child class of SparseMatrix.
[ ] Declare the following attributes:
[ ] Constructors:
[ ] Implement the methods to do the following:
[ ] Write comments everywhere.
[ ] Check for potential incorrect usage and display what to do.
[ ] Make sure it doesn't corrupt any existing things and it passes compilation.
Definition of done: