(self)
| 517 | class TestMisc: |
| 518 | |
| 519 | def test_legfromroots(self): |
| 520 | res = leg.legfromroots([]) |
| 521 | assert_almost_equal(trim(res), [1]) |
| 522 | for i in range(1, 5): |
| 523 | roots = np.cos(np.linspace(-np.pi, 0, 2*i + 1)[1::2]) |
| 524 | pol = leg.legfromroots(roots) |
| 525 | res = leg.legval(roots, pol) |
| 526 | tgt = 0 |
| 527 | assert_(len(pol) == i + 1) |
| 528 | assert_almost_equal(leg.leg2poly(pol)[-1], 1) |
| 529 | assert_almost_equal(res, tgt) |
| 530 | |
| 531 | def test_legroots(self): |
| 532 | assert_almost_equal(leg.legroots([1]), []) |
nothing calls this directly
no test coverage detected