55 for (
size_t i = 0; i < polys.size(); i++)
57 std::cerr << i <<
" ";
62 assert(polys.size() ==
mOrder);
82 std::cout <<
"oops: didn't find element " << i <<
" !!" << std::endl;
102 o <<
" order = " <<
mOrder << std::endl;
103 o <<
" 1 = " <<
mOne << std::endl;
105 o <<
" fromZZ: " << std::endl <<
" ";
108 if ((i + 1) % 10 == 0) o << std::endl <<
" ";
111 o << std::endl <<
" oneTable: " << std::endl <<
" ";
114 if ((i + 1) % 10 == 0) o << std::endl <<
" ";
127 const std::vector<long> &poly)
const
131 for (
long i = 0; i < poly.size(); i++)
135 power(b,
mGF.generatorExponent(), i);
143 if (&
mGF.ring() != Rf)
return false;
145 std::vector<long> poly;
157 else if (f ==
mGF.one())
169 if (&
mGF.ring() != Rg)
return false;
185 o <<
"GF(" <<
mGF.characteristic() <<
"^" <<
mGF.dimension() <<
",M2)";
200 mGF.ring().elem_text_out(o, h, p_one, p_plus, p_parens);
201 mGF.ring().remove(h);
void dringelem(const Ring *R, const ring_elem f)
M2::ARingGFM2 — native engine Galois field, no FLINT dependency.
void text_out(buffer &o) const
void power(elem &result, elem a, long n) const
void lift_to_original_ring(ring_elem &result, const ElementType &f) const
void elem_text_out(buffer &o, ElementType a, bool p_one=true, bool p_plus=false, bool p_parens=false) const
void fromSmallIntegerCoefficients(ElementType &result, const std::vector< long > &poly) const
bool lift(const Ring *Rg, const elem f, ring_elem &result) const
ARingGFM2(const PolynomialRing &R, const ring_elem a)
void mult(elem &result, elem a, elem b) const
void add(elem &result, elem a, elem b) const
void set_from_long(elem &result, long a) const
void eval(const RingMap *map, const elem f, int first_var, ring_elem &result) const
bool promote(const Ring *Rf, const ring_elem f, elem &result) const
GaloisFieldTable(const PolynomialRing &R, const ring_elem prim)
const ring_elem mPrimitiveElement
GFElement characteristic() const
GFElement * mFromIntTable
const RingElement * mGenerator
GFElement mGeneratorExponent
void display(std::ostream &o) const
const PolynomialRing & mOriginalRing
Abstract base for the engine's polynomial-ring hierarchy.
virtual ring_elem copy(const ring_elem f) const =0
virtual ring_elem power(const ring_elem f, mpz_srcptr n) const
Exponentiation. This is the default function, if a class doesn't define this.
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...
bool system_interrupted()
system_interrupted() — thread-safe polling predicate for Ctrl+C handling.
VALGRIND_MAKE_MEM_DEFINED & result(result)
Monoid — variable count, naming, grading, and monomial order of a polynomial ring.
#define newarray_atomic(T, len)
PolynomialRing — abstract polynomial-ring base, the engine's most-reused class.
Engine-boundary C API for the engine's PRNG and rational / real / complex random draws.
RingElement — tagged (Ring*, ring_elem) pair, the engine's universal element type.
RingMap — engine representation of a ring homomorphism.
Singly linked-list node carrying one term of a polynomial-ring element.