The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Polynomial - Perl module implementing an algebraic polynomial

DESCRIPTION

new

Create a new zero polynomial and return it to the caller.

copy OBJREF

Perform a deep copy of the polynomial object referenced by OBJREF.

monOrder
monOrder STRING

Return the current monomial ordering. If an argument is passed, it is assigned as the new monomial ordering. The valid orderings are:

        tdeg            - total degree (single variable case only)
        lex             - pure lexicographic ordering
        grlex           - graded lex
        grevlex         - graded reverse lex

varOrder
varOrder ARRAYREF

Return the current variable ordering as an array reference. If an argument is passed, it is assigned as the new variable ordering. For example,

        $poly->varOrder(['x','y','z']);

assigns the variable ordering x > y > z.

monomials
monomials HASHREF

Returns the current collection of monomials. If an argument is passed, it is assigned as the new collection of monomials.

insertMonomial OBJREF

Performs a copy of the monomial referred to by OBJREF and inserts it into the monomial collection.

simplify

Attempt to unify monomials with the same 'signature' (see getSignature) through addition.

fromString STRING

Construct the state of the polynomial from the algebraic expressin represented in STRING. For example,

        $poly->fromString("xyz+x^2y^4+x+2");

would create four monomials: xyz, x^2y^4, x, and 2. The previous monomials contained in the polynomial are destroyed.

toString

Convert the current state of the polynomial into a string and return it to the caller. This string can be sent back in via fromString and be used to reconstruct the polynomial.

applyOrder

Order the monomials according to the current monomial ordering setting.

SortByLexOrder

(Internal) Perform sort.

SortByGrevLex

(Internal) Perform sort.

SortByGrLex

(Internal) Perform sort.

SortByTotalDegree

(Internal) Perform sort.

getLT

Get the leading term of the polynomial and return it to the caller.

isNotZero

Return a boolean indiciating wether or not the polynomial is a zero polynomial or not.

mult OBJREF

Perform polynomial multiplication using this polynomial and the one referred to by OBJREF. Return a new polynomial containing the product.

add OBJREF

Perform polynomial addition using this polynomial and the one referred to by OBJREF. Return a new polynomial containing the sum.

subtract OBJREF

Perform polynomial subtraction using this polynomial and the one referred to by OBJREF. Return a new polynomial containing the difference.

divide OBJREF

Perform polynomial division using this polynomial and the one referred to by OBJREF. Return an array reference containing the quotients and the remainder.

gcd OBJREF

Determine the polynomial greatest common divisor with respect to this polynomial and the one referred to by OBJREF. Return a new polynomial containing the gcd.

reduce

Attempt to achieve two goals:

        1) Get as many 1's as coefficients as possible
        2) If the leading term's coefficient is negative multiply all the coefficients by -1.

spoly

Determine the polynomial SPOLY with respect to this polynomial and the one referred to by OBJREF. Return a new polynomial containing the SPOLY.

AUTHOR

Brian Guarraci <bguarrac@hotmail.com>