## Data structures for multivariate polynomial division.

### Michael Monagan, Department of Mathematics, Simon Fraser University.

Wednesday May 23, 2007, AQ4125, 2:30-4:30pm.

```Abstract:
Suppose we have two polynomials F and G in k[x1,...,xn], k a field.
Suppose we want to divide them.  Let Q be their quotient and R their remainder
so that F = Q G + R.  Suppose the divisor has M terms and the quotient has N
terms and suppose also they are sparse so that F = Q G has O(M N) terms.
In this lecture we will study the efficiency of various data structures for
polynomial division.

The Axiom computer algebra system uses a linked list of terms, sorted in
descending order using a monomial ordering where each term is stored as a
pair, a coefficient and an exponent vector.  If we use this for division,
and we subtract polynomials using merging of linked lists, the algorithm will
do O(M^2 N) comparisons of monomials and O(M N) coefficient operations.

We will study two data structures, ``geo-buckets'' introduced by Yan in 1996,
and ``pointer heaps'', introduced by Johnson in 1971, which both allow us to
reduce the number of comparisons to O(M N log M).

A second problem with using linked lists of terms is that there are many
idirect memory references which cause a loss of efficiency when the polynomials
are too big to fit inside the computer's cache.  A third problem is that there
are many storage allocations for terms and monomials.  These can be eliminated
by using dynamic arrays instead of linked lists and by packing the exponent
vectors.  We will study a packing for the graded monomial ordering.
```