galois.typing.PolyLike

galois.typing.PolyLike

A Union representing objects that can be coerced into a polynomial.

Union

  • int: A polynomial in its integer representation, see Int(). The Galois field must be known from context.

    # Known from context
    In [1]: GF = galois.GF(3)
    
    In [2]: galois.Poly.Int(19, field=GF)
    Out[2]: Poly(2x^2 + 1, GF(3))
    
  • str: A polynomial in its string representation, see Str(). The Galois field must be known from context.

    In [3]: galois.Poly.Str("2x^2 + 1", field=GF)
    Out[3]: Poly(2x^2 + 1, GF(3))
    
  • ArrayLike: An array of polynomial coefficients in degree-descending order. If the coefficients are not Array, then the Galois field must be known from context.

    In [4]: galois.Poly([2, 0, 1], field=GF)
    Out[4]: Poly(2x^2 + 1, GF(3))
    
    In [5]: galois.Poly(GF([2, 0, 1]))
    Out[5]: Poly(2x^2 + 1, GF(3))
    
  • Poly: A previously-created Poly object. No coercion is necessary.

Alias

alias of Union[int, str, Sequence[Union[int, str, Array]], Sequence[IterableLike], ndarray, Array, Poly]


Last update: May 17, 2022