Polynomial - Perl module implementing an algebraic polynomial
Create a new zero polynomial and return it to the caller.
Perform a deep copy of the polynomial object referenced by OBJREF.
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
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.
Returns the current collection of monomials. If an argument is passed, it is assigned as the new collection of monomials.
Performs a copy of the monomial referred to by OBJREF and inserts it into the monomial collection.
Attempt to unify monomials with the same 'signature' (see getSignature) through addition.
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.
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.
Order the monomials according to the current monomial ordering setting.
(Internal) Perform sort.
Get the leading term of the polynomial and return it to the caller.
Return a boolean indiciating wether or not the polynomial is a zero polynomial or not.
Perform polynomial multiplication using this polynomial and the one referred to by OBJREF. Return a new polynomial containing the product.
Perform polynomial addition using this polynomial and the one referred to by OBJREF. Return a new polynomial containing the sum.
Perform polynomial subtraction using this polynomial and the one referred to by OBJREF. Return a new polynomial containing the difference.
Perform polynomial division using this polynomial and the one referred to by OBJREF. Return an array reference containing the quotients and the remainder.
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.
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.
Determine the polynomial SPOLY with respect to this polynomial and the one referred to by OBJREF. Return a new polynomial containing the SPOLY.
Brian Guarraci <bguarrac@hotmail.com>
To install Math::MVPoly, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Math::MVPoly
CPAN shell
perl -MCPAN -e shell install Math::MVPoly
For more information on module installation, please visit the detailed CPAN module installation guide.