Changeset c6eecb in git
- Timestamp:
- Apr 26, 2007, 10:22:48 AM (16 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- 8251cc1c81aab678de3aec185a8de7969e825393
- Parents:
- cb637fad8051814719a0ea36ed4b65a20f1114cc
- Location:
- factory
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/NTLconvert.cc
rcb637f rc6eecb 1 /* $Id: NTLconvert.cc,v 1.2 1 2007-03-01 12:17:24Singular Exp $ */1 /* $Id: NTLconvert.cc,v 1.22 2007-04-26 08:22:48 Singular Exp $ */ 2 2 #include <config.h> 3 3 … … 49 49 #endif 50 50 51 int fac_NTL_char=-1; // the current characterstic for NTL calls 52 // -1: undefined 51 53 #ifdef NTL_CLIENT // in <NTL/tools.h>: using of name space NTL 52 54 NTL_CLIENT -
factory/NTLconvert.h
rcb637f rc6eecb 1 /* $Id: NTLconvert.h,v 1. 8 2007-04-25 11:00:51Singular Exp $ */1 /* $Id: NTLconvert.h,v 1.9 2007-04-26 08:22:48 Singular Exp $ */ 2 2 #ifndef INCL_NTLCONVERT_H 3 3 #define INCL_NTLCONVERT_H … … 58 58 CFFList convertNTLvec_pair_zzpEX_long2FacCFFList(vec_pair_zz_pEX_long e,zz_pE multi,Variable x,Variable alpha); 59 59 60 extern int fac_NTL_char; 60 61 #endif 61 62 #endif -
factory/cf_factor.cc
rcb637f rc6eecb 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_factor.cc,v 1.3 1 2007-04-25 11:13:34Singular Exp $ */2 /* $Id: cf_factor.cc,v 1.32 2007-04-26 08:22:48 Singular Exp $ */ 3 3 4 4 //{{{ docu … … 80 80 } 81 81 82 #if 0 82 #if 1 83 #ifndef NOSTREAMIO 83 84 void out_cf(char *s1,const CanonicalForm &f,char *s2) 84 85 { … … 161 162 } 162 163 #endif 164 #endif 163 165 164 166 bool isPurePoly(const CanonicalForm & f) … … 347 349 { 348 350 // set remainder 349 #ifdef NTL_ZZ 350 ZZ r; 351 r=getCharacteristic(); 352 ZZ_pContext ccc(r); 353 #else 354 zz_pContext ccc(getCharacteristic()); 355 #endif 356 ccc.restore(); 357 #ifdef NTL_ZZ 358 ZZ_p::init(r); 359 #else 360 zz_p::init(getCharacteristic()); 361 #endif 351 if (fac_NTL_char!=getCharacteristic()) 352 { 353 fac_NTL_char=getCharacteristic(); 354 #ifdef NTL_ZZ 355 ZZ r; 356 r=getCharacteristic(); 357 ZZ_pContext ccc(r); 358 #else 359 zz_pContext ccc(getCharacteristic()); 360 #endif 361 ccc.restore(); 362 #ifdef NTL_ZZ 363 ZZ_p::init(r); 364 #else 365 zz_p::init(getCharacteristic()); 366 #endif 367 } 362 368 // convert to NTL 363 369 #ifdef NTL_ZZ … … 390 396 { 391 397 // Specialcase characteristic==2 392 ZZ r;r=2;393 ZZ_p::init(r);394 395 // remainder is 2 --> nothing to set396 398 if (fac_NTL_char!=2) 399 { 400 fac_NTL_char=2; 401 zz_p::init(2); 402 } 397 403 // convert to NTL using the faster conversion routine for characteristic 2 398 404 GF2X f1=convertFacCF2NTLGF2X(f); … … 531 537 // First all cases with characteristic !=2 532 538 // set remainder 533 #ifdef NTL_ZZ 534 ZZ r; 535 r=getCharacteristic(); 536 ZZ_pContext ccc(r); 537 ccc.restore(); 538 #else 539 zz_pContext ccc(getCharacteristic()); 540 ccc.restore(); 541 #endif 539 if (fac_NTL_char!=getCharacteristic()) 540 { 541 fac_NTL_char=getCharacteristic(); 542 #ifdef NTL_ZZ 543 ZZ r; 544 r=getCharacteristic(); 545 ZZ_pContext ccc(r); 546 #else 547 zz_pContext ccc(getCharacteristic()); 548 #endif 549 ccc.restore(); 550 #ifdef NTL_ZZ 551 ZZ_p::init(r); 552 #else 553 zz_p::init(getCharacteristic()); 554 #endif 555 } 542 556 543 557 // set minimal polynomial in NTL -
factory/cf_gcd.cc
rcb637f rc6eecb 1 1 /* emacs edit mode for this file is -*- C++ -*- */ 2 /* $Id: cf_gcd.cc,v 1.4 8 2006-09-25 12:33:11Singular Exp $ */2 /* $Id: cf_gcd.cc,v 1.49 2007-04-26 08:22:48 Singular Exp $ */ 3 3 4 4 #include <config.h> … … 125 125 && isPurePoly(f) && isPurePoly(g)) 126 126 { 127 zz_pContext ccc(getCharacteristic()); 128 ccc.restore(); 129 zz_p::init(getCharacteristic()); 127 if (fac_NTL_char!=getCharacteristic()) 128 { 129 fac_NTL_char=getCharacteristic(); 130 #ifdef NTL_ZZ 131 ZZ r; 132 r=getCharacteristic(); 133 ZZ_pContext ccc(r); 134 #else 135 zz_pContext ccc(getCharacteristic()); 136 #endif 137 ccc.restore(); 138 #ifdef NTL_ZZ 139 ZZ_p::init(r); 140 #else 141 zz_p::init(getCharacteristic()); 142 #endif 143 } 144 #ifdef NTL_ZZ 145 ZZ_pX F1=convertFacCF2NTLZZpX(f); 146 ZZ_pX G1=convertFacCF2NTLZZpX(g); 147 ZZ_pX R; 148 ZZ_pX A,B; 149 XGCD(R,A,B,F1,G1); 150 a=convertNTLZZpX2CF(A,f.mvar()); 151 b=convertNTLZZpX2CF(B,f.mvar()); 152 return convertNTLZZpX2CF(R,f.mvar()); 153 #else 130 154 zz_pX F1=convertFacCF2NTLzzpX(f); 131 155 zz_pX G1=convertFacCF2NTLzzpX(g); … … 136 160 b=convertNTLzzpX2CF(B,f.mvar()); 137 161 return convertNTLzzpX2CF(R,f.mvar()); 162 #endif 138 163 } 139 164 #endif … … 144 169 CanonicalForm f0 = 1, f1 = 0, g0 = 0, g1 = 1, q, r; 145 170 146 while ( ! p1.isZero() ) { 171 while ( ! p1.isZero() ) 172 { 147 173 divrem( p0, p1, q, r ); 148 174 p0 = p1; p1 = r; … … 156 182 b = g0 / ( contg * contp0 ); 157 183 p0 /= contp0; 158 if ( p0.sign() < 0 ) { 184 if ( p0.sign() < 0 ) 185 { 159 186 p0 = -p0; 160 187 a = -a; … … 696 723 gcd_univar_ntlp( const CanonicalForm & F, const CanonicalForm & G ) 697 724 { 725 if (fac_NTL_char!=getCharacteristic()) 726 { 727 fac_NTL_char=getCharacteristic(); 728 #ifdef NTL_ZZ 729 ZZ r; 730 r=getCharacteristic(); 731 ZZ_pContext ccc(r); 732 #else 698 733 zz_pContext ccc(getCharacteristic()); 734 #endif 699 735 ccc.restore(); 736 #ifdef NTL_ZZ 737 ZZ_p::init(r); 738 #else 700 739 zz_p::init(getCharacteristic()); 701 zz_pX F1=convertFacCF2NTLzzpX(F); 702 zz_pX G1=convertFacCF2NTLzzpX(G); 703 zz_pX R=GCD(F1,G1); 704 return convertNTLzzpX2CF(R,F.mvar()); 740 #endif 741 } 742 #ifdef NTL_ZZ 743 ZZ_pX F1=convertFacCF2NTLZZpX(F); 744 ZZ_pX G1=convertFacCF2NTLZZpX(G); 745 ZZ_pX R=GCD(F1,G1); 746 return convertNTLZZpX2CF(R,F.mvar()); 747 #else 748 zz_pX F1=convertFacCF2NTLzzpX(F); 749 zz_pX G1=convertFacCF2NTLzzpX(G); 750 zz_pX R=GCD(F1,G1); 751 return convertNTLzzpX2CF(R,F.mvar()); 752 #endif 705 753 } 706 754
Note: See TracChangeset
for help on using the changeset viewer.