3#ifndef _aring_zzp_flint_hpp_
4#define _aring_zzp_flint_hpp_
52#include <M2/gc-include.h>
54#pragma GCC diagnostic push
55#pragma GCC diagnostic ignored "-Wconversion"
56#include <flint/flint.h>
57#include <flint/fmpz.h>
58#ifdef HAVE_FLINT_NMOD_H
59 #include <flint/nmod.h>
61#pragma GCC diagnostic pop
102 return static_cast<unsigned int>(a);
126 if (f > g)
return -1;
254 unsigned long nbar = mpz_fdiv_ui(n,
mCharac - 1);
262 else if (mpz_sgn(n) > 0)
280 bool p_parens =
false)
const;
318 assert(
sizeof(mp_limb_t) <=
sizeof(
long));
329 return static_cast<mp_limb_t
>(a.
get_long());
Shared base of the aring framework (namespace M2) that unifies the engine's coefficient rings.
Append-only GC-backed byte buffer used throughout the engine for text output.
long coerceToLongInteger(const elem &f) const
void set(ElementType &result, ElementType a) const
void power_mpz(ElementType &result, ElementType a, mpz_srcptr n) const
void elem_text_out(buffer &o, ElementType a, bool p_one=true, bool p_plus=false, bool p_parens=false) const
void init_set(ElementType &result, ElementType a) const
void to_ring_elem(ring_elem &result, const ElementType &a) const
static const RingID ringID
bool is_unit(ElementType f) const
static void clear(ElementType &result)
void mult(ElementType &result, ElementType a, ElementType b) const
void set_from_mpz(ElementType &result, mpz_srcptr a) const
void set_zero(ElementType &result) const
std::vector< elem > ElementContainerType
void swap(ElementType &a, ElementType &b) const
void add(ElementType &result, ElementType a, ElementType b) const
ElementType from_ring_elem_const(const ring_elem &a) const
void invert(ElementType &result, ElementType a) const
int compare_elems(ElementType f, ElementType g) const
void set_from_long(ElementType &result, long a) const
void negate(ElementType &result, ElementType a) const
void divide(ElementType &result, ElementType a, ElementType b) const
void power(ElementType &result, ElementType a, long n) const
bool set_from_mpq(ElementType &result, mpq_srcptr a) const
unsigned int computeHashValue(const elem &a) const
void subtract_multiple(ElementType &result, ElementType a, ElementType b) const
flint_rand_t mRandomState
void getGenerator(elem &gen) const
void eval(const RingMap *map, const ElementType f, int first_var, ring_elem &result) const
bool is_zero(ElementType f) const
void from_ring_elem(ElementType &result, const ring_elem &a) const
void init(ElementType &result) const
ARingZZpFlint(size_t prime)
size_t characteristic() const
size_t cardinality() const
long discreteLog(const elem &a) const
bool is_equal(ElementType f, ElementType g) const
void syzygy(ElementType a, ElementType b, ElementType &x, ElementType &y) const
void random(ElementType &result) const
bool set_from_BigReal(ElementType &result, gmp_RR a) const
void text_out(buffer &o) const
void set_var(ElementType &result, int v) const
nmod_t flintModulus() const
void subtract(ElementType &result, ElementType a, ElementType b) const
A base class for simple ARings.
Engine-side ring homomorphism: stores, for each source-ring variable, the target-ring element it maps...
namespace exc — internal C++ exception types and the TRY / CATCH macro pair.
VALGRIND_MAKE_MEM_DEFINED & result(result)
unsigned long rawRandomULong(unsigned long max)
Engine-boundary C API for the engine's PRNG and rational / real / complex random draws.
ring_elem — the universal value type carried by every Ring* in the engine.