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

Method test_hermefromroots

numpy/polynomial/tests/test_hermite_e.py:510–520  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

508class TestMisc:
509
510 def test_hermefromroots(self):
511 res = herme.hermefromroots([])
512 assert_almost_equal(trim(res), [1])
513 for i in range(1, 5):
514 roots = np.cos(np.linspace(-np.pi, 0, 2*i + 1)[1::2])
515 pol = herme.hermefromroots(roots)
516 res = herme.hermeval(roots, pol)
517 tgt = 0
518 assert_(len(pol) == i + 1)
519 assert_almost_equal(herme.herme2poly(pol)[-1], 1)
520 assert_almost_equal(res, tgt)
521
522 def test_hermeroots(self):
523 assert_almost_equal(herme.hermeroots([1]), [])

Callers

nothing calls this directly

Calls 4

assert_almost_equalFunction · 0.90
assert_Function · 0.90
linspaceMethod · 0.80
trimFunction · 0.70

Tested by

no test coverage detected