22 std::vector<long> poly;
28 for (
long i = poly.size() - 1; i >= 0; i--)
39 for (
long i=0; i<poly.size(); i++)
40 printf(
" %ld", poly[i]);
46 for (
long i = poly.size() - 1; i >= 0; i--)
47 if (poly[i] != 0) nmod_poly_set_coeff_ui(mMinPoly, i, poly[i]);
49 fq_nmod_ctx_init_modulus(
mContext, mMinPoly,
"a");
53 nmod_poly_clear(mMinPoly);
75 std::vector<long>& poly)
const
77 long deg = nmod_poly_degree(&a);
79 for (
long i = deg; i >= 0; i--) poly[i] = nmod_poly_get_coeff_ui(&a, i);
84 const std::vector<long>& poly)
const
88 for (
long i=0; i<poly.size(); i++)
89 printf(
"%ld ", poly[i]);
92 for (
long i = poly.size() - 1; i >= 0; i--)
97 nmod_poly_set_coeff_ui(&
result, i, a);
100 printf(
" result before reduction = ");
106 printf(
" result = ");
128 std::vector<long> poly;
138 std::vector<long> poly;
164 std::vector<long> poly;
166 for (
long i = poly.size() - 1; i >= 0; i--)
201 long degF = nmod_poly_degree(&f);
202 long degG = nmod_poly_degree(&g);
205 else if (degF < degG)
208 for (
long i = degF; i >= 0; i--)
210 long coeffF = nmod_poly_get_coeff_ui(&f, i);
211 long coeffG = nmod_poly_get_coeff_ui(&g, i);
212 if (coeffF > coeffG)
return GT;
213 if (coeffG > coeffF)
return LT;
M2::ARingGFFlintBig — arbitrary-degree GF(p^k) via FLINT fq_nmod.
#define FLINT_RAND_INIT(x)
#define FLINT_RAND_CLEAR(x)
const PolynomialRing & originalRing() const
void fromSmallIntegerCoefficients(ElementType &result, const std::vector< long > &poly) const
void getGenerator(ElementType &result_gen) const
const PolynomialRing & mOriginalRing
bool lift(const Ring *Rg, const ElementType &f, ring_elem &result) const
ElementType mCachedGenerator
const RingElement * mPrimitiveElement
void lift_to_original_ring(ring_elem &result, const ElementType &f) const
bool is_zero(const ElementType &f) const
ARingGFFlintBig(const PolynomialRing &R, const ring_elem a)
bool promote(const Ring *Rf, const ring_elem f, ElementType &result) const
flint_rand_t mRandomState
void text_out(buffer &o) const
long characteristic() const
fq_nmod_struct ElementType
void elem_text_out(buffer &o, const ElementType &a, bool p_one=true, bool p_plus=false, bool p_parens=false) const
void getSmallIntegerCoefficients(const ElementType &a, std::vector< long > &poly) const
int compare_elems(const ElementType &f, const ElementType &g) const
void eval(const RingMap *map, const ElementType &f, int first_var, ring_elem &result) const
void copy(ElementType &result, const ElementType &a) const
ring_elem fromSmallIntegerCoefficients(const std::vector< long > &coeffs, int var) const
virtual const PolyRing * getNumeratorRing() const
Abstract base for the engine's polynomial-ring hierarchy.
virtual ring_elem add(const ring_elem f, const ring_elem g) const =0
virtual ring_elem from_long(long n) const =0
virtual void elem_text_out(buffer &o, const ring_elem f, bool p_one=true, bool p_plus=false, bool p_parens=false) const =0
long characteristic() const
virtual ring_elem copy(const ring_elem f) const =0
virtual bool is_zero(const ring_elem f) const =0
virtual ring_elem mult(const ring_elem f, const ring_elem g) const =0
static RingElement * make_raw(const Ring *R, ring_elem f)
bool getSmallIntegerCoefficients(std::vector< long > &result_coeffs) const
Front-end-visible "ring element" value: an engine ring_elem paired with the Ring* that gives it meani...
const ring_elem elem(int i) const
const Ring * get_ring() const
Engine-side ring homomorphism: stores, for each source-ring variable, the target-ring element it maps...
VALGRIND_MAKE_MEM_DEFINED & result(result)
#define newarray_atomic(T, len)
Concrete commutative PolyRing — standard polynomial ring inheriting from PolyRingFlat.
RingElement — tagged (Ring*, ring_elem) pair, the engine's universal element type.
RingMap — engine representation of a ring homomorphism.