示例#1
0
def evalTester(method, fun, evalpts, chebpts):

    x = evalpts
    xk = chebpts
    fvals = fun(xk)

    if method is bary:
        vk = Chebtech2._barywts(fvals.size)
        a = bary(x, fvals, xk, vk)
        tol_multiplier = 1e0

    elif method is clenshaw:
        ak = Chebtech2._vals2coeffs(fvals)
        a = clenshaw(x, ak)
        tol_multiplier = 2e1

    b = fun(evalpts)
    n = evalpts.size
    tol = tol_multiplier * scaled_tol(n)

    return infNormLessThanTol(a, b, tol)
示例#2
0
def evalTester(method, fun, evalpts, chebpts):

    x = evalpts
    xk = chebpts
    fvals = fun(xk)

    if method is bary:
        vk = Chebtech2._barywts(fvals.size)
        a = bary(x, fvals, xk, vk)
        tol_multiplier = 1e0

    elif method is clenshaw:
        ak = Chebtech2._vals2coeffs(fvals)
        a = clenshaw(x, ak)
        tol_multiplier = 2e1

    b = fun(evalpts)
    n = evalpts.size
    tol = tol_multiplier * scaled_tol(n)

    return infNormLessThanTol(a, b, tol)
示例#3
0
 def asserter(self):
     coeffs = rand(n)
     values = _coeffs2vals(coeffs)
     _coeffs_ = _vals2coeffs(values)
     self.assertLessEqual(infnorm(coeffs - _coeffs_), scaled_tol(n))
示例#4
0
 def asserter(self):
     values = np.random.rand(n)
     coeffs = _vals2coeffs(values)
     _values_ = _coeffs2vals(coeffs)
     self.assertLessEqual( infnorm(values-_values_), scaled_tol(n) )
示例#5
0
 def asserter(self):
     coeffs = np.random.rand(n)
     values = _coeffs2vals(coeffs)
     _coeffs_ = _vals2coeffs(values)
     self.assertLessEqual( infnorm(coeffs-_coeffs_), scaled_tol(n) )