(Poly)
| 118 | |
| 119 | |
| 120 | def test_fromroots(Poly): |
| 121 | # check that requested roots are zeros of a polynomial |
| 122 | # of correct degree, domain, and window. |
| 123 | d = Poly.domain + random((2,)) * .25 |
| 124 | w = Poly.window + random((2,)) * .25 |
| 125 | r = random((5,)) |
| 126 | p1 = Poly.fromroots(r, domain=d, window=w) |
| 127 | assert_equal(p1.degree(), len(r)) |
| 128 | assert_equal(p1.domain, d) |
| 129 | assert_equal(p1.window, w) |
| 130 | assert_almost_equal(p1(r), 0) |
| 131 | |
| 132 | # check that polynomial is monic |
| 133 | pdom = Polynomial.domain |
| 134 | pwin = Polynomial.window |
| 135 | p2 = Polynomial.cast(p1, domain=pdom, window=pwin) |
| 136 | assert_almost_equal(p2.coef[-1], 1) |
| 137 | |
| 138 | |
| 139 | def test_bad_conditioned_fit(Poly): |
nothing calls this directly
no test coverage detected
searching dependent graphs…