MCPcopy Create free account
hub / github.com/Singular/Singular / postReduceByMon

Function postReduceByMon

kernel/GBEngine/kutil.cc:10700–10774  ·  view source on GitHub ↗

! used for GB over ZZ: intermediate reduction by monomial elements background: any known constant element of ideal suppresses intermediate coefficient swell */

Source from the content-addressed store, hash-verified

10698 intermediate coefficient swell
10699*/
10700void 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 {

Callers 6

redRing_ZFunction · 0.85
redRing_Z_SFunction · 0.85
redRingFunction · 0.85
redRing_SFunction · 0.85
redRilocFunction · 0.85
redRiloc_ZFunction · 0.85

Calls 6

nCoeff_is_ZFunction · 0.85
rIsLPRingFunction · 0.85
n_IntModFunction · 0.85
p_SetCoeffFunction · 0.85
GetPMethod · 0.80
SetLmCurrRingMethod · 0.80

Tested by

no test coverage detected