Skip to content

Commit

Permalink
Format using black
Browse files Browse the repository at this point in the history
  • Loading branch information
Haleshot committed Sep 4, 2024
1 parent bb6e0d0 commit da6ba44
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ def solve_jacobi(A: np.ndarray, b: np.ndarray, n: int) -> list:
m = np.array(A).shape[0]
strided = np.lib.stride_tricks.as_strided
s0, s1 = np.array(A).strides
aij = (strided(np.array(A).ravel()[1:], shape=(m-1,m), strides=(s0+s1,s1)).reshape(m,-1))
aij = strided(
np.array(A).ravel()[1:], shape=(m - 1, m), strides=(s0 + s1, s1)
).reshape(m, -1)
print(aij)




A = [[5, -2, 3], [-3, 9, 1], [2, -1, -7]]
b = [-1, 2, 3]
n = 2
print(solve_jacobi(A=A, b=b, n=n)) # type: ignore
print(solve_jacobi(A=A, b=b, n=n)) # type: ignore

0 comments on commit da6ba44

Please sign in to comment.