MCPcopy Create free account
hub / github.com/Singular/Singular / earlyFactorDetect

Function earlyFactorDetect

factory/facFqFactorize.cc:611–660  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

609
610#if defined(HAVE_NTL) || defined(HAVE_FLINT)
611CFList
612earlyFactorDetect (CanonicalForm& F, CFList& factors, int& adaptedLiftBound,
613 bool& success, const int deg, const CFList& MOD,
614 const int bound)
615{
616 CFList result;
617 CFList T= factors;
618 CanonicalForm buf= F;
619 Variable y= F.mvar();
620 Variable x= Variable (1);
621 CanonicalForm LCBuf= LC (buf, x);
622 CanonicalForm g, quot;
623 CFList M= MOD;
624 M.append (power (y, deg));
625 adaptedLiftBound= 0;
626 int d= bound;
627 int e= 0;
628 int nBuf;
629 for (CFListIterator i= factors; i.hasItem(); i++)
630 {
631 g= mulMod (i.getItem(), LCBuf, M);
632 g /= myContent (g);
633 if (fdivides (g, buf, quot))
634 {
635 result.append (g);
636 nBuf= degree (g, y) + degree (LC (g, x), y);
637 d -= nBuf;
638 e= tmax (e, nBuf);
639 buf= quot;
640 LCBuf= LC (buf, x);
641 T= Difference (T, CFList (i.getItem()));
642 }
643 }
644 adaptedLiftBound= d;
645
646 if (adaptedLiftBound < deg)
647 {
648 if (adaptedLiftBound < degree (F) + 1)
649 {
650 if (d == 1)
651 adaptedLiftBound= tmin (e + 1, deg);
652 else
653 adaptedLiftBound= deg;
654 }
655 factors= T;
656 F= buf;
657 success= true;
658 }
659 return result;
660}
661#endif
662
663#if defined(HAVE_NTL) || defined(HAVE_FLINT)

Callers 1

henselLiftAndEarlyFunction · 0.85

Calls 13

VariableFunction · 0.85
LCFunction · 0.85
powerFunction · 0.85
mulModFunction · 0.85
myContentFunction · 0.85
fdividesFunction · 0.85
degreeFunction · 0.85
tmaxFunction · 0.85
DifferenceFunction · 0.85
tminFunction · 0.85
mvarMethod · 0.80
hasItemMethod · 0.80

Tested by

no test coverage detected