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

Function hermint

numpy/polynomial/hermite.py:680–799  ·  view source on GitHub ↗

Integrate a Hermite series. Returns the Hermite series coefficients `c` integrated `m` times from `lbnd` along `axis`. At each iteration the resulting series is **multiplied** by `scl` and an integration constant, `k`, is added. The scaling factor is for use in a linear change

(c, m=1, k=[], lbnd=0, scl=1, axis=0)

Source from the content-addressed store, hash-verified

678
679
680def hermint(c, m=1, k=[], lbnd=0, scl=1, axis=0):
681 """
682 Integrate a Hermite series.
683
684 Returns the Hermite series coefficients `c` integrated `m` times from
685 `lbnd` along `axis`. At each iteration the resulting series is
686 **multiplied** by `scl` and an integration constant, `k`, is added.
687 The scaling factor is for use in a linear change of variable. ("Buyer
688 beware": note that, depending on what one is doing, one may want `scl`
689 to be the reciprocal of what one might expect; for more information,
690 see the Notes section below.) The argument `c` is an array of
691 coefficients from low to high degree along each axis, e.g., [1,2,3]
692 represents the series ``H_0 + 2*H_1 + 3*H_2`` while [[1,2],[1,2]]
693 represents ``1*H_0(x)*H_0(y) + 1*H_1(x)*H_0(y) + 2*H_0(x)*H_1(y) +
694 2*H_1(x)*H_1(y)`` if axis=0 is ``x`` and axis=1 is ``y``.
695
696 Parameters
697 ----------
698 c : array_like
699 Array of Hermite series coefficients. If c is multidimensional the
700 different axis correspond to different variables with the degree in
701 each axis given by the corresponding index.
702 m : int, optional
703 Order of integration, must be positive. (Default: 1)
704 k : {[], list, scalar}, optional
705 Integration constant(s). The value of the first integral at
706 ``lbnd`` is the first value in the list, the value of the second
707 integral at ``lbnd`` is the second value, etc. If ``k == []`` (the
708 default), all constants are set to zero. If ``m == 1``, a single
709 scalar can be given instead of a list.
710 lbnd : scalar, optional
711 The lower bound of the integral. (Default: 0)
712 scl : scalar, optional
713 Following each integration the result is *multiplied* by `scl`
714 before the integration constant is added. (Default: 1)
715 axis : int, optional
716 Axis over which the integral is taken. (Default: 0).
717
718 .. versionadded:: 1.7.0
719
720 Returns
721 -------
722 S : ndarray
723 Hermite series coefficients of the integral.
724
725 Raises
726 ------
727 ValueError
728 If ``m < 0``, ``len(k) > m``, ``np.ndim(lbnd) != 0``, or
729 ``np.ndim(scl) != 0``.
730
731 See Also
732 --------
733 hermder
734
735 Notes
736 -----
737 Note that the result of each integration is *multiplied* by `scl`.

Callers

nothing calls this directly

Calls 5

normalize_axis_indexFunction · 0.90
hermvalFunction · 0.85
astypeMethod · 0.80
ndimMethod · 0.80
allMethod · 0.45

Tested by

no test coverage detected