nzmath.poly.univar

PolynomialInterface

Base class for all univariate polynomials. Because this class is abstract, do not instanciate.

This class inherits FormalSumContainerInterface.

Constructor

PolynomialInterface(coefficients [, keyword arguments..])

For any descendants of PolynomialInterface, coefficients have to be given. Other arguments, if necessary, should be passed as keyword arguments. Note that in this initializer, no actual initialization happens.

Methods

differentiate()

Return the formal differentiation of this polynomial.

downshift_degree(slide)

Return the polynomial obtained by shifting downward all terms with degrees of slide.

Be careful that if the least degree term has the degree less than slide then the result is not mathematically a polynomial. Even in such a case, the method does not raise an exception.

f.downshift_degree(slide) is equivalent to f.upshift_degree(-slide).

upshift_degree(slide)

Return the polynomial obtained by shifting upward all terms with degrees of slide.

f.upshift_degree(slide) is equivalent to f.term_mul( (slide, 1) ).

ring_mul(other)

Return the result of multiplication with the other polynomial.

scalar_mul(scale)

Return the result of multiplication by scalar scale.

term_mul(term)

Return the result of multiplication with the given term. The term can be given as a tuple (degree, coeff) or as a Polynomial instance.

square()

Return the square of this polynomial.

Operators

In addition to the operators defined in FormalSumContainerInterface, this class defines:

f * gmultiplication *1
f ** ipowering

*1 in FormalSumContainerInterface, there is only scalar multiplication