A term order is primalily a function, which determines precedence between two terms (or monomials). By the precedence, all terms are ordered.
More precisely in terms of Python, a term order accepts two tuples of integers, each of which represents power indeces of the term, and returns 0, 1 or -1 just like cmp built-in function.
A TermOrder object provides not only the precedence function, but also a method to format a string for a polynomial, to tell degree, leading coefficients, etc.
This class is abstract and should not be instanciated. The methods below have to be overridden.
comparator accepts two tuples of integers, each of which represents power indeces of the term, and returns 0, 1 or -1 just like cmp built-in function.
Compare two indeces left and right and determine precedence.
Return the formatted string of the polynomial polynom.
Return the leading coefficient of polynomial polynom with respect to the term order.
Return the leading term of polynomial polynom as tuple of (degree index, coefficient) with respect to the term order.