Skip to content

Commit 2f0a3a4

Browse files
enhanced the test case
1 parent 831c668 commit 2f0a3a4

File tree

1 file changed

+6
-6
lines changed
  • questions/67_implement-compressed-column-sparse-matrix-format-c

1 file changed

+6
-6
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
[
22
{
3-
"test": "dense_matrix = [\n [0, 0, 0],\n [0, 0, 0],\n [0, 0, 0]\n]\nvals, row_idx, col_ptr = compressed_col_sparse_matrix(dense_matrix)\nprint(vals)",
4-
"expected_output": "[]"
3+
"test": "dense_matrix = [\n [0, 0, 0],\n [0, 0, 0],\n [0, 0, 0]\n]\nvals, row_idx, col_ptr = compressed_col_sparse_matrix(dense_matrix)\nprint(vals)\nprint(row_idx)\nprint(col_ptr)",
4+
"expected_output": "[]\n[]\n[0, 0, 0, 0]"
55
},
66
{
7-
"test": "dense_matrix = [\n [0, 0, 0],\n [1, 2, 0],\n [0, 3, 4]\n]\nvals, row_idx, col_ptr = compressed_col_sparse_matrix(dense_matrix)\nprint(vals)",
8-
"expected_output": "[1, 2, 3, 4]"
7+
"test": "dense_matrix = [\n [0, 0, 0],\n [1, 2, 0],\n [0, 3, 4]\n]\nvals, row_idx, col_ptr = compressed_col_sparse_matrix(dense_matrix)\nprint(vals)\nprint(row_idx)\nprint(col_ptr)",
8+
"expected_output": "[1, 2, 3, 4]\n[1, 1, 2, 2]\n[0, 1, 3, 4]"
99
},
1010
{
11-
"test": "dense_matrix = [\n [0, 0, 3, 0, 0],\n [0, 4, 0, 0, 0],\n [5, 0, 0, 6, 0],\n [0, 0, 0, 0, 0],\n [0, 7, 0, 0, 8]\n]\nvals, row_idx, col_ptr = compressed_col_sparse_matrix(dense_matrix)\nprint(vals)",
12-
"expected_output": "[5, 4, 7, 3, 6, 8]"
11+
"test": "dense_matrix = [\n [0, 0, 3, 0, 0],\n [0, 4, 0, 0, 0],\n [5, 0, 0, 6, 0],\n [0, 0, 0, 0, 0],\n [0, 7, 0, 0, 8]\n]\nvals, row_idx, col_ptr = compressed_col_sparse_matrix(dense_matrix)\nprint(vals)\nprint(row_idx)\nprint(col_ptr)",
12+
"expected_output": "[5, 4, 7, 3, 6, 8]\n[2, 1, 4, 0, 2, 4]\n[0, 1, 3, 4, 5, 6]"
1313
}
1414
]

0 commit comments

Comments
 (0)