Changeset cb7827 in git
- Timestamp:
- Apr 26, 2012, 3:50:40 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 59778389f5075553bef793320610ce298d74b18d
- Parents:
- 47046743f1273df49ef99fda72ed22a1531d10bd
- git-author:
- Martin Lee <martinlee84@web.de>2012-04-26 15:50:40+02:00
- git-committer:
- Martin Lee <martinlee84@web.de>2012-05-07 14:16:35+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
factory/cf_gcd.cc
r4704674 rcb7827 1260 1260 minCommonDeg= tmin (minCommonDeg, tmin (degree (g, i), degree (f, i))); 1261 1261 } 1262 b= 2*tmin (maxNorm (f), maxNorm (g))*abs (cl)*power (CanonicalForm (2), minCommonDeg); 1262 b= 2*tmin (maxNorm (f), maxNorm (g))*abs (cl)* 1263 power (CanonicalForm (2), minCommonDeg); 1263 1264 bool equal= false; 1264 1265 i = cf_getNumBigPrimes() - 1; 1265 1266 1267 CanonicalForm cof, cog, cofp, cogp, newCof, newCog, cofn, cogn; 1266 1268 //Off (SW_RATIONAL); 1267 1269 while ( true ) … … 1277 1279 setCharacteristic( p ); 1278 1280 Dp = gcd_poly( mapinto( f ), mapinto( g ) ); 1281 //Dp = GCD_small_p (mapinto (f), mapinto (g), cofp, cogp); 1279 1282 Dp /=Dp.lc(); 1283 cofp= mapinto (f)/Dp; 1284 cogp= mapinto (g)/Dp; 1285 cofp /= lc (cofp); 1286 cogp /= lc (cogp); 1280 1287 setCharacteristic( 0 ); 1281 1288 dp_deg=totaldegree(Dp); … … 1288 1295 { 1289 1296 D = mapinto( Dp ); 1297 cof= mapinto (cofp); 1298 cog= mapinto (cogp); 1290 1299 d_deg=dp_deg; 1291 1300 q = p; … … 1296 1305 { 1297 1306 chineseRemainder( D, q, mapinto( Dp ), p, newD, newq ); 1307 chineseRemainder( cof, q, mapinto (cofp), p, newCof, newq); 1308 chineseRemainder( cog, q, mapinto (cogp), p, newCog, newq); 1309 cof= newCof; 1310 cog= newCog; 1298 1311 q = newq; 1299 1312 D = newD; … … 1305 1318 q = p; 1306 1319 D = mapinto( Dp ); 1320 cof= mapinto (cof); 1321 cog= mapinto (cog); 1307 1322 d_deg=dp_deg; 1308 1323 test= 0; … … 1318 1333 { 1319 1334 Dn= Farey(D,q); 1335 cofn= Farey(cof,q); 1336 cogn= Farey(cog,q); 1320 1337 int is_rat= isOn (SW_RATIONAL); 1321 1338 On (SW_RATIONAL); 1322 1339 cd = bCommonDen( Dn ); // we need On(SW_RATIONAL) 1340 cofn *= bCommonDen (cofn); 1341 cogn *= bCommonDen (cogn); 1323 1342 if (!is_rat) 1324 1343 Off (SW_RATIONAL); … … 1329 1348 equal= true; 1330 1349 //Dn /=vcontent(Dn,Variable(1)); 1331 if ((equal || q > b) && fdivides( Dn, f ) && fdivides( Dn, g ))1350 if ((equal || q > b) || ((cofn*Dn==f) && (cogn*Dn==g))) 1332 1351 { 1333 1352 //printf(" -> success\n"); … … 1348 1367 } 1349 1368 1369
Note: See TracChangeset
for help on using the changeset viewer.