Пример #1
0
 def testSolveCholesky(self):
    
    x = ls.solveCholesky(self.A, self.b1, self.n) 
    self.assertMatrixAlmosteEqual(self.x1, x, 14)
      
    x = ls.solveCholesky(self.complexA, self.complexb, self.n)    
    self.assertMatrixAlmosteEqual(self.complexx, x, 14)
    
    x_ref = mynp.linalg.solve(self.randA, self.randb)
    x = ls.solveCholesky(self.randA, self.randb, self.L)                     
    self.assertMatrixAlmosteEqual(x_ref, x, 15)
Пример #2
0
 def testSolveUHDUvsCholesky(self):
    
    x_uhdu = ls.solveUHDU(self.randA, self.randb, self.L)
    x_chol = ls.solveCholesky(self.randA, self.randb, self.L)
                     
    self.assertMatrixAlmosteEqual(x_uhdu, x_chol, 15)