Macaulay2 Engine
Loading...
Searching...
No Matches
aring-m2-gf.hpp File Reference

M2::ARingGFM2 — native engine Galois field, no FLINT dependency. More...

#include "interface/random.h"
#include "aring.hpp"
#include "buffer.hpp"
#include "ringelem.hpp"
#include "exceptions.hpp"
#include <iostream>
#include "polyring.hpp"

Go to the source code of this file.

Classes

class  M2::GaloisFieldTable
class  M2::ARingGFM2
 Pure-M2 (no-FLINT) aring-style adapter for GF(p^n), using a discrete-log encoding plus an M2-side primitive table. More...

Namespaces

namespace  M2

Typedefs

typedef int M2::GFElement

Detailed Description

M2::ARingGFM2 — native engine Galois field, no FLINT dependency.

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

ARingGFM2 implements GF(p^k) entirely in engine code as a SimpleARing<ARingGFM2> with ElementType = int — a GFElement log index of a chosen primitive root, with 0 reserved for the field zero (the same convention as aring-zzp.hpp, generalised to extension fields). Construction goes through GaloisFieldTable(R, prim): it takes a PolynomialRing R = Z/p[t] / f(t) plus a user-supplied primitive element, locates the primitive root, and precomputes the two tables that drive arithmetic — mOneTable (the "add one to a log index" lookup, i.e. the Zech logarithm) and mFromIntTable (mapping Z/p residues into log indices). Multiplication of non-zero elements is index addition mod q - 1; addition uses one mOneTable lookup.

The class is the M2-side entry point rawARingGaloisField1 in interface/aring.cpp and is the GF implementation used when no FLINT backend is requested. The old Givaro path is gone — rawARingGaloisField(prime, dimension) errors out with "givaro is no longer available". The FLINT variants are aring-gf-flint.hpp (small Zech-table) and aring-gf-flint-big.hpp (polynomial-quotient).

See also
aring-gf-flint.hpp
aring-gf-flint-big.hpp
GF.hpp
aring-zzp.hpp

Definition in file aring-m2-gf.hpp.