Example #1
0
def adaptiveTester(fun, funlen):
    ff = Chebtech2.initfun_adaptive(fun)

    def tester(self):
        self.assertEquals(ff.size, funlen)

    return tester
Example #2
0
def rootsTester(f, roots, tol):
    ff = Chebtech2.initfun_adaptive(f)
    rts = ff.roots()

    def tester(self):
        self.assertLessEqual(infnorm(rts - roots), tol)

    return tester
Example #3
0
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
Example #4
0
 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)
Example #5
0
 def setUp(self):
     self.z = Chebtech2.initfun_adaptive(lambda x: np.exp(np.pi * 1j * x))
Example #6
0
 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)
Example #7
0
def rootsTester(f, roots, tol):
    ff = Chebtech2.initfun_adaptive(f)
    rts = ff.roots()
    def tester(self):
        self.assertLessEqual(infnorm(rts-roots), tol)
    return tester
Example #8
0
def adaptiveTester(fun, funlen):
    ff = Chebtech2.initfun_adaptive(fun)
    def tester(self):
        self.assertEquals(ff.size, funlen)
    return tester
Example #9
0
 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)