57 #define TEST_ONE_MAX 50
69 else if (
p == 5 ||
p == 7)
89#if defined(HAVE_NTL) || defined(HAVE_FLINT)
94 #if defined(HAVE_NTL) && !defined(HAVE_FLINT)
103 bool primFail=
false;
106 ASSERT (!primFail,
"failure in integer factorizer");
110 nmod_poly_t Irredpoly;
112 nmod_poly_randtest_monic_irreducible(Irredpoly,
FLINTrandom, 3*d+1);
115 #elif defined(HAVE_NTL)
117 BuildIrred (NTLIrredpoly, d*3);
127 nmod_poly_t Irredpoly;
129 nmod_poly_randtest_monic_irreducible(Irredpoly,
FLINTrandom, 3*d+1);
132 #elif defined(HAVE_NTL)
134 BuildIrred (NTLIrredpoly, d*2);
144 else if ((
p == 3 && d < 4) || ((
p == 5 ||
p == 7) && d < 3))
146 bool primFail=
false;
149 ASSERT (!primFail,
"failure in integer factorizer");
151 nmod_poly_t Irredpoly;
153 nmod_poly_randtest_monic_irreducible(Irredpoly,
FLINTrandom, 2*d+1);
156 #elif defined(HAVE_NTL)
158 BuildIrred (NTLIrredpoly, d*2);
170 F=
mapUp (F,
v, v2, primElem, imPrimElem, source, dest);
171 G=
mapUp (
G,
v, v2, primElem, imPrimElem, source, dest);
172 lcf=
mapUp (
lcf,
v, v2, primElem, imPrimElem, source, dest);
173 lcg=
mapUp (
lcg,
v, v2, primElem, imPrimElem, source, dest);
180 if ((!algExtension &&
p > 0) ||
p == 0)
264 for (
i =
f;
i.hasTerms();
i++ )
CanonicalForm convertnmod_poly_t2FacCF(const nmod_poly_t poly, const Variable &x)
conversion of a FLINT poly over Z/p to CanonicalForm
This file defines functions for conversion to FLINT (www.flintlib.org) and back.
CanonicalForm convertNTLzzpX2CF(const zz_pX &poly, const Variable &x)
Conversion to and from NTL.
bool gcd_test_one(const CanonicalForm &f, const CanonicalForm &g, bool swap, int &d)
Coprimality Check. f and g are assumed to have the same level. If swap is true, the main variables of...
CanonicalForm balance_p(const CanonicalForm &f, const CanonicalForm &q, const CanonicalForm &qh)
same as balance_p ( const CanonicalForm & f, const CanonicalForm & q ) but qh= q/2 is provided,...
#define ASSERT(expression, message)
#define GaloisFieldDomain
Interface to generate InternalCF's over various domains from intrinsic types or mpz_t's.
Iterators for CanonicalForm's.
CanonicalForm mapPrimElem(const CanonicalForm &primElem, const Variable &alpha, const Variable &beta)
compute the image of a primitive element of in . We assume .
CanonicalForm primitiveElement(const Variable &alpha, Variable &beta, bool &fail)
determine a primitive element of , is a primitive element of a field which is isomorphic to
static CanonicalForm mapUp(const Variable &alpha, const Variable &beta)
and is a primitive element, returns the image of
CanonicalForm GFMapUp(const CanonicalForm &F, int k)
maps a polynomial over to a polynomial over , d needs to be a multiple of k
This file implements functions to map between extensions of finite fields.
GLOBAL_VAR flint_rand_t FLINTrandom
generate random evaluation points
VAR void(* factoryError)(const char *s)
int ipower(int b, int m)
int ipower ( int b, int m )
generate random elements in F_p(alpha)
class to iterate through CanonicalForm's
static CFRandom * generate()
virtual class for random element generation
class to generate random evaluation points
factory's class for variables
const Variable & v
< [in] a sqrfree bivariate poly
nmod_poly_init(FLINTmipo, getCharacteristic())
nmod_poly_clear(FLINTmipo)
some useful template functions.
template CanonicalForm tmax(const CanonicalForm &, const CanonicalForm &)
Operations in GF, where GF is a finite field of size less than 2^16 represented by a root of Conway p...
int status int void size_t count
void prune1(const Variable &alpha)
CanonicalForm getMipo(const Variable &alpha, const Variable &x)
Variable rootOf(const CanonicalForm &mipo, char name)
returns a symbolic root of polynomial with name name Use it to define algebraic variables