Generate a HermiteE series with given roots. The function returns the coefficients of the polynomial .. math:: p(x) = (x - r_0) * (x - r_1) * ... * (x - r_n), in HermiteE form, where the :math:`r_n` are the roots specified in `roots`. If a zero has multiplicity n, then it mus
(roots)
| 255 | |
| 256 | |
| 257 | def hermefromroots(roots): |
| 258 | """ |
| 259 | Generate a HermiteE series with given roots. |
| 260 | |
| 261 | The function returns the coefficients of the polynomial |
| 262 | |
| 263 | .. math:: p(x) = (x - r_0) * (x - r_1) * ... * (x - r_n), |
| 264 | |
| 265 | in HermiteE form, where the :math:`r_n` are the roots specified in `roots`. |
| 266 | If a zero has multiplicity n, then it must appear in `roots` n times. |
| 267 | For instance, if 2 is a root of multiplicity three and 3 is a root of |
| 268 | multiplicity 2, then `roots` looks something like [2, 2, 2, 3, 3]. The |
| 269 | roots can appear in any order. |
| 270 | |
| 271 | If the returned coefficients are `c`, then |
| 272 | |
| 273 | .. math:: p(x) = c_0 + c_1 * He_1(x) + ... + c_n * He_n(x) |
| 274 | |
| 275 | The coefficient of the last term is not generally 1 for monic |
| 276 | polynomials in HermiteE form. |
| 277 | |
| 278 | Parameters |
| 279 | ---------- |
| 280 | roots : array_like |
| 281 | Sequence containing the roots. |
| 282 | |
| 283 | Returns |
| 284 | ------- |
| 285 | out : ndarray |
| 286 | 1-D array of coefficients. If all roots are real then `out` is a |
| 287 | real array, if some of the roots are complex, then `out` is complex |
| 288 | even if all the coefficients in the result are real (see Examples |
| 289 | below). |
| 290 | |
| 291 | See Also |
| 292 | -------- |
| 293 | numpy.polynomial.polynomial.polyfromroots |
| 294 | numpy.polynomial.legendre.legfromroots |
| 295 | numpy.polynomial.laguerre.lagfromroots |
| 296 | numpy.polynomial.hermite.hermfromroots |
| 297 | numpy.polynomial.chebyshev.chebfromroots |
| 298 | |
| 299 | Examples |
| 300 | -------- |
| 301 | >>> from numpy.polynomial.hermite_e import hermefromroots, hermeval |
| 302 | >>> coef = hermefromroots((-1, 0, 1)) |
| 303 | >>> hermeval((-1, 0, 1), coef) |
| 304 | array([0., 0., 0.]) |
| 305 | >>> coef = hermefromroots((-1j, 1j)) |
| 306 | >>> hermeval((-1j, 1j), coef) |
| 307 | array([0.+0.j, 0.+0.j]) |
| 308 | |
| 309 | """ |
| 310 | return pu._fromroots(hermeline, hermemul, roots) |
| 311 | |
| 312 | |
| 313 | def hermeadd(c1, c2): |
nothing calls this directly
no test coverage detected
searching dependent graphs…