Skip to content

Commit 30930a6

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 792ee57 commit 30930a6

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

divide_and_conquer/tests/test_strassen_matrix_multiplication.py

+6-20
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,13 @@
33

44

55
class TestSplitMatrix(unittest.TestCase):
6-
76
def test_4x4_matrix(self):
8-
matrix = [
9-
[4, 3, 2, 4],
10-
[2, 3, 1, 1],
11-
[6, 5, 4, 3],
12-
[8, 4, 1, 6]
13-
]
7+
matrix = [[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]]
148
expected = (
159
[[4, 3], [2, 3]],
1610
[[2, 4], [1, 1]],
1711
[[6, 5], [8, 4]],
18-
[[4, 3], [1, 6]]
12+
[[4, 3], [1, 6]],
1913
)
2014
self.assertEqual(split_matrix(matrix), expected)
2115

@@ -28,31 +22,23 @@ def test_8x8_matrix(self):
2822
[4, 3, 2, 4, 4, 3, 2, 4],
2923
[2, 3, 1, 1, 2, 3, 1, 1],
3024
[6, 5, 4, 3, 6, 5, 4, 3],
31-
[8, 4, 1, 6, 8, 4, 1, 6]
25+
[8, 4, 1, 6, 8, 4, 1, 6],
3226
]
3327
expected = (
3428
[[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]],
3529
[[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]],
3630
[[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]],
37-
[[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]]
31+
[[4, 3, 2, 4], [2, 3, 1, 1], [6, 5, 4, 3], [8, 4, 1, 6]],
3832
)
3933
self.assertEqual(split_matrix(matrix), expected)
4034

4135
def test_invalid_odd_matrix(self):
42-
matrix = [
43-
[1, 2, 3],
44-
[4, 5, 6],
45-
[7, 8, 9]
46-
]
36+
matrix = [[1, 2, 3], [4, 5, 6], [7, 8, 9]]
4737
with self.assertRaises(Exception):
4838
split_matrix(matrix)
4939

5040
def test_invalid_non_square_matrix(self):
51-
matrix = [
52-
[1, 2, 3, 4],
53-
[5, 6, 7, 8],
54-
[9, 10, 11, 12]
55-
]
41+
matrix = [[1, 2, 3, 4], [5, 6, 7, 8], [9, 10, 11, 12]]
5642
with self.assertRaises(Exception):
5743
split_matrix(matrix)
5844

0 commit comments

Comments
 (0)