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

Method test_legroots

numpy/polynomial/tests/test_legendre.py:531–537  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

529 assert_almost_equal(res, tgt)
530
531 def test_legroots(self):
532 assert_almost_equal(leg.legroots([1]), [])
533 assert_almost_equal(leg.legroots([1, 2]), [-.5])
534 for i in range(2, 5):
535 tgt = np.linspace(-1, 1, i)
536 res = leg.legroots(leg.legfromroots(tgt))
537 assert_almost_equal(trim(res), trim(tgt))
538
539 def test_legtrim(self):
540 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