mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 18:38:39 +00:00
Update jacobi_iteration_method.py
Replaced init_val with new_val.
This commit is contained in:
parent
2be3f22321
commit
cb4ea2002b
@ -14,7 +14,7 @@ def jacobi_iteration_method(
|
|||||||
constant_matrix: NDArray[float64],
|
constant_matrix: NDArray[float64],
|
||||||
init_val: list[int],
|
init_val: list[int],
|
||||||
iterations: int,
|
iterations: int,
|
||||||
) -> NDArray[float64]:
|
) -> list[float]:
|
||||||
"""
|
"""
|
||||||
Jacobi Iteration Method:
|
Jacobi Iteration Method:
|
||||||
An iterative algorithm to determine the solutions of strictly diagonally dominant
|
An iterative algorithm to determine the solutions of strictly diagonally dominant
|
||||||
@ -160,7 +160,7 @@ def jacobi_iteration_method(
|
|||||||
new_val = (temp + val) / denom
|
new_val = (temp + val) / denom
|
||||||
init_val = new_val
|
init_val = new_val
|
||||||
|
|
||||||
return init_val.tolist()
|
return new_val.tolist()
|
||||||
|
|
||||||
|
|
||||||
# Checks if the given matrix is strictly diagonally dominant
|
# Checks if the given matrix is strictly diagonally dominant
|
||||||
|
Loading…
x
Reference in New Issue
Block a user