nzmath.polynomial | (ÆüËܸì)

OneVariablePolynomial

The class is for polynomials with one variable.

Constructor

OneVariablePolynomial(coefficient, variable, coeffring)

coefficient must be a OneVariablePolynomialCoefficients object. variable must be a string, a list, or a tuple. coeffring must be a ring object implementing ring.Ring.

Ordinarily OneVariableDensePolynomial or OneVariableSparsePolynomial are used as a factory method to construct a OneVariablePolynomial object.

Methods

content()

Return the content of the polynomial.

copy()

Return a copy of the polynomial.

degree()

Return the degree of the polynomial.

differentiate(var)

Return the derivative of the polynomial by variable var.

getCoefficientRing()

Return a coefficient ring of the polynomial.

getRing()

Return a ring, to which the polynomial belongs.

getVariable()

Return the name string of the variable of the polynomial.

getVariableList()

Return a list consists of the variable of the polynomial. The length of the list is always one.

integrate(var [, min , max])

Integrate by variable var. Return definite integral of the polynomial from min to max when min and max are specified, otherwise indefinite integral.
(deleted in 0.5.0)

leadingCoefficient()

Return the leading coefficient of the polynomial.

primitivePart()

Return the primitive part of the polynomial.

toMultiVariableSparsePolynomial()

Return a conversion to MultiVariableSparsePolynomial.

toOneVariableDensePolynomial()

This method remains for backward compatibility, and does nothing but same as unary +.

toOneVariableSparsePolynomial()

This method remains for backward compatibility, and does nothing but same as unary +.

Operators

operatorexplanation
f + gReturn the sum of polynomials f and g.
f - gReturn the difference of polynomials f and g.
f * gReturn the product of polynomials f and g.
divmod(f,g)Return the tuple of quotient and remainder resulting by dividing f by g.
f / gReturn the ratio of f and g. The result can be a rational function.
f // gReturn the quotient of f by g.
f % gReturn the remainder of f by g.
f ** iReturn f power to i.
-fReturn the polynomial whose coefficients have inverted signs of f.
+fReturn the same polynomial with f. Simplification is carried out if possible.
f == gReturn whether f and g are equal or not.
f != gReturn whether f and g are different or not.
f[n]Return the coefficient of degree n term of f.
f[n] = cReplace the coefficient of the degree n term of the polynomial f by c.
repr(f)Return the repr string of the polynomial f
str(f)Return the str string of the polynomial f.
f(c)Return the value of f substituting c.

Last-modified: 2006-01-08 (Æü) 22:36:28