def adaptiveTester(fun, funlen): ff = Chebtech2.initfun_adaptive(fun) def tester(self): self.assertEquals(ff.size, funlen) return tester
def rootsTester(f, roots, tol): ff = Chebtech2.initfun_adaptive(f) rts = ff.roots() def tester(self): self.assertLessEqual(infnorm(rts - roots), tol) return tester
def adaptiveTester(fun, funlen): ff = Chebtech2.initfun_adaptive(fun) def tester(self): self.assertLessEqual(ff.size - funlen, 2) self.assertGreater(ff.size - funlen, -1) return tester
def setUp(self): f = lambda x: sin(3 * x) + 5e-1 * cos(30 * x) self.f0 = Chebtech2.initfun_fixedlen(f, 100) self.f1 = Chebtech2.initfun_adaptive(f)
def setUp(self): self.z = Chebtech2.initfun_adaptive(lambda x: np.exp(np.pi * 1j * x))
def setUp(self): f = lambda x: sin(3 * x) + 5e-1 * cos(30 * x) u = lambda x: np.exp(2 * np.pi * 1j * x) self.f0 = Chebtech2.initfun_fixedlen(f, 100) self.f1 = Chebtech2.initfun_adaptive(f) self.f2 = Chebtech2.initfun_adaptive(u)
def rootsTester(f, roots, tol): ff = Chebtech2.initfun_adaptive(f) rts = ff.roots() def tester(self): self.assertLessEqual(infnorm(rts-roots), tol) return tester
def setUp(self): f = lambda x: sin(3*x) + 5e-1*cos(30*x) self.f0 = Chebtech2.initfun_fixedlen(f, 100) self.f1 = Chebtech2.initfun_adaptive(f)