|
Macaulay2 Engine
|
M2::ARingGFFlintBig — arbitrary-degree GF(p^k) via FLINT fq_nmod. More...
#include <vector>#include <M2/gc-include.h>#include <M2/math-include.h>#include <flint/flint.h>#include <flint/fmpz.h>#include <flint/fq_nmod.h>#include <flint/nmod_poly.h>#include "aring.hpp"#include "buffer.hpp"#include "ringelem.hpp"#include "exceptions.hpp"Go to the source code of this file.
Classes | |
| class | M2::ARingGFFlintBig |
| aring-style adapter for FLINT's polynomial-quotient representation of finite fields GF(p^n) that are too large for Zech tables. More... | |
| class | M2::ARingGFFlintBig::Element |
| A wrapper class for ElementType. More... | |
| class | M2::ARingGFFlintBig::ElementArray |
| Fixed-size owned array of fq_nmod_struct slots tied to an ARingGFFlintBig for the matching FLINT context. More... | |
Namespaces | |
| namespace | M2 |
M2::ARingGFFlintBig — arbitrary-degree GF(p^k) via FLINT fq_nmod.
ARingGFFlintBig (registered as ringID = ring_GFFlintBig) represents a Galois-field element as a degree-less-than-k polynomial over Z/p, stored in FLINT's fq_nmod_struct — which the in-source comment expands as {mp_ptr coeffs; slong alloc; slong length; nmod_t mod;}, i.e. an nmod_poly_struct under another name. Addition is coefficient-wise in Z/p; multiplication is polynomial multiply followed by reduction modulo the primitive polynomial (FLINT picks between schoolbook and Kronecker / FFT variants internally based on degree); inversion is the extended Euclidean algorithm over Z/p[t]. No Zech tables — every operation runs the underlying polynomial arithmetic, so per-op cost grows with k, but q = p^k carries no storage limit. The class inherits from RingInterface directly so its nested Element can hold an fq_nmod_ctx_struct* for the destructor.
The M2-side entry point is rawARingGaloisFieldFlintBig in interface/aring.cpp. There is no in-engine auto-fallback to the small-q aring-gf-flint.hpp; selecting between the Zech-table and polynomial-quotient implementations happens at the user / top-level M2 call site via the separate rawARingGaloisFieldFlintZech and rawARingGaloisFieldFlintBig entry points. The native, FLINT-free alternative is aring-m2-gf.hpp, and aring-tower.hpp handles iterated extensions.
Definition in file aring-gf-flint-big.hpp.