Changeset 0aa5d5 in git for factory/libfac/charset/alg_factor.cc
- Timestamp:
- Mar 10, 2014, 4:02:26 PM (10 years ago)
- Branches:
- (u'spielwiese', 'a719bcf0b8dbc648b128303a49777a094b57592c')
- Children:
- df3eef0007e351efd7a2c08a22185605e7ae6dd2
- Parents:
- 5f4e0e5f2f9ec9aea8d113e4a58ecbc39cf69c35
- git-author:
- Martin Lee <martinlee84@web.de>2014-03-10 16:02:26+01:00
- git-committer:
- Hans Schoenemann <hannes@mathematik.uni-kl.de>2014-03-17 18:31:54+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/libfac/charset/alg_factor.cc
r5f4e0e r0aa5d5 733 733 #ifndef DEBUGOUTPUT 734 734 static CFFList 735 alg_factor( const CanonicalForm & f, const CFList & Astar, const Variable & vminpoly, const Varlist /*& oldord*/, const CFList & as)735 alg_factor( const CanonicalForm & F, const CFList & Astar, const Variable & vminpoly, const Varlist /*& oldord*/, const CFList & as, bool isFunctionField) 736 736 #else 737 737 static CFFList 738 alg_factor( const CanonicalForm & f, const CFList & Astar, const Variable & vminpoly, const Varlist & oldord, const CFList & as)738 alg_factor( const CanonicalForm & F, const CFList & Astar, const Variable & vminpoly, const Varlist & oldord, const CFList & as, bool isFunctionField) 739 739 #endif 740 740 { 741 741 CFFList L, Factorlist; 742 CanonicalForm R, Rstar, s, g, h ;742 CanonicalForm R, Rstar, s, g, h, f= F; 743 743 CFList substlist; 744 744 … … 747 747 748 748 //out_cf("start alg_factor:",f,"\n"); 749 substlist= simpleextension(Astar, vminpoly, Rstar);749 substlist= simpleextension(Astar, vminpoly, isFunctionField, Rstar); 750 750 DEBOUTLN(CERR, "alg_factor: substlist= ", substlist); 751 751 DEBOUTLN(CERR, "alg_factor: minpoly Rstar= ", Rstar); 752 752 DEBOUTLN(CERR, "alg_factor: vminpoly= ", vminpoly); 753 754 f= subst (f, Astar, substlist, Rstar, isFunctionField); 755 756 Variable alpha; 757 if (!isFunctionField) 758 { 759 alpha= rootOf (Rstar); 760 g= replacevar (f, Rstar.mvar(), alpha); 761 762 Factorlist= factorize (g, alpha); 763 764 for (CFFListIterator i= Factorlist; i.hasItem(); i++) 765 { 766 h= i.getItem().factor(); 767 if (!h.inCoeffDomain()) 768 { 769 h= replacevar (h, alpha, Rstar.mvar()); 770 h *= bCommonDen(h); 771 h= Prem (h, as); 772 L.append (CFFactor (h, i.getItem().exp())); 773 } 774 } 775 return L; 776 } 753 777 754 778 sqrf_norm(f, Rstar, vminpoly, s, g, R ); … … 1047 1071 CFFList Factorlist; 1048 1072 Varlist gcdord= Union(ord,newuord); gcdord.append(f.mvar()); 1073 bool isFunctionField= (newuord.length() > 0); 1074 1049 1075 // This is for now. we need alg_sqrfree implemented! 1050 CanonicalForm Fgcd; 1051 Fgcd= alg_gcd(f,f.deriv(),Astar); 1076 CanonicalForm Fgcd= 0; 1077 if (isFunctionField) 1078 Fgcd= alg_gcd(f,f.deriv(),Astar); 1079 1052 1080 if ( Fgcd == 0 ) {DEBOUTMSG(CERR, "WARNING: p'th root ?");} 1053 if (( degree(Fgcd, f.mvar()) > 0) && (!(f.deriv().isZero())) ){ 1081 if (isFunctionField && ( degree(Fgcd, f.mvar()) > 0) && (!(f.deriv().isZero())) ) 1082 { 1054 1083 DEBOUTLN(CERR, "Nontrivial GCD found of ", f); 1055 1084 CanonicalForm Ggcd= divide(f, Fgcd,Astar); 1085 if (getCharacteristic() == 0) 1086 { 1087 CFFList result= newfactoras (Ggcd,as,success); //Ggcd is the squarefree part of f 1088 multiplicity (result, f, Astar); 1089 return result; 1090 } 1056 1091 DEBOUTLN(CERR, " split into ", Fgcd); 1057 1092 DEBOUTLN(CERR, " and ", Ggcd); … … 1060 1095 return myUnion(newfactoras(Fgcd,as,success) , newfactoras(Ggcd,as,success)); 1061 1096 } 1062 if ( getCharacteristic() > 0 ) {1063 1097 if ( getCharacteristic() > 0 ) 1098 { 1064 1099 // First look for extension! 1065 1100 IntList degreelist; … … 1077 1112 vminpoly= rootOf(MIPO); 1078 1113 } 1079 Factorlist= alg_factor(f, Astar, vminpoly, oldord, as );1114 Factorlist= alg_factor(f, Astar, vminpoly, oldord, as, isFunctionField); 1080 1115 DEBDECLEVEL(CERR,"newfactoras"); 1081 1116 return Factorlist; … … 1097 1132 DEBOUTLN(CERR, "degree(vminpoly)= ", degree(vminpoly)); 1098 1133 } 1099 Factorlist= alg_factor(f, Astar, vminpoly, oldord, as );1134 Factorlist= alg_factor(f, Astar, vminpoly, oldord, as, isFunctionField); 1100 1135 DEBDECLEVEL(CERR,"newfactoras"); 1101 1136 return Factorlist; … … 1105 1140 DEBOUTMSG(CERR, "Char=0! Apply Trager!"); 1106 1141 Variable vminpoly; 1107 Factorlist= alg_factor(f, Astar, vminpoly, oldord, as );1142 Factorlist= alg_factor(f, Astar, vminpoly, oldord, as, isFunctionField); 1108 1143 DEBDECLEVEL(CERR,"newfactoras"); 1109 1144 return Factorlist; … … 1117 1152 newcfactor(const CanonicalForm & f, const CFList & as, int & success ) 1118 1153 { 1119 Off(SW_RATIONAL); 1120 CFFList Output, output, Factors=Factorize(f); 1121 On(SW_RATIONAL); 1122 Factors.removeFirst(); 1123 1124 if ( as.length() == 0 ){ success=1; return Factors;} 1125 if ( cls(f) <= cls(as.getLast()) ) { success=1; return Factors;} 1154 On (SW_RATIONAL); 1155 CFFList Output, output, Factors= factorize(f); 1156 if (Factors.getFirst().factor().inCoeffDomain()) 1157 Factors.removeFirst(); 1158 1159 if ( as.length() == 0 ) 1160 { 1161 success=1; 1162 return Factors; 1163 } 1164 if ( cls(f) <= cls(as.getLast()) ) 1165 { 1166 success=1; 1167 return Factors; 1168 } 1126 1169 1127 1170 success=1;
Note: See TracChangeset
for help on using the changeset viewer.