modular gcd over F_p[x]/(M) for not necessarily irreducible M. If a zero divisor is encountered fail is set to true.
396 result=
reduce (result, M);
415 result=
reduce (result, M);
454 Variable
v= M.
mvar();
461 zz_pE::init (NTLMipo);
477 tryEuclid(f,g,M,result,fail);
482 result= NN (
reduce (result, M));
502 tryEuclid(
cf,
cg,M,c,fail);
507 f.tryDiv (
cf, M, fail);
511 g.tryDiv (
cg, M, fail);
515 if(f.inCoeffDomain())
523 if(g.inCoeffDomain())
531 int *L =
new int[mv+1];
532 int *
N =
new int[mv+1];
533 for(
int i=2;
i<=mv;
i++)
552 for(
int i=2; i<=mv; i++)
556 int *dg_im = new
int[mv+1];
557 for(
int i=2; i<=mv; i++)
563 Variable
x= Variable (1);
565 for(FFGenerator gen = FFGenerator(); gen.hasItems(); gen.
next())
568 gamma_image =
reduce(gamma(alpha,
x),M);
572 tryBrownGCD(
f(alpha,
x),
g(alpha,
x), M, g_image, fail,
false );
574 "time for recursive calls in alg gcd mod p: ")
577 g_image =
reduce(g_image, M);
578 if(g_image.inCoeffDomain())
586 for(
int i=2; i<=mv; i++)
588 dg_im =
leadDeg(g_image, dg_im);
596 g_image *= gamma_image;
597 g_image=
reduce (g_image, M);
601 "time for Newton interpolation in alg gcd mod p: ")
608 if((
firstLC(gnew) == gamma) || (gnew == gm))
629 result = NN(
reduce (c*g_image, M));
631 "time for successful termination test in alg gcd mod p: ")
648 for(
int i=2; i<=mv; i++)
TIMING_END_AND_PRINT(fac_alg_resultant, "time to compute resultant0: ")
for(int i=0;i<=n;i++) degsf[i]
TIMING_START(fac_alg_resultant)
factory's class for variables
generate all elements in F_p starting from 0
int myCompress(const CanonicalForm &F, const CanonicalForm &G, CFMap &M, CFMap &N, bool topLevel)
compressing two polynomials F and G, M is used for compressing, N to reverse the compression ...
const CanonicalForm CFMap CFMap bool topLevel
void tryInvert(const CanonicalForm &F, const CanonicalForm &M, CanonicalForm &inv, bool &fail)
bool isLess(int *a, int *b, int lower, int upper)
const CanonicalForm CFMap CFMap & N
zz_pEX convertFacCF2NTLzz_pEX(const CanonicalForm &f, const zz_pX &mipo)
CanonicalForm firstLC(const CanonicalForm &f)
static CanonicalForm tryvcontent(const CanonicalForm &f, const Variable &x, const CanonicalForm &M, bool &fail)
CanonicalForm convertNTLzz_pEX2CF(const zz_pEX &f, const Variable &x, const Variable &alpha)
bool isEqual(int *a, int *b, int lower, int upper)
const Variable & v
< [in] a sqrfree bivariate poly
static CanonicalForm tryNewtonInterp(const CanonicalForm &alpha, const CanonicalForm &u, const CanonicalForm &newtonPoly, const CanonicalForm &oldInterPoly, const Variable &x, const CanonicalForm &M, bool &fail)
void tryNTLGCD(zz_pEX &x, const zz_pEX &a, const zz_pEX &b, bool &fail)
compute the GCD x of a and b, fail is set to true if a zero divisor is encountered ...
zz_pX convertFacCF2NTLzzpX(const CanonicalForm &f)
int * leadDeg(const CanonicalForm &f, int *degs)
bool tryFdivides(const CanonicalForm &f, const CanonicalForm &g, const CanonicalForm &M, bool &fail)
same as fdivides but handles zero divisors in Z_p[t]/(f)[x1,...,xn] for reducible f ...