Changeset 4704674 in git
- Timestamp:
- Apr 26, 2012, 10:46:57 AM (11 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- cb7827a842fd2e9878498f940e9f7735fdbe488e
- Parents:
- 9f84ad2f3376850c4d78697edb203d32c07d3094
- git-author:
- Martin Lee <martinlee84@web.de>2012-04-26 10:46:57+02:00
- git-committer:
- Martin Lee <martinlee84@web.de>2012-05-07 14:16:24+02:00
- Location:
- factory
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cf_gcd.cc
r9f84ad r4704674 1237 1237 1238 1238 CanonicalForm Dn, test= 0; 1239 cl = gcd (f.lc(),g.lc()); 1240 CanonicalForm b= 1; 1241 int minCommonDeg= 0; 1242 CanonicalForm gcdcfcg= gcd (cf, cg); 1243 for (i= tmax (f.level(), g.level()); i > 0; i--) 1244 { 1245 if (degree (f, i) <= 0 || degree (g, i) <= 0) 1246 continue; 1247 else 1248 { 1249 minCommonDeg= tmin (degree (g, i), degree (f, i)); 1250 break; 1251 } 1252 } 1253 if (i == 0) 1254 return gcdcfcg; 1255 for (; i > 0; i--) 1256 { 1257 if (degree (f, i) <= 0 || degree (g, i) <= 0) 1258 continue; 1259 else 1260 minCommonDeg= tmin (minCommonDeg, tmin (degree (g, i), degree (f, i))); 1261 } 1262 b= 2*tmin (maxNorm (f), maxNorm (g))*abs (cl)*power (CanonicalForm (2), minCommonDeg); 1239 1263 bool equal= false; 1240 1264 i = cf_getNumBigPrimes() - 1; 1241 cl = gcd (f.lc(),g.lc()); 1242 1243 CanonicalForm gcdcfcg= gcd (cf, cg); 1265 1244 1266 //Off (SW_RATIONAL); 1245 1267 while ( true ) … … 1307 1329 equal= true; 1308 1330 //Dn /=vcontent(Dn,Variable(1)); 1309 if ( equal&& fdivides( Dn, f ) && fdivides( Dn, g ) )1331 if ((equal || q > b) && fdivides( Dn, f ) && fdivides( Dn, g ) ) 1310 1332 { 1311 1333 //printf(" -> success\n"); -
factory/cf_gcd_smallp.cc
r9f84ad r4704674 560 560 CanonicalForm prim_elem, im_prim_elem; 561 561 CFList source, dest; 562 int bound= tmin (degree (ppA, 1), degree (ppB, 1)); 563 int count= 0; 562 564 do 563 565 { … … 665 667 G_m= 0; 666 668 d= d0; 669 count= 0; 667 670 } 668 671 … … 672 675 "time for newton interpolation: "); 673 676 677 count++; 674 678 //termination test 675 679 if (uni_lcoeff (H) == gcdlcAlcB) … … 682 686 //maybe it's better to test if ppH is an element of F(\alpha) before 683 687 //mapping down 684 if (fdivides (ppH, ppA) && fdivides (ppH, ppB)) 688 DEBOUTLN (cerr, "ppH before mapDown= " << ppH); 689 ppH= mapDown (ppH, prim_elem, im_prim_elem, alpha, u, v); 690 ppH /= Lc(ppH); 691 DEBOUTLN (cerr, "ppH after mapDown= " << ppH); 692 if ((count == bound) || (fdivides (ppH, ppA) && fdivides (ppH, ppB))) 685 693 { 686 694 DEBOUTLN (cerr, "ppH before mapDown= " << ppH); … … 693 701 } 694 702 } 695 else if ( fdivides (ppH, ppA) && fdivides (ppH, ppB))703 else if ((count == bound) || (fdivides (ppH, ppA) && fdivides (ppH, ppB))) 696 704 { 697 705 if (compressConvexDense) … … 882 890 int expon; 883 891 char gf_name_buf= gf_name; 892 int bound= tmin (degree (ppA, 1), degree (ppB, 1)); 893 int count= 0; 884 894 do 885 895 { … … 963 973 G_m= 0; 964 974 d= d0; 975 count= 0; 965 976 } 966 977 … … 969 980 TIMING_END_AND_PRINT (newton_interpolation, "time for newton interpolation: "); 970 981 982 count++; 971 983 //termination test 972 984 if (uni_lcoeff (H) == gcdlcAlcB) … … 976 988 if (inextension) 977 989 { 978 if ( fdivides(ppH, ppA) && fdivides(ppH, ppB))990 if ((count == bound) || (fdivides(ppH, ppA) && fdivides(ppH, ppB))) 979 991 { 980 992 DEBOUTLN (cerr, "ppH before mapDown= " << ppH); … … 1186 1198 topLevel= false; 1187 1199 CFList source, dest; 1200 int bound= tmin (degree (ppA, 1), degree (ppB, 1)); 1201 int count= 0; 1188 1202 do 1189 1203 { … … 1332 1346 G_m= 0; 1333 1347 d= d0; 1348 count= 0; 1334 1349 } 1335 1350 … … 1339 1354 "time for newton_interpolation: "); 1340 1355 1356 count++; 1341 1357 //termination test 1342 1358 if (uni_lcoeff (H) == gcdlcAlcB) … … 1346 1362 ppH /= Lc (ppH); 1347 1363 DEBOUTLN (cerr, "ppH= " << ppH); 1348 if ( fdivides (ppH, ppA) && fdivides (ppH, ppB))1364 if ((count == bound) || (fdivides (ppH, ppA) && fdivides (ppH, ppB))) 1349 1365 { 1350 1366 if (compressConvexDense)
Note: See TracChangeset
for help on using the changeset viewer.