Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K
JAX  documentation - Home

jax.numpy.polysub

Contents

jax.numpy.polysub#

jax.numpy.polysub(a1,a2)[source]#

Returns the difference of two polynomials.

JAX implementation ofnumpy.polysub().

Parameters:
  • a1 (ArrayLike) – Array of minuend polynomial coefficients.

  • a2 (ArrayLike) – Array of subtrahend polynomial coefficients.

Returns:

An array containing the coefficients of the difference of two polynomials.

Return type:

Array

Note

jax.numpy.polysub() only accepts arrays as input unlikenumpy.polysub() which accepts scalar inputs as well.

See also

Examples

>>>x1=jnp.array([2,3])>>>x2=jnp.array([5,4,1])>>>jnp.polysub(x1,x2)Array([-5, -2,  2], dtype=int32)
>>>x3=jnp.array([[2,3,1]])>>>x4=jnp.array([[5,7,3],...[8,2,6]])>>>jnp.polysub(x3,x4)Array([[-5, -7, -3],       [-6,  1, -5]], dtype=int32)
>>>x5=jnp.array([1,3,5])>>>x6=jnp.array([[5,7,9],...[8,6,4]])>>>jnp.polysub(x5,x6)Traceback (most recent call last):...ValueError:Cannot broadcast to shape with fewer dimensions: arr_shape=(2, 3) shape=(2,)>>>x7=jnp.array([2])>>>jnp.polysub(x6,x7)Array([[5, 7, 9],       [6, 4, 2]], dtype=int32)
Contents

[8]ページ先頭

©2009-2025 Movatter.jp