Changeset 9e03f3 in git for kernel


Ignore:
Timestamp:
Jan 31, 2020, 11:38:02 AM (4 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '2a584933abf2a2d3082034c7586d38bb6de1a30a')
Children:
3ada27bd457c540e7307b402cf08aeeebd40b113
Parents:
ef6df21e3783870d5dd988a568b01c19e2ccbbb5ed01f112cee60b9d71fdcff8400dab5c67a23882
Message:
Merge branch 'reduce_fix' of https://github.com/kabouzeid/Singular into kabouzeid-reduce_fix
Location:
kernel
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kstd1.cc

    red01f11 r9e03f3  
    263263      return 0;
    264264    }
    265 
    266     // NO!
     265    if (TEST_OPT_IDLIFT)
     266    {
     267      if (h->p!=NULL)
     268      {
     269        if(p_GetComp(h->p,currRing)>strat->syzComp)
     270        {
     271          h->Delete();
     272          return 0;
     273        }
     274      }
     275      else if (h->t_p!=NULL)
     276      {
     277        if(p_GetComp(h->t_p,strat->tailRing)>strat->syzComp)
     278        {
     279          h->Delete();
     280          return 0;
     281        }
     282      }
     283    }
     284    #if 0
     285    else if ((strat->syzComp > 0)&&(!TEST_OPT_REDTAIL_SYZ))
     286    {
     287      if (h->p!=NULL)
     288      {
     289        if(p_GetComp(h->p,currRing)>strat->syzComp)
     290        {
     291          return 1;
     292        }
     293      }
     294      else if (h->t_p!=NULL)
     295      {
     296        if(p_GetComp(h->t_p,strat->tailRing)>strat->syzComp)
     297        {
     298          return 1;
     299        }
     300      }
     301    }
     302    #endif
     303
     304    // done ? NO!
    267305    h->SetShortExpVector();
    268306    h->SetpFDeg();
     
    795833      return 0;
    796834    }
     835    if (TEST_OPT_IDLIFT)
     836    {
     837      if (h->p!=NULL)
     838      {
     839        if(p_GetComp(h->p,currRing)>strat->syzComp)
     840        {
     841          h->Delete();
     842          return 0;
     843        }
     844      }
     845      else if (h->t_p!=NULL)
     846      {
     847        if(p_GetComp(h->t_p,strat->tailRing)>strat->syzComp)
     848        {
     849          h->Delete();
     850          return 0;
     851        }
     852      }
     853    }
     854    #if 0
     855    else if ((strat->syzComp > 0)&&(!TEST_OPT_REDTAIL_SYZ))
     856    {
     857      if (h->p!=NULL)
     858      {
     859        if(p_GetComp(h->p,currRing)>strat->syzComp)
     860        {
     861          return 1;
     862        }
     863      }
     864      else if (h->t_p!=NULL)
     865      {
     866        if(p_GetComp(h->t_p,strat->tailRing)>strat->syzComp)
     867        {
     868          return 1;
     869        }
     870      }
     871    }
     872    #endif
    797873    h->SetShortExpVector();
    798874
  • kernel/GBEngine/kstd2.cc

    red01f11 r9e03f3  
    633633  if (strat->tl<0) return 1;
    634634
    635   int at/*,i*/;
     635  int at;
    636636  long d;
    637637  int j = 0;
    638638  int pass = 0;
    639   // poly zeroPoly = NULL;
    640639
    641640// TODO warum SetpFDeg notwendig?
     
    683682            return 1;
    684683          }
    685         } else {
     684        }
     685        else
     686        {
    686687          /* not(lc(reducer) | lc(poly)) && not(lc(poly) | lc(reducer))
    687688           * => we try to cut down the lead coefficient at least */
     
    702703          tj.Clear();
    703704        }
    704       } else {
     705      }
     706      else
     707      {
    705708        /* same lead monomial but lead coefficients do not divide each other:
    706709         * change the polys to h <- spoly(h,tj) and h2 <- gpoly(h,tj). */
     
    717720        replaceInLAndSAndT(h2, j, strat);
    718721      }
    719     } else {
     722    }
     723    else
     724    {
    720725      ksReducePoly(h, &(strat->T[j]), NULL, NULL, strat);
    721726    }
     
    974979      return 0;
    975980    }
     981    if (TEST_OPT_IDLIFT)
     982    {
     983      if (h->p!=NULL)
     984      {
     985        if(p_GetComp(h->p,currRing)>strat->syzComp)
     986        {
     987          h->Delete();
     988          return 0;
     989        }
     990      }
     991      else if (h->t_p!=NULL)
     992      {
     993        if(p_GetComp(h->t_p,strat->tailRing)>strat->syzComp)
     994        {
     995          h->Delete();
     996          return 0;
     997        }
     998      }
     999    }
     1000    #if 0
     1001    else if ((strat->syzComp > 0)&&(!TEST_OPT_REDTAIL_SYZ))
     1002    {
     1003      if (h->p!=NULL)
     1004      {
     1005        if(p_GetComp(h->p,currRing)>strat->syzComp)
     1006        {
     1007          return 1;
     1008        }
     1009      }
     1010      else if (h->t_p!=NULL)
     1011      {
     1012        if(p_GetComp(h->t_p,strat->tailRing)>strat->syzComp)
     1013        {
     1014          return 1;
     1015        }
     1016      }
     1017    }
     1018    #endif
    9761019    h->SetShortExpVector();
    9771020    not_sev = ~ h->sev;
     
    16711714      return 0;
    16721715    }
     1716    if (TEST_OPT_IDLIFT)
     1717    {
     1718      if (h->p!=NULL)
     1719      {
     1720        if(p_GetComp(h->p,currRing)>strat->syzComp)
     1721        {
     1722          h->Delete();
     1723          return 0;
     1724        }
     1725      }
     1726      else if (h->t_p!=NULL)
     1727      {
     1728        if(p_GetComp(h->t_p,strat->tailRing)>strat->syzComp)
     1729        {
     1730          h->Delete();
     1731          return 0;
     1732        }
     1733      }
     1734    }
     1735    #if 0
     1736    else if ((strat->syzComp > 0)&&(!TEST_OPT_REDTAIL_SYZ))
     1737    {
     1738      if (h->p!=NULL)
     1739      {
     1740        if(p_GetComp(h->p,currRing)>strat->syzComp)
     1741        {
     1742          return 1;
     1743        }
     1744      }
     1745      else if (h->t_p!=NULL)
     1746      {
     1747        if(p_GetComp(h->t_p,strat->tailRing)>strat->syzComp)
     1748        {
     1749          return 1;
     1750        }
     1751      }
     1752    }
     1753    #endif
    16731754    h->SetShortExpVector();
    16741755    not_sev = ~ h->sev;
     
    18611942      }
    18621943    }
    1863     if ((strat->syzComp > 0)&&(!TEST_OPT_REDTAIL_SYZ))
     1944    else if ((strat->syzComp > 0)&&(!TEST_OPT_REDTAIL_SYZ))
    18641945    {
    18651946      if (h->p!=NULL)
     
    24142495      /* if we are computing over Z we always want to try and cut down
    24152496       * the coefficients in the tail terms */
    2416       if (rField_is_Z(currRing) && !rHasLocalOrMixedOrdering(currRing)) {
     2497      if (rField_is_Z(currRing) && !rHasLocalOrMixedOrdering(currRing))
     2498      {
    24172499        redtailBbaAlsoLC_Z(&(strat->P), strat->tl, strat);
    24182500        strat->P.pCleardenom();
  • kernel/GBEngine/kutil.cc

    ref6df2 r9e03f3  
    93749374void enterSBbaShift (LObject &p,int atS,kStrategy strat, int atR)
    93759375{
     9376  enterSBba(p, atS, strat, atR);
     9377
    93769378  int maxPossibleShift = p_mLPmaxPossibleShift(p.p, strat->tailRing);
    93779379  for (int i = maxPossibleShift; i > 0; i--)
    93789380  {
     9381
    93799382    LObject qq;
    93809383    qq.p = pLPCopyAndShiftLM(p.p, i); // don't use Set() because it'll test the poly order
    93819384    qq.shift = i;
    93829385    strat->initEcart(&qq); // initEcartBBA sets length, pLength, FDeg and ecart
     9386    int atS = posInS(strat, strat->sl, qq.p, qq.ecart); // S needs to stay sorted because this is for example assumed when searching S later
    93839387    enterSBba(qq, atS, strat, -1);
    93849388  }
    9385   enterSBba(p, atS, strat, atR);
    93869389}
    93879390#endif
  • kernel/ideals.cc

    red01f11 r9e03f3  
    206206  if ((idIs0(h1)) || (idIs0(h2)))  return idInit(1,rank);
    207207
     208  BITSET save_opt;
     209  SI_SAVE_OPT1(save_opt);
     210  if (TEST_OPT_RETURN_SB) si_opt_1 |= Sy_bit(OPT_REDTAIL_SYZ);
     211
    208212  ideal first,second,temp,temp1,result;
    209213  poly p,q;
     
    404408
    405409  idSkipZeroes(result);
     410  SI_RESTORE_OPT1(save_opt);
    406411  if (TEST_OPT_RETURN_SB)
    407412  {
     
    793798  idTest(s_h1);
    794799
     800  BITSET save_opt;
     801  SI_SAVE_OPT1(save_opt);
     802  if (TEST_OPT_RETURN_SB) si_opt_1|=Sy_bit(OPT_REDTAIL_SYZ);
     803
    795804  ideal s_h3=idPrepare(s_h1,h,k,w,alg); // main (syz) GB computation
     805
     806  SI_RESTORE_OPT1(save_opt);
    796807
    797808  if (s_h3==NULL)
     
    15101521  #endif
    15111522  ideal s_h3;
     1523  BITSET old_test1;
     1524  SI_SAVE_OPT1(old_test1);
     1525  if (TEST_OPT_RETURN_SB) si_opt_1 |= Sy_bit(OPT_REDTAIL_SYZ);
    15121526  if (addOnlyOne)
    15131527  {
    1514     BITSET old_test1;
    1515     SI_SAVE_OPT1(old_test1);
    15161528    if(!rField_is_Ring(currRing)) si_opt_1 |= Sy_bit(OPT_SB_1);
    15171529    s_h3 = kStd(s_h4,currRing->qideal,hom,&weights1,NULL,0/*kmax-1*/,IDELEMS(s_h4)-1);
    1518     SI_RESTORE_OPT1(old_test1);
    15191530  }
    15201531  else
     
    15221533    s_h3 = kStd(s_h4,currRing->qideal,hom,&weights1,NULL,kmax-1);
    15231534  }
     1535  SI_RESTORE_OPT1(old_test1);
    15241536  #if 0
    15251537  // only together with the above debug stuff
     
    18941906            p_Delete(&q,currRing);
    18951907          }
    1896         }
     1908        }
    18971909        /*delete the matrix tmp*/
    18981910        for (i=1; i<=ar; i++)
     
    23292341
    23302342  idTest(s_temp);
    2331   unsigned save_opt=si_opt_1;
     2343  unsigned save_opt;
     2344  SI_SAVE_OPT1(save_opt);
    23322345  si_opt_1 |= Sy_bit(OPT_REDTAIL_SYZ);
    23332346  ideal s_temp1 = kStd(s_temp,currRing->qideal,hom,&wtmp,NULL,length);
    2334   si_opt_1=save_opt;
     2347  SI_RESTORE_OPT1(save_opt);
    23352348
    23362349  //if (wtmp!=NULL)  Print("output weights:");wtmp->show(1);PrintLn();
Note: See TracChangeset for help on using the changeset viewer.