190 bool extension= (v.
level() != 1);
224 A= A/(contentAx*contentAy);
225 CFFList contentAxFactors, contentAyFactors;
231 contentAxFactors=
factorize (contentAx, v);
232 if (contentAxFactors.
getFirst().factor().inCoeffDomain())
237 contentAyFactors=
factorize (contentAy, v);
238 if (contentAyFactors.
getFirst().factor().inCoeffDomain())
246 contentAxFactors=
factorize (contentAx,
true);
247 if (contentAxFactors.
getFirst().factor().inCoeffDomain())
252 contentAyFactors=
factorize (contentAy,
true);
253 if (contentAyFactors.
getFirst().factor().inCoeffDomain())
266 conv (contentAyFactors),
false,
false, N);
299 conv (contentAyFactors),
false,
false, N);
312 CFList uniFactors, list, bufUniFactors;
317 CFList bufUniFactors2, list2, uniFactors2;
329 int evaluation, evaluation2, bufEvaluation= 0, bufEvaluation2= 0;
330 for (
int i= 0;
i < factorNums;
i++)
339 bufAeval2=
evalPoint (buf, bufEvaluation2);
341 "time for eval point over Q in y: ");
350 "time for univariate factorization over Q: ");
351 DEBOUTLN (cerr,
"prod (bufUniFactors)== bufAeval " <<
352 (
prod (bufUniFactors) == bufAeval));
357 if (bufUniFactors.
length() == 1)
362 conv (contentAyFactors), swap, swap2, N);
375 "time for univariate factorization in y over Q: ");
376 DEBOUTLN (cerr,
"prod (bufuniFactors2)== bufAeval2 " <<
377 (
prod (bufUniFactors2) == bufAeval2));
381 if (bufUniFactors2.
length() == 1)
386 conv (contentAyFactors), swap, swap2, N);
399 if (subCheck > 1 && (subCheck1%subCheck == 0))
402 subst (bufA, bufA, subCheck, x);
406 conv (contentAyFactors), swap, swap2, N);
417 if (subCheck > 1 && (subCheck2%subCheck == 0))
420 subst (bufA, bufA, subCheck, y);
424 conv (contentAyFactors), swap, swap2, N);
439 evaluation= bufEvaluation;
440 uniFactors= bufUniFactors;
443 evaluation2= bufEvaluation2;
444 uniFactors2= bufUniFactors2;
453 uniFactors2= bufUniFactors2;
455 evaluation2= bufEvaluation2;
459 uniFactors= bufUniFactors;
461 evaluation= bufEvaluation;
464 if (bufEvaluation > 0)
467 bufEvaluation= -bufEvaluation + 1;
468 if (bufEvaluation > 0)
471 bufEvaluation2= -bufEvaluation2 + 1;
479 uniFactors= uniFactors2;
480 evaluation= evaluation2;
490 conv (contentAyFactors), swap, swap2, N);
497 A=
A (y + evaluation, y);
499 int liftBound=
degree (A, y) + 1;
502 bool mipoHasDen=
false;
512 printf (
"out of primes\n");
537 i.getItem()= i.getItem()*
bCommonDen(i.getItem());
560 bool earlySuccess=
false;
564 (A, earlySuccess, earlyFactors, degs, liftBound,
565 uniFactors, dummy, evaluation, b, den);
567 "time for bivariate hensel lifting over Q: ");
568 DEBOUTLN (cerr,
"lifted factors= " << uniFactors);
591 "time for bivariate factor recombination over Q: ");
596 factors=
Union (earlyFactors, factors);
597 else if (!earlySuccess && degs.
getLength() == 1)
598 factors= earlyFactors;
601 conv (contentAyFactors), swap, swap2, N);
CFFList append(const CFFList &Inputlist, const CFFactor &TheFactor)
DegreePattern provides a functionality to create, intersect and refine degree patterns.
const CanonicalForm int const CFList const Variable & y
static poly normalize(poly next_p, ideal add_generators, syStrategy syzstr, int *g_l, int *p_l, int crit_comp)
int getLength() const
getter
bool irreducibilityTest(const CanonicalForm &F)
computes the Newton polygon of F and checks if it satisfies the irreducibility criterion from S...
#define TIMING_END_AND_PRINT(t, msg)
factory's class for variables
CFList henselLiftAndEarly(CanonicalForm &A, bool &earlySuccess, CFList &earlyFactors, DegreePattern °s, int &liftBound, const CFList &uniFactors, const ExtensionInfo &info, const CanonicalForm &eval, modpk &b, CanonicalForm &den)
hensel Lifting and early factor detection
CFList *& Aeval
<[in] poly
ZZX convertFacCF2NTLZZX(const CanonicalForm &f)
const CanonicalForm int const CFList & evaluation
void appendSwapDecompress(CFList &factors1, const CFList &factors2, const CFList &factors3, const bool swap1, const bool swap2, const CFMap &N)
first swap Variables in factors1 if necessary, then append factors2 and factors3 on factors1 and fina...
CanonicalForm getMipo(const Variable &alpha, const Variable &x)
CanonicalForm compress(const CanonicalForm &f, CFMap &m)
CanonicalForm compress ( const CanonicalForm & f, CFMap & m )
Rational abs(const Rational &a)
void prune(Variable &alpha)
CanonicalForm subst(const CanonicalForm &f, const CFList &a, const CFList &b, const CanonicalForm &Rstar, bool isFunctionField)
void intersect(const DegreePattern °Pat)
intersect two degree patterns
CFList factorRecombination(CFList &factors, CanonicalForm &F, const CanonicalForm &N, DegreePattern °s, const CanonicalForm &eval, int s, int thres, const modpk &b, const CanonicalForm &den)
naive factor recombination as decribed in "Factoring multivariate polynomials over a finite field" by...
template List< Variable > Union(const List< Variable > &, const List< Variable > &)
CFList conv(const CFFList &L)
convert a CFFList to a CFList by dropping the multiplicity
CFFList factorize(const CanonicalForm &f, bool issqrfree=false)
factorization over or
CanonicalForm evalPoint(const CanonicalForm &F, int &i)
ExtensionInfo contains information about extension.
const CanonicalForm CFMap CFMap & N
CanonicalForm decompress(const CanonicalForm &F, const mpz_t *inverseM, const mpz_t *A)
decompress a bivariate poly
int status int void * buf
static const int SW_RATIONAL
set to 1 for computations over Q
int substituteCheck(const CanonicalForm &F, const Variable &x)
check if a substitution x^n->x is possible
CanonicalForm bCommonDen(const CanonicalForm &f)
CanonicalForm bCommonDen ( const CanonicalForm & f )
CFList biFactorize(const CanonicalForm &F, const Variable &v)
const Variable & v
< [in] a sqrfree bivariate poly
int cf_getBigPrime(int i)
static BOOLEAN discriminant(leftv result, leftv arg)
void findGoodPrime(const CanonicalForm &f, int &start)
find a big prime p from our tables such that no term of f vanishes mod p
CanonicalForm reverseSubst(const CanonicalForm &F, const int d, const Variable &x)
reverse a substitution x^d->x
#define DEBOUTLN(stream, objects)
modpk coeffBound(const CanonicalForm &f, int p, const CanonicalForm &mipo)
compute p^k larger than the bound on the coefficients of a factor of f over Q (mipo) ...
CanonicalForm convertZZ2CF(const ZZ &a)
NAME: convertZZ2CF.
CanonicalForm resultant(const CanonicalForm &f, const CanonicalForm &g, const Variable &x)
CanonicalForm resultant ( const CanonicalForm & f, const CanonicalForm & g, const Variable & x ) ...
class to do operations mod p^k for int's p and k