MCPcopy Index your code
hub / github.com/numpy/numpy / test_approximation

Method test_approximation

numpy/polynomial/tests/test_classes.py:616–625  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

614 assert_(Chebyshev.interpolate(self.f, deg).degree() == deg)
615
616 def test_approximation(self):
617
618 def powx(x, p):
619 return x**p
620
621 x = np.linspace(0, 2, 10)
622 for deg in range(10):
623 for t in range(deg + 1):
624 p = Chebyshev.interpolate(powx, deg, domain=[0, 2], args=(t,))
625 assert_almost_equal(p(x), powx(x, t), decimal=11)

Callers

nothing calls this directly

Calls 3

assert_almost_equalFunction · 0.90
linspaceMethod · 0.80
interpolateMethod · 0.80

Tested by

no test coverage detected