Macaulay2 Engine
Loading...
Searching...
No Matches
cra.h File Reference

Engine-boundary C API for Chinese-remainder lifting and rational reconstruction. More...

Go to the source code of this file.

Functions

const RingElementrawRingElementCRA (const RingElement *f, const RingElement *g, mpz_srcptr m, mpz_srcptr n)
const MatrixrawMatrixCRA (const Matrix *f, const Matrix *g, mpz_srcptr m, mpz_srcptr n)
const RingElementrawRingElementRatConversion (const RingElement *f, mpz_srcptr m, const Ring *RQ)
const MatrixrawMatrixRatConversion (const Matrix *f, mpz_srcptr m, const Ring *RQ)

Detailed Description

Engine-boundary C API for Chinese-remainder lifting and rational reconstruction.

Note
AI-generated documentation. Verify against the source before relying on it.

Declares the extern "C" entry points the M2 interpreter calls to combine modular results from independent prime-field computations and lift them back to characteristic 0: rawRingElementCRA / rawMatrixCRA merge two CRT residues with moduli m and n into a single residue mod m*n, and rawRingElementRatConversion / rawMatrixRatConversion run rational reconstruction — recovering the unique a/b with |a|, |b| <= sqrt(m)/2 — against a target RQ polynomial ring whose coefficients are QQ. The moduli arrive as GMP mpz_srcptr so the front end can pass arbitrarily large primes (or products of primes) without an extra conversion.

Heavily used by the modular-F4 path and by rational resolutions / Hilbert-function computations that run the same algorithm modulo many primes in parallel and reconstruct afterwards.

See also
cra.cpp
engine-includes.hpp

Definition in file cra.h.