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

Function _zseries_int

numpy/polynomial/chebyshev.py:309–340  ·  view source on GitHub ↗

Integrate a z-series. The integral is with respect to x, not z. This is achieved by a change of variable using dx/dz given in the module notes. Parameters ---------- zs : z-series The z-series to integrate Returns ------- integral : z-series The ind

(zs)

Source from the content-addressed store, hash-verified

307
308
309def _zseries_int(zs):
310 """Integrate a z-series.
311
312 The integral is with respect to x, not z. This is achieved by a change
313 of variable using dx/dz given in the module notes.
314
315 Parameters
316 ----------
317 zs : z-series
318 The z-series to integrate
319
320 Returns
321 -------
322 integral : z-series
323 The indefinite integral
324
325 Notes
326 -----
327 The zseries for x (ns) has been multiplied by two in order to avoid
328 using floats that are incompatible with Decimal and likely other
329 specialized scalar types. This scaling has been compensated by
330 dividing the resulting zs by two.
331
332 """
333 n = 1 + len(zs)//2
334 ns = np.array([-1, 0, 1], dtype=zs.dtype)
335 zs = _zseries_mul(zs, ns)
336 div = np.arange(-n, n+1)*2
337 zs[:n] /= div[:n]
338 zs[n+1:] /= div[n+1:]
339 zs[n] = 0
340 return zs
341
342#
343# Chebyshev series functions

Callers

nothing calls this directly

Calls 1

_zseries_mulFunction · 0.85

Tested by

no test coverage detected