MCPcopy Index your code
hub / github.com/numpy/numpy / test_deriv

Function test_deriv

numpy/polynomial/tests/test_classes.py:477–492  ·  view source on GitHub ↗
(Poly)

Source from the content-addressed store, hash-verified

475
476
477def 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
495def test_linspace(Poly):

Callers

nothing calls this directly

Calls 4

assert_almost_equalFunction · 0.90
PolyFunction · 0.85
integMethod · 0.45
derivMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…