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

Method test_polyroots

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

Source from the content-addressed store, hash-verified

516 assert_almost_equal(trim(res), trim(tgt))
517
518 def test_polyroots(self):
519 assert_almost_equal(poly.polyroots([1]), [])
520 assert_almost_equal(poly.polyroots([1, 2]), [-.5])
521 for i in range(2, 5):
522 tgt = np.linspace(-1, 1, i)
523 res = poly.polyroots(poly.polyfromroots(tgt))
524 assert_almost_equal(trim(res), trim(tgt))
525
526 def test_polyfit(self):
527 def f(x):

Callers

nothing calls this directly

Calls 3

assert_almost_equalFunction · 0.90
linspaceMethod · 0.80
trimFunction · 0.70

Tested by

no test coverage detected