3#ifndef _aring_gf_flint_hpp_
4#define _aring_gf_flint_hpp_
46#include <M2/gc-include.h>
49#include <M2/math-include.h>
51#pragma GCC diagnostic push
52#pragma GCC diagnostic ignored "-Wconversion"
53#include <flint/flint.h>
54#include <flint/fmpz.h>
55#include <flint/fq_nmod.h>
56#include <flint/fq_zech.h>
57#include <flint/nmod_poly.h>
58#pragma GCC diagnostic pop
142 std::unique_ptr<ElementType[]>
mData;
194 return static_cast<unsigned int>(a.value);
211 return {.value =
static_cast<mp_limb_t
>(a.
get_int())};
217 return fq_zech_is_zero(&f,
mContext);
221 return fq_zech_equal(&f, &g,
mContext);
224 int compare_elems(
const ElementType& f,
const ElementType& g)
const;
249 std::vector<long> poly = {0, 1};
333 printf(
"entering divide\n");
376 fmpz_init_set_readonly(
fn, abs_n);
378 fmpz_clear_readonly(
fn);
388 const ElementType& a,
391 bool p_parens =
false)
const;
410 std::vector<long> poly;
418 const std::vector<long>& poly)
const;
421 std::vector<long>& poly)
const;
434 const ElementType& f,
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.
const fq_zech_ctx_struct * mContext
Element(const ARingGFFlint &R, const ElementType &value)
Element(const ARingGFFlint &R)
const fq_zech_ctx_struct * mContext
const ElementType & operator[](size_t idx) const
ElementType & operator[](size_t idx)
ElementArray(const ARingGFFlint &R, size_t size)
const ElementType * data() const
std::unique_ptr< ElementType[]> mData
const fq_zech_ctx_struct * flintContext() const
void getGenerator(ElementType &result_gen) const
void getSmallIntegerCoefficients(const ElementType &a, std::vector< long > &poly) const
void text_out(buffer &o) const
void init_set(ElementType &result, const ElementType &a) const
void divide(ElementType &result, const ElementType &a, const ElementType &b) const
fq_zech_struct ElementType
void negate(ElementType &result, const ElementType &a) const
void init(ElementType &result) const
void to_ring_elem(ring_elem &result, const ElementType &a) const
void mult(ElementType &result, const ElementType &a, const ElementType &b) const
unsigned int computeHashValue(const elem &a) const
Arithmetic functions ///////.
void copy(ElementType &result, const ElementType &a) const
void clear(ElementType &result) const
std::vector< elem > ElementContainerType
ElementType from_ring_elem_const(const ring_elem &a) const
bool promote(const Ring *Rf, const ring_elem f, ElementType &result) const
ARingGFFlint(const PolynomialRing &R, const ring_elem a)
void elem_text_out(buffer &o, const ElementType &a, bool p_one=true, bool p_plus=false, bool p_parens=false) const
void add(ElementType &result, const ElementType &a, const ElementType &b) const
void subtract_multiple(ElementType &result, const ElementType &a, const ElementType &b) const
void eval(const RingMap *map, const ElementType &f, int first_var, ring_elem &result) const
fq_nmod_ctx_t mBigContext
void set_var(ElementType &result, int v) const
void set_zero(ElementType &result) const
void syzygy(const ElementType &a, const ElementType &b, ElementType &x, ElementType &y) const
bool set_from_BigReal(ElementType &result, gmp_RR a) const
flint_rand_t mRandomState
static const RingID ringID
bool is_zero(const ElementType &f) const
void set(ElementType &result, const ElementType &a) const
bool is_unit(const ElementType &f) const
void from_ring_elem(ElementType &result, const ring_elem &a) const
const RingElement * mPrimitiveElement
void power_mpz(ElementType &result, const ElementType &a, mpz_srcptr n) const
void power(ElementType &result, const ElementType &a, int n) const
void set_from_mpz(ElementType &result, mpz_srcptr a) const
const PolynomialRing & originalRing() const
void set_from_long(ElementType &result, long a) const
int compare_elems(const ElementType &f, const ElementType &g) const
void swap(ElementType &a, ElementType &b) const
void lift_to_original_ring(ring_elem &result, const ElementType &f) const
long characteristic() const
ElementType mCachedGenerator
void fromSmallIntegerCoefficients(ElementType &result, const std::vector< long > &poly) const
void subtract(ElementType &result, const ElementType &a, const ElementType &b) const
const PolynomialRing & mOriginalRing
bool is_equal(const ElementType &f, const ElementType &g) const
bool lift(const Ring *Rg, const ElementType &f, ring_elem &result) const
void invert(ElementType &result, const ElementType &a) const
bool set_from_mpq(ElementType &result, mpq_srcptr a) const
void random(ElementType &result) const
const ElementType & value() const
Abstract base for the engine's polynomial-ring hierarchy.
Front-end-visible "ring element" value: an engine ring_elem paired with the Ring* that gives it meani...
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.