MCPcopy Create free account
hub / github.com/numpy/numpy / lagder

Function lagder

numpy/polynomial/laguerre.py:591–674  ·  view source on GitHub ↗

Differentiate a Laguerre series. Returns the Laguerre series coefficients `c` differentiated `m` times along `axis`. At each iteration the result is multiplied by `scl` (the scaling factor is for use in a linear change of variable). The argument `c` is an array of coefficients

(c, m=1, scl=1, axis=0)

Source from the content-addressed store, hash-verified

589
590
591def lagder(c, m=1, scl=1, axis=0):
592 """
593 Differentiate a Laguerre series.
594
595 Returns the Laguerre series coefficients `c` differentiated `m` times
596 along `axis`. At each iteration the result is multiplied by `scl` (the
597 scaling factor is for use in a linear change of variable). The argument
598 `c` is an array of coefficients from low to high degree along each
599 axis, e.g., [1,2,3] represents the series ``1*L_0 + 2*L_1 + 3*L_2``
600 while [[1,2],[1,2]] represents ``1*L_0(x)*L_0(y) + 1*L_1(x)*L_0(y) +
601 2*L_0(x)*L_1(y) + 2*L_1(x)*L_1(y)`` if axis=0 is ``x`` and axis=1 is
602 ``y``.
603
604 Parameters
605 ----------
606 c : array_like
607 Array of Laguerre series coefficients. If `c` is multidimensional
608 the different axis correspond to different variables with the
609 degree in each axis given by the corresponding index.
610 m : int, optional
611 Number of derivatives taken, must be non-negative. (Default: 1)
612 scl : scalar, optional
613 Each differentiation is multiplied by `scl`. The end result is
614 multiplication by ``scl**m``. This is for use in a linear change of
615 variable. (Default: 1)
616 axis : int, optional
617 Axis over which the derivative is taken. (Default: 0).
618
619 .. versionadded:: 1.7.0
620
621 Returns
622 -------
623 der : ndarray
624 Laguerre series of the derivative.
625
626 See Also
627 --------
628 lagint
629
630 Notes
631 -----
632 In general, the result of differentiating a Laguerre series does not
633 resemble the same operation on a power series. Thus the result of this
634 function may be "unintuitive," albeit correct; see Examples section
635 below.
636
637 Examples
638 --------
639 >>> from numpy.polynomial.laguerre import lagder
640 >>> lagder([ 1., 1., 1., -3.])
641 array([1., 2., 3.])
642 >>> lagder([ 1., 0., 0., -4., 3.], m=2)
643 array([1., 2., 3.])
644
645 """
646 c = np.array(c, ndmin=1, copy=True)
647 if c.dtype.char in '?bBhHiIlLqQpP':
648 c = c.astype(np.double)

Callers 1

laggaussFunction · 0.85

Calls 2

normalize_axis_indexFunction · 0.90
astypeMethod · 0.80

Tested by

no test coverage detected