Changeset 4a7e5c in git
- Timestamp:
- Aug 27, 2012, 10:53:58 AM (10 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'ad2543eab51733612ba7d118afc77edca719600e')
- Children:
- 935632e9d66d12abe5da2483364feb9f4f1266ef
- Parents:
- 0facdca6b24379ab6fa4c490c0c6105b9f0e8c45
- git-author:
- Martin Lee <martinlee84@web.de>2012-08-27 10:53:58+02:00
- git-committer:
- Martin Lee <martinlee84@web.de>2012-09-04 18:01:19+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cf_gcd.cc
r0facdc r4a7e5c 36 36 37 37 static CanonicalForm cf_content ( const CanonicalForm &, const CanonicalForm & ); 38 static void cf_prepgcd( const CanonicalForm &, const CanonicalForm &, int &, int &, int & );39 38 40 39 void out_cf(const char *s1,const CanonicalForm &f,const char *s2); … … 697 696 { 698 697 CanonicalForm fc, gc, d1; 699 int mp, cc, p1, pe;700 mp = f.level()+1;701 698 bool fc_isUnivariate=f.isUnivariate(); 702 699 bool gc_isUnivariate=g.isUnivariate(); 703 700 bool fc_and_gc_Univariate=fc_isUnivariate && gc_isUnivariate; 704 cf_prepgcd( f, g, cc, p1, pe);705 if ( cc != 0 )706 {707 if ( cc > 0 )708 {709 fc = replacevar( f, Variable(cc), Variable(mp) );710 gc = g;711 }712 else713 {714 fc = replacevar( g, Variable(-cc), Variable(mp) );715 gc = f;716 }717 return cf_content( fc, gc );718 }719 // now each appearing variable is in f and g720 701 fc = f; 721 702 gc = g; … … 739 720 else 740 721 #endif 741 if ( p1 == fc.level() ) 742 fc = gcd_poly_p( fc, gc ); 743 else 744 { 745 fc = replacevar( fc, Variable(p1), Variable(mp) ); 746 gc = replacevar( gc, Variable(p1), Variable(mp) ); 747 fc = replacevar( gcd_poly_p( fc, gc ), Variable(mp), Variable(p1) ); 748 } 722 fc = gcd_poly_p( fc, gc ); 749 723 } 750 724 else if (!fc_and_gc_Univariate) 751 725 { 752 726 if ( isOn( SW_USE_EZGCD ) ) 753 {754 727 fc= ezgcd (fc, gc); 755 /*if ( pe == 1 ) 756 fc = ezgcd( fc, gc ); 757 else if ( pe > 0 )// no variable at position 1 758 { 759 fc = replacevar( fc, Variable(pe), Variable(1) ); 760 gc = replacevar( gc, Variable(pe), Variable(1) ); 761 fc = replacevar( ezgcd( fc, gc ), Variable(1), Variable(pe) ); 762 } 763 else 764 { 765 pe = -pe; 766 fc = swapvar( fc, Variable(pe), Variable(1) ); 767 gc = swapvar( gc, Variable(pe), Variable(1) ); 768 fc = swapvar( ezgcd( fc, gc ), Variable(1), Variable(pe) ); 769 }*/ 770 } 771 else if ( 772 isOn(SW_USE_CHINREM_GCD) 773 && (isPurePoly_m(fc)) && (isPurePoly_m(gc)) 774 ) 775 { 776 #if 0 777 if ( p1 == fc.level() ) 778 fc = chinrem_gcd( fc, gc ); 779 else 780 { 781 fc = replacevar( fc, Variable(p1), Variable(mp) ); 782 gc = replacevar( gc, Variable(p1), Variable(mp) ); 783 fc = replacevar( chinrem_gcd( fc, gc ), Variable(mp), Variable(p1) ); 784 } 785 #else 728 else if (isOn(SW_USE_CHINREM_GCD)) 786 729 fc = chinrem_gcd( fc, gc); 787 #endif788 }789 730 else 790 731 { … … 1100 1041 * p1 in "gcd_poly1" 1101 1042 */ 1102 static1043 /*static 1103 1044 void optvalues ( const int * df, const int * dg, const int n, int & p1, int &pe ) 1104 1045 { … … 1130 1071 i--; 1131 1072 } 1132 } 1073 }*/ 1133 1074 1134 1075 /* 1135 1076 * make some changes of variables, see optvalues 1136 1077 */ 1137 static void1078 /*static void 1138 1079 cf_prepgcd( const CanonicalForm & f, const CanonicalForm & g, int & cc, int & p1, int &pe ) 1139 1080 { … … 1182 1123 delete [] degsf; 1183 1124 delete [] degsg; 1184 } 1125 }*/ 1185 1126 1186 1127
Note: See TracChangeset
for help on using the changeset viewer.