A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.jax.dev/en/latest/_autosummary/jax.numpy.poly.html below:

jax.numpy.poly — JAX documentation

jax.numpy.poly#
jax.numpy.poly(seq_of_zeros)[source]#

Returns the coefficients of a polynomial for the given sequence of roots.

JAX implementation of numpy.poly().

Parameters:

seq_of_zeros (ArrayLike) – A scalar or an array of roots of the polynomial of shape (M,) or (M, M).

Returns:

An array containing the coefficients of the polynomial. The dtype of the output is always promoted to inexact.

Return type:

Array

Note

jax.numpy.poly() differs from numpy.poly():

Examples

Scalar inputs:

>>> jnp.poly(1)
Array([ 1., -1.], dtype=float32)

Input array with integer values:

>>> x = jnp.array([1, 2, 3])
>>> jnp.poly(x)
Array([ 1., -6., 11., -6.], dtype=float32)

Input array with complex conjugates:

>>> x = jnp.array([2, 1+2j, 1-2j])
>>> jnp.poly(x)
Array([  1.+0.j,  -4.+0.j,   9.+0.j, -10.+0.j], dtype=complex64)

Input array as square matrix with real valued inputs:

>>> x = jnp.array([[2, 1, 5],
...                [3, 4, 7],
...                [1, 3, 5]])
>>> jnp.round(jnp.poly(x))
Array([  1.+0.j, -11.-0.j,   9.+0.j, -15.+0.j], dtype=complex64)

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.3