mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-05 17:34:49 +08:00
Add flake8-builtins to pre-commit and fix errors (#7105)
Ignore `A003` Co-authored-by: Christian Clauss <cclauss@me.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Dhruv Manilawala <dhruvmanila@gmail.com>
This commit is contained in:
@ -147,14 +147,14 @@ def strictly_diagonally_dominant(table: NDArray[float64]) -> bool:
|
||||
is_diagonally_dominant = True
|
||||
|
||||
for i in range(0, rows):
|
||||
sum = 0
|
||||
total = 0
|
||||
for j in range(0, cols - 1):
|
||||
if i == j:
|
||||
continue
|
||||
else:
|
||||
sum += table[i][j]
|
||||
total += table[i][j]
|
||||
|
||||
if table[i][i] <= sum:
|
||||
if table[i][i] <= total:
|
||||
raise ValueError("Coefficient matrix is not strictly diagonally dominant")
|
||||
|
||||
return is_diagonally_dominant
|
||||
|
Reference in New Issue
Block a user