Macaulay2 Engine
Loading...
Searching...
No Matches
M2::ARingGFM2 Class Reference

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

#include <aring-m2-gf.hpp>

Inheritance diagram for M2::ARingGFM2:
M2::SimpleARing< ARingGFM2 > M2::RingInterface our_new_delete

Public Types

typedef int ElementType
typedef int elem
typedef std::vector< elemElementContainerType

Public Member Functions

 ARingGFM2 (const PolynomialRing &R, const ring_elem a)
GFElement characteristic () const
void text_out (buffer &o) const
const PolynomialRingoriginalRing () const
unsigned int computeHashValue (const elem &a) const
void getGenerator (elem &result_gen) const
int get_repr (elem f) const
void to_ring_elem (ring_elem &result, const ElementType &a) const
void from_ring_elem (ElementType &result, const ring_elem &a) const
ElementType from_ring_elem_const (const ring_elem &a) const
bool is_unit (ElementType f) const
bool is_zero (ElementType f) const
bool is_equal (ElementType f, ElementType g) const
int compare_elems (ElementType f, ElementType g) const
void copy (elem &result, elem a) const
void init (elem &result) const
void init_set (elem &result, elem a) const
void set (elem &result, elem a) const
void set_zero (elem &result) const
void set_from_long (elem &result, long a) const
void set_var (elem &result, int v) const
void set_from_mpz (elem &result, mpz_srcptr a) const
bool set_from_mpq (elem &result, mpq_srcptr a) const
bool set_from_BigReal (elem &result, gmp_RR a) const
void negate (elem &result, elem a) const
void invert (elem &result, elem a) const
void add (elem &result, elem a, elem b) const
void subtract (elem &result, elem a, elem b) const
void subtract_multiple (elem &result, elem a, elem b) const
void mult (elem &result, elem a, elem b) const
void divide (elem &result, elem a, elem b) const
void power (elem &result, elem a, long n) const
void power_mpz (elem &result, elem a, mpz_srcptr n) const
void swap (ElementType &a, ElementType &b) const
void elem_text_out (buffer &o, ElementType a, bool p_one=true, bool p_plus=false, bool p_parens=false) const
void syzygy (ElementType a, ElementType b, ElementType &x, ElementType &y) const
void random (ElementType &result) const
void fromSmallIntegerCoefficients (ElementType &result, const std::vector< long > &poly) const
bool promote (const Ring *Rf, const ring_elem f, elem &result) const
void lift_to_original_ring (ring_elem &result, const ElementType &f) const
bool lift (const Ring *Rg, const elem f, ring_elem &result) const
void eval (const RingMap *map, const elem f, int first_var, ring_elem &result) const

Static Public Member Functions

static void clear (elem &result)
Static Public Member Functions inherited from our_new_delete
static void * operator new (size_t size)
static void * operator new[] (size_t size)
static void operator delete (void *obj)
static void operator delete[] (void *obj)
static void * operator new (size_t size, void *existing_memory)
static void * operator new[] (size_t size, void *existing_memory)
static void operator delete (void *obj, void *existing_memory)
static void operator delete[] (void *obj, void *existing_memory)

Static Public Attributes

static const RingID ringID = ring_GFM2

Static Private Member Functions

static int modulus_add (int a, int b, int p)
 Arithmetic functions ///////.
static int modulus_sub (int a, int b, int p)

Private Attributes

GaloisFieldTable mGF

Detailed Description

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

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

Backed by an M2GFTable (the file's other class) that owns the [exp, log, one_table, primitive_element] machinery for the specific extension. Elements are int indices; multiplication and division are integer add / sub mod p^n - 1. ringID = ring_GFM2. Selected when FLINT's ARingGFFlint* rings are unavailable or undesirable (e.g. when reproducing legacy behaviour matters).

Definition at line 124 of file aring-m2-gf.hpp.


The documentation for this class was generated from the following files: