! used for GB over ZZ: intermediate reduction by monomial elements background: any known constant element of ideal suppresses intermediate coefficient swell */
| 10698 | intermediate coefficient swell |
| 10699 | */ |
| 10700 | void postReduceByMon(LObject* h, kStrategy strat) |
| 10701 | { |
| 10702 | if(!nCoeff_is_Z(currRing->cf)) |
| 10703 | return; |
| 10704 | poly pH = h->GetP(); |
| 10705 | poly p,pp; |
| 10706 | p = pH; |
| 10707 | bool deleted = FALSE, ok = FALSE; |
| 10708 | for(int i = 0; i<=strat->sl; i++) |
| 10709 | { |
| 10710 | p = pH; |
| 10711 | if(pNext(strat->S[i]) == NULL) |
| 10712 | { |
| 10713 | //pWrite(p); |
| 10714 | //pWrite(strat->S[i]); |
| 10715 | while(ok == FALSE && p != NULL) |
| 10716 | { |
| 10717 | if(pLmDivisibleBy(strat->S[i], p) |
| 10718 | #ifdef HAVE_SHIFTBBA |
| 10719 | || (rIsLPRing(currRing) && pLPLmDivisibleBy(strat->S[i], p)) |
| 10720 | #endif |
| 10721 | ) |
| 10722 | { |
| 10723 | number dummy = n_IntMod(p->coef, strat->S[i]->coef, currRing->cf); |
| 10724 | p_SetCoeff(p,dummy,currRing); |
| 10725 | } |
| 10726 | if(nIsZero(p->coef)) |
| 10727 | { |
| 10728 | pLmDelete(&p); |
| 10729 | h->p = p; |
| 10730 | deleted = TRUE; |
| 10731 | } |
| 10732 | else |
| 10733 | { |
| 10734 | ok = TRUE; |
| 10735 | } |
| 10736 | } |
| 10737 | if (p!=NULL) |
| 10738 | { |
| 10739 | pp = pNext(p); |
| 10740 | while(pp != NULL) |
| 10741 | { |
| 10742 | if(pLmDivisibleBy(strat->S[i], pp) |
| 10743 | #ifdef HAVE_SHIFTBBA |
| 10744 | || (rIsLPRing(currRing) && pLPLmDivisibleBy(strat->S[i], pp)) |
| 10745 | #endif |
| 10746 | ) |
| 10747 | { |
| 10748 | number dummy = n_IntMod(pp->coef, strat->S[i]->coef, currRing->cf); |
| 10749 | p_SetCoeff(pp,dummy,currRing); |
| 10750 | if(nIsZero(pp->coef)) |
| 10751 | { |
| 10752 | pLmDelete(&pNext(p)); |
| 10753 | pp = pNext(p); |
| 10754 | deleted = TRUE; |
| 10755 | } |
| 10756 | else |
| 10757 | { |
no test coverage detected