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

aring-style adapter for FLINT's Zech-logarithm representation of small finite fields GF(p^n). More...

#include <aring-gf-flint.hpp>

Inheritance diagram for M2::ARingGFFlint:
M2::RingInterface our_new_delete

Classes

class  Element
 A wrapper class for ElementType. More...
class  ElementArray
 Fixed-size owned array of fq_zech_struct slots tied to an ARingGFFlint for the matching FLINT context. More...

Public Types

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

Public Member Functions

 ARingGFFlint (const PolynomialRing &R, const ring_elem a)
 ~ARingGFFlint ()
const fq_zech_ctx_struct * flintContext () const
long characteristic () const
long dimension () const
const PolynomialRingoriginalRing () const
void getGenerator (ElementType &result_gen) const
void text_out (buffer &o) const
unsigned int computeHashValue (const elem &a) const
 Arithmetic functions ///////.
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 (const ElementType &f) const
bool is_zero (const ElementType &f) const
bool is_equal (const ElementType &f, const ElementType &g) const
int compare_elems (const ElementType &f, const ElementType &g) const
void copy (ElementType &result, const ElementType &a) const
void init (ElementType &result) const
void init_set (ElementType &result, const ElementType &a) const
void set (ElementType &result, const ElementType &a) const
void set_zero (ElementType &result) const
void clear (ElementType &result) const
void set_from_long (ElementType &result, long a) const
void set_var (ElementType &result, int v) const
void set_from_mpz (ElementType &result, mpz_srcptr a) const
bool set_from_mpq (ElementType &result, mpq_srcptr a) const
bool set_from_BigReal (ElementType &result, gmp_RR a) const
void negate (ElementType &result, const ElementType &a) const
void invert (ElementType &result, const ElementType &a) const
void add (ElementType &result, const ElementType &a, const ElementType &b) const
void subtract (ElementType &result, const ElementType &a, const ElementType &b) const
void subtract_multiple (ElementType &result, const ElementType &a, const ElementType &b) const
void mult (ElementType &result, const ElementType &a, const ElementType &b) const
void divide (ElementType &result, const ElementType &a, const ElementType &b) const
void power (ElementType &result, const ElementType &a, int n) const
void power_mpz (ElementType &result, const ElementType &a, mpz_srcptr n) const
void swap (ElementType &a, ElementType &b) const
void elem_text_out (buffer &o, const ElementType &a, bool p_one=true, bool p_plus=false, bool p_parens=false) const
void syzygy (const ElementType &a, const ElementType &b, ElementType &x, ElementType &y) const
void random (ElementType &result) const
void fromSmallIntegerCoefficients (ElementType &result, const std::vector< long > &poly) const
void getSmallIntegerCoefficients (const ElementType &a, std::vector< long > &poly) const
bool promote (const Ring *Rf, const ring_elem f, ElementType &result) const
void lift_to_original_ring (ring_elem &result, const ElementType &f) const
bool lift (const Ring *Rg, const ElementType &f, ring_elem &result) const
void eval (const RingMap *map, const ElementType &f, int first_var, ring_elem &result) const

Static Public Attributes

static const RingID ringID = ring_GFFlintZech

Private Attributes

fq_zech_ctx_t mContext
fq_nmod_ctx_t mBigContext
const PolynomialRingmOriginalRing
const RingElementmPrimitiveElement
ulongmPPowers
long mCharacteristic
long mDimension
flint_rand_t mRandomState
ElementType mCachedGenerator
bool mGeneratorComputed

Additional Inherited Members

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)

Detailed Description

aring-style adapter for FLINT's Zech-logarithm representation of small finite fields GF(p^n).

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

ElementType is fq_zech_struct and every arithmetic call delegates to FLINT's fq_zech_* routines through the held mContext (fq_zech_ctx_struct*). The table-driven Zech representation makes addition fast, so this is the preferred GF(p^n) backend when the field is small enough for the lookup tables to fit. ringID = ring_GFFlintZech so VectorArithmetic can dispatch to the matching concrete specialisation. For larger fields where the Zech tables would exceed memory, use ARingGFFlintBig instead.

Definition at line 89 of file aring-gf-flint.hpp.


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