Changeset 32f7e5 in git


Ignore:
Timestamp:
Dec 5, 2013, 8:41:29 PM (10 years ago)
Author:
Christian Eder
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
0c15dc1d046c89a6a771b4f899e787a85af175ce
Parents:
88bb8861e1718d85807ce45f043eba5c778545e1
git-author:
Christian Eder <ederc@mathematik.uni-kl.de>2013-12-05 20:41:29+01:00
git-committer:
Christian Eder <ederc@mathematik.uni-kl.de>2013-12-12 13:51:29+01:00
Message:
improves criteria checks in sba, big speedup for Arris variant
Location:
kernel
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/kInline.h

    r88bb88 r32f7e5  
    11561156// dummy function for function pointer strat->rewCrit being usable in all
    11571157// possible choices for criteria
    1158 KINLINE BOOLEAN arriRewDummy(poly /*sig*/, unsigned long /*not_sevSig*/, kStrategy /*strat*/, int /*start=0*/)
     1158KINLINE BOOLEAN arriRewDummy(poly /*sig*/, unsigned long /*not_sevSig*/, poly /*lm*/, kStrategy /*strat*/, int /*start=0*/)
    11591159{
    11601160  return FALSE;
  • kernel/kstd1.cc

    r88bb88 r32f7e5  
    22682268    strat->rewCrit1 = arriRewDummy;
    22692269    strat->rewCrit2 = arriRewCriterion;
     2270    strat->rewCrit3 = arriRewCriterionPre;
    22702271  }
    22712272  else
     
    22732274    strat->rewCrit1 = faugereRewCriterion;
    22742275    strat->rewCrit2 = faugereRewCriterion;
     2276    strat->rewCrit3 = faugereRewCriterion;
    22752277  }
    22762278
  • kernel/kstd2.cc

    r88bb88 r32f7e5  
    18211821      // initialize new syzygy rules for the next iteration step
    18221822      initSyzRules(strat);
     1823
    18231824    }
    18241825    /*********************************************************************
     
    18311832    /* reduction of the element choosen from L */
    18321833
    1833     if (!strat->rewCrit2(strat->P.sig, ~strat->P.sevSig, strat, strat->P.checked+1)) {
     1834    if (!strat->rewCrit2(strat->P.sig, ~strat->P.sevSig, strat->P.GetLmCurrRing(), strat, strat->P.checked+1)) {
    18341835      //#if 1
    18351836#ifdef DEBUGF5
     
    18991900        if (strat->P.prd_crit) {
    19001901          product_criterion++;
    1901           enterSyz(strat->P, strat);
     1902          int pos = posInSyz(strat, strat->P.sig);
     1903          enterSyz(strat->P, strat, pos);
    19021904          if (strat->P.lcm!=NULL)
    19031905            pLmFree(strat->P.lcm);
     
    21122114//#if 1
    21132115#if DEBUGF50
    2114     printf("---------------------------\n");
     2116    //printf("---------------------------\n");
    21152117    Print(" %d. ELEMENT ADDED TO GCURR:\n",strat->sl+1);
    21162118    Print("LEAD POLY:  "); pWrite(pHead(strat->S[strat->sl]));
     
    21572159        zeroreductions++;
    21582160#endif
    2159         enterSyz(strat->P,strat);
     2161        int pos = posInSyz(strat, strat->P.sig);
     2162        enterSyz(strat->P, strat, pos);
    21602163//#if 1
    21612164#ifdef DEBUGF5
     
    22232226#endif
    22242227#if SBA_PRINT_SIZE_SYZ
    2225   size_syz = strat->syzl+1;
    2226 #endif
    2227 
     2228  // that is correct, syzl is counting one too far
     2229  size_syz = strat->syzl;
     2230#endif
    22282231  exitSba(strat);
    22292232//  if (TEST_OPT_WEIGHTM)
  • kernel/kutil.cc

    r88bb88 r32f7e5  
    987987  memmove(&(strat->sevSig[i]),&(strat->sevSig[i+1]),(strat->sl - i)*sizeof(unsigned long));
    988988  memmove(&(strat->S_2_R[i]),&(strat->S_2_R[i+1]),(strat->sl - i)*sizeof(int));
    989   memmove(&(strat->fromS[i]),&(strat->fromS[i+1]),(strat->sl - i)*sizeof(int));
    990989#else
    991990  int j;
     
    998997    strat->sevSig[j] = strat->sevSig[j+1];
    999998    strat->S_2_R[j] = strat->S_2_R[j+1];
    1000     strat->fromS[j] = strat->fromS[j+1];
    1001999  }
    10021000#endif
     
    10451043#endif
    10461044      pLmFree(set[j].lcm);
     1045  }
     1046  if (set[j].sig!=NULL)
     1047  {
     1048#ifdef HAVE_RINGS
     1049    if (pGetCoeff(set[j].sig) != NULL)
     1050      pLmDelete(set[j].sig);
     1051    else
     1052#endif
     1053      pLmFree(set[j].sig);
    10471054  }
    10481055  if (set[j].p!=NULL)
     
    17791786              // the corresponding signatures for criteria checks
    17801787  LObject  Lp;
    1781   // poly last;
    17821788  poly pSigMult = p_Copy(pSig,currRing);
    17831789  poly sSigMult = p_Copy(strat->sig[i],currRing);
     
    18061812  Print("P1  ");
    18071813  pWrite(pHead(p));
    1808   Print("FROM: %d\n", from);
    18091814  Print("P2  ");
    18101815  pWrite(pHead(strat->S[i]));
    1811   Print("FROM: %d\n", strat->fromS[i]);
    18121816  Print("M1  ");
    18131817  pWrite(m1);
     
    18271831  pWrite(sSigMult);
    18281832  Print("----------------\n");
    1829 #endif
    1830   // testing by syzCrit = F5 Criterion
    1831   // testing by rewCrit1 = Rewritten Criterion
    1832   if  ( strat->syzCrit(pSigMult,pSigMultNegSev,strat) ||
    1833         strat->syzCrit(sSigMult,sSigMultNegSev,strat)
    1834         || strat->rewCrit1(sSigMult,sSigMultNegSev,strat,i+1)
    1835       )
    1836   {
    1837     pDelete(&pSigMult);
    1838     pDelete(&sSigMult);
    1839     strat->cp++;
    1840     pLmFree(Lp.lcm);
    1841     Lp.lcm=NULL;
    1842     pDelete (&m1);
    1843     pDelete (&m2);
    1844     return;
    1845   }
    1846   // in any case Lp is checked up to the next strat->P which is added
    1847   // to S right after this critical pair creation.
    1848   // NOTE: this even holds if the 2nd generator gives the bigger signature
    1849   //       moreover, this improves rewCriterion,
    1850   //       i.e. strat->checked > strat->from if and only if the 2nd generator
    1851   //       gives the bigger signature.
    1852   Lp.checked = strat->sl+1;
     1833  Lp.checked  = 0;
     1834#endif
    18531835  int sigCmp = p_LmCmp(pSigMult,sSigMult,currRing);
    18541836//#if 1
     
    18621844    // printf("!!!!   EQUAL SIGS   !!!!\n");
    18631845    // pSig = sSig, delete element due to Rewritten Criterion
    1864     strat->cp++;
    18651846    pDelete(&pSigMult);
    18661847    pDelete(&sSigMult);
     
    18711852    return;
    18721853  }
    1873   // at this point it is clear that the pair will be added to L, since it has
    1874   // passed all tests up to now
    1875 
    1876   // store from which element this pair comes from for further tests
    1877   Lp.from = strat->sl+1;
    1878   if(sigCmp==currRing->OrdSgn)
    1879   {
    1880     // pSig > sSig
    1881     pDelete (&sSigMult);
    1882     Lp.sig    = pSigMult;
    1883     Lp.sevSig = ~pSigMultNegSev;
    1884   }
    1885   else
    1886   {
    1887     // pSig < sSig
    1888     pDelete (&pSigMult);
    1889     Lp.sig    = sSigMult;
    1890     Lp.sevSig = ~sSigMultNegSev;
    1891   }
    1892 // adds buchberger's first criterion
    1893   if (pLmCmp(m2,pHead(p)) == 0) {
    1894     Lp.prod_crit = TRUE; // Product Criterion
    1895 #if 0
    1896     enterSyz(Lp, strat);
     1854  // testing by syzCrit = F5 Criterion
     1855  // testing by rewCrit1 = Rewritten Criterion
     1856  // NOTE: Arri's Rewritten Criterion is tested below, we need Lp.p for it!
     1857  if  ( strat->syzCrit(pSigMult,pSigMultNegSev,strat) ||
     1858        strat->syzCrit(sSigMult,sSigMultNegSev,strat)
     1859        || strat->rewCrit1(sSigMult,sSigMultNegSev,Lp.lcm,strat,i+1)
     1860      )
     1861  {
     1862    pDelete(&pSigMult);
     1863    pDelete(&sSigMult);
     1864    pLmFree(Lp.lcm);
    18971865    Lp.lcm=NULL;
    18981866    pDelete (&m1);
    18991867    pDelete (&m2);
    19001868    return;
    1901 #endif
    1902   }
    1903   pDelete (&m1);
    1904   pDelete (&m2);
    1905 #if DEBUGF5
    1906   printf("SIGNATURE OF PAIR:  ");
    1907   pWrite(Lp.sig);
    1908 #endif
     1869  }
    19091870  /*
    19101871  *the pair (S[i],p) enters B if the spoly != 0
     
    19851946      }
    19861947  }
     1948  // store from which element this pair comes from for further tests
     1949  //Lp.from = strat->sl+1;
     1950  if(sigCmp==currRing->OrdSgn)
     1951  {
     1952    // pSig > sSig
     1953    pDelete (&sSigMult);
     1954    Lp.sig    = pSigMult;
     1955    Lp.sevSig = ~pSigMultNegSev;
     1956  }
     1957  else
     1958  {
     1959    // pSig < sSig
     1960    pDelete (&pSigMult);
     1961    Lp.sig    = sSigMult;
     1962    Lp.sevSig = ~sSigMultNegSev;
     1963  }
    19871964  if (Lp.p == NULL)
    19881965  {
    1989     /*- the case that the s-poly is 0 -*/
    1990     if (strat->pairtest==NULL) initPairtest(strat);
    1991     strat->pairtest[i] = TRUE;/*- hint for spoly(S^[i],p)=0 -*/
    1992     strat->pairtest[strat->sl+1] = TRUE;
    1993     /*hint for spoly(S[i],p) == 0 for some i,0 <= i <= sl*/
    1994     /*
    1995     *suppose we have (s,r),(r,p),(s,p) and spoly(s,p) == 0 and (r,p) is
    1996     *still in B (i.e. lcm(r,p) == lcm(s,p) or the leading term of s does not
    1997     *devide lcm(r,p)). In the last case (s,r) can be canceled if the leading
    1998     *term of p devides the lcm(s,r)
    1999     *(this canceling should be done here because
    2000     *the case lcm(s,p) == lcm(s,r) is not covered in chainCrit)
    2001     *the first case is handeled in chainCrit
    2002     */
    20031966    if (Lp.lcm!=NULL) pLmFree(Lp.lcm);
    20041967  }
    20051968  else
    20061969  {
     1970    // testing by rewCrit3 = Arris Rewritten Criterion (for F5 nothing happens!)
     1971    if (strat->rewCrit3(Lp.sig,~Lp.sevSig,Lp.p,strat,strat->sl+1)) {
     1972      pLmFree(Lp.lcm);
     1973      pDelete(&Lp.sig);
     1974      Lp.lcm=NULL;
     1975      pDelete (&m1);
     1976      pDelete (&m2);
     1977      return;
     1978    }
     1979    // in any case Lp is checked up to the next strat->P which is added
     1980    // to S right after this critical pair creation.
     1981    // NOTE: this even holds if the 2nd generator gives the bigger signature
     1982    //       moreover, this improves rewCriterion,
     1983    //       i.e. strat->checked > strat->from if and only if the 2nd generator
     1984    //       gives the bigger signature.
     1985    Lp.checked = strat->sl+1;
     1986    // at this point it is clear that the pair will be added to L, since it has
     1987    // passed all tests up to now
     1988
     1989  // adds buchberger's first criterion
     1990    if (pLmCmp(m2,pHead(p)) == 0) {
     1991      Lp.prod_crit = TRUE; // Product Criterion
     1992#if 0
     1993      int pos = posInSyz(Lp.sig);
     1994      enterSyz(Lp, strat,pos);
     1995      Lp.lcm=NULL;
     1996      pDelete (&m1);
     1997      pDelete (&m2);
     1998      return;
     1999#endif
     2000    }
     2001    pDelete (&m1);
     2002    pDelete (&m2);
     2003#if DEBUGF5
     2004    printf("SIGNATURE OF PAIR:  ");
     2005    pWrite(Lp.sig);
     2006#endif
    20072007    /*- the pair (S[i],p) enters B -*/
    20082008    Lp.p1 = strat->S[i];
     
    46314631}
    46324632
     4633// for sba, sorting syzygies
     4634int posInSyz (const kStrategy strat, poly sig)
     4635{
     4636if (strat->syzl==0) return 0;
     4637if (pLmCmp(strat->syz[strat->syzl-1],sig) != currRing->OrdSgn)
     4638  return strat->syzl;
     4639
     4640int i;
     4641int an = 0;
     4642int en= strat->syzl-1;
     4643loop
     4644{
     4645  if (an >= en-1)
     4646  {
     4647    if (pLmCmp(strat->syz[an],sig) != currRing->OrdSgn) return en;
     4648    return an;
     4649  }
     4650  i=(an+en) / 2;
     4651  if (pLmCmp(strat->syz[i],sig) != currRing->OrdSgn) an=i;
     4652  else                                      en=i;
     4653  /*aend. fuer lazy == in !=- machen */
     4654}
     4655}
     4656
    46334657/*2
    46344658*
     
    50785102      return TRUE;
    50795103    }
     5104    //k++;
    50805105  }
    50815106  return FALSE;
     
    51195144      if (p_LmShortDivisibleBy(strat->syz[k], strat->sevSyz[k], sig, not_sevSig, currRing))
    51205145        return TRUE;
     5146      //k++;
    51215147    }
    51225148    return FALSE;
     
    51275153 * REWRITTEN CRITERION for signature-based standard basis algorithms
    51285154 */
    5129 BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, kStrategy strat, int start=0)
     5155BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly /*lm*/, kStrategy strat, int start=0)
    51305156{
    51315157  //printf("Faugere Rewritten Criterion\n");
     
    51355161  pWrite(sig);
    51365162#endif
    5137   //for(int k = start; k<strat->sl+1; k++)
    51385163  for(int k = strat->sl; k>start; k--)
    51395164  {
     
    51455170#endif
    51465171    if (p_LmShortDivisibleBy(strat->sig[k], strat->sevSig[k], sig, not_sevSig, currRing))
    5147     //if (p_LmEqual(strat->sig[k], sig, currRing))
    51485172    {
    51495173//#if 1
     
    51535177      return TRUE;
    51545178    }
     5179    //k--;
    51555180  }
    51565181#ifdef DEBUGF5
     
    51845209//        critical pair. In this situation we can discard the critical pair
    51855210//        completely.
    5186 BOOLEAN arriRewCriterion(poly /*sig*/, unsigned long /*not_sevSig*/, kStrategy strat, int /*start=0*/)
    5187 {
    5188   //printf("Arri Rewritten Criterion\n");
    5189   while (strat->Ll > 0 && pLmEqual(strat->L[strat->Ll].sig,strat->P.sig))
    5190   {
    5191     /*
    5192     if (strat->P.GetLmCurrRing() == NULL)
    5193     {
    5194       printf("---\n");
    5195       pWrite(strat->P.GetLmCurrRing());
    5196       deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
    5197     }
    5198     */
    5199     /*
    5200     if (strat->L[strat->Ll].GetLmCurrRing() == NULL)
    5201     {
    5202       printf("---\n");
    5203       pDelete(&strat->P.sig);
    5204       strat->P.Delete();
    5205       strat->P = strat->L[strat->Ll];
    5206       strat->Ll--;
    5207     }
    5208     */
    5209     if ((strat->P.GetLmCurrRing() != NULL)
    5210     && (strat->L[strat->Ll].GetLmCurrRing() != NULL))
    5211     {
    5212       if (pLmCmp(strat->P.GetLmCurrRing(),strat->L[strat->Ll].GetLmCurrRing()) == -1)
    5213       {
    5214         deleteInL(strat->L,&strat->Ll,strat->Ll,strat);
    5215       }
    5216       else
    5217       {
    5218         pDelete(&strat->P.sig);
    5219         //strat->P.Delete();
    5220         strat->P = strat->L[strat->Ll];
    5221         strat->Ll--;
    5222       }
     5211BOOLEAN arriRewCriterion(poly /*sig*/, unsigned long /*not_sevSig*/, poly /*lm*/, kStrategy strat, int start=0)
     5212{
     5213  poly p1 = pOne();
     5214  poly p2 = pOne();
     5215  for (int ii=strat->sl; ii>start; ii--)
     5216  {
     5217    if (p_LmShortDivisibleBy(strat->sig[ii], strat->sevSig[ii], strat->P.sig, ~strat->P.sevSig, currRing))
     5218    {
     5219      p_ExpVectorSum(p1,strat->P.sig,strat->S[ii],currRing);
     5220      p_ExpVectorSum(p2,strat->sig[ii],strat->P.p,currRing);
     5221      if (!(pLmCmp(p1,p2) == 1))
     5222      {
     5223        pDelete(&p1);
     5224        pDelete(&p2);
     5225        return TRUE;
     5226      }
     5227    }
     5228  }
     5229  pDelete(&p1);
     5230  pDelete(&p2);
     5231  return FALSE;
     5232}
     5233
     5234BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int /*start=0*/)
     5235{
     5236  int found = -1;
     5237  for (int i=strat->Bl; i>-1; i--) {
     5238    if (pLmEqual(strat->B[i].sig,sig)) {
     5239      found = i;
     5240      break;
     5241    }
     5242  }
     5243  if (found != -1) {
     5244    if (pLmCmp(lm,strat->B[found].GetLmCurrRing()) == -1) {
     5245      deleteInL(strat->B,&strat->Bl,found,strat);
     5246    } else {
     5247      return TRUE;
    52235248    }
    52245249  }
     
    52275252  for (int ii=strat->sl; ii>-1; ii--)
    52285253  {
    5229     if (p_LmShortDivisibleBy(strat->sig[ii], strat->sevSig[ii], strat->P.sig, ~strat->P.sevSig, currRing))
    5230     {
    5231       p_ExpVectorSum(p1,strat->P.sig,strat->S[ii],currRing);
    5232       p_ExpVectorSum(p2,strat->sig[ii],strat->P.p,currRing);
     5254    if (p_LmShortDivisibleBy(strat->sig[ii], strat->sevSig[ii], sig, not_sevSig, currRing))
     5255    {
     5256      p_ExpVectorSum(p1,sig,strat->S[ii],currRing);
     5257      p_ExpVectorSum(p2,strat->sig[ii],lm,currRing);
    52335258      if (!(pLmCmp(p1,p2) == 1))
    52345259      {
    5235         pDelete(&strat->P.sig);
    5236         //strat->P.Delete();
    52375260        pDelete(&p1);
    52385261        pDelete(&p2);
     
    59165939  else i=setmaxT;
    59175940  strat->ecartS =   initec(i);
    5918   strat->fromS  =   initec(i);
    59195941  strat->sevS   =   initsevS(i);
    59205942  strat->sevSig =   initsevS(i);
     
    61316153        {
    61326154          poly p          = pOne();
    6133           pLcm(strat->S[k],strat->S[i],p);
     6155          p_ExpVectorCopy(p,strat->S[k],currRing);
    61346156          strat->syz[ctr] = p;
    61356157          p_SetCompP (strat->syz[ctr], comp, currRing);
    61366158          poly q          = p_Copy(p, currRing);
     6159          p_ExpVectorCopy(q,strat->S[i],currRing);
    61376160          q               = p_Neg (q, currRing);
    61386161          p_SetCompP (q, p_GetComp(strat->sig[k], currRing), currRing);
    61396162          strat->syz[ctr] = p_Add_q (strat->syz[ctr], q, currRing);
    61406163#if defined(DEBUGF5) || defined(DEBUGF51)
     6164//#if 1
     6165          printf(". . \n");
    61416166          pWrite(strat->syz[ctr]);
    61426167#endif
     
    61696194    for (k = 0; k<strat->sl+1; k++)
    61706195    {
    6171       strat->syz[ctr] = p_Copy (pHead(strat->S[k]), currRing);
     6196      poly p          = pOne();
     6197      p_ExpVectorCopy(p,strat->S[k],currRing);
     6198      strat->syz[ctr] = p;
    61726199      p_SetCompP (strat->syz[ctr], comp, currRing);
    6173       poly q          = p_Copy (pHead(strat->L[strat->Ll].p), currRing);
     6200      poly q          = p_Copy(p, currRing);
     6201      p_ExpVectorCopy(q,strat->L[strat->Ll].p,currRing);
    61746202      q               = p_Neg (q, currRing);
    61756203      p_SetCompP (q, p_GetComp(strat->sig[k], currRing), currRing);
     
    61866214#ifdef DEBUGF5
    61876215    Print("Principal syzygies:\n");
     6216    printf("syzl   %d\n",strat->syzl);
     6217    printf("syzmax %d\n",strat->syzmax);
     6218    printf("ps     %d\n",ps);
    61886219    Print("--------------------------------\n");
    61896220    for(i=0;i<=ps-1;i++)
     
    63546385  else i=setmaxT;
    63556386  i=((i+IDELEMS(F)+IDELEMS(P)+15)/16)*16;
    6356   strat->fromS=initec(i);
    63576387  strat->sevS=initsevS(i);
    63586388  strat->sevSig=initsevS(i);
     
    70117041                                          (IDELEMS(strat->Shdl)+setmaxTinc)
    70127042                                                  *sizeof(int));
    7013     strat->fromS = (intset)omReallocSize(strat->fromS,
    7014                                           IDELEMS(strat->Shdl)*sizeof(int),
    7015                                           (IDELEMS(strat->Shdl)+setmaxTinc)
    7016                                                   *sizeof(int));
    70177043    strat->S_2_R = (int*) omRealloc0Size(strat->S_2_R,
    70187044                                         IDELEMS(strat->Shdl)*sizeof(int),
     
    70517077    memmove(&(strat->ecartS[atS+1]), &(strat->ecartS[atS]),
    70527078            (strat->sl - atS + 1)*sizeof(int));
    7053     memmove(&(strat->fromS[atS+1]), &(strat->fromS[atS]),
    7054             (strat->sl - atS + 1)*sizeof(int));
    70557079    memmove(&(strat->sevS[atS+1]), &(strat->sevS[atS]),
    70567080            (strat->sl - atS + 1)*sizeof(unsigned long));
     
    70687092      strat->S[i] = strat->S[i-1];
    70697093      strat->ecartS[i] = strat->ecartS[i-1];
    7070       strat->fromS[i] = strat->fromS[i-1];
    70717094      strat->sevS[i] = strat->sevS[i-1];
    70727095      strat->S_2_R[i] = strat->S_2_R[i-1];
     
    71157138  }
    71167139  strat->ecartS[atS] = p.ecart;
    7117   strat->fromS[atS] = p.from;
    71187140  strat->S_2_R[atS] = atR;
    71197141  strat->sl++;
     
    72017223}
    72027224
     7225
    72037226/*2
    72047227* puts signature p.sig to the set syz
    72057228*/
    7206 void enterSyz(LObject p, kStrategy strat)
    7207 {
    7208   int i = strat->syzl;
    7209 
     7229void enterSyz(LObject p, kStrategy strat, int atT)
     7230{
     7231  int i;
    72107232  strat->newt = TRUE;
    72117233  if (strat->syzl == strat->syzmax)
     
    72187240    strat->syzmax += setmaxTinc;
    72197241  }
     7242  if (atT < strat->syzl-1)
     7243  {
     7244#ifdef ENTER_USE_MEMMOVE
     7245    memmove(&(strat->syz[atT+1]), &(strat->syz[atT]),
     7246            (strat->syzl-atT+1)*sizeof(poly));
     7247    memmove(&(strat->sevSyz[atT+1]), &(strat->sevSyz[atT]),
     7248            (strat->syzl-atT+1)*sizeof(unsigned long));
     7249#endif
     7250    for (i=strat->syzl; i>=atT+1; i--)
     7251    {
     7252#ifndef ENTER_USE_MEMMOVE
     7253      strat->syz[i] = strat->syz[i-1];
     7254      strat->sevSyz[i] = strat->sevSyz[i-1];
     7255#endif
     7256    }
     7257  }
     7258  i = strat->syzl;
     7259  //i = atT;
    72207260  strat->syz[i] = p.sig;
    72217261  strat->sevSyz[i] = p.sevSig;
     
    72297269  while (cc>-1)
    72307270  {
    7231     if (p_LmShortDivisibleBy( strat->syz[strat->syzl-1], strat->sevSyz[strat->syzl-1],
     7271    if (p_LmShortDivisibleBy( strat->syz[atT], strat->sevSyz[atT],
    72327272                              strat->L[cc].sig, ~strat->L[cc].sevSig, currRing))
    72337273    {
     
    72367276    cc--;
    72377277  }
    7238 
    72397278}
    72407279
     
    77477786  omFreeSize(strat->sevT, (strat->tmax)*sizeof(unsigned long));
    77487787  omFreeSize(strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
    7749   omFreeSize(strat->fromS,IDELEMS(strat->Shdl)*sizeof(int));
    77507788  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
    77517789  omFreeSize((ADDRESS)strat->sevSig,IDELEMS(strat->Shdl)*sizeof(unsigned long));
  • kernel/kutil.h

    r88bb88 r32f7e5  
    180180public:
    181181  unsigned long sev;
    182   unsigned long from; // from which polynomial it comes from
    183             // this is important for signature-based
    184             // algorithms
     182  unsigned long from; // index in sig up to which the correspongin LObject was already checked
    185183  unsigned long checked; // this is the index of S up to which
    186184                      // the corresponding LObject was already checked in
     
    290288  void (*chainCrit) (poly p,int ecart,kStrategy strat);
    291289  BOOLEAN (*syzCrit) (poly sig, unsigned long not_sevSig, kStrategy strat);
    292   BOOLEAN (*rewCrit1) (poly sig, unsigned long not_sevSig, kStrategy strat, int start /*= 0*/);
    293   BOOLEAN (*rewCrit2) (poly sig, unsigned long not_sevSig, kStrategy strat, int start /*= 0*/);
     290  BOOLEAN (*rewCrit1) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
     291  BOOLEAN (*rewCrit2) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
     292  BOOLEAN (*rewCrit3) (poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start /*= 0*/);
    294293  pFDegProc pOrigFDeg;
    295294  pLDegProc pOrigLDeg;
     
    447446int posInLSig (const LSet set, const int length,
    448447               LObject* L,const kStrategy strat);
     448int posInSyz (const kStrategy strat, const poly sig);
    449449int posInL0 (const LSet set, const int length,
    450450             LObject* L,const kStrategy strat);
     
    521521void initSyzRules (kStrategy strat);
    522522void updateS(BOOLEAN toT,kStrategy strat);
    523 void enterSyz (LObject p,kStrategy strat);
     523void enterSyz (LObject p,kStrategy strat, int atT);
    524524void enterT (LObject p,kStrategy strat, int atT = -1);
    525525void cancelunit (LObject* p,BOOLEAN inNF=FALSE);
     
    545545BOOLEAN syzCriterion(poly sig, unsigned long not_sevSig, kStrategy strat);
    546546BOOLEAN syzCriterionInc(poly sig, unsigned long not_sevSig, kStrategy strat);
    547 KINLINE BOOLEAN arriRewDummy(poly sig, unsigned long not_sevSig, kStrategy strat, int start);
    548 BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, kStrategy strat, int start);
    549 BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, kStrategy strat, int start);
     547KINLINE BOOLEAN arriRewDummy(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
     548BOOLEAN arriRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
     549BOOLEAN arriRewCriterionPre(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
     550BOOLEAN faugereRewCriterion(poly sig, unsigned long not_sevSig, poly lm, kStrategy strat, int start);
    550551BOOLEAN findMinLMPair(poly sig, unsigned long not_sevSig, kStrategy strat, int start);
    551552// returns index of p in TSet, or -1 if not found
Note: See TracChangeset for help on using the changeset viewer.