Changeset 142afd in git
- Timestamp:
- Sep 11, 2013, 3:30:00 PM (10 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'f875bbaccd0831e36aaed09ff6adeb3eb45aeb94')
- Children:
- 1e5bbd70c45325682c85dd82ac76bdd5d0cdecbf
- Parents:
- d83c0bc579fb38d2539c9c3b55cba1c04ccf3ff2
- git-author:
- Martin Lee <martinlee84@web.de>2013-09-11 15:30:00+02:00
- git-committer:
- Martin Lee <martinlee84@web.de>2013-09-11 15:31:05+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cf_factor.cc
rd83c0b r142afd 455 455 { 456 456 fac_NTL_char = getCharacteristic(); 457 #ifndef NTL_ZZ 458 if (fac_NTL_char > NTL_SP_BOUND) 459 { 460 ZZ r; 461 r=getCharacteristic(); 462 ZZ_pContext ccc(r); 463 ccc.restore(); 464 ZZ_p::init(r); 465 } 466 else 467 #endif 468 { 469 #ifdef NTL_ZZ 470 ZZ r; 471 r=getCharacteristic(); 472 ZZ_pContext ccc(r); 473 #else 474 zz_pContext ccc(getCharacteristic()); 475 #endif 476 ccc.restore(); 477 #ifdef NTL_ZZ 478 ZZ_p::init(r); 479 #else 480 zz_p::init(getCharacteristic()); 481 #endif 482 } 457 zz_p::init(getCharacteristic()); 483 458 } 484 #ifndef NTL_ZZ 485 if (fac_NTL_char > NTL_SP_BOUND) 486 { 487 // convert to NTL 488 ZZ_pX f1=convertFacCF2NTLZZpX(f); 489 ZZ_p leadcoeff = LeadCoeff(f1); 490 //make monic 491 f1=f1 / LeadCoeff(f1); 492 // factorize 493 vec_pair_ZZ_pX_long factors; 494 CanZass(factors,f1); 495 // convert back to factory 496 F=convertNTLvec_pair_ZZpX_long2FacCFFList(factors,leadcoeff,f.mvar()); 497 } 498 else 499 #endif 500 { 501 // convert to NTL 502 #ifdef NTL_ZZ 503 ZZ_pX f1=convertFacCF2NTLZZpX(f); 504 ZZ_p leadcoeff = LeadCoeff(f1); 505 #else 506 zz_pX f1=convertFacCF2NTLzzpX(f); 507 zz_p leadcoeff = LeadCoeff(f1); 508 #endif 509 //make monic 510 f1=f1 / LeadCoeff(f1); 511 // factorize 512 #ifdef NTL_ZZ 513 vec_pair_ZZ_pX_long factors; 514 #else 515 vec_pair_zz_pX_long factors; 516 #endif 517 CanZass(factors,f1); 518 // convert back to factory 519 #ifdef NTL_ZZ 520 F=convertNTLvec_pair_ZZpX_long2FacCFFList(factors,leadcoeff,f.mvar()); 521 #else 522 F=convertNTLvec_pair_zzpX_long2FacCFFList(factors,leadcoeff,f.mvar()); 523 #endif 524 } 459 460 // convert to NTL 461 zz_pX f1=convertFacCF2NTLzzpX(f); 462 zz_p leadcoeff = LeadCoeff(f1); 463 464 //make monic 465 f1=f1 / LeadCoeff(f1); 466 // factorize 467 vec_pair_zz_pX_long factors; 468 CanZass(factors,f1); 469 470 F=convertNTLvec_pair_zzpX_long2FacCFFList(factors,leadcoeff,f.mvar()); 525 471 //test_cff(F,f); 526 472 } … … 716 662 { 717 663 fac_NTL_char = getCharacteristic(); 718 #ifdef NTL_ZZ719 ZZ r;720 r=getCharacteristic();721 ZZ_pContext ccc(r);722 #else723 zz_pContext ccc(getCharacteristic());724 #endif725 ccc.restore();726 #ifdef NTL_ZZ727 ZZ_p::init(r);728 #else729 664 zz_p::init(getCharacteristic()); 730 #endif731 665 } 732 666 733 667 // set minimal polynomial in NTL 734 #ifdef NTL_ZZ735 ZZ_pX minPo=convertFacCF2NTLZZpX(getMipo(alpha));736 ZZ_pEContext c(minPo);737 #else738 668 zz_pX minPo=convertFacCF2NTLzzpX(getMipo(alpha)); 739 zz_pEContext c(minPo); 740 #endif 741 742 c.restore(); 669 zz_pE::init (minPo); 743 670 744 671 // convert to NTL 745 #ifdef NTL_ZZ746 ZZ_pEX f1=convertFacCF2NTLZZ_pEX(f,minPo);747 ZZ_pE leadcoeff= LeadCoeff(f1);748 #else749 672 zz_pEX f1=convertFacCF2NTLzz_pEX(f,minPo); 750 673 zz_pE leadcoeff= LeadCoeff(f1); 751 #endif752 674 753 675 //make monic … … 755 677 756 678 // factorize using NTL 757 #ifdef NTL_ZZ758 vec_pair_ZZ_pEX_long factors;759 #else760 679 vec_pair_zz_pEX_long factors; 761 #endif762 680 CanZass(factors,f1); 763 681 764 682 // return converted result 765 #ifdef NTL_ZZ766 F=convertNTLvec_pair_ZZpEX_long2FacCFFList(factors,leadcoeff,f.mvar(),alpha);767 #else768 683 F=convertNTLvec_pair_zzpEX_long2FacCFFList(factors,leadcoeff,f.mvar(),alpha); 769 #endif770 684 } 771 685 else if (/*getCharacteristic()*/ch==2) … … 774 688 775 689 // remainder is two ==> nothing to do 776 // set remainder777 ZZ r;778 r=getCharacteristic();779 ZZ_pContext ccc(r);780 ccc.restore();781 690 782 691 // set minimal polynomial in NTL using the optimized conversion routines for characteristic 2 783 692 GF2X minPo=convertFacCF2NTLGF2X(getMipo(alpha,f.mvar())); 784 GF2EContext c(minPo); 785 c.restore(); 693 GF2E::init (minPo); 786 694 787 695 // convert to NTL again using the faster conversion routines
Note: See TracChangeset
for help on using the changeset viewer.