(Poly)
| 475 | |
| 476 | |
| 477 | def test_deriv(Poly): |
| 478 | # Check that the derivative is the inverse of integration. It is |
| 479 | # assumes that the integration has been checked elsewhere. |
| 480 | d = Poly.domain + random((2,)) * .25 |
| 481 | w = Poly.window + random((2,)) * .25 |
| 482 | p1 = Poly([1, 2, 3], domain=d, window=w) |
| 483 | p2 = p1.integ(2, k=[1, 2]) |
| 484 | p3 = p1.integ(1, k=[1]) |
| 485 | assert_almost_equal(p2.deriv(1).coef, p3.coef) |
| 486 | assert_almost_equal(p2.deriv(2).coef, p1.coef) |
| 487 | # default domain and window |
| 488 | p1 = Poly([1, 2, 3]) |
| 489 | p2 = p1.integ(2, k=[1, 2]) |
| 490 | p3 = p1.integ(1, k=[1]) |
| 491 | assert_almost_equal(p2.deriv(1).coef, p3.coef) |
| 492 | assert_almost_equal(p2.deriv(2).coef, p1.coef) |
| 493 | |
| 494 | |
| 495 | def test_linspace(Poly): |
nothing calls this directly
no test coverage detected
searching dependent graphs…