AngouriMath

Navigation

← Back to list of members

Gcd​(AngouriMath.​Functions.​IntegerPolynomial,​AngouriMath.​Functions.​IntegerPolynomial)

 Method (no overloads)

Summary

The greatest common divisor in Z[x], with a positive leading coefficient.

Remarks

By Gauss's lemma the divisor splits as the greatest common divisor of the two
integer contents times that of the two primitive parts, so the integer part is
taken out first and the polynomial part is left to a remainder sequence.
The sequence is the primitive one: the primitive part is taken at every
step, which is the cheapest way to stop pseudo-division's exponential coefficient
growth — the alternative, the subresultant sequence used by
PolynomialGcd, is faster but needs bookkeeping that buys nothing at
the degrees this type is capped at. Knuth, TAOCP vol. 2, §4.6.1, algorithm E.
The result really is a divisor of both: it is the last nonzero member of a
sequence in which each member divides the previous two, and callers that cannot
afford to be wrong about it — SquareFreeDecomposition divides by it —
use DivideExact(AngouriMath.Functions.IntegerPolynomial), which answers null rather than
rounding.

























Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online