Update jacobi_iteration_method.py

Replaced init_val with new_val.
This commit is contained in:
Kamil 2023-08-09 18:24:29 +05:00 committed by GitHub
parent 2be3f22321
commit cb4ea2002b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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