Exemplo n.º 1
0
 def test(self):
     rhs = self.rhs
     Ainv = BicgJacobi(self.A, symmetric=True)
     solb = Ainv*rhs
     for i in range(3):
         err = np.linalg.norm(
             self.A*solb[:, i] - rhs[:, i]) / np.linalg.norm(rhs[:, i])
         self.assertLess(err, TOL)
     Ainv.clean()
Exemplo n.º 2
0
 def test(self):
     rhs = self.rhs
     Ainv = BicgJacobi(self.A, symmetric=True)
     solb = Ainv * rhs
     for i in range(3):
         err = np.linalg.norm(self.A * solb[:, i] -
                              rhs[:, i]) / np.linalg.norm(rhs[:, i])
         self.assertLess(err, TOL)
     Ainv.clean()
Exemplo n.º 3
0
 def test_T(self):
     rhs = self.rhs
     Ainv = BicgJacobi(self.A, symmetric=True)
     Ainv.maxIter = 2000
     AinvT = Ainv.T
     solb = AinvT*rhs
     for i in range(3):
         err = np.linalg.norm(
             self.A.T*solb[:, i] - rhs[:, i]) / np.linalg.norm(rhs[:, i])
         self.assertLess(err, TOL)
     Ainv.clean()
Exemplo n.º 4
0
 def test_T(self):
     rhs = self.rhs
     Ainv = BicgJacobi(self.A, symmetric=True)
     Ainv.maxIter = 2000
     AinvT = Ainv.T
     solb = AinvT * rhs
     for i in range(3):
         err = np.linalg.norm(self.A.T * solb[:, i] -
                              rhs[:, i]) / np.linalg.norm(rhs[:, i])
         self.assertLess(err, TOL)
     Ainv.clean()