bkochuna / ners570f24-SpMV

3 stars 0 forks source link

Add tests for CSR accessors #32

Open KyleVaughn opened 1 month ago

KyleVaughn commented 1 month ago

Description:

The CSR, or Compressed Sparse Row, matrix storage format is a format that can store matrices with many nonzero elements much more efficiently than a full 2D array representation.

An accessor method of a class is a "getter" function, used to output the attributes of an object without directly accessing or altering them, as the attributes are private. Unit tests of these functions will ensure that the proper values are accessed from the object in the proper format

The following attributes must be targets of the accessor:

  1. nrows, the number of rows of the matrix (size_t)
  2. ncols, the number of columns of the matrix (size_t)
  3. nnz, the number of nonzeros in the matrix (size_t)
  4. aij, an array of the matrix values (templated as float or double)
  5. ja, an array of the column index values corresponding to the values in aij (int)
  6. ia, an array of pointers that specify which positions in aij correspond to moving to the next row (int)

Tasks:

Definition of done:

This task is done when each task box is checked off. If applicable, each main task box requires all subtask boxes to be checked before completion.

AndrewPanter commented 1 month ago

Issue description ready for review

nickamano commented 1 month ago

This issue looks good. I would say that you should consider some edge cases in accessing like making sure it does not modify the value when accessing or something like that but generally looks good.

nickamano commented 4 weeks ago

I added my comments to the implementation CSR accessors pr but after review it looked good and I was able to pull and make without any issues.