Skip to content

Commit 6e9e640

Browse files
committed
SparseLU: Add adjoint and transpose in unit test
1 parent 54b6ee9 commit 6e9e640

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/test_sparse_lu.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,15 @@
6161
x_reconstructed[P_cols_indices] = y
6262

6363
assert nanoeigenpy.is_approx(x_reconstructed, x_true, 1e-6)
64+
65+
splu_transpose = splu.transpose()
66+
splu_adjoint = splu.adjoint()
67+
68+
x_true = rng.random(dim)
69+
b_transpose = A.T.dot(x_true)
70+
x_est = splu_transpose.solve(b_transpose)
71+
assert nanoeigenpy.is_approx(x_true, x_est)
72+
73+
x_est_adj = splu_adjoint.solve(b_transpose)
74+
assert nanoeigenpy.is_approx(x_true, x_est_adj)
75+
assert nanoeigenpy.is_approx(x_est, x_est_adj)

0 commit comments

Comments
 (0)