Ejemplo n.º 1
0
 def test_unitary_vectors(self, bigsparsemat, SVDType):
     a = bigsparsemat
     uk, sk, vk = svds_slepc(a, k=10, return_vecs=True, SVDType=SVDType)
     assert_allclose(uk.H @ uk, eye(10), atol=1e-6)
     assert_allclose(vk @ vk.H, eye(10), atol=1e-6)
     pk, lk, qk = svds_scipy(a, k=10, return_vecs=True)
     assert_allclose(sk, lk)
     assert pk.shape == uk.shape
     assert vk.shape == qk.shape
     assert_allclose(abs(uk.H @ pk), eye(10), atol=1e-6)
     assert_allclose(abs(qk @ vk.H), eye(10), atol=1e-6)
Ejemplo n.º 2
0
 def test_random_compare_scipy(self, bigsparsemat, SVDType):
     a = bigsparsemat
     lk = svds_slepc(a, k=5, return_vecs=False, SVDType=SVDType)
     ls = svds_scipy(a, k=5, return_vecs=False)
     assert_allclose(lk, ls)
Ejemplo n.º 3
0
 def test_simple(self, prematsparse):
     u, a = prematsparse
     lk = svds_slepc(a, k=1, return_vecs=False)
     assert_allclose(lk, 4)