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

Function postReduceByMonSig

kernel/GBEngine/kutil.cc:10776–10858  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10774}
10775
10776void postReduceByMonSig(LObject* h, kStrategy strat)
10777{
10778 if(!nCoeff_is_Z(currRing->cf))
10779 return;
10780 poly hSig = h->sig;
10781 poly pH = h->GetP();
10782 poly p,pp;
10783 p = pH;
10784 bool deleted = FALSE, ok = FALSE;
10785 for(int i = 0; i<=strat->sl; i++)
10786 {
10787 p = pH;
10788 if(pNext(strat->S[i]) == NULL)
10789 {
10790 while(ok == FALSE && p!=NULL)
10791 {
10792 if(pLmDivisibleBy(strat->S[i], p))
10793 {
10794 poly sigMult = pDivideM(pHead(p),pHead(strat->S[i]));
10795 sigMult = ppMult_mm(sigMult,pCopy(strat->sig[i]));
10796 if(sigMult!= NULL && pLtCmp(hSig,sigMult) == 1)
10797 {
10798 number dummy = n_IntMod(p->coef, strat->S[i]->coef, currRing->cf);
10799 p_SetCoeff(p,dummy,currRing);
10800 }
10801 pDelete(&sigMult);
10802 }
10803 if(nIsZero(p->coef))
10804 {
10805 pLmDelete(&p);
10806 h->p = p;
10807 deleted = TRUE;
10808 }
10809 else
10810 {
10811 ok = TRUE;
10812 }
10813 }
10814 if(p == NULL)
10815 return;
10816 pp = pNext(p);
10817 while(pp != NULL)
10818 {
10819 if(pLmDivisibleBy(strat->S[i], pp))
10820 {
10821 poly sigMult = pDivideM(pHead(p),pHead(strat->S[i]));
10822 sigMult = ppMult_mm(sigMult,pCopy(strat->sig[i]));
10823 if(sigMult!= NULL && pLtCmp(hSig,sigMult) == 1)
10824 {
10825 number dummy = n_IntMod(pp->coef, strat->S[i]->coef, currRing->cf);
10826 p_SetCoeff(pp,dummy,currRing);
10827 if(nIsZero(pp->coef))
10828 {
10829 pLmDelete(&pNext(p));
10830 pp = pNext(p);
10831 deleted = TRUE;
10832 }
10833 else

Callers 1

redSigRingFunction · 0.85

Calls 5

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

Tested by

no test coverage detected