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

Function _zseries_to_cseries

numpy/polynomial/chebyshev.py:158–180  ·  view source on GitHub ↗

Convert z-series to a Chebyshev series. Convert a z series to the equivalent Chebyshev series. The result is never an empty array. The dtype of the return is the same as that of the input. No checks are run on the arguments as this routine is for internal use. Parameters --

(zs)

Source from the content-addressed store, hash-verified

156
157
158def _zseries_to_cseries(zs):
159 """Convert z-series to a Chebyshev series.
160
161 Convert a z series to the equivalent Chebyshev series. The result is
162 never an empty array. The dtype of the return is the same as that of
163 the input. No checks are run on the arguments as this routine is for
164 internal use.
165
166 Parameters
167 ----------
168 zs : 1-D ndarray
169 Odd length symmetric z-series, ordered from low to high.
170
171 Returns
172 -------
173 c : 1-D ndarray
174 Chebyshev coefficients, ordered from low to high.
175
176 """
177 n = (zs.size + 1)//2
178 c = zs[n-1:].copy()
179 c[1:n] *= 2
180 return c
181
182
183def _zseries_mul(z1, z2):

Callers 3

chebmulFunction · 0.85
chebdivFunction · 0.85
chebpowFunction · 0.85

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected