Changeset 0ebd7e in git
 Timestamp:
 Apr 20, 2011, 6:09:43 PM (12 years ago)
 Branches:
 (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
 Children:
 1ddd044275ba5d4433a597ff9edee1abfce81a0e
 Parents:
 2945379dfb56330fb50187871415af6e9c6ec7d3
 gitauthor:
 Hans Schoenemann <hannes@mathematik.unikl.de>20110420 18:09:43+02:00
 gitcommitter:
 Mohamed Barakat <mohamed.barakat@rwthaachen.de>20111109 12:31:23+01:00
 Files:

 4 edited
Legend:
 Unmodified
 Added
 Removed

kernel/kspoly.cc
r294537 r0ebd7e 346 346 * 347 347 ***************************************************************/ 348 349 /*350 * input  output: a, b351 * returns:352 * a := a/gcd(a,b), b := b/gcd(a,b)353 * and return value354 * 0 > a != 1, b != 1355 * 1 > a == 1, b != 1356 * 2 > a != 1, b == 1357 * 3 > a == 1, b == 1358 * this value is used to control the spolys359 */360 int ksCheckCoeff(number *a, number *b)361 {362 int c = 0;363 number an = *a, bn = *b;364 nTest(an);365 nTest(bn);366 367 number cn = nGcd(an, bn, currRing);368 369 if(nIsOne(cn))370 {371 an = nCopy(an);372 bn = nCopy(bn);373 }374 else375 {376 an = nIntDiv(an, cn);377 bn = nIntDiv(bn, cn);378 }379 nDelete(&cn);380 if (nIsOne(an))381 {382 c = 1;383 }384 if (nIsOne(bn))385 {386 c += 2;387 }388 *a = an;389 *b = bn;390 return c;391 }392 348 393 349 /*2 
kernel/kutil.h
r294537 r0ebd7e 599 599 600 600 601 /*602 * input  output: a, b603 * returns:604 * a := a/gcd(a,b), b := b/gcd(a,b)605 * and return value606 * 0 > a != 1, b != 1607 * 1 > a == 1, b != 1608 * 2 > a != 1, b == 1609 * 3 > a == 1, b == 1610 * this value is used to control the spolys611 */612 int ksCheckCoeff(number *a, number *b);613 614 601 // old stuff 615 602 KINLINE poly ksOldSpolyRed(poly p1, poly p2, poly spNoether = NULL); 
libpolys/polys/kbuckets.cc
r294537 r0ebd7e 1084 1084 //StringSetS("##### bn = "); nWrite(bn); PrintS(StringAppend("\n")); 1085 1085 /* ksCheckCoeff: divide out gcd from an and bn: */ 1086 int ct = ksCheckCoeff(&an, &bn );1086 int ct = ksCheckCoeff(&an, &bn,r>cf); 1087 1087 /* the previous command returns ct=0 or ct=2 iff an!=1 1088 1088 note: an is now 1 or 1 */ … … 1281 1281 } 1282 1282 } 1283 1284 /* 1285 * input  output: a, b 1286 * returns: 1287 * a := a/gcd(a,b), b := b/gcd(a,b) 1288 * and return value 1289 * 0 > a != 1, b != 1 1290 * 1 > a == 1, b != 1 1291 * 2 > a != 1, b == 1 1292 * 3 > a == 1, b == 1 1293 * this value is used to control the spolys 1294 */ 1295 int ksCheckCoeff(number *a, number *b, const coeffs r) 1296 { 1297 int c = 0; 1298 number an = *a, bn = *b; 1299 n_Test(an,r); 1300 n_Test(bn,r); 1301 1302 number cn = n_Gcd(an, bn, r); 1303 1304 if(n_IsOne(cn, r)) 1305 { 1306 an = n_Copy(an, r); 1307 bn = n_Copy(bn, r); 1308 } 1309 else 1310 { 1311 an = n_IntDiv(an, cn, r); 1312 bn = n_IntDiv(bn, cn, r); 1313 } 1314 n_Delete(&cn, r); 1315 if (n_IsOne(an, r)) 1316 { 1317 c = 1; 1318 } 1319 if (n_IsOne(bn, r)) 1320 { 1321 c += 2; 1322 } 1323 *a = an; 1324 *b = bn; 1325 return c; 1326 } 1327 
libpolys/polys/kbuckets.h
r294537 r0ebd7e 232 232 void kBucketSimpleContent(kBucket_pt bucket); 233 233 BOOLEAN kBucketIsCleared(kBucket_pt bucket); 234 int ksCheckCoeff(number *a, number *b, const coeffs r); 234 235 #endif /* KBUCKETS_H */
Note: See TracChangeset
for help on using the changeset viewer.