コード例 #1
0
ファイル: test_linalg.py プロジェクト: longchao343/sporco
 def test_08(self):
     rho = 1e-1
     N = 128
     M = 64
     K = 32
     D = np.random.randn(N, M)
     X = np.random.randn(M, K)
     S = D.dot(X)
     Z = (D.dot(X).dot(X.T) + rho*D - S.dot(X.T)) / rho
     c, lwr = linalg.cho_factor(X, rho)
     Dslv = linalg.cho_solve_AATI(X, rho, S.dot(X.T) + rho*Z, c, lwr)
     assert(linalg.rrs(Dslv.dot(X).dot(X.T) + rho*Dslv,
                     S.dot(X.T) + rho*Z) < 1e-11)
コード例 #2
0
ファイル: test_linalg.py プロジェクト: bwohlberg/sporco
 def test_08(self):
     rho = 1e-1
     N = 128
     M = 64
     K = 32
     D = np.random.randn(N, M)
     X = np.random.randn(M, K)
     S = D.dot(X)
     Z = (D.dot(X).dot(X.T) + rho*D - S.dot(X.T)) / rho
     c, lwr = linalg.cho_factor(X, rho)
     Dslv = linalg.cho_solve_AATI(X, rho, S.dot(X.T) + rho*Z, c, lwr)
     assert(linalg.rrs(Dslv.dot(X).dot(X.T) + rho*Dslv,
                     S.dot(X.T) + rho*Z) < 1e-11)