2 * creates the leading term of the S-polynomial of p1 and p2 * do not destroy p1 and p2 * remarks: * 1. the coefficient is 0 (p_Init) * 1. a) in the case of coefficient ring, the coefficient is calculated * 2. pNext is undefined */ static void bbb() { int i=0; }
| 1445 | */ |
| 1446 | //static void bbb() { int i=0; } |
| 1447 | poly ksCreateShortSpoly(poly p1, poly p2, ring tailRing) |
| 1448 | { |
| 1449 | poly a1 = pNext(p1), a2 = pNext(p2); |
| 1450 | #ifdef HAVE_SHIFTBBA |
| 1451 | int shift1, shift2; |
| 1452 | if (tailRing->isLPring) |
| 1453 | { |
| 1454 | // assume: LM is shifted, tail unshifted |
| 1455 | assume(p_FirstVblock(a1, tailRing) <= 1); |
| 1456 | assume(p_FirstVblock(a2, tailRing) <= 1); |
| 1457 | // save the shift of the LM so we can shift the other monomials on demand |
| 1458 | shift1 = p_mFirstVblock(p1, tailRing) - 1; |
| 1459 | shift2 = p_mFirstVblock(p2, tailRing) - 1; |
| 1460 | } |
| 1461 | #endif |
| 1462 | long c1=p_GetComp(p1, currRing),c2=p_GetComp(p2, currRing); |
| 1463 | long c; |
| 1464 | poly m1,m2; |
| 1465 | number t1 = NULL,t2 = NULL; |
| 1466 | int cm,i; |
| 1467 | BOOLEAN equal; |
| 1468 | |
| 1469 | BOOLEAN is_Ring=rField_is_Ring(currRing); |
| 1470 | number lc1 = pGetCoeff(p1), lc2 = pGetCoeff(p2); |
| 1471 | if (is_Ring) |
| 1472 | { |
| 1473 | ksCheckCoeff(&lc1, &lc2, currRing->cf); // gcd and zero divisors |
| 1474 | if (a1 != NULL) t2 = nMult(pGetCoeff(a1),lc2); |
| 1475 | if (a2 != NULL) t1 = nMult(pGetCoeff(a2),lc1); |
| 1476 | while (a1 != NULL && nIsZero(t2)) |
| 1477 | { |
| 1478 | pIter(a1); |
| 1479 | nDelete(&t2); |
| 1480 | if (a1 != NULL) t2 = nMult(pGetCoeff(a1),lc2); |
| 1481 | } |
| 1482 | while (a2 != NULL && nIsZero(t1)) |
| 1483 | { |
| 1484 | pIter(a2); |
| 1485 | nDelete(&t1); |
| 1486 | if (a2 != NULL) t1 = nMult(pGetCoeff(a2),lc1); |
| 1487 | } |
| 1488 | } |
| 1489 | |
| 1490 | #ifdef HAVE_SHIFTBBA |
| 1491 | // shift the next monomial on demand |
| 1492 | if (tailRing->isLPring) |
| 1493 | { |
| 1494 | a1 = p_LPCopyAndShiftLM(a1, shift1, tailRing); |
| 1495 | a2 = p_LPCopyAndShiftLM(a2, shift2, tailRing); |
| 1496 | } |
| 1497 | #endif |
| 1498 | if (a1==NULL) |
| 1499 | { |
| 1500 | if(a2!=NULL) |
| 1501 | { |
| 1502 | m2=p_Init(currRing); |
| 1503 | x2: |
| 1504 | for (i = (currRing->N); i; i--) |
no test coverage detected