This can only be used in the case of coefficients coming from a field or at least an integral domain. */
| 1262 | /* This can only be used in the case of coefficients coming from a field |
| 1263 | or at least an integral domain. */ |
| 1264 | static void addOperationBucket(poly f1, poly f2, kBucket_pt bucket) |
| 1265 | { |
| 1266 | /* fills all terms of f1 * f2 into the bucket */ |
| 1267 | poly a = f1; poly b = f2; |
| 1268 | int aLen = pLength(a); int bLen = pLength(b); |
| 1269 | if (aLen > bLen) |
| 1270 | { |
| 1271 | b = f1; a = f2; bLen = aLen; |
| 1272 | } |
| 1273 | pNormalize(b); |
| 1274 | |
| 1275 | while (a != NULL) |
| 1276 | { |
| 1277 | /* The next line actually uses only LT(a): */ |
| 1278 | kBucket_Plus_mm_Mult_pp(bucket, a, b, bLen); |
| 1279 | a = pNext(a); |
| 1280 | } |
| 1281 | } |
| 1282 | |
| 1283 | /* computes the polynomial (p1 * p2 - p3 * p4) and puts result into p1; |
| 1284 | the method destroys the old value of p1; |
no test coverage detected