Changeset c495ca in git for factory/cf_gcd.cc
 Timestamp:
 Feb 11, 2013, 11:17:23 AM (10 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
 Children:
 3a3393b2348060418dd1091d7fd2aeeec607740c
 Parents:
 1176ba0e57d133e7f6c1f50dca18b4170c0de3b6
 gitauthor:
 Martin Lee <martinlee84@web.de>20130211 11:17:23+01:00
 gitcommitter:
 Martin Lee <martinlee84@web.de>20130218 15:16:17+01:00
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

factory/cf_gcd.cc
r1176ba0 rc495ca 607 607 gcd_poly_p( const CanonicalForm & f, const CanonicalForm & g ) 608 608 { 609 if (f.inCoeffDomain()  g.inCoeffDomain()) //zero case should be caught by gcd 610 return 1; 609 611 CanonicalForm pi, pi1; 610 612 CanonicalForm C, Ci, Ci1, Hi, bi, pi2; 611 bool bpure ;613 bool bpure, ezgcdon= isOn (SW_USE_EZGCD_P); 612 614 int delta = degree( f )  degree( g ); 613 615 … … 620 622 pi = g; pi1 = f; delta = delta; 621 623 } 622 On (SW_USE_EZGCD_P); 623 Ci = content( pi ); Ci1 = content( pi1 ); 624 Off (SW_USE_EZGCD_P); 625 pi1 = pi1 / Ci1; pi = pi / Ci; 624 if (pi.isUnivariate()) 625 Ci= 1; 626 else 627 { 628 if (!ezgcdon) 629 On (SW_USE_EZGCD_P); 630 Ci = content( pi ); 631 if (!ezgcdon) 632 Off (SW_USE_EZGCD_P); 633 pi = pi / Ci; 634 } 635 if (pi1.isUnivariate()) 636 Ci1= 1; 637 else 638 { 639 if (!ezgcdon) 640 On (SW_USE_EZGCD_P); 641 Ci1 = content( pi1 ); 642 if (!ezgcdon) 643 Off (SW_USE_EZGCD_P); 644 pi1 = pi1 / Ci1; 645 } 626 646 C = gcd( Ci, Ci1 ); 627 647 int d= 0; … … 685 705 pi = pi1; pi1 = pi2; 686 706 maxNumVars= tmax (getNumVars (pi), getNumVars (pi1)); 687 if (! (pi1.isUnivariate()) && (size (pi1)/maxNumVars > 500))707 if (!pi1.isUnivariate() && (size (pi1)/maxNumVars > 500)) 688 708 { 689 709 On (SW_USE_FF_MOD_GCD); … … 703 723 if (!(pi.isUnivariate() && pi1.isUnivariate())) 704 724 { 705 if (size (Hi)*size (pi)/(maxNumVars*3) > 500) //maybe this needs more tuning725 if (size (Hi)*size (pi)/(maxNumVars*3) > 1500) //maybe this needs more tuning 706 726 { 707 727 On (SW_USE_FF_MOD_GCD); … … 719 739 return C; 720 740 } 721 pi /= content( pi ); 741 if (!pi.isUnivariate()) 742 { 743 if (!ezgcdon) 744 On (SW_USE_EZGCD_P); 745 Ci= gcd (LC (oldPi,v), LC (oldPi1,v)); 746 pi /= LC (pi,v)/Ci; 747 Ci= content (pi); 748 pi /= Ci; 749 if (!ezgcdon) 750 Off (SW_USE_EZGCD_P); 751 } 722 752 if ( bpure ) 723 753 pi /= pi.lc();
Note: See TracChangeset
for help on using the changeset viewer.