Changeset 428b38 in git for factory/algext.cc
- Timestamp:
- Nov 16, 2012, 12:56:34 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '00e2e9c41af3fde1273eb3633f4c0c7c3db2579d')
- Children:
- f3bd4cf51acbd4ce841f52698b25e2b56e561b5d
- Parents:
- 241a04727aaaf99b8ac0d6d44f9fddd8bc4d8221
- git-author:
- Martin Lee <martinlee84@web.de>2012-11-16 12:56:34+01:00
- git-committer:
- Martin Lee <martinlee84@web.de>2012-11-16 13:39:10+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/algext.cc
r241a04 r428b38 27 27 #include "cf_generator.h" 28 28 #include "facMul.h" 29 #include "facNTLzzpEXGCD.h" 29 30 30 31 #ifdef HAVE_NTL … … 463 464 mv = g.level(); 464 465 // here: mv is level of the largest variable in f, g 466 Variable v1= Variable (1); 467 #ifdef HAVE_NTL 468 Variable v= M.mvar(); 469 zz_p::init (getCharacteristic()); 470 zz_pX NTLMipo= convertFacCF2NTLzzpX (M); 471 zz_pE::init (NTLMipo); 472 zz_pEX NTLResult; 473 zz_pEX NTLF; 474 zz_pEX NTLG; 475 #endif 465 476 if(mv == 1) // f,g univariate 466 477 { 467 478 TIMING_START (alg_euclid_p) 479 #ifdef HAVE_NTL 480 NTLF= convertFacCF2NTLzz_pEX (f, NTLMipo); 481 NTLG= convertFacCF2NTLzz_pEX (g, NTLMipo); 482 tryNTLGCD (NTLResult, NTLF, NTLG, fail); 483 if (fail) 484 return; 485 result= convertNTLzz_pEX2CF (NTLResult, f.mvar(), v); 486 #else 468 487 tryEuclid(f,g,M,result,fail); 488 if(fail) 489 return; 490 #endif 469 491 TIMING_END_AND_PRINT (alg_euclid_p, "time for euclidean alg mod p: ") 470 if(fail)471 return;472 492 result= NN (reduce (result, M)); // do not forget to map back 473 493 return; … … 482 502 return; 483 503 CanonicalForm c; 504 #ifdef HAVE_NTL 505 NTLF= convertFacCF2NTLzz_pEX (cf, NTLMipo); 506 NTLG= convertFacCF2NTLzz_pEX (cg, NTLMipo); 507 tryNTLGCD (NTLResult, NTLF, NTLG, fail); 508 if (fail) 509 return; 510 c= convertNTLzz_pEX2CF (NTLResult, v1, v); 511 #else 484 512 tryEuclid(cf,cg,M,c,fail); 485 513 if(fail) 486 514 return; 515 #endif 487 516 // f /= cf 488 517 f.tryDiv (cf, M, fail); … … 518 547 CanonicalForm gamma; 519 548 TIMING_START (alg_euclid_p) 549 #ifdef HAVE_NTL 550 NTLF= convertFacCF2NTLzz_pEX (firstLC (f), NTLMipo); 551 NTLG= convertFacCF2NTLzz_pEX (firstLC (g), NTLMipo); 552 tryNTLGCD (NTLResult, NTLF, NTLG, fail); 553 if (fail) 554 return; 555 gamma= convertNTLzz_pEX2CF (NTLResult, v1, v); 556 #else 520 557 tryEuclid( firstLC(f), firstLC(g), M, gamma, fail ); 558 if(fail) 559 return; 560 #endif 521 561 TIMING_END_AND_PRINT (alg_euclid_p, "time for gcd of lcs in alg mod p: ") 522 if(fail)523 return;524 562 for(int i=2; i<=mv; i++) // entries at i=0,1 not visited 525 563 if(N[i] < L[i])
Note: See TracChangeset
for help on using the changeset viewer.