polyInterface, poly='0') |
polyInterface
:
poly
: The class Poly contains the following methods:
) |
) |
This is similar to degree of the class Monom.
) |
) |
) |
) |
) |
) |
var, deg=1) |
coeff) |
The coefficients of a polynomial and coeff must have the same interface.
monom) |
Monomials of a polynomial and monom must have the same interface.
par, deg=1) |
poly) |
The leading monomial poly must divide the leading monomial of a polynomial. The polynomials must have the same interface.
poly) |
The polynomials must have the same interface.
The class Poly can be an argument of the following functions.
poly) |
The Python command print works similarly.
poly1, poly2) |
1
if poly1 > poly2
,
0
if poly1 == poly2
,
-1
if poly1 < poly2
.
Comparison is done for the leading monomials of polynomials. The polynomials must have the same interface.
<, >, <=, >=, ==, != ( |
poly1, poly2) |
A polynomial can be used in logical expressions. The zero polynomial yields False in logical expressions, and other polynomials yield True.
+, /, * ( |
poly1, poly2) |
The polynomials must have the same interface.
+=, /=, *= ( |
poly1, poly2) |
The polynomials must have the same interface.
poly) |
[] ( |
poly, i) |
The polynomial is an iterator of Python:
import ginv st = ginv.SystemType("Polynomial") im = ginv.MonomInterface("Lex", st, ['x', 'y', 'z']) ic = ginv.CoeffInterface("GmpZ", st) ip = ginv.PolyInterface("PolyList", st, im, ic) poly1 = ginv.Poly(ip, "(y^3 - x)^3") print poly1 poly2 = ginv.Poly(ip, "(y^3 - x)^2 + (x^3 - y)^2") print poly2 poly1 *= poly2 for (m, c) in poly1: print (m, c),
(-1)*x^3 + 3*x^2*y^3 + (-3)*x*y^6 + y^9 x^6 + (-2)*x^3*y + x^2 + (-2)*x*y^3 + y^6 + y^2 (x^9, -1) (x^8*y^3, 3) (x^7*y^6, -3) (x^6*y^9, 1) (x^6*y, 2) (x^5*y^4, -6) (x^5, -1) (x^4*y^7, 6) (x^4*y^3, 5) (x^3*y^10, -2) (x^3*y^6, -10) (x^3*y^2, -1) (x^2*y^9, 10) (x^2*y^5, 3) (x*y^12, -5) (x*y^8, -3) (y^15, 1) (y^11, 1)