nzmath.poly.termorder

UnivarTermOrder

Term order for univariate polynomials.

One thing special to univariate case is that powers are not tuples but integers.

This class inherits TermOrderInterface.

constructor

UnivarTermOrder(comparator)

comparator can be any callable that accepts two integers and returns 0, 1 or -1 just like cmp, i.e. if they are equal it returns 0, first one is greater 1, and otherwise -1. Theoretically acceptable comparator is only the cmp function.

methods

cmp(left, right)

Compare two indeces left and right and determine precedence by self.comparator.

format(polynom [, varname="X" [, reverse=False]])

Return the formatted string of the polynomial.

degree(polynom)

Return the degree of the polynomial polynom.

leading_coefficient('polynom7)

Return the leading coefficient of polynomial polynom with respect to the term order.

leading_term(polynom)

Return the leading term of polynomial polynom as tuple of (degree, coefficient) with respect to the term order.

tail_degree(polynom)

Return the least degree among all terms of the polynomial polynom.
This method is EXPERIMENTAL.