Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.polyint

Contents

jax.numpy.polyint#

jax.numpy.polyint(p,m=1,k=None)[source]#

Returns the coefficients of the integration of specified order of a polynomial.

JAX implementation ofnumpy.polyint().

Parameters:
  • p (ArrayLike) – An array of polynomial coefficients.

  • m (int) – Order of integration. Default is 1. It must be specified statically.

  • k (int |ArrayLike |None) – Scalar or array ofm integration constant (s).

Returns:

An array of coefficients of integrated polynomial.

Return type:

Array

See also

Examples

The first order integration of the polynomial\(12 x^2 + 12 x + 6\) is\(4 x^3 + 6 x^2 + 6 x\).

>>>p=jnp.array([12,12,6])>>>jnp.polyint(p)Array([4., 6., 6., 0.], dtype=float32)

Since the constantk is not provided, the result included0 at the end.If the constantk is provided:

>>>jnp.polyint(p,k=4)Array([4., 6., 6., 4.], dtype=float32)

and the second order integration is\(x^4 + 2 x^3 + 3 x\):

>>>jnp.polyint(p,m=2)Array([1., 2., 3., 0., 0.], dtype=float32)

Whenm>=2, the constantsk should be provided as an array havingm elements. The second order integration of the polynomial\(12 x^2 + 12 x + 6\) with the constantsk=[4,5] is\(x^4 + 2 x^3 + 3 x^2 + 4 x + 5\):

>>>jnp.polyint(p,m=2,k=jnp.array([4,5]))Array([1., 2., 3., 4., 5.], dtype=float32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp