Changeset aa7c1c2 in git for kernel/GBEngine/kutil.cc


Ignore:
Timestamp:
Jun 14, 2018, 1:08:24 PM (6 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
8c73fdea988c87d699605750b3180fa69edf5d10
Parents:
a718906498691a0860e186cfee5db4fc1142ccd6db48f3ea705fcb451c2ea640a2b72f643bae2f22
Message:
Merge branch 'spielwiese' into letterplace_kernel_multiplication
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kutil.cc

    ra718906 raa7c1c2  
    1097110971void finalReduceByMon(kStrategy strat)
    1097210972{
     10973  assume(strat->tl<0); /* can only be called with no elements in T:
     10974                          i.e. after exitBuchMora */
     10975  /* do not use strat->S, strat->sl as they may be out of sync*/
    1097310976  if(!nCoeff_is_Ring_Z(currRing->cf))
    1097410977      return;
    1097510978  poly p,pp;
    10976   for(int j = 0; j<=strat->sl; j++)
    10977   {
    10978     if((strat->S[j]!=NULL)&&(pNext(strat->S[j]) == NULL))
    10979     {
    10980       for(int i = 0; i<=strat->sl; i++)
    10981       {
    10982         if((i != j) && (strat->S[i] != NULL))
    10983         {
    10984           p = strat->S[i];
    10985           if(pLmDivisibleBy(strat->S[j], p))
     10979  for(int j = 0; j<IDELEMS(strat->Shdl); j++)
     10980  {
     10981    if((strat->Shdl->m[j]!=NULL)&&(pNext(strat->Shdl->m[j]) == NULL))
     10982    {
     10983      for(int i = 0; i<IDELEMS(strat->Shdl); i++)
     10984      {
     10985        if((i != j) && (strat->Shdl->m[i] != NULL))
     10986        {
     10987          p = strat->Shdl->m[i];
     10988          while((p!=NULL) && pLmDivisibleBy(strat->Shdl->m[j], p))
    1098610989          {
    10987             number dummy = n_IntMod(p->coef, strat->S[j]->coef, currRing->cf);
    10988             p_SetCoeff(p,dummy,currRing);
     10990            number dummy = n_IntMod(p->coef, strat->Shdl->m[j]->coef, currRing->cf);
     10991            if (!nEqual(dummy,p->coef))
     10992            {
     10993              if (nIsZero(dummy))
     10994              {
     10995                nDelete(&dummy);
     10996                pLmDelete(&strat->Shdl->m[i]);
     10997                p=strat->Shdl->m[i];
     10998              }
     10999              else
     11000              {
     11001                p_SetCoeff(p,dummy,currRing);
     11002                break;
     11003              }
     11004            }
     11005            else
     11006            {
     11007              nDelete(&dummy);
     11008              break;
     11009            }
    1098911010          }
    10990           pp = pNext(p);
    10991           if((pp == NULL) && (nIsZero(p->coef)))
     11011          if (p!=NULL)
    1099211012          {
    10993             deleteInS(i, strat);
    10994           }
    10995           else
    10996           {
     11013            pp = pNext(p);
    1099711014            while(pp != NULL)
    1099811015            {
    10999               if(pLmDivisibleBy(strat->S[j], pp))
     11016              if(pLmDivisibleBy(strat->Shdl->m[j], pp))
    1100011017              {
    11001                 number dummy = n_IntMod(pp->coef, strat->S[j]->coef, currRing->cf);
    11002                 p_SetCoeff(pp,dummy,currRing);
    11003                 if(nIsZero(pp->coef))
     11018                number dummy = n_IntMod(pp->coef, strat->Shdl->m[j]->coef, currRing->cf);
     11019                if (!nEqual(dummy,pp->coef))
    1100411020                {
    11005                   pLmDelete(&pNext(p));
    11006                   pp = pNext(p);
     11021                  p_SetCoeff(pp,dummy,currRing);
     11022                  if(nIsZero(pp->coef))
     11023                  {
     11024                    pLmDelete(&pNext(p));
     11025                    pp = pNext(p);
     11026                  }
     11027                  else
     11028                  {
     11029                    p = pp;
     11030                    pp = pNext(p);
     11031                  }
    1100711032                }
    1100811033                else
    1100911034                {
     11035                  nDelete(&dummy);
    1101011036                  p = pp;
    1101111037                  pp = pNext(p);
     
    1101911045            }
    1102011046          }
    11021           if(strat->S[i]!= NULL && nIsZero(pGetCoeff(strat->S[i])))
    11022           {
    11023             if(pNext(strat->S[i]) == NULL)
    11024               strat->S[i]=NULL;
    11025             else
    11026               strat->S[i]=pNext(strat->S[i]);
    11027           }
    1102811047        }
    1102911048      }
     
    1103111050    }
    1103211051  }
    11033   //idSkipZeroes(strat->Shdl);
     11052  idSkipZeroes(strat->Shdl);
    1103411053}
    1103511054#endif
Note: See TracChangeset for help on using the changeset viewer.