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

aring-style adapter for Z/p with p a word-size prime, backed by FLINT's nmod_* routines. More...

#include <aring-zzp-flint.hpp>

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

Public Types

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

Public Member Functions

 ARingZZpFlint (size_t prime)
 ~ARingZZpFlint ()
nmod_t flintModulus () const
size_t characteristic () const
size_t cardinality () const
unsigned int computeHashValue (const elem &a) const
long coerceToLongInteger (const elem &f) const
void getGenerator (elem &gen) const
long discreteLog (const elem &a) const
void text_out (buffer &o) 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 init (ElementType &result) const
void init_set (ElementType &result, ElementType a) const
void set (ElementType &result, ElementType a) const
void set_zero (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, ElementType a) const
void invert (ElementType &result, ElementType a) const
void add (ElementType &result, ElementType a, ElementType b) const
void subtract (ElementType &result, ElementType a, ElementType b) const
void subtract_multiple (ElementType &result, ElementType a, ElementType b) const
void mult (ElementType &result, ElementType a, ElementType b) const
void divide (ElementType &result, ElementType a, ElementType b) const
void power (ElementType &result, ElementType a, long n) const
void power_mpz (ElementType &result, ElementType 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 eval (const RingMap *map, const ElementType f, int first_var, ring_elem &result) 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

Static Public Member Functions

static void clear (ElementType &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_ZZpFlint

Private Attributes

nmod_t mModulus
size_t mCharac
flint_rand_t mRandomState
fmpz_t mFmpzCharac
mp_limb_t mGenerator

Detailed Description

aring-style adapter for Z/p with p a word-size prime, backed by FLINT's nmod_* routines.

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

Elements are residues in 0..p-1. The largest supported prime is the largest prime below 2^64, so this covers basically every prime that fits in a single mp_limb_t. ringID = ring_ZZpFlint. Used wherever CoefficientRingZZp would be too slow at the high end of the small-prime range, or when FLINT's batched nmod primitives buy the inner loop.

Definition at line 79 of file aring-zzp-flint.hpp.


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