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

Method test_polyfromroots

numpy/polynomial/tests/test_polynomial.py:509–516  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

507class TestMisc:
508
509 def test_polyfromroots(self):
510 res = poly.polyfromroots([])
511 assert_almost_equal(trim(res), [1])
512 for i in range(1, 5):
513 roots = np.cos(np.linspace(-np.pi, 0, 2*i + 1)[1::2])
514 tgt = Tlist[i]
515 res = poly.polyfromroots(roots)*2**(i-1)
516 assert_almost_equal(trim(res), trim(tgt))
517
518 def test_polyroots(self):
519 assert_almost_equal(poly.polyroots([1]), [])

Callers

nothing calls this directly

Calls 3

assert_almost_equalFunction · 0.90
linspaceMethod · 0.80
trimFunction · 0.70

Tested by

no test coverage detected