Changeset cac0f8 in git
 Timestamp:
 Jun 17, 2020, 10:17:41 PM (3 years ago)
 Branches:
 (u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
 Children:
 329dd32beeab3db0280ea4a24f56b6a03cf155c7
 Parents:
 6e12a4509235103a5e009837c0a1ae25ff078e5b
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

factory/cf_factor.cc
r6e12a4 rcac0f8 545 545 if ( f.isUnivariate() ) 546 546 { 547 #ifdef HAVE_NTL548 //USE NTL549 547 CanonicalForm ic=icontent(fz); 550 548 fz/=ic; 551 ZZ c; 552 vec_pair_ZZX_long factors; 553 //factorize the converted polynomial 554 factor(c,factors,convertFacCF2NTLZZX(fz)); 555 556 //convert the result back to Factory 557 F=convertNTLvec_pair_ZZX_long2FacCFFList(factors,c,fz.mvar()); 549 #if 0 // #if defined(HAVE_FLINT) && (__FLINT_RELEASE>=20504) 550 // use FLINT 551 fmpz_poly_t f1; 552 convertFacCF2Fmpz_poly_t (f1, fz); 553 fmpz_poly_factor_t result; 554 fmpz_poly_factor_init (result); 555 fmpz_poly_factor_zassenhaus(result, f1); 556 F= convertFLINTfmpz_poly_factor2FacCFFList (result, fz.mvar()); 557 fmpz_poly_factor_clear (result); 558 fmpz_poly_clear (f1); 558 559 if ( ! ic.isOne() ) 559 560 { … … 567 568 F.insert( CFFactor( ic ) ); 568 569 } 570 goto end_char0; 571 #elif defined HAVE_NTL 572 //USE NTL 573 ZZ c; 574 vec_pair_ZZX_long factors; 575 //factorize the converted polynomial 576 factor(c,factors,convertFacCF2NTLZZX(fz)); 577 578 //convert the result back to Factory 579 F=convertNTLvec_pair_ZZX_long2FacCFFList(factors,c,fz.mvar()); 580 if ( ! ic.isOne() ) 581 { 582 if ( F.getFirst().factor().inCoeffDomain() ) 583 { 584 CFFactor new_first( F.getFirst().factor() * ic ); 585 F.removeFirst(); 586 F.insert( new_first ); 587 } 588 else 589 F.insert( CFFactor( ic ) ); 590 } 569 591 else 570 592 { … … 575 597 } 576 598 } 577 if(isOn(SW_USE_NTL_SORT)) F.sort(cmpCF); 578 return F; 579 #endif 580 #if defined(HAVE_FLINT) && (__FLINT_RELEASE>=20504) 581 // use FLINT 582 fmpz_poly_t f1; 583 convertFacCF2Fmpz_poly_t (f1, f); 584 fmpz_poly_factor_t result; 585 fmpz_poly_factor_init (result); 586 fmpz_poly_factor_zassenhaus(result, f1); 587 F= convertFLINTfmpz_poly_factor2FacCFFList (result, f.mvar()); 588 fmpz_poly_factor_clear (result); 589 fmpz_poly_clear (f1); 590 if(isOn(SW_USE_NTL_SORT)) F.sort(cmpCF); 591 return F; 592 #endif 593 #if !defined(AHE_NTL) && !defined(HAVE_FLINT) 599 goto end_char0; 600 #else 594 601 factoryError ("univariate factorization over Z depends on NTL/FLINT(missing)"); 595 602 return CFFList (CFFactor (f, 1)); … … 616 623 } 617 624 625 end_char0: 618 626 if ( on_rational ) 619 627 On(SW_RATIONAL);
Note: See TracChangeset
for help on using the changeset viewer.