polycore
polycore
A shared polynomial trait foundation for fields, word-sized prime fields, Chinese remaindering, sparse multivariate and dense univariate polynomials, and a sparse incremental echelon form.
Field: blanket trait over the field operatorsModular: prime fields with access to bare residuesFp,Gf<P>: prime fields below $2^{64}$Poly<F>,Monomial,Order: sparse multivariate polynomialsUni<F>: dense univariate polynomialsPrimeField: NTT multiplication, Newton division and half-GCDPowerTable<F>: cached monomial powersGeometricEvaluator<F>: successive geometric evaluationsmodp: word-sized modular arithmeticMulBy: Shoup multiplication by a fixed residuePrimes: descending word-sized primesSmoothPrimes: primes with a prescribed power of two in p − 1PowerOfTwoSubgroup: subgroup generators and discrete logarithmsRatFunc<F>: univariate rational functionsEchelon<F>,dense: sparse and dense linear algebracrt: Chinese remaindering and rational reconstructionCrtAccumulator: incremental CRT over coefficient vectorsMixedRadixAccumulator: CRT with coefficient support remappingWangContext: rational reconstruction with a shared boundlehmer: Lehmer gcd for big integersNewton<F>: incremental polynomial interpolationThiele<F>: rational interpolation by continued fractionsMassey<F>: incremental Berlekamp–Massey recurrence recoveryRng: deterministic sampling from keyed seedsBlackBox: evaluation of unknown functions over prime fieldsRing: parsing and printing
Field is operator-based rather than method-based (add, multiply, ...) so that BigRational, Fp, and extensions can be fields without wrappers or impls, generic code reads as the mathematics does, and nothing new is needed from num-traits. The cost is some clone() calls on big coefficients but whatever.
Fp::zero() and Fp::one() carry no modulus and adopt the one they meet, so nullary constructors still work at a runtime modulus.
This library is for scientific computing uses not cryptography or anything timing attack sensitive.
polyfactor
Factoring in one variable, on top of polycore.
factor_mod: Berlekamp over $\mathrm{GF}(p)$factor: Hensel lifting and Zassenhaus over $\mathbb{Q}$Alg,NumberField: number field arithmeticfactor_over: Trager over number fields
License
Released under the MIT License. See LICENSE for details.