bkochuna / ners570f24-SpMV

3 stars 0 forks source link

Add tests for the COO matvec method #18

Open KyleVaughn opened 2 weeks ago

KyleVaughn commented 2 weeks ago

Description:

Create unit tests for the matrix-vector multiplication (matvec) method of the COO (Coordinate List) matrix class. The COO format stores matrix elements as triplets of row, column, and value, making it efficient for sparse matrix operations. However, given the sparse nature of the data, it's important to ensure that the matvec method behaves correctly under a variety of conditions, such as different matrix sizes, sparsity patterns, and edge cases. These tests will ensure the correctness of the matrix-vector multiplication operation across various scenarios. This issue focuses on testing the implementation of .cpp .

Tasks:

  1. Create unit tests for typical cases:
    • Test matrix-vector multiplication for a sparse COO matrix with random non-zero elements and a compatible dense vector.
    • Test non-square matrices (e.g., more rows than columns or vice versa).
      1. Create unit tests for edge cases:
    • Test with an empty COO matrix (no entries).
    • Test when the matrix contains zero values (both explicitly and implicitly).
    • Test multiplication with a vector of zeros.
    • Test for dimension mismatches between the matrix and the vector (expect error or graceful handling). 3.Performance and memory handling:
    • Ensure that the method handles large sparse matrices efficiently.
    • Test that no memory leaks or performance bottlenecks are introduced during multiplication.
  2. Documentation:
    • Clear and concise documentation inside the code.

Definition of done:

  1. Unit tests are created for typical cases, covering sparse matrix-vector multiplication.
  2. Edge cases are tested, including empty matrices, and zero-filled vectors.
  3. All tests pass successfully.
  4. Tests are documented with clear descriptions for each case.
ffarha commented 1 day ago

I'm reviewing this.

ffarha commented 1 day ago

The method is concisely and adequately described, with clear description of the tasks, and a reasonable guideline for what defines done.

However, there is a syntax issue in Tasks, the 3rd point is wrongly indented which also caused the 4th point to become 3rd. The Tasks could have been written with checkboxes that could have been used for the definition of done, I feel like doing that is more comprehensive.