16 assert(FieldType::maxCardinality() >=
mCharac);
23 bool print_parens)
const
27 if (a == 1 and not print_one)
return;
28 if (a > 0 and print_plus) o <<
"+";
38 for (
UTT currIntElem = 2; currIntElem <
mCharac; currIntElem++)
44 for (
UTT count = 0; count <
mCharac - 2; count++)
46 mult(tmpElem, tmpElem, currElem);
47 if (
is_equal(currElem, tmpElem)) found =
false;
51 std::cerr <<
"generator = " << currElem << std::endl;
111 unsigned long b =
static_cast<UTT>(mpz_fdiv_ui(a,
mCharac));
233 else if (mpz_sgn(n) == 0)
283 long a =
static_cast<long>(f);
M2::ARingZZpFFPACK — Z/p via FFLAS-FFPACK's Givaro::Modular<double> field.
bool set_from_mpq(ElementType &result, mpq_srcptr a) const
void divide(ElementType &result, const ElementType a, const ElementType b) const
test doc
void subtract_multiple(ElementType &result, const ElementType a, const ElementType b) const
void add(ElementType &result, const ElementType a, const ElementType b) const
void invert(ElementType &result, const ElementType a) const
void set_from_mpz(ElementType &result, mpz_srcptr a) const
void power(ElementType &result, const ElementType a, const STT n) const
void set_from_long(ElementType &result, long a) const
ElementType computeGenerator() const
void elem_text_out(buffer &o, const ElementType a, bool p_one=true, bool p_plus=false, bool p_parens=false) const
FieldType::RandIter mFfpackRandomIterator
void subtract(ElementType &result, const ElementType a, const ElementType b) const
const FieldType mFfpackField
std::make_signed< UTT >::type STT
int compare_elems(const ElementType f, const ElementType g) const
bool is_equal(const ElementType f, const ElementType g) const
void eval(const RingMap *map, const ElementType f, int first_var, ring_elem &result) const
void power_mpz(ElementType &result, const ElementType a, mpz_srcptr n) const
void random(ElementType &result) const
void init(ElementType &result) const
Givaro::Modular< double > FieldType
void set_zero(ElementType &result) const
bool is_unit(const ElementType f) const
void swap(ElementType &a, ElementType &b) const
void negate(ElementType &result, const ElementType a) const
UTT mDimension
same as extensionDegree
ARingZZpFFPACK(UTT charac)
void syzygy(const ElementType a, const ElementType b, ElementType &x, ElementType &y) const
returns x,y s.y. x*a + y*b == 0. if possible, x is set to 1. no need to consider the case a==0 or b==...
void mult(ElementType &result, const ElementType a, const ElementType b) const
void copy(ElementType &result, const ElementType a) const
void unsafeInvert(ElementType &result, const ElementType a) const
FieldType::Element ElementType
void set(ElementType &result, ElementType a) const
bool is_zero(const ElementType f) const
virtual ring_elem from_long(long n) const =0
const Ring * get_ring() const
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.
static CanonicalForm base
VALGRIND_MAKE_MEM_DEFINED & result(result)
RingMap — engine representation of a ring homomorphism.