Feature #987
GCD: add special case if args are monomials
Description
While trying to comprehend the (undocumented) code I wrote in ArithGroup.cpkg5
, I noticed a comment about GCD being very slow for monomials over a finite field (because it drops through to the general syzygy method).
Add a special case: perhaps not hugely useful, but should be fairly easy to implement.
Related issues
History
#1 Updated by John Abbott over 7 years ago
The relevant place in the code seems to be in SparsePolyRing.C:814
.
To see how slow the current code is, try the following:
f := x+y+z; g := f^256; --> has 33153 terms lcm(support(g)); --> takes about 1.1s use ZZ/(32003)[x,y,z]; f := x+y+z; g := f^256; --> has 33153 terms lcm(support(g)); --> takes ages (36s)
#2 Updated by John Abbott over 7 years ago
- Related to Slug #129: Better GCD added