4.2 Monomial

class Monom( monomInterface, monom=None)
Specifies monomial
monomInterface:
defines the interface of a monomial (see 4.1)

monom:
string that initializes a monomial. If the string is not specified, then the monomial becomes the unit one. For module orders a Python dependent variable is not determined. It can be given by the method setDependVar.

Example for value of monom System type
'1' unit monomial for a system of any type
'x*y4*x' polynomial system 3.1
'df(u, x, y, 4, x)' linear differential system 3.3
'T(u, x, y, 4, x)' linear difference system 3.4

The class Monom contains the following methods:

degree( )
returns the total degree of a monomial.

dependVar( )
returns the index of independent variable.

setZero( )
zeroizes the variable degrees in a monomial.

prolong( var, deg=1)
multiplies a monomial by the independent variable with index var raised to power deg.

gcd( monom)
returns the total degree of variables in GCD of a monomial and the monomial monom.

The monomials must have the same interface.

lcm( monom)
returns LCM of a monomial and the monomial monom.

The monomials must have the same interface.

divisibility( monom)
returns True if a monomial is divisible by the monomial monom, otherwise returns False.

The monomials must have the same interface.

divisibilityTrue( monom)
returns True if a monomial is divisible by the monomial monom and they are not equal. Otherwise, returns False.

The monomials must have the same interface.

Class Monom can be an argument of the following functions:

str( monom)
returns the string representation of monomial monom in accordance to the type of system 3.

The Python command print works similarly

cmp( monom1, monom2)
returns 1 if monom1 > monom2,
returns 0 if monom1 == monom2,
returns -1 if monom1 < monom2.

Monomials are compared in accordance to the order specified. The monomials must have the same interface.

<, >, <=, >=, ==, !=( monom1, monom2)
For these operations monomials are compared in accordance to the order specified. The monomials must have the same interface.

Monomials can be used in logical expressions. The unit monomial yields False in logical expressions, and other monomials yield True.

*, /( monom1, monom2)
These operations return the product and quotient of monomials. To perform the division operation monomial monom1 must be divisible by monom2.

The monomials must have the same interface.

*=( monom1, monom2)
This operation assigns the product of monomials to variable monom1.

The monomials must have the same interface.

len( monom)
returns the number of independent variables in the monomial interface monom.

It acts similarly to method dimIndepend in class MonomInterface.

[]( monom, i)
returns degree i of the independent variable in monomial monom.

Monomial is an iterator of Python:

import ginv

st = ginv.SystemType("Polynomial")
im = ginv.MonomInterface("DegRevLex", st, ['x', 'y', 'z'])
m = ginv.Monom(im, "x^3*y*x*z^2")

for d in m: print d,
This yields the list of degrees "4 1 2" printed.