Package sage :: Package rings :: Module polynomial_ring :: Class PolynomialRing
[show private | hide private]
[frames | no frames]

Type PolynomialRing

               Gens --+
                      |
               Ring --+
                      |
         object --+   |
                  |   |
_uniqPolynomialRing --+
                      |
                     PolynomialRing

Known Subclasses:
PowerSeriesRing

Univariate polynomial ring.

EXAMPLES:
>>> import rings
>>> Q = rings.RationalField()
>>> R = PolynomialRing(Q)
>>> x = R.gen()
>>> R(-1) + R(1)
0

>>> (x - '2/3')*(x**2 - 8*x + 16)
x^3 - 26/3*x^2 + 64/3*x - 32/3

Method Summary
  __init__(self, base_ring, variable, sparse)
  __call__(self, *args, **kwds)
  __cmp__(self, other)
  __contains__(self, x)
  __repr__(self)
  base_ring(self)
  characteristic(self)
  cyclotomic_polynomial(self, n)
The nth cyclotomic polynomial, which is irreducible and has a primitive nth root of unity as root.
  gen(self, n)
If this is R[x], this intrinsic returns x.
  is_field(self)
  is_sparse(self)
  name(self)
  ngens(self)
  polynomial(self, *args, **kwds)
  random(self, degree, bound)
Return a random polynomial.
  set_variable(self, variable)
  variable(self)
Returns the string which is used to print the generator of the polynomial ring.
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)
    Inherited from Ring
  is_atomic_repr(self)
True if the elements have atomic string representations, in the sense that they print if they print at s, then -s means the negative of s.
  type(self)
    Inherited from Gens
  __getattr__(self, attrname)
  __getitem__(self, n)
  __getslice__(self, n, m)
  gens(self)
  list(self)

Instance Method Details

cyclotomic_polynomial(self, n)

The nth cyclotomic polynomial, which is irreducible and has a primitive nth root of unity as root.

gen(self, n=0)

If this is R[x], this intrinsic returns x.

random(self, degree, bound=10)

Return a random polynomial.

INPUT:
    degree -- an int
    bound -- an int
OUTPUT: Polynomial
   A polynomial whose coefficients of x^i, for i up to degree,
   are coercisions to the base ring of random integers between
   -bound and bound.

variable(self)

Returns the string which is used to print the generator of the polynomial ring.
OUTPUT:
    str -- generator name

Generated by Epydoc 2.1 on Mon Jun 20 15:43:21 2005 http://epydoc.sf.net