(Poly)
| 457 | |
| 458 | |
| 459 | def test_deriv(Poly): |
| 460 | # Check that the derivative is the inverse of integration. It is |
| 461 | # assumes that the integration has been checked elsewhere. |
| 462 | d = Poly.domain + random((2,))*.25 |
| 463 | w = Poly.window + random((2,))*.25 |
| 464 | p1 = Poly([1, 2, 3], domain=d, window=w) |
| 465 | p2 = p1.integ(2, k=[1, 2]) |
| 466 | p3 = p1.integ(1, k=[1]) |
| 467 | assert_almost_equal(p2.deriv(1).coef, p3.coef) |
| 468 | assert_almost_equal(p2.deriv(2).coef, p1.coef) |
| 469 | # default domain and window |
| 470 | p1 = Poly([1, 2, 3]) |
| 471 | p2 = p1.integ(2, k=[1, 2]) |
| 472 | p3 = p1.integ(1, k=[1]) |
| 473 | assert_almost_equal(p2.deriv(1).coef, p3.coef) |
| 474 | assert_almost_equal(p2.deriv(2).coef, p1.coef) |
| 475 | |
| 476 | |
| 477 | def test_linspace(Poly): |
nothing calls this directly
no test coverage detected