| 662 | |
| 663 | #if defined(HAVE_NTL) || defined(HAVE_FLINT) |
| 664 | CFList |
| 665 | extEarlyFactorDetect (CanonicalForm& F, CFList& factors, int& adaptedLiftBound, |
| 666 | bool& success, const ExtensionInfo& info, const CFList& |
| 667 | eval, const int deg, const CFList& MOD, const int bound) |
| 668 | { |
| 669 | Variable alpha= info.getAlpha(); |
| 670 | Variable beta= info.getBeta(); |
| 671 | CanonicalForm gamma= info.getGamma(); |
| 672 | CanonicalForm delta= info.getDelta(); |
| 673 | int k= info.getGFDegree(); |
| 674 | CFList result; |
| 675 | CFList T= factors; |
| 676 | CanonicalForm buf= F; |
| 677 | Variable y= F.mvar(); |
| 678 | Variable x= Variable (1); |
| 679 | CanonicalForm LCBuf= LC (buf, x); |
| 680 | CanonicalForm g, gg, quot; |
| 681 | CFList M= MOD; |
| 682 | M.append (power (y, deg)); |
| 683 | adaptedLiftBound= 0; |
| 684 | int d= bound; |
| 685 | int e= 0; |
| 686 | int nBuf; |
| 687 | CFList source, dest; |
| 688 | |
| 689 | int degMipoBeta= 1; |
| 690 | if (!k && beta.level() != 1) |
| 691 | degMipoBeta= degree (getMipo (beta)); |
| 692 | |
| 693 | for (CFListIterator i= factors; i.hasItem(); i++) |
| 694 | { |
| 695 | g= mulMod (i.getItem(), LCBuf, M); |
| 696 | g /= myContent (g); |
| 697 | if (fdivides (g, buf, quot)) |
| 698 | { |
| 699 | gg= reverseShift (g, eval); |
| 700 | gg /= Lc (gg); |
| 701 | if (!k && beta == x) |
| 702 | { |
| 703 | if (degree (gg, alpha) < degMipoBeta) |
| 704 | { |
| 705 | appendTestMapDown (result, gg, info, source, dest); |
| 706 | buf= quot; |
| 707 | nBuf= degree (g, y) + degree (LC (g, x), y); |
| 708 | d -= nBuf; |
| 709 | e= tmax (e, nBuf); |
| 710 | LCBuf= LC (buf, x); |
| 711 | T= Difference (T, CFList (i.getItem())); |
| 712 | } |
| 713 | } |
| 714 | else |
| 715 | { |
| 716 | if (!isInExtension (gg, gamma, k, delta, source, dest)) |
| 717 | { |
| 718 | appendTestMapDown (result, gg, info, source, dest); |
| 719 | buf= quot; |
| 720 | nBuf= degree (g, y) + degree (LC (g, x), y); |
| 721 | d -= nBuf; |
no test coverage detected