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)
def asserter(self): coeffs = rand(n) values = _coeffs2vals(coeffs) _coeffs_ = _vals2coeffs(values) self.assertLessEqual(infnorm(coeffs - _coeffs_), scaled_tol(n))
def asserter(self): values = np.random.rand(n) coeffs = _vals2coeffs(values) _values_ = _coeffs2vals(coeffs) self.assertLessEqual( infnorm(values-_values_), scaled_tol(n) )
def asserter(self): coeffs = np.random.rand(n) values = _coeffs2vals(coeffs) _coeffs_ = _vals2coeffs(values) self.assertLessEqual( infnorm(coeffs-_coeffs_), scaled_tol(n) )