def testLDLRandomPSD(self):
     matrix = self._randomSymmetricMatrix(10, [2, 1, 3],
                                          1e-6,
                                          10.,
                                          forcemin=0.,
                                          seed=42)
     left, diag = self.evaluate(no_pivot_ldl(matrix))
     reconstruct = np.einsum('...ij,...j,...kj->...ik', left, diag, left)
     self.assertAllClose(matrix, reconstruct)
Exemple #2
0
 def testLDLIndefinite(self):
   matrix = [[1., 2.], [2., 1.]]
   left, diag = self.evaluate(no_pivot_ldl(matrix))
   reconstruct = np.einsum('...ij,...j,...kj->...ik', left, diag, left)
   self.assertAllClose(matrix, reconstruct)