Changeset 14e634 in git for factory/facFqBivar.cc
- Timestamp:
- Dec 10, 2012, 3:38:49 PM (10 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- b15cf8578937df382dad415dbfdd2229103409bf
- Parents:
- 3e7db4d961b4509d248e12d8e96e2bed08d9cfe8
- git-author:
- Martin Lee <martinlee84@web.de>2012-12-10 15:38:49+01:00
- git-committer:
- Martin Lee <martinlee84@web.de>2012-12-12 15:24:58+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/facFqBivar.cc
r3e7db4 r14e634 482 482 factorRecombination (CFList& factors, CanonicalForm& F, 483 483 const CanonicalForm& N, DegreePattern& degs, int s, 484 int thres, const modpk& b 484 int thres, const modpk& b, const CanonicalForm& den 485 485 ) 486 486 { … … 515 515 Variable y= Variable (2); 516 516 Variable x= Variable (1); 517 CanonicalForm LCBuf= LC (F, x); 517 CanonicalForm denom= den, denQuot; 518 CanonicalForm LCBuf= LC (F, x)*denom; 518 519 CanonicalForm g, quot, buf= F; 519 520 int * v= new int [T.length()]; … … 598 599 { 599 600 On (SW_RATIONAL); 601 if (!Lc (g).inBaseDomain()) 602 g /= Lc (g); 600 603 g *= bCommonDen (g); 601 604 Off (SW_RATIONAL); … … 605 608 if (fdivides (g, buf, quot)) 606 609 { 610 denom *= abs (lc (g)); 607 611 recombination= true; 608 612 result.append (g); 609 613 if (b.getp() != 0) 610 buf= quot*bCommonDen (quot); 614 { 615 denQuot= bCommonDen (quot); 616 buf= quot*denQuot; 617 Off (SW_RATIONAL); 618 denom /= gcd (denom, denQuot); 619 On (SW_RATIONAL); 620 } 611 621 else 612 622 buf= quot; 613 LCBuf= LC (buf, x) ;623 LCBuf= LC (buf, x)*denom; 614 624 T= Difference (T, S); 615 625 l -= degree (g); … … 726 736 factors, int& adaptedLiftBound, int*& factorsFoundIndex, 727 737 DegreePattern& degs, bool& success, int deg, 728 const modpk& b )738 const modpk& b, CanonicalForm& den) 729 739 { 730 740 DegreePattern bufDegs1= degs; … … 742 752 if (b.getp() != 0) 743 753 buf *= bCommonDen (buf); 744 CanonicalForm LCBuf= LC (buf, x) ;754 CanonicalForm LCBuf= LC (buf, x)*den; 745 755 CanonicalForm buf0= mulNTL (buf (0,x), LCBuf); 746 756 CanonicalForm buf1= mulNTL (buf (1,x), LCBuf); … … 748 758 Off (SW_RATIONAL); 749 759 CanonicalForm test0, test1; 760 CanonicalForm denQuot; 750 761 751 762 for (CFListIterator i= factors; i.hasItem(); i++, l++) … … 777 788 { 778 789 On (SW_RATIONAL); 790 if (!Lc (g).inBaseDomain()) 791 g /= Lc (g); 779 792 g *= bCommonDen (g); 780 793 Off (SW_RATIONAL); … … 784 797 if (fdivides (g, buf, quot)) 785 798 { 799 den *= abs (lc (g)); 786 800 reconstructedFactors.append (g); 787 801 factorsFoundIndex[l]= 1; 788 802 if (b.getp() != 0) 789 buf= quot*bCommonDen(quot); 803 { 804 denQuot= bCommonDen (quot); 805 buf= quot*denQuot; 806 Off (SW_RATIONAL); 807 den /= gcd (den, denQuot); 808 On (SW_RATIONAL); 809 } 790 810 else 791 811 buf= quot; 792 812 d -= degree (g); 793 LCBuf= LC (buf, x) ;813 LCBuf= LC (buf, x)*den; 794 814 buf0= mulNTL (buf (0,x), LCBuf); 795 815 buf1= mulNTL (buf (1,x), LCBuf); … … 827 847 if (bufDegs1.getLength() <= 1) 828 848 degs= bufDegs1; 849 } 850 851 void 852 earlyFactorDetection (CFList& reconstructedFactors, CanonicalForm& F, CFList& 853 factors, int& adaptedLiftBound, int*& factorsFoundIndex, 854 DegreePattern& degs, bool& success, int deg, 855 const modpk& b) 856 { 857 CanonicalForm den= 1; 858 earlyFactorDetection (reconstructedFactors, F, factors, adaptedLiftBound, factorsFoundIndex, degs, success, deg,b, den); 829 859 } 830 860 … … 1002 1032 earlyFactors, DegreePattern& degs, int& liftBound, 1003 1033 const CFList& uniFactors, const ExtensionInfo& info, 1004 const CanonicalForm& eval, modpk& b)1034 const CanonicalForm& eval,modpk& b, CanonicalForm& den) 1005 1035 { 1006 1036 Variable alpha= info.getAlpha(); … … 1018 1048 CFList diophant; 1019 1049 CFList bufUniFactors= uniFactors; 1050 On (SW_RATIONAL); 1020 1051 CanonicalForm bufA= A; 1052 if (!Lc (A).inBaseDomain()) 1053 { 1054 bufA /= Lc (A); 1055 CanonicalForm denBufA= bCommonDen (bufA); 1056 bufA *= denBufA; 1057 Off (SW_RATIONAL); 1058 den /= gcd (den, denBufA); 1059 } 1060 else 1061 { 1062 bufA= A; 1063 Off (SW_RATIONAL); 1064 den /= gcd (den, Lc (A)); 1065 } 1021 1066 CanonicalForm lcA0= 0; 1022 1067 bool mipoHasDen= false; … … 1082 1127 earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound, 1083 1128 factorsFoundIndex, degs, earlySuccess, 1084 smallFactorDeg, b );1129 smallFactorDeg, b, den); 1085 1130 else 1086 1131 earlyFactorDetection(earlyFactors, bufA, bufBufUniFactors, newLiftBound, 1087 1132 factorsFoundIndex, degs, earlySuccess, 1088 smallFactorDeg, b );1133 smallFactorDeg, b, den); 1089 1134 } 1090 1135 else … … 1111 1156 earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound, 1112 1157 factorsFoundIndex, degs, earlySuccess, 1113 liftPre[sizeOfLiftPre-1] + 1, b );1158 liftPre[sizeOfLiftPre-1] + 1, b, den); 1114 1159 else 1115 1160 earlyFactorDetection (earlyFactors,bufA,bufBufUniFactors,newLiftBound, 1116 1161 factorsFoundIndex, degs, earlySuccess, 1117 liftPre[sizeOfLiftPre-1] + 1, b );1162 liftPre[sizeOfLiftPre-1] + 1, b, den); 1118 1163 } 1119 1164 else … … 1145 1190 earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound, 1146 1191 factorsFoundIndex, degs, earlySuccess, 1147 liftPre[i-1] + 1, b );1192 liftPre[i-1] + 1, b, den); 1148 1193 else 1149 1194 earlyFactorDetection (earlyFactors,bufA,bufBufUniFactors,newLiftBound, 1150 1195 factorsFoundIndex, degs, earlySuccess, 1151 liftPre[i-1] + 1, b );1196 liftPre[i-1] + 1, b, den); 1152 1197 } 1153 1198 else … … 1188 1233 earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound, 1189 1234 factorsFoundIndex, degs, earlySuccess, 1190 smallFactorDeg, b );1235 smallFactorDeg, b, den); 1191 1236 else 1192 1237 earlyFactorDetection (earlyFactors, bufA, bufBufUniFactors, newLiftBound, 1193 1238 factorsFoundIndex, degs, earlySuccess, 1194 smallFactorDeg, b );1239 smallFactorDeg, b, den); 1195 1240 } 1196 1241 else … … 1217 1262 if (v==alpha) 1218 1263 earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound, 1219 factorsFoundIndex, degs, earlySuccess, dummy, b); 1264 factorsFoundIndex, degs, earlySuccess, dummy, b, 1265 den); 1220 1266 else 1221 1267 earlyFactorDetection (earlyFactors, bufA,bufBufUniFactors, newLiftBound, 1222 factorsFoundIndex, degs, earlySuccess, dummy, b); 1268 factorsFoundIndex, degs, earlySuccess, dummy, b, 1269 den); 1223 1270 } 1224 1271 else … … 1245 1292 if (v==alpha) 1246 1293 earlyFactorDetection (earlyFactors, bufA, bufUniFactors, newLiftBound, 1247 factorsFoundIndex, degs, earlySuccess, dummy,b); 1294 factorsFoundIndex, degs, earlySuccess, dummy,b, 1295 den); 1248 1296 else 1249 1297 earlyFactorDetection (earlyFactors,bufA,bufBufUniFactors,newLiftBound, 1250 factorsFoundIndex, degs, earlySuccess, dummy,b); 1298 factorsFoundIndex, degs, earlySuccess, dummy,b, 1299 den); 1251 1300 } 1252 1301 else … … 1287 1336 { 1288 1337 modpk dummy= modpk(); 1338 CanonicalForm den= 1; 1289 1339 return henselLiftAndEarly (A, earlySuccess, earlyFactors, degs, liftBound, 1290 uniFactors, info, eval, dummy );1340 uniFactors, info, eval, dummy, den); 1291 1341 } 1292 1342
Note: See TracChangeset
for help on using the changeset viewer.