bkochuna / ners570f24-SpMV

2 stars 0 forks source link

Add tests for ELL accessors #33

Open KyleVaughn opened 1 week ago

KyleVaughn commented 1 week ago

Description:

Accessor methods are used to retrieve the private attributes of a particular class and make them available for use elsewhere in the script. For the ELL Sparse Matrix format, these private attributes (based on Lec 12 Notes) include:

1. nrows - The total number of rows in the original matrix, size _sizet 2. ncols - The total number of columns in the original matrix, size _sizet 3. nnz - The number of non-zeroes in the original matrix, size _sizet 6. maxnnz_row - The number of non-zeroes in the longest row of non-zeroes, size int 4. aij - Array of padded values of the non-zero at original coordinate (I,J) sorted in column major, size double or float 5. ja - Array of padded column indices for each non-zero number sorted in column major, size int

Testing must ensure that, at the very least, all the implemented accessors:

  1. Return the default attribute values if the ELL matrix has not yet been created
  2. Return the correct attribute values if the ELL matrix has been created

Additional tests can be implemented and discussion with the ELL accessor developer will be held in order to determine the extent of these tests.

Tasks:

  1. Confirm formatting of ELL accessors with ELL accessor developer. This formatting would include how each private attribute accessor is named and the order in which they are implemented.

    • [ ] Arranged meeting with ELL accessor developer
    • [ ] Confirmed formatting with developer
    • [ ] Discussed potential tests for accessor methods
  2. Develop _unit_test_ELLaccessors.cpp. This script is the script that will be used to perform the unit tests. Comments should be included to ensure that each test case is properly documented

    • [ ] Determined full list of unit tests to be performed and update this description to include the list.
    • [ ] Wrote unit tests framework, test inputs, and expected outputs for nrows accessor
    • [ ] Wrote unit tests framework, test inputs, and expected outputs for ncols accessor
    • [ ] Wrote unit tests framework, test inputs, and expected outputs for nnz accessor
    • [ ] Wrote unit tests framework, test inputs, and expected outputs for aij accessor
    • [ ] Wrote unit tests framework, test inputs, and expected outputs for ja accessor
    • [ ] Wrote the test inputs and expected outputs for each of the frameworks
  3. Test the accessor methods. The later boxes can potentially be marked by default if none of the unit tests fail on the first run.

    • [ ] Confirmed with ELL accessor developer that the methods are ready for testing
    • [ ] Ran all unit tests
    • [ ] Reported any failed unit tests to ELL accessor developer
    • [ ] Reran unit tests to test new accessor changes from ELL accessor developer
  4. Finalization.

    • [ ] Confirmed all unit tests have successfully passed
    • [ ] Communicated success of unit tests to ELL accessor developer
    • [ ] Push _unit_test_ELLaccessors.cpp and update makefile as needed

Definition of done:

Each task has a corresponding checkbox. As tasks are completed, these checkboxes will be gradually checked off. Once each checkbox has been marked, then the task will be considered complete.

MattGranados commented 4 hours ago

@PengYululu I have updated the issue description and would appreciate your review of it. Thanks in advance!