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

Function _zseries_int

numpy/polynomial/chebyshev.py:308–339  ·  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

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

Callers

nothing calls this directly

Calls 1

_zseries_mulFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…