Skip to content

Commit 3751294

Browse files
committed
[BUG FIX] Matrix must be hermitian.
1 parent 1993e59 commit 3751294

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

EXAMPLES/PYARPACK/pyarpackSparseLDLT.py.in

+5-5
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ for k in range(n):
1919
Aij = np.append(Aij, np.complex128(complex( 200., 200.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
2020
if l == k-1:
2121
Aij = np.append(Aij, np.complex128(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
22-
if l == k+1:
23-
Aij = np.append(Aij, np.complex128(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
22+
if l == k+1: # Note: matrix must be hermitian.
23+
Aij = np.append(Aij, np.complex128(complex(-101., 101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
2424
for k, l, Akl in zip(i, j, Aij):
2525
print("A[", k, ",", l, "] =", Akl)
2626
A = (n, i, j, Aij) # coo format: dimension, i 0-based indices, j 0-based indices, Aij values.
@@ -80,9 +80,9 @@ for k in range(n):
8080
if l == k-1:
8181
Aij = np.append(Aij, np.complex64(complex(-101., -101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
8282
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
83-
if l == k+1:
84-
Aij = np.append(Aij, np.complex64(complex( -99., -99.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
85-
Bij = np.append(Bij, np.complex64(complex( 16.6, 16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
83+
if l == k+1: # Note: matrix must be hermitian.
84+
Aij = np.append(Aij, np.complex64(complex(-101., 101.))) # Casting value on append is MANDATORY or C++ won't get the expected type.
85+
Bij = np.append(Bij, np.complex64(complex( 16.6, -16.6))) # Casting value on append is MANDATORY or C++ won't get the expected type.
8686
for k, l, Akl in zip(i, j, Aij):
8787
print("A[", k, ",", l, "] =", Akl)
8888
for k, l, Bkl in zip(i, j, Bij):

0 commit comments

Comments
 (0)