Macaulay2 Engine
Loading...
Searching...
No Matches
GF.hpp File Reference

Legacy Ring-based Galois field with explicit Zech-style lookup tables. More...

#include "relem.hpp"

Go to the source code of this file.

Classes

class  GF
 Engine-side finite field GF(p^n) built on top of (Z/p)[t] / f(t) for a primitive element of the resulting field. More...

Detailed Description

Legacy Ring-based Galois field with explicit Zech-style lookup tables.

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

GF is the engine's original Galois-field implementation, pre-dating the aring refactor. It inherits from Ring directly (so arithmetic goes through virtual dispatch) and stores two int tables indexed by powers of a chosen primitive element: _one_table[i] is the log index of alpha^i + 1 (i.e. the Zech logarithm), and _from_int_table[a] maps a Z/p residue a to its log index. Multiplication of non-zero elements becomes index addition mod Q - 1, addition reduces to one _one_table lookup. Alongside the tables the class keeps a pointer to the presenting polynomial ring (Z/p)[t]/f(t) and the primitive RingElement, so M2 code that needs to introspect the defining polynomial or round-trip through it can still do so via getMinimalPolynomial / get_rep.

Three modern siblings cover the same algebra with different backing stores: ARingGFM2 (native, CRTP-inlined via SimpleARing), ARingGFFlint (FLINT Zech tables, small q), and ARingGFFlintBig (FLINT fq_nmod, large q). New engine code prefers those; the legacy class is reached through the rawGaloisField entry point in interface/ring.cpp (GF::create(f)).

See also
aring-m2-gf.hpp
aring-gf-flint.hpp
aring-gf-flint-big.hpp
ZZp.hpp

Definition in file GF.hpp.