Skip to content

Commit

Permalink
Update logic
Browse files Browse the repository at this point in the history
  • Loading branch information
Haleshot committed Sep 4, 2024
1 parent da6ba44 commit b30a081
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@

def solve_jacobi(A: np.ndarray, b: np.ndarray, n: int) -> list:
aii = np.diag(A).tolist()
# print(A.shape[0])

# print(aii)
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)
print(aij)
# print(aij)


A = [[5, -2, 3], [-3, 9, 1], [2, -1, -7]]
Expand Down

0 comments on commit b30a081

Please sign in to comment.