def setUp(self): self.n = 200 self.A = PysparseMatrix(matrix=poisson.poisson2d_sym_blk(self.n)) self.x_exact = numpy.ones(self.n*self.n)/self.n self.normx = 1.0/self.n self.b = self.A * self.x_exact h = 1.0 / self.n lmbd_min = 4.0/h/h * (math.sin(math.pi*h/2.0) ** 2 + math.sin(math.pi*h/2.0) ** 2) lmbd_max = 4.0/h/h * (math.sin((self.n - 1)*math.pi*h/2.0) ** 2 + math.sin((self.n - 1)*math.pi*h/2.0) ** 2) cond = lmbd_max/lmbd_min self.tol = cond * macheps() self.LU = None self.relerr = 0.0 self.descr = '' self.fmt = '\t%10s %8.2e %8.2e %8d %8d %6.2f %6.2f\n'
def setUp(self): self.n = 20 self.A = poisson.poisson2d(self.n) self.S = poisson.poisson2d_sym(self.n) self.B = poisson.poisson2d_sym_blk(self.n)