| 3523 | } |
| 3524 | #ifdef HAVE_RATGRING |
| 3525 | void chainCritPart (poly p,int ecart,kStrategy strat) |
| 3526 | { |
| 3527 | int i,j,l; |
| 3528 | |
| 3529 | /* |
| 3530 | *pairtest[i] is TRUE if spoly(S[i],p) == 0. |
| 3531 | *In this case all elements in B such |
| 3532 | *that their lcm is divisible by the leading term of S[i] can be canceled |
| 3533 | */ |
| 3534 | if (strat->pairtest!=NULL) |
| 3535 | { |
| 3536 | /*- i.e. there is an i with pairtest[i]==TRUE -*/ |
| 3537 | for (j=0; j<=strat->sl; j++) |
| 3538 | { |
| 3539 | if (strat->pairtest[j]) |
| 3540 | { |
| 3541 | for (i=strat->Bl; i>=0; i--) |
| 3542 | { |
| 3543 | if (_p_LmDivisibleByPart(strat->S[j],currRing, |
| 3544 | strat->B[i].lcm,currRing, |
| 3545 | currRing->real_var_start,currRing->real_var_end)) |
| 3546 | { |
| 3547 | if(TEST_OPT_DEBUG) |
| 3548 | { |
| 3549 | Print("chain-crit-part: S[%d]=",j); |
| 3550 | p_wrp(strat->S[j],currRing); |
| 3551 | Print(" divide B[%d].lcm=",i); |
| 3552 | p_wrp(strat->B[i].lcm,currRing); |
| 3553 | PrintLn(); |
| 3554 | } |
| 3555 | deleteInL(strat->B,&strat->Bl,i,strat); |
| 3556 | strat->c3++; |
| 3557 | } |
| 3558 | } |
| 3559 | } |
| 3560 | } |
| 3561 | omFreeSize(strat->pairtest,(strat->sl+2)*sizeof(BOOLEAN)); |
| 3562 | strat->pairtest=NULL; |
| 3563 | } |
| 3564 | if (strat->Gebauer || strat->fromT) |
| 3565 | { |
| 3566 | if (strat->sugarCrit) |
| 3567 | { |
| 3568 | /* |
| 3569 | *suppose L[j] == (s,r) and p/lcm(s,r) |
| 3570 | *and lcm(s,r)#lcm(s,p) and lcm(s,r)#lcm(r,p) |
| 3571 | *and in case the sugar is o.k. then L[j] can be canceled |
| 3572 | */ |
| 3573 | for (j=strat->Ll; j>=0; j--) |
| 3574 | { |
| 3575 | if (sugarDivisibleBy(ecart,strat->L[j].ecart) |
| 3576 | && ((pNext(strat->L[j].p) == strat->tail) || (rHasGlobalOrdering(currRing))) |
| 3577 | && pCompareChainPart(p,strat->L[j].p1,strat->L[j].p2,strat->L[j].lcm)) |
| 3578 | { |
| 3579 | if (strat->L[j].p == strat->tail) |
| 3580 | { |
| 3581 | if(TEST_OPT_DEBUG) |
| 3582 | { |
no test coverage detected