|
Macaulay2 Engine
|
M2::ARingGFFlint — small GF(p^k) via FLINT Zech-logarithm tables. 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/fq_zech.h>#include <flint/nmod_poly.h>#include "interface/random.h"#include "aring.hpp"#include "buffer.hpp"#include "ringelem.hpp"#include "exceptions.hpp"Go to the source code of this file.
Classes | |
| class | M2::ARingGFFlint |
| aring-style adapter for FLINT's Zech-logarithm representation of small finite fields GF(p^n). More... | |
| class | M2::ARingGFFlint::Element |
| A wrapper class for ElementType. More... | |
| class | M2::ARingGFFlint::ElementArray |
| Fixed-size owned array of fq_zech_struct slots tied to an ARingGFFlint for the matching FLINT context. More... | |
Namespaces | |
| namespace | M2 |
M2::ARingGFFlint — small GF(p^k) via FLINT Zech-logarithm tables.
ARingGFFlint (registered as ringID = ring_GFFlintZech) represents a Galois field GF(q) of small order via FLINT's fq_zech_* interface. The element type is FLINT's fq_zech_struct, which wraps a single mp_limb_t Zech log index of a chosen primitive root; every non-zero operation reduces to O(1) integer arithmetic on that index (multiplication is (i + j) mod (q - 1), addition uses a Zech table built once at construction). One word per element and no per-call allocations make this the fastest path for small q; FLINT's Zech table sizing imposes the upper limit on q. The class inherits from RingInterface directly (not SimpleARing<ARingGFFlint>) so its nested Element can hold an fq_zech_ctx_struct* for the destructor.
The context is initialised via fq_zech_ctx_init_modulus against a user-supplied minimal polynomial; the M2-side entry point is rawARingGaloisFieldFlintZech in interface/aring.cpp. Larger extensions are reached by the separate rawARingGaloisFieldFlintBig entry point (which builds an ARingGFFlintBig from aring-gf-flint-big.hpp using polynomial-quotient fq_nmod_* arithmetic). The native aring-m2-gf.hpp path provides the same algebra without a FLINT dependency, and GF.hpp is the legacy table-based class.
Definition in file aring-gf-flint.hpp.