poly2lag(pol) Convert a polynomial to a Laguerre series. Convert an array representing the coefficients of a polynomial (relative to the "standard" basis) ordered from lowest degree to highest, to an array of the coefficients of the equivalent Laguerre series, ordered from
(pol)
| 94 | |
| 95 | |
| 96 | def poly2lag(pol): |
| 97 | """ |
| 98 | poly2lag(pol) |
| 99 | |
| 100 | Convert a polynomial to a Laguerre series. |
| 101 | |
| 102 | Convert an array representing the coefficients of a polynomial (relative |
| 103 | to the "standard" basis) ordered from lowest degree to highest, to an |
| 104 | array of the coefficients of the equivalent Laguerre series, ordered |
| 105 | from lowest to highest degree. |
| 106 | |
| 107 | Parameters |
| 108 | ---------- |
| 109 | pol : array_like |
| 110 | 1-D array containing the polynomial coefficients |
| 111 | |
| 112 | Returns |
| 113 | ------- |
| 114 | c : ndarray |
| 115 | 1-D array containing the coefficients of the equivalent Laguerre |
| 116 | series. |
| 117 | |
| 118 | See Also |
| 119 | -------- |
| 120 | lag2poly |
| 121 | |
| 122 | Notes |
| 123 | ----- |
| 124 | The easy way to do conversions between polynomial basis sets |
| 125 | is to use the convert method of a class instance. |
| 126 | |
| 127 | Examples |
| 128 | -------- |
| 129 | >>> from numpy.polynomial.laguerre import poly2lag |
| 130 | >>> poly2lag(np.arange(4)) |
| 131 | array([ 23., -63., 58., -18.]) |
| 132 | |
| 133 | """ |
| 134 | [pol] = pu.as_series([pol]) |
| 135 | res = 0 |
| 136 | for p in pol[::-1]: |
| 137 | res = lagadd(lagmulx(res), p) |
| 138 | return res |
| 139 | |
| 140 | |
| 141 | def lag2poly(c): |