We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e963383 commit e8e52b7Copy full SHA for e8e52b7
maths/numerical_analysis/gauss_seidel_method.py
@@ -35,9 +35,7 @@ def gauss_seidel(
35
sum_after = sum(coefficients[i][j] * x[j] for j in range(i + 1, n))
36
x_new[i] = (rhs[i] - sum_before - sum_after) / coefficients[i][i]
37
38
- # Convergence check
39
if all(abs(x_new[i] - x[i]) < tol for i in range(n)):
40
- # Return rounded results for stable test comparison
41
return [round(val, 10) for val in x_new]
42
43
x = x_new
0 commit comments