- Timestamp:
- Oct 19, 2012, 6:38:35 PM (12 years ago)
- Branches:
- (u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
- Children:
- c879eea1669e963fb4c7287a3963abb287d00a49
- Parents:
- b37b3984a12e1552c7bafc9fd5a7849240ea79806bbe944402dfca102dcc3e036c4f2f119be41e44
- Location:
- factory
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/algext.cc
rb37b398 r1bc7201 548 548 return; 549 549 m *= (x - alpha); 550 if( gnew == gm) // gnew did not change551 { 552 cf = tryvcontent(g m, Variable(2), M, fail);550 if((firstLC(gnew) == gamma) || (gnew == gm)) // gnew did not change 551 { 552 cf = tryvcontent(gnew, Variable(2), M, fail); 553 553 if(fail) 554 554 return; 555 555 divides = true; 556 g_image= g m;556 g_image= gnew; 557 557 g_image.tryDiv (cf, M, fail); 558 558 if(fail) … … 692 692 } 693 693 // here: a is the biggest alg. var in f and g AND some of f,g is in extension 694 // (in the sequel b is used to swap alg/poly vars)695 694 setReduce(a,false); // do not reduce expressions modulo mipo 696 695 tmp = getMipo(a); … … 703 702 mv = i; 704 703 // here: mv is level of the largest variable in f, g 705 b = Variable(mv+1);706 704 bound = new int[mv+1]; // 'bound' could be indexed from 0 to mv, but we will only use from 1 to mv 707 705 other = new int[mv+1]; … … 750 748 if(isEqual(bound, other, 1, mv)) // equal 751 749 { 752 chineseRemainder( D, q, replacevar( mapinto(Dp), a, b), p, tmp, newq );750 chineseRemainder( D, q, mapinto(Dp), p, tmp, newq ); 753 751 // tmp = Dp mod p 754 752 // tmp = D mod q … … 758 756 D = tmp; 759 757 On( SW_RATIONAL ); 760 tmp = replacevar( Farey( D, q ), b, a ); // Farey and switch back to alg var 758 tmp = Farey( D, q ); // Farey 759 tmp *= bCommonDen (tmp); 761 760 setReduce(a,true); // reduce expressions modulo mipo 762 761 On( SW_RATIONAL ); // needed by fdivides … … 780 779 // here: isLess(other, bound, 1, mv) ) ==> all previous primes unlucky 781 780 q = p; 782 D = replacevar( mapinto(Dp), a, b); // shortcut CRA // shortcut CRA781 D = mapinto(Dp); // shortcut CRA // shortcut CRA 783 782 for(int i=1; i<=mv; i++) // tighten bound 784 783 bound[i] = other[i]; -
factory/cf_chinese.cc
rb37b398 r1bc7201 227 227 } 228 228 else 229 result += power( x, i.exp() ) * Farey(c,q); 230 #else 231 if (c.inZ()) 232 result += power( x, i.exp() ) * Farey_n(c,q); 233 else 234 result += power( x, i.exp() ) * Farey(c,q); 229 235 #endif 230 result += power( x, i.exp() ) * Farey_n(c,q);231 236 } 232 237 else -
factory/cf_gcd_smallp.cc
r6bbe94 r1bc7201 4229 4229 Evaluation result= Evaluation (A.min(), A.max()); 4230 4230 ASSERT (A.min() == 2, "expected A.min() == 2"); 4231 ASSERT (A.max() >= n, "expected A.max() >= n");4232 4231 int max_deg; 4233 4232 int k= n; -
factory/facFqBivarUtil.cc
r6bbe94 r1bc7201 519 519 } 520 520 521 q= newtonDiv (bufF, G, xToLOldL); 521 if (l-oldL > 0) 522 q= newtonDiv (bufF, G, xToLOldL); 523 else 524 q= 0; 522 525 q *= xToOldL; 523 526 q += oldQ; -
factory/facFqSquarefree.h
r6bbe94 r1bc7201 18 18 #include "cf_factory.h" 19 19 #include "fac_sqrfree.h" 20 #include "cf_factory.h" 20 21 21 22 /// squarefree factorization over a finite field -
factory/facHensel.cc
r6bbe94 r1bc7201 544 544 } 545 545 546 setReduce (alpha, false); 546 547 for (k= 0; k < factors.length(); k++) 547 548 { … … 554 555 } 555 556 } 557 setReduce (alpha, true); 556 558 setCharacteristic(0); 557 559 … … 591 593 } 592 594 setCharacteristic (p); 595 setReduce (alpha, false); 593 596 recResult= mapinto (recResult); 597 setReduce (alpha, true); 594 598 if (mipoHasDen) 595 599 { … … 606 610 coeffE= div (e, modulus); 607 611 setCharacteristic (p); 612 if (mipoHasDen) 613 setReduce (gamma, false); 614 else 615 setReduce (alpha, false); 608 616 coeffE= coeffE.mapinto(); 617 if (mipoHasDen) 618 setReduce (gamma, true); 619 else 620 setReduce (alpha, true); 609 621 if (mipoHasDen) 610 622 coeffE= replacevar (coeffE, gamma, beta); … … 619 631 { 620 632 setCharacteristic (p); 633 setReduce (alpha, false); 621 634 g= mulNTL (coeffE, j.getItem()); 622 635 g= modNTL (g, bufFactors[ii]); 636 setReduce (alpha, true); 623 637 setCharacteristic (0); 624 638 if (mipoHasDen) 625 639 { 640 setReduce (beta, false); 626 641 k.getItem() += replacevar (g.mapinto()*modulus, beta, gamma); 627 642 e -= mulNTL (replacevar (g.mapinto(), beta, gamma)*modulus, 628 643 l.getItem(), b); 644 setReduce (beta, true); 629 645 } 630 646 else -
factory/facMul.cc
r6bbe94 r1bc7201 404 404 { 405 405 ZZ_p::init (convertFacCF2NTLZZ (b.getpk())); 406 ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (getMipo (alpha))); 406 CanonicalForm mipo= getMipo (alpha); 407 bool is_rat= isOn (SW_RATIONAL); 408 if (!is_rat) 409 On (SW_RATIONAL); 410 mipo *=bCommonDen (mipo); 411 if (!is_rat) 412 Off (SW_RATIONAL); 413 ZZ_pX NTLmipo= to_ZZ_pX (convertFacCF2NTLZZX (mipo)); 407 414 ZZ_pE::init (NTLmipo); 408 415 ZZ_pEX NTLg= convertFacCF2NTLZZ_pEX (G, NTLmipo); -
factory/fac_ezgcd.cc
r6bbe94 r1bc7201 215 215 Evaluation result= Evaluation (A.min(), A.max()); 216 216 ASSERT (A.min() == 2, "expected A.min() == 2"); 217 ASSERT (A.max() == n, "expected A.max() == n");218 217 int max_deg; 219 218 int k= n;
Note: See TracChangeset
for help on using the changeset viewer.