Changeset c13ebd in git
- Timestamp:
- Jun 29, 2020, 5:57:05 PM (3 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- e64ec88de66303fe1a011fc6de0230f0d45acc5a
- Parents:
- 168e13c73f575fd0acbcbd8dece921aaacd1abe5
- Location:
- factory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/facAbsBiFact.cc
r168e13 rc13ebd 31 31 #endif 32 32 33 #if def HAVE_NTL33 #if defined(HAVE_NTL) || defined(HAVE_FLINT) 34 34 TIMING_DEFINE_PRINT(fac_Qa_factorize) 35 35 TIMING_DEFINE_PRINT(fac_evalpoint) … … 113 113 if (f2Factors.length() == 1 && f2Factors.getFirst().exp() == 1) 114 114 { 115 #ifdef HAVE_FLINT 116 // init 117 fmpz_t FLINTD1,FLINTD2; 118 fmpz_init(FLINTD1); 119 fmpz_init(FLINTD2); 120 fmpz_poly_t FLINTf1; 121 fmpz_poly_t FLINTf2; 122 // conversion 123 convertFacCF2Fmpz_poly_t(FLINTf1,f1); 124 convertFacCF2Fmpz_poly_t(FLINTf2,f2); 125 // discriminant 126 fmpz_poly_discriminant(FLINTD1,FLINTf1); 127 fmpz_poly_discriminant(FLINTD2,FLINTf2); 128 // conversion 129 CanonicalForm D1= convertFmpz2CF(FLINTD1); 130 CanonicalForm D2= convertFmpz2CF(FLINTD2); 131 // clean up 132 fmpz_poly_clear(FLINTf1); 133 fmpz_poly_clear(FLINTf2); 134 fmpz_clear(FLINTD1); 135 fmpz_clear(FLINTD2); 136 #elif defined(HAVE_NTL) 115 137 ZZX NTLf1= convertFacCF2NTLZZX (f1); 116 138 ZZX NTLf2= convertFacCF2NTLZZX (f2); … … 119 141 CanonicalForm D1= convertZZ2CF (NTLD1); 120 142 CanonicalForm D2= convertZZ2CF (NTLD2); 143 #endif 121 144 if ((!f.isZero()) && 122 145 (abs(f)>cf_getSmallPrime (cf_getNumSmallPrimes()-1))) … … 183 206 } 184 207 208 #ifdef HAVE_NTL 185 209 //G is assumed to be bivariate, irreducible over Q, primitive wrt x and y, compressed 186 210 CFAFList absBiFactorizeMain (const CanonicalForm& G, bool full) … … 670 694 671 695 F /= Lc (F1); 696 #ifdef HAVE_FLINT 697 // init 698 fmpz_t FLINTf,FLINTD; 699 fmpz_init(FLINTf); 700 fmpz_init(FLINTD); 701 fmpz_poly_t FLINTmipo; 702 fmpz_poly_t FLINTLcf; 703 //conversion 704 convertFacCF2Fmpz_poly_t(FLINTmipo,mipo); 705 convertFacCF2Fmpz_poly_t(FLINTLcf,Lc (F*bCommonDen (F))); 706 // resultant, discriminant 707 fmpz_poly_resultant(FLINTf,FLINTmipo,FLINTLcf); 708 fmpz_poly_discriminant(FLINTD,FLINTmipo); 709 fmpz_mul(FLINTf,FLINTD,FLINTf); 710 den= abs (convertFmpz2CF(FLINTf)); 711 // clean up 712 fmpz_clear(FLINTf); 713 // FLINTD is used below 714 fmpz_poly_clear(FLINTLcf); 715 fmpz_poly_clear(FLINTmipo); 716 #elif defined(HAVE_NTL) 672 717 ZZX NTLmipo= convertFacCF2NTLZZX (mipo); 673 718 ZZX NTLLcf= convertFacCF2NTLZZX (Lc (F*bCommonDen (F))); … … 675 720 ZZ NTLD= discriminant (NTLmipo); 676 721 den= abs (convertZZ2CF (NTLD*NTLf)); 722 #endif 677 723 678 724 // make factors elements of Z(a)[x] disable for modularDiophant … … 688 734 Off (SW_RATIONAL); 689 735 int ii= 0; 736 #ifdef HAVE_FLINT 737 CanonicalForm discMipo= convertFmpz2CF(FLINTD); 738 fmpz_clear(FLINTD); 739 #elif defined(HAVE_NTL) 690 740 CanonicalForm discMipo= convertZZ2CF (NTLD); 741 #endif 691 742 findGoodPrime (bufF*discMipo,ii); 692 743 findGoodPrime (F1*discMipo,ii); … … 780 831 } 781 832 #endif 833 #endif -
factory/facBivar.cc
r168e13 rc13ebd 184 184 } 185 185 186 #ifdef HAVE_NTL // resultatnt(ZZ), discrimeninat186 #ifdef HAVE_NTL // henselLiftAndEarly 187 187 CFList biFactorize (const CanonicalForm& F, const Variable& v) 188 188 { … … 526 526 mipoHasDen= !bCommonDen(mipo).isOne(); 527 527 mipo *= bCommonDen (mipo); 528 #ifdef HAVE_FLINT 529 // init 530 fmpz_t FLINTf,FLINTD; 531 fmpz_init(FLINTf); 532 fmpz_init(FLINTD); 533 fmpz_poly_t FLINTmipo; 534 fmpz_poly_t FLINTLcf; 535 //conversion 536 convertFacCF2Fmpz_poly_t(FLINTmipo,mipo); 537 convertFacCF2Fmpz_poly_t(FLINTLcf,Lc (A*bCommonDen (A))); 538 // resultant, discriminant 539 fmpz_poly_resultant(FLINTf,FLINTmipo,FLINTLcf); 540 fmpz_poly_discriminant(FLINTD,FLINTmipo); 541 fmpz_mul(FLINTf,FLINTD,FLINTf); 542 // conversion 543 den= abs (convertFmpz2CF(FLINTf)); 544 // clean up 545 fmpz_clear(FLINTf); 546 // FLINTD is used below 547 fmpz_poly_clear(FLINTLcf); 548 fmpz_poly_clear(FLINTmipo); 549 #elif defined(HAVE_NTL) 528 550 ZZX NTLmipo= convertFacCF2NTLZZX (mipo); 529 551 ZZX NTLLcf= convertFacCF2NTLZZX (Lc (A*bCommonDen (A))); … … 531 553 ZZ NTLD= discriminant (NTLmipo); 532 554 den= abs (convertZZ2CF (NTLD*NTLf)); 555 #endif 533 556 534 557 // make factors elements of Z(a)[x] disable for modularDiophant … … 544 567 Off (SW_RATIONAL); 545 568 int i= 0; 569 #ifdef HAVE_FLINT 570 CanonicalForm discMipo= convertFmpz2CF(FLINTD); 571 fmpz_clear(FLINTD); 572 #elif defined(HAVE_NTL) 546 573 CanonicalForm discMipo= convertZZ2CF (NTLD); 574 #endif 547 575 findGoodPrime (F*discMipo,i); 548 576 findGoodPrime (Aeval*discMipo,i); … … 608 636 } 609 637 #endif 638
Note: See TracChangeset
for help on using the changeset viewer.