6.11.2.2 Polynomial_dense_mod_n Objects

class Polynomial_dense_mod_n
A dense polynomial over the integers modulo n, where n is not prime.
Polynomial_dense_mod_n( parent, [x=False], [check=False], [is_gen=True], [construct=None])

Instances of class Polynomial_dense_mod_n have the following methods (in addition to inherited methods and special methods):

copy,$  $ degree,$  $ int_list,$  $ is_irreducible,$  $ list,$  $ ntl_ZZ_pX,$  $ quo_rem,$  $ set_directly

Further documentation:

degree( )

Return the degree of this polynomial. The zero polynomial has degree -1.

list( )

sage: x = PolynomialRing(Integers(100)).gen()
sage: f = x**3 + 3*x - 17
sage: f.list()
[83, 3, 0, 1]

ntl_ZZ_pX( )

Return underlying NTL representation of this polynomial. Additional ``bonus'' functionality is available through this function.

quo_rem( right)

Returns a tuple (quotient, remainder) where self = quotient*other + remainder.

set_directly( v)

Set the value of this polynomial directly from a vector or string.

Polynomials over the integers modulo n are stored internally using NTL's ZZ_pX class. Use this function to set the value of this polynomial using the NTL constructor, which is potentially very fast. The input v is either a vector of ints or a string of the form '[ n1 n2 n3 ... ]' where the ni are integers and there are no commas between them. The optimal input format is the string format, since that's what NTL uses by default.

sage: R = PolynomialRing(Integers(100))
sage: R([1,-2,3])
3*x^2 + 98*x + 1
sage: f = R(0)
sage: f.set_directly([1,-2,3])
sage: f
3*x^2 + 98*x + 1
sage: f.set_directly('[1 -2 3 4]')
sage: f
4*x^3 + 3*x^2 + 98*x + 1

Instances of class Polynomial_dense_mod_n also have the following special methods:

__getitem__,$  $ __getslice__,$  $ __pow__,$  $ __reduce__,$  $ __setitem__,$  $ _add,$  $ _mul,$  $ _pari_,$  $ _sub

Further documentation:

_mul( right)

sage: x = PolynomialRing(Integers(100)).gen()
sage: (x - 2)*(x**2 - 8*x + 16)
x^3 + 90*x^2 + 32*x + 68

See About this document... for information on suggesting changes.