Returns the coefficients of the integration of specified order of a polynomial.
JAX implementation of numpy.polyint()
.
An array of coefficients of integrated polynomial.
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 constant k
is not provided, the result included 0
at the end. If the constant k
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)
When m>=2
, the constants k
should be provided as an array having m
elements. The second order integration of the polynomial \(12 x^2 + 12 x + 6\) with the constants k=[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)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4