AngouriMath
PrimeFieldPolynomial
Description
Summary
A univariate polynomial over the prime field F_p , stored densely as its
coefficients with the constant term first.
coefficients with the constant term first.
Remarks
rationals the Euclidean algorithm is unusable directly because the coefficients of
the remainder sequence explode — which is why PolynomialGcd has to
carry the whole subresultant apparatus. Here every coefficient is one machine word
no matter how long the computation runs, so the textbook algorithms are the ones
that are actually used: plain Euclid for the greatest common divisor, plain long
division, square-and-multiply for powers.
over the integers is factored by factoring it modulo a prime, where the problem is
finite, and lifting the result back — von zur Gathen and Gerhard,
Modern Computer Algebra, ch. 14, and Knuth, TAOCP vol. 2, §4.6.2.
PrimeFieldFactorization is the first half of that.
coefficients has to fit without overflow. A reduced coefficient is at most
reduction, so the largest intermediate is
by MaxPrime accordingly. Nothing here uses a wider type, because
factorisation moduli are three digits and paying EInteger for them on
the inner loop would be the wrong trade.
written to after construction; the operations all build a fresh array. That is what
lets Coefficients hand the array out rather than copying it.
costs
knows its own modulus. Where a composite one does reach the arithmetic it surfaces
as a failure to invert rather than as a wrong answer, and
Factor(AngouriMath.Functions.PrimeFieldPolynomial) — the one entry point a modulus could
arrive at from outside — checks primality itself.
Members
coefficients
FieldCoefficients
PropertyCreate(System.Collections.Generic.IReadOnlyList{System.Int64},System.Int64)
MethodDegree
PropertyDerivative
MethodDivide(AngouriMath.Functions.PrimeFieldPolynomial,System.Int64[]@,System.Int64[]@)
MethodIsMonic
PropertyIsSquareFree
PropertyMakeMonic
MethodMaxPrime
FieldPowMod(PeterO.Numbers.EInteger,AngouriMath.Functions.PrimeFieldPolynomial)
MethodPrime
PropertyQuotient(AngouriMath.Functions.PrimeFieldPolynomial)
MethodRemainder(AngouriMath.Functions.PrimeFieldPolynomial)
MethodTrim(System.Int64[])
Method
Angouri © 2019-2023 · Project's repo · Site's repo · Octicons · Transparency · 4378 pages online