MCPcopy Create free account
hub / github.com/numpy/numpy / test_chebroots

Method test_chebroots

numpy/polynomial/tests/test_chebyshev.py:555–561  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

553 assert_almost_equal(trim(res), trim(tgt))
554
555 def test_chebroots(self):
556 assert_almost_equal(cheb.chebroots([1]), [])
557 assert_almost_equal(cheb.chebroots([1, 2]), [-.5])
558 for i in range(2, 5):
559 tgt = np.linspace(-1, 1, i)
560 res = cheb.chebroots(cheb.chebfromroots(tgt))
561 assert_almost_equal(trim(res), trim(tgt))
562
563 def test_chebtrim(self):
564 coef = [2, -1, 1, 0]

Callers

nothing calls this directly

Calls 3

assert_almost_equalFunction · 0.90
linspaceMethod · 0.80
trimFunction · 0.70

Tested by

no test coverage detected