42 if (
i.getItem() == item)
52 if ((pos > 0) && (pos <= list.
length()))
76 zz_pE::init (NTL_mipo);
78 zz_pE root= FindRoot (NTL_alpha_mipo);
102 if (
degree(F) == 0)
return F;
106 remainder=
mod (buf, G);
112 while (
degree (buf) != 0 && counter < bound)
116 if (buf == buf2)
break;
118 ASSERT (counter >= bound,
"alpha is not primitive");
121 alpha_power=
power (alpha, counter);
122 dest.
append (alpha_power);
125 alpha_power=
getItem (dest, pos);
126 result = alpha_power;
151 if (F.
isOne())
return 1;
198 if (F.
isOne())
return F;
210 ASSERT (d%k == 0,
"multiple of GF degree expected");
212 int ext_field_size=
ipower (p, d);
213 int field_size=
ipower ( p, k);
214 int diff= (ext_field_size - 1)/(field_size - 1);
222 if (F.
isOne())
return F;
246 ASSERT (d % k == 0,
"multiple of GF degree expected");
248 int ext_field_size=
ipower (p, d);
249 int field_size=
ipower ( p, k);
250 int diff= (ext_field_size - 1)/(field_size - 1);
270 if (
degree(F) <= 0)
return F;
274 remainder=
mod (buf, G);
280 while (
degree (buf) != 0 && counter < bound)
284 if (buf == buf2)
break;
286 ASSERT (counter <= bound,
"alpha is not primitive");
289 H_power= buf*
power (H, counter);
312 bool primitive=
false;
334 bool initialized=
false;
337 BuildIrred (NTL_mipo, d);
350 zz_pE::init (alpha_mipo);
351 zz_pEX NTL_beta_mipo= to_zz_pEX (NTL_mipo);
352 zz_pE root= FindRoot (NTL_beta_mipo);
362 return mapUp (F, im_prim_elem, alpha, prim_elem, dest, source);
370 if (prim_elem == alpha)
371 return F (im_prim_elem, alpha);
372 return mapUp (F, prim_elem, alpha, im_prim_elem, source, dest);
380 if (primElem == alpha)
381 return mapUp (alpha, beta);
392 zz_pE::init (NTLMipo);
394 zz_pE root= FindRoot (NTLPrimElemMipo);
417 zz_pE::init (NTL_mipo);
420 vec_zz_pE roots= FindRoots (NTL_alpha_mipo);
422 for (
long i= 0;
i < roots.length();
i++)
424 if (
power (roots [
i], order)== NTLBeta)
447 zz_pE::init (NTLMipo);
449 pows.SetLength (2*d);
453 zz_pE NTLFE= to_zz_pE (NTLF);
455 for (
int i= 0;
i < 2*d;
i++)
458 buf.rep.SetLength (d);
459 pows [
i]= buf.rep[0];
464 MinPolySeq (NTLMinPoly, pows, d);
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
CanonicalForm Falpha2GFRep(const CanonicalForm &F)
change representation by residue classes modulo a Conway polynomial to representation by primitive el...
static CanonicalForm mapDown(const CanonicalForm &F, const Variable &alpha, const CanonicalForm &G, CFList &source, CFList &dest)
the CanonicalForm G is the output of map_up, returns F considered as an element over ...
Conversion to and from NTL.
static CanonicalForm bound(const CFMatrix &M)
functions to print debug output
CanonicalForm getItem(const CFList &list, const int &pos)
helper function
static CanonicalForm GF2FalphaHelper(const CanonicalForm &F, const Variable &alpha)
helper function
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 ...
factory's class for variables
CanonicalForm convertNTLzzpE2CF(const zz_pE &coefficient, const Variable &x)
void setMipo(const Variable &alpha, const CanonicalForm &mipo)
bool isPrimitive(const Variable &alpha, bool &fail)
checks if alpha is a primitive element, alpha is assumed to be an algebraic variable over some finite...
CanonicalForm convertNTLzzpX2CF(const zz_pX &poly, const Variable &x)
CanonicalForm getMipo(const Variable &alpha, const Variable &x)
virtual class for internal CanonicalForm's
void prune(Variable &alpha)
This file implements functions to map between extensions of finite fields.
Variable rootOf(const CanonicalForm &, char name='@')
returns a symbolic root of polynomial with name name Use it to define algebraic variables ...
static CanonicalForm mapUp(const Variable &alpha, const Variable &beta)
and is a primitive element, returns the image of
int status int void * buf
zz_pEX convertFacCF2NTLzz_pEX(const CanonicalForm &f, const zz_pX &mipo)
CanonicalForm GFMapDown(const CanonicalForm &F, int k)
maps a polynomial over to a polynomial over , d needs to be a multiple of k
Compute cyclotomic polynomials and factorize integers by brute force.
InternalCF * int2imm_gf(long i)
Iterators for CanonicalForm's.
CanonicalForm findMinPoly(const CanonicalForm &F, const Variable &alpha)
compute minimal polynomial of via NTL
class to iterate through CanonicalForm's
static CanonicalForm GFPowDown(const CanonicalForm &F, int k)
GFMapDown helper.
long imm2int(const InternalCF *const imm)
CanonicalForm GF2FalphaRep(const CanonicalForm &F, const Variable &alpha)
changes representation by primitive element to representation by residue classes modulo a Conway poly...
int ipower(int b, int m)
int ipower ( int b, int m )
zz_pX convertFacCF2NTLzzpX(const CanonicalForm &f)
CanonicalForm GFMapUp(const CanonicalForm &F, int k)
maps a polynomial over to a polynomial over , d needs to be a multiple of k
operations on immediates, that is elements of F_p, GF, Z, Q that fit into intrinsic int...
#define ASSERT(expression, message)
CanonicalForm mapPrimElem(const CanonicalForm &primElem, const Variable &alpha, const Variable &beta)
compute the image of a primitive element of in . We assume .
int findItem(const CFList &list, const CanonicalForm &item)
helper function
static CanonicalForm GFPowUp(const CanonicalForm &F, int k)
GF_map_up helper.