Polynomial division using dynamic arrays, heaps, and packed exponent vectors

  • Authors:
  • Michael Monagan;Roman Pearce

  • Affiliations:
  • Department of Mathematics, Simon Fraser University, Burnaby, B.C., Canada;Department of Mathematics, Simon Fraser University, Burnaby, B.C., Canada

  • Venue:
  • CASC'07 Proceedings of the 10th international conference on Computer Algebra in Scientific Computing
  • Year:
  • 2007

Quantified Score

Hi-index 0.00

Visualization

Abstract

A common way of implementing multivariate polynomial multiplication and division is to represent polynomials as linked lists of terms sorted in a term ordering and to use repeated merging. This results in poor performance on large sparse polynomials. In this paper we use an auxiliary heap of pointers to reduce the number of monomial comparisons in the worst case while keeping the overall storage linear. We give two variations. In the first, the size of the heap is bounded by the number of terms in the quotient(s). In the second, which is new, the size is bounded by the number of terms in the divisor(s). We use dynamic arrays of terms rather than linked lists to reduce storage allocations and indirect memory references. We pack monomials in the array to reduce storage and to speed up monomial comparisons. We give a new packing for the graded reverse lexicographical ordering. We have implemented the heap algorithms in C with an interface to Maple. For comparison we have also implemented Yan's "geobuckets" data structure. Our timings demonstrate that heaps of pointers are comparable in speed with geobuckets but use significantly less storage.