Skip to main content

Crate polycore

Crate polycore 

Source
Expand description

Fields, prime fields, sparse and dense polynomials, and sparse echelon forms: the shared foundation beneath Groebner bases, sparse interpolation and linear system reduction.

Re-exports§

pub use modp::Primes;

Modules§

crt
Chinese remaindering and Wang’s rational number reconstruction.
dense
Dense Gaussian elimination over any field, for the small square systems that sparse methods bottom out in. Matrices are rows of equal length.
interp
Incremental interpolation.
lehmer
Lehmer’s Euclidean algorithm for big integer gcds and rational reconstruction.
modp
Arithmetic on bare u64 residues modulo a prime p < 2^64, for inner loops that keep the modulus out of the element.
sample
Deterministic sampling and black boxes: every point is named by a key, so reruns and snapshots reproduce and callers that share a key share evaluations.

Structs§

Echelon
An incremental row echelon form: monic rows keyed by their leading column, optionally recording which pivots each row was reduced by, over a dense scratch row that grows on demand.
Fp
An element of GF(p) for a prime p < 2^64 chosen at runtime.
Gf
An element of GF(P) for a prime P fixed at compile time.
Monomial
An exponent vector in one shared allocation, with its total degree cached.
ParseError
ParseFpError
Poly
A sparse multivariate polynomial: nonzero terms in strictly descending order.
RatFunc
A univariate rational function num / den in lowest terms with den monic: the field F(a), coefficients for polynomials with a parameter.
Ring
Variable names and an order: enough to read and write polynomials.
Uni
A dense univariate polynomial by ascending power, without trailing zeros.

Enums§

Lead
Which end of a row leads: Low for F4 matrices whose columns ascend with descending monomials, High for Laporta systems that eliminate the most complex unknown first.
Order
A monomial order on exponent vectors, variable 0 most significant.

Traits§

Field
A field given by its operators. Every type with these operations is one, so BigRational, crate::Fp, crate::Gf and user extensions such as Q(sqrt(m)) need no wrapper.
Modular
A prime field of word-sized residues, for code that drops to bare u64 arithmetic in modp on its inner loops.

Functions§

combination
sum h[i] * gens[i], the polynomial a certificate claims.
nat
n as a field element, by doubling.
pow
x^e by repeated squaring.

Type Aliases§

SparseRow
A sparse row as (column, coefficient) pairs, leading column first once reduced.
Term