Skip to content

Commit 0d74d80

Browse files
style: Apply automatic formatting fixes
1 parent 8110425 commit 0d74d80

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

matrix/strassen.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,7 @@ def split_matrix(matrix: Matrix) -> tuple[Matrix, Matrix, Matrix, Matrix]:
118118
return a11, a12, a21, a22
119119

120120

121-
def combine_matrices(
122-
c11: Matrix, c12: Matrix, c21: Matrix, c22: Matrix
123-
) -> Matrix:
121+
def combine_matrices(c11: Matrix, c12: Matrix, c21: Matrix, c22: Matrix) -> Matrix:
124122
"""
125123
Combines four quadrants into a single matrix.
126124
>>> a, b, c, d = split_matrix(matrix_count_up)
@@ -185,9 +183,7 @@ def strassen(matrix_a: Matrix, matrix_b: Matrix) -> Matrix:
185183
return []
186184

187185
if not (
188-
len(matrix_a) == len(matrix_b)
189-
and is_square(matrix_a)
190-
and is_square(matrix_b)
186+
len(matrix_a) == len(matrix_b) and is_square(matrix_a) and is_square(matrix_b)
191187
):
192188
raise ValueError("Matrices must be square and of the same dimensions")
193189

@@ -244,7 +240,7 @@ def strassen(matrix_a: Matrix, matrix_b: Matrix) -> Matrix:
244240
from timeit import timeit
245241

246242
# Run fewer iterations as Strassen is slower for small matrices in Python
247-
mytimeit = partial(timeit, globals=globals(), number=10_0DENIED)
243+
mytimeit = partial(timeit, globals=globals(), number=10_000)
248244
for func in ("matrix_multiply", "strassen"):
249245
print(
250246
f"{func:>25}(): "

0 commit comments

Comments
 (0)