numpy.polynomial.hermite_e.hermefromroots#

polynomial.hermite_e.hermefromroots(roots)[source]#

生成具有给定根的 HermiteE 级数。

该函数返回

\[p(x) = (x - r_0) * (x - r_1) * ... * (x - r_n),\]

以 HermiteE 形式表示,其中 \(r_n\)roots 中指定的根。如果一个零点具有重数 n,则它必须在 roots 中出现 n 次。例如,如果 2 是重数为 3 的根,3 是重数为 2 的根,则 roots 看起来就像 [2, 2, 2, 3, 3]。根可以以任何顺序出现。

如果返回的系数是 c,那么

\[p(x) = c_0 + c_1 * He_1(x) + ... + c_n * He_n(x)\]

对于 HermiteE 形式的首一多项式,最后一项的系数通常不为 1。

参数:
rootsarray_like

包含根的序列。

返回:
outndarray

一维系数数组。如果所有根都是实数,则 out 是一个实数数组;如果一些根是复数,则 out 是复数数组,即使结果中的所有系数都是实数(请参阅下面的示例)。

示例

>>> from numpy.polynomial.hermite_e import hermefromroots, hermeval
>>> coef = hermefromroots((-1, 0, 1))
>>> hermeval((-1, 0, 1), coef)
array([0., 0., 0.])
>>> coef = hermefromroots((-1j, 1j))
>>> hermeval((-1j, 1j), coef)
array([0.+0.j, 0.+0.j])