Multiply a polynomial by x. Multiply the polynomial `c` by x, where x is the independent variable. Parameters ---------- c : array_like 1-D array of polynomial coefficients ordered from low to high. Returns ------- out : ndarray Array repre
(c)
| 286 | |
| 287 | |
| 288 | def polymulx(c): |
| 289 | """Multiply a polynomial by x. |
| 290 | |
| 291 | Multiply the polynomial `c` by x, where x is the independent |
| 292 | variable. |
| 293 | |
| 294 | |
| 295 | Parameters |
| 296 | ---------- |
| 297 | c : array_like |
| 298 | 1-D array of polynomial coefficients ordered from low to |
| 299 | high. |
| 300 | |
| 301 | Returns |
| 302 | ------- |
| 303 | out : ndarray |
| 304 | Array representing the result of the multiplication. |
| 305 | |
| 306 | See Also |
| 307 | -------- |
| 308 | polyadd, polysub, polymul, polydiv, polypow |
| 309 | |
| 310 | Notes |
| 311 | ----- |
| 312 | |
| 313 | .. versionadded:: 1.5.0 |
| 314 | |
| 315 | """ |
| 316 | # c is a trimmed copy |
| 317 | [c] = pu.as_series([c]) |
| 318 | # The zero series needs special treatment |
| 319 | if len(c) == 1 and c[0] == 0: |
| 320 | return c |
| 321 | |
| 322 | prd = np.empty(len(c) + 1, dtype=c.dtype) |
| 323 | prd[0] = c[0]*0 |
| 324 | prd[1:] = c |
| 325 | return prd |
| 326 | |
| 327 | |
| 328 | def polymul(c1, c2): |
no outgoing calls
no test coverage detected