46 ERROR(
"ZZP: expected a prime number p in range 2 <= p <= 32749");
65 ERROR(
"expected poly ring of the form ZZ/p[x]/(f)");
70 ERROR(
"expected poly ring of the form ZZ/p[x]/(f)");
75 ERROR(
"expected poly ring of the form ZZ/p[x]/(f)");
80 ERROR(
"expected poly ring of the form ZZ/p[x]/(f)");
88 if (R ==
nullptr)
return nullptr;
101 if (R ==
nullptr)
return nullptr;
115 if (R ==
nullptr)
return nullptr;
142 ERROR(
" givaroGF/FFPACK: help, dimension is negative ! ");
151 ERROR(
"givaroGF/FFPACK: expected a prime number p ");
178 ERROR(
"calling rawARingGaloisField with no longer allowed values, givaro is no longer available");
181 ERROR(
"add --enable-fflas-ffpack --enable-givaro when building M2");
202 ERROR(
"expected poly ring of the form ZZ/p[x]/(f)");
207 ERROR(
"expected poly ring of the form ZZ/p[x]/(f)");
212 ERROR(
"expected poly ring of the form ZZ/p[x]/(f)");
217 ERROR(
"expected poly ring of the form ZZ/p[x]/(f)");
224 "primitive element needs to be the generator of the ring, we "
232 M2_arrayint modPoly = F.getSmallIntegerCoefficients();
235 ERROR(
"internal error: this should not happen");
239 if (primitiveElementPoly == 0)
return NULL;
261 ERROR(
"expected a GaloisField");
264 const M2::ARingGFGivaro &A = RGF->
ring();
265 return A.getModPolynomialCoeffs();
267 ERROR(
"add --enable-fflas-ffpack --enable-givaro when building M2");
282 ERROR(
"expected a GaloisField");
285 const M2::ARingGFGivaro &A = RGF->
ring();
286 M2::ARingGFGivaro::ElementType a;
288 return A.fieldElementToM2Array(a);
290 ERROR(
"add --enable-fflas-ffpack --enable-givaro when building M2");
304 ERROR(
"expected a base ring ZZ/p");
313 std::unique_ptr<M2::ARingTower>(
T));
322 M2_ArrayString new_names)
330 ERROR(
"expected a tower ring");
338 std::unique_ptr<M2::ARingTower>(
T));
347 engine_RawRingElementArray eqns)
355 ERROR(
"expected a tower ring");
360 std::vector<M2::ARingTower::ElementType> extensions;
362 for (
int i = 0; i < eqns->len; i++)
368 ERROR(
"extension element has incorrect base ring");
372 extensions.push_back(f1);
376 std::unique_ptr<M2::ARingTower>(
T));
M2::ARingGFFlintBig — arbitrary-degree GF(p^k) via FLINT fq_nmod.
M2::ARingGFFlint — small GF(p^k) via FLINT Zech-logarithm tables.
ConcreteRing<RingType> — the templated bridge between aring and the legacy Ring API.
M2::ARingGFM2 — native engine Galois field, no FLINT dependency.
Tiny dispatcher header that picks the default ARingQQ from among the QQ aring implementations.
M2::ARingTower — iterated finite-field extension tower for very large GF(p^k).
M2::ARingZZ — FLINT-backed arbitrary-precision integers with small-value inlining.
M2::ARingZZpFFPACK — Z/p via FFLAS-FFPACK's Givaro::Modular<double> field.
M2::ARingZZpFlint — Z/p via FLINT's nmod_t precomputed-reciprocal reduction.
M2::ARingZZp — portable Z/p for small primes via log / exp tables.
M2_arrayintOrNull rawARingGFPolynomial(const Ring *R)
M2_arrayintOrNull rawARingGFCoefficients(const RingElement *f)
const Ring * rawARingGaloisFieldFromQuotient(const RingElement *prim)
Engine-boundary C API for constructing aring-backed coefficient rings.
ARingPolynomial ElementType
void from_ring_elem(ElementType &result, const ring_elem &a) const
static ARingTower * create(const BaseRingType &baseRing, const std::vector< std::string > &names)
aring-style coefficient ring for tower polynomial rings (Z/p)[x_0][x_1]...[x_{n-1}...
static double getMaxModulus()
wrapper for the FFPACK::ModularBalanced<double> field implementation
const RingType & ring() const
static ConcreteRing< RingType > * create(std::unique_ptr< RingType > R)
virtual ring_elem var(int v) const =0
Nterm * quotient_element(int i) const
Abstract base for the engine's polynomial-ring hierarchy.
virtual bool is_equal(const ring_elem f, const ring_elem g) const =0
virtual const PolynomialRing * cast_to_PolynomialRing() const
long characteristic() const
ring_elem get_value() const
bool getSmallIntegerCoefficients(std::vector< long > &result_coeffs) const
const Ring * get_ring() const
Front-end-visible "ring element" value: an engine ring_elem paired with the Ring* that gives it meani...
namespace exc — internal C++ exception types and the TRY / CATCH macro pair.
const Ring * rawARingGaloisFieldFlintZech(const RingElement *f)
const Ring * rawARingGaloisField1(const RingElement *f)
static const PolynomialRing * checkGaloisFieldInput(const RingElement *f)
const Ring * rawARingGaloisField(int prime, int dimension)
const Ring * rawARingTower3(const Ring *R1, engine_RawRingElementArray eqns)
void initializeRationalRing()
const Ring * rawARingQQFlint()
const RingQQ * rawARingQQ()
const Ring * rawARingZZFlint()
const Ring * rawARingTower2(const Ring *R1, M2_ArrayString new_names)
const Ring * rawARingZZp(unsigned long p)
const Ring * rawARingGaloisFieldFlintBig(const RingElement *f)
const Ring * rawARingZZpFlint(unsigned long p)
const Ring * rawARingTower1(const Ring *K, M2_ArrayString names)
M2_arrayint M2_arrayintOrNull
PolynomialRing — abstract polynomial-ring base, the engine's most-reused class.
RingElement — tagged (Ring*, ring_elem) pair, the engine's universal element type.
void M2_ArrayString_to_stdvector(M2_ArrayString strs, std::vector< std::string > &result)