Apalab -- A Matlab toolbox for Approximate Polynomial Algebra
Copyright 2007 by Zhonggang Zeng.  All rights reserved.

(Updated on June 25, 2007)

Apalab  is a Matlab toolbox for numerical and symbolic computation in Approximate Polynomial Algebra. Its Maple counterpart is named  ApaTools.  These packages are integral components of a research project in development by Zhonggang Zeng, Department of Mathematics, Northeastern Illinois University, Chicago, IL 60625, supported by National Science Foundation under grants DMS-0715127 and DMS-0412003.  Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author and do not necessarily reflect the views of the National Science Foundation.

website: http://www.neiu.edu/~zzeng                   email: zzeng@neiu.edu

Preprint:   ApaTools:  A software toolbox for approximate polynomial algebraZhonggang Zeng, 2007  

Disclaimer:   Apalab is an on-going research project, not yet a finished product.  Bugs and errors almost certainly exist.  The author is not responsible for any damage  or loss from using this software. Users should verify their results through other means.
 

Table of contents


Software tools currently available in the box:
          (click each module name for a brief explanation and examples)

Univariate polynomial:        
uvGCD     ExtendedGCD     uvFactor
Multivariate polynomial:       mvGCD      SquarefreeFactor     mvFactorRefine 
Matrix computation:             ApproxiJordanForm      NulVector        ApproxiRank  
                                         
ApproxiRankRowUpdate   ApproxiRankRowDowndate  ApproxiRankColumnUpdate   ApproxiRankColumnDowndate     
Utilities:            

      Polynomial manipulation:       Polynomial2CoefficientMatrix
                                                 
mvPolynDegree            mvPolynTimesMonom      mvPolynAdd        mvPolynMultiply      mvPolynEvaluate
                                                  mvPolynDerivative    mvPolynClear     mvPolynPower
      Matrix computation:               HouseholderVector     HouseholderTransform                    HouseholderTransformRight      GivensMatrix
 
                                               IntegerInverse                MatrixWithGivenJordanForm      ScaledLeastSquares


Download and installation:

  1. Download the package zip file according to your Matlab version:
    (Support for older versions of Matlab are possible upon request)
         -- For Matlab 2008:    ApalabForMatlab2008.zip
         -- For Matlab 2009:    ApalabForMatlab2009.zip
         -- For Matlab 2010:    ApalabForMatlab2010.zip
         -- For Matlab 2011:    ApalabForMatlab2011.zip
  2. Unzip  the zip file in a directory,  say  "c:\polynomials",  so that a director  "c:\polynomials\ApalabForMatlab61" or  "c:\polynomials\ApalabForMatlab65"  etc will be created and contains all the necessary files.
  3. Start Matlab.
  4. Set path to the directory, e.g.    >> path(path,'c:/polynomials/ApalabForMatlab61')  
  5. Now all the tool modules will be accessible. 
  6. To access the help file of each module, say uvGCD,   try    >> help uvGCD    

 

Representation of polynomials in Apalab

Coefficient vectors of univariate polynomials:  A univariate polynomial is represented by its coefficient vector.  For example,  f(x) = x3 + 2x2 + 3x + 4  is represented as
               f  =  [1, 2, 3, 4]   or  its transpose
Polynomial multiplication  h = f*g,  is carried out in Matlab by 
             >>  h = conv(f,g)
with  f, g, h  being coefficient vectors.

Coefficient matrix:  An  m-multivariate polynomial  of  n  terms is represented by a coefficient matrix  of size  (m+1) n  according to the following rules:
     1.  Every column of  F  represents one term (monomial)
     2.  F(i,j)    for i<m+1   is the exponent of the i-th variable on j-th term
     3.  F(m+1,j)  is the coefficient of the j-th term
For example, let
          p(x, y, z)  =  8  +  3x3 y  +  5 x2 z5   -  2 y3   + 6 y3 z2  - 7 x y z
Then it is represented as the following coefficient matrix in Matlab
 
>> P = [0 3 2 0 0 1; 0 1 0 3 3 1; 0 0 5 0 2 1; 8 3 5 -2 6 -7]

P =

      0    3    2    0    0     1
      0    1    0    3    3     1
      0    0    5    0    2     1
      8    3    5   -2    6    -7

 

Coefficient matrices can be constructed using the Symbolic Math Toolbox and function Polynomial2CoefficientMatrix, as shown in the following example

>> syms x y z  % declare symbolic variables for the polynomial
>> p = 8 + 3*x^3*y + 5*x^2*z^5 - 2*y^3 + 6*y^3*z^2 - 7*x*y*z;
>> pretty(p)  
% showcase the polynomial

                       3        2  5      3      3  2
                8 + 3 x  y + 5 x  z  - 2 y  + 6 y  z  - 7 x y z

>> F = Polynomial2CoefficientMatrix(p,[x,y,z])

 F =

     0     3     2     0     0     1
     0     1     0     3     3     1
     0     0     5     0     2     1
     8     3     5    -2     6    -7

Maple  module  Polynomial2CoefficientMatrix  is part of package  ApaTools  for converting a polynomial into a coefficient matrix. Its simplified version is provided in a Maple classic worksheet  Polyn2CoeffMat.mws.  Right-click the link, save as a .mws file, then open it in Maple. Here is a screen shot of the worksheet.

Basic tools for manipulating multivariate polynomials in coefficient matricesOne can add/subtract, multiply two multivariate polynomials, evaluate a polynomial, etc. using utility tools  mvPolynDegreemvPolynTimesMonom,   mvPolynAddmvPolynMultiply mvPolynEvaluatemvPolynDerivativemvPolynClear,   mvPolynPower 
                                    

Total degree  and  tuple degree:   The total degree of a monomial is the sum of the exponents on all variables in the monomial.  The total degree of a polynomial is the maximum of total degrees of all terms in the polynomial.

For an  m-variable polynomial  f( x1 , ..., xm ),  its m-tuple degree is a vector  [d1 , d2 , ..., dm ]  where  dj  is the degree of  f  in  xj.   We call this type of degree a tuple degree, or  an  m-tuple degree  if  m  is to be specified.

Utility module   mvPolynDegree  calculates either the total or tuple degree of a given polynomial in coefficient matrix.

 

Modules with brief explanations and examples