We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f728dfb commit b3009e5Copy full SHA for b3009e5
unittest/python/decompositions/sparse/test_SimplicialLLT.py
@@ -1,4 +1,5 @@
1
import numpy as np
2
+import scipy
3
from scipy.sparse import csc_matrix
4
5
import eigenpy
@@ -30,3 +31,14 @@
30
31
llt.analyzePattern(A)
32
llt.factorize(A)
33
permutation = llt.permutationP()
34
+
35
+X_sparse = scipy.sparse.random(dim, 10, random_state=rng)
36
+B_sparse = A.dot(X_sparse)
37
+B_sparse = B_sparse.tocsc(True)
38
39
+if B_sparse.has_sorted_indices:
40
+ B_sparse.sort_indices()
41
42
+X_est = llt.solve(B_sparse)
43
+assert eigenpy.is_approx(X_est.toarray(), X_sparse.toarray())
44
+assert eigenpy.is_approx(A.dot(X_est.toarray()), B_sparse.toarray())
0 commit comments