Changeset 11416e in git for kernel


Ignore:
Timestamp:
May 27, 2016, 1:08:52 PM (8 years ago)
Author:
Adi Popescu <adi_popescum@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'c5facdfddea2addfd91babd8b9019161dea4b695')
Children:
48cbb08675244a2938cd9318ad2f38b0c70e5172
Parents:
d6e0c0fd81f7fba2ec29faa8a27186e0133b2293
Message:
add: posInLSigRing
add: messageSba
Location:
kernel/GBEngine
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kspoly.cc

    rd6e0c0 r11416e  
    280280        //The sigs have the same lm, have to substract
    281281        PR->sig = pSub(PR->sig, pCopy(sigMult));
     282        pDelete(&sigMult);
    282283        //It may happen that now the signature is 0 (drop)
    283284        if(PR->sig == NULL)
     
    288289          strat->sigdrop=TRUE;
    289290        }
    290       }
    291       else
    292       {
    293         if(sigSafe == -1)
     291        else
    294292        {
    295           // do not allow this reduction - it will increase it's signature
    296           // and the partially standard basis is just till the old sig, not the new one
    297           PR->is_redundant = TRUE;
    298           return 3;
     293          if(sigSafe == -1)
     294          {
     295            // do not allow this reduction - it will increase it's signature
     296            // and the partially standard basis is just till the old sig, not the new one
     297            PR->is_redundant = TRUE;
     298            return 3;
     299          }
    299300        }
    300301      }
     
    302303    #endif
    303304    //pDelete(&f1);
    304     pDelete(&sigMult);
    305305    // go on with the computations only if the signature of p2 is greater than the
    306306    // signature of fm*p1
  • kernel/GBEngine/kstd1.cc

    rd6e0c0 r11416e  
    25642564        r=sba(F,Q,NULL,hilb,strat);
    25652565        #if ADIDEBUG
    2566         printf("\nSBA Run 1: %i elements (syzCrit = %i)\n",IDELEMS(r),strat->nrsyzcrit);
     2566        printf("\nSBA Run 1: %i elements (syzCrit = %i,rewCrit = %i)\n",IDELEMS(r),strat->nrsyzcrit,strat->nrrewcrit);
    25672567        //idPrint(r);
    25682568        //getchar();
     
    25732573          r=sba(r,Q,NULL,hilb,strat);
    25742574          #if ADIDEBUG
    2575           printf("SBA Run %i: %i elements (syzCrit = %i)\n",sbarun++,IDELEMS(r),strat->nrsyzcrit);
     2575          printf("SBA Run %i: %i elements (syzCrit = %i,rewCrit = %i)\n",sbarun++,IDELEMS(r),strat->nrsyzcrit,strat->nrrewcrit);
    25762576          //idPrint(r);
    25772577          //getchar();
  • kernel/GBEngine/kstd2.cc

    rd6e0c0 r11416e  
    16561656    printf("\n   list   L\n");
    16571657    int iii;
    1658     #if 1
     1658    #if 0
    16591659    for(iii = 0; iii<= strat->Ll; iii++)
    16601660    {
     
    16721672    }
    16731673    #endif
    1674     #if 1
     1674    #if 0
    16751675    for(iii = 0; iii<= strat->Bl; iii++)
    16761676    {
     
    20492049    strat->sigdrop = FALSE;
    20502050  strat->nrsyzcrit = 0;
     2051  strat->nrrewcrit = 0;
    20512052  #endif
    20522053#if SBA_INTERRED_START
     
    21652166    }
    21662167    #endif
    2167     //getchar();
     2168    getchar();
    21682169    #endif
    21692170    if (strat->Ll > lrmax) lrmax =strat->Ll;/*stat.*/
     
    23482349        #endif
    23492350        strat->enterS(strat->P, 0, strat, strat->tl);
     2351        if (TEST_OPT_PROT)
     2352          PrintS("-");
    23502353        break;
    23512354      }
     
    23652368    }
    23662369#endif
     2370    if (TEST_OPT_PROT)
     2371    {
     2372      if(strat->P.p != NULL)
     2373        message((strat->honey ? strat->P.ecart : 0) + strat->P.pFDeg(),
     2374                &olddeg,&reduc,strat, red_result);
     2375      else
     2376        message((strat->honey ? strat->P.ecart : 0),
     2377                &olddeg,&reduc,strat, red_result);
     2378    }
    23672379
    23682380    if (strat->overflow)
     
    28252837//    }
    28262838//  }
    2827   if (TEST_OPT_PROT) messageStat(hilbcount,strat);
     2839  if (TEST_OPT_PROT) messageStatSBA(hilbcount,strat);
    28282840  if (Q!=NULL) updateResult(strat->Shdl,Q,strat);
    28292841#if SBA_PRINT_SIZE_G
  • kernel/GBEngine/kutil.cc

    rd6e0c0 r11416e  
    55225522               LObject* p,const kStrategy /*strat*/)
    55235523{
    5524 if (length<0) return 0;
    5525 if (pLtCmp(set[length].sig,p->sig)== currRing->OrdSgn)
    5526   return length+1;
    5527 
    5528 int i;
    5529 int an = 0;
    5530 int en= length;
    5531 loop
    5532 {
    5533   if (an >= en-1)
    5534   {
    5535     if (pLtCmp(set[an].sig,p->sig) == currRing->OrdSgn) return en;
    5536     return an;
    5537   }
    5538   i=(an+en) / 2;
    5539   if (pLtCmp(set[i].sig,p->sig) == currRing->OrdSgn) an=i;
    5540   else                                      en=i;
    5541   /*aend. fuer lazy == in !=- machen */
    5542 }
     5524  if (length<0) return 0;
     5525  if (pLtCmp(set[length].sig,p->sig)== currRing->OrdSgn)
     5526    return length+1;
     5527
     5528  int i;
     5529  int an = 0;
     5530  int en= length;
     5531  loop
     5532  {
     5533    if (an >= en-1)
     5534    {
     5535      if (pLtCmp(set[an].sig,p->sig) == currRing->OrdSgn) return en;
     5536      return an;
     5537    }
     5538    i=(an+en) / 2;
     5539    if (pLtCmp(set[i].sig,p->sig) == currRing->OrdSgn) an=i;
     5540    else                                      en=i;
     5541    /*aend. fuer lazy == in !=- machen */
     5542  }
     5543}
     5544//sorts the pair list in this order: pLtCmp on the sigs, FDeg, pLtCmp on the polys
     5545int posInLSigRing (const LSet set, const int length,
     5546               LObject* p,const kStrategy /*strat*/)
     5547{
     5548  assume(currRing->OrdSgn == 1 && rField_is_Ring(currRing));
     5549  if (length<0) return 0;
     5550  if (pLtCmp(set[length].sig,p->sig)== 1)
     5551    return length+1;
     5552
     5553  int an,en,i;
     5554  an = 0;
     5555  en = length+1;
     5556  int cmp;
     5557  loop
     5558  {
     5559    if (an >= en-1)
     5560    {
     5561      if(an == en)
     5562        return en;
     5563      cmp = pLtCmp(set[an].sig,p->sig);
     5564      if (cmp == 1)
     5565        return en;
     5566      if (cmp == -1)
     5567        return an;
     5568      if (cmp == 0)
     5569      {
     5570         if (set[an].FDeg > p->FDeg)
     5571          return en;
     5572         if (set[an].FDeg < p->FDeg)
     5573          return an;
     5574         if (set[an].FDeg == p->FDeg)
     5575         {
     5576            cmp = pLtCmp(set[an].p,p->p);
     5577            if(cmp == 1)
     5578              return en;
     5579            else
     5580              return an;
     5581         }
     5582      }
     5583    }
     5584    i=(an+en) / 2;
     5585    cmp = pLtCmp(set[i].sig,p->sig);
     5586    if (cmp == 1)
     5587      an = i;
     5588    if (cmp == -1)
     5589      en = i;
     5590    if (cmp == 0)
     5591    {
     5592       if (set[i].FDeg > p->FDeg)
     5593        an = i;
     5594       if (set[i].FDeg < p->FDeg)
     5595        en = i;
     5596       if (set[i].FDeg == p->FDeg)
     5597       {
     5598          cmp = pLtCmp(set[i].p,p->p);
     5599          if(cmp == 1)
     5600            an = i;
     5601          else
     5602            en = i;
     5603       }
     5604    }
     5605  }
    55435606}
    55445607
     
    64676530      printf("\nFaugere RewCrit: * divisible by *\n");pWrite(sig);pWrite(strat->sig[k]);
    64686531      #endif
     6532      strat->nrrewcrit++;
    64696533      return TRUE;
    64706534    }
     
    70837147  //Print("%d/%d polynomials in set L (for lazy alg.)",lrmax+1,strat->Lmax);
    70847148  Print("product criterion:%d chain criterion:%d\n",strat->cp,strat->c3);
     7149  if (hilbcount!=0) Print("hilbert series criterion:%d\n",hilbcount);
     7150  /* in usual case strat->cv is 0, it gets changed only in shift routines */
     7151  if (strat->cv!=0) Print("shift V criterion:%d\n",strat->cv);
     7152  /*mflush();*/
     7153}
     7154
     7155void messageStatSBA (int hilbcount,kStrategy strat)
     7156{
     7157  //PrintS("\nUsage/Allocation of temporary storage:\n");
     7158  //Print("%d/%d polynomials in standard base\n",srmax,IDELEMS(Shdl));
     7159  //Print("%d/%d polynomials in set L (for lazy alg.)",lrmax+1,strat->Lmax);
     7160  Print("syz criterion:%d rew criterion:%d\n",strat->nrsyzcrit,strat->nrrewcrit);
     7161  //Print("product criterion:%d chain criterion:%d\n",strat->cp,strat->c3);
    70857162  if (hilbcount!=0) Print("hilbert series criterion:%d\n",hilbcount);
    70867163  /* in usual case strat->cv is 0, it gets changed only in shift routines */
     
    93999476  //strat->posInL     = posInLSig;
    94009477  strat->posInL     = posInLF5C;
     9478  if (rField_is_Ring(currRing))
     9479  {
     9480    strat->posInLSba  = posInLSigRing;
     9481    strat->posInL     = posInL11Ring;
     9482  }
    94019483  //strat->posInT     = posInTSig;
    94029484}
  • kernel/GBEngine/kutil.h

    rd6e0c0 r11416e  
    358358  bool sigdrop; //This is used to check sigdrop in sba over Z
    359359  int nrsyzcrit; // counts how many pairs are deleted by SyzCrit
     360  int nrrewcrit; // counts how many pairs are deleted by FaugereRewCrit
    360361  int sbaEnterS; // sba over Z strategy: if sigdrop element has _*gen(sbaEnterS+1), then
    361362                 // add directly sbaEnterS elements into S
     
    453454int posInLSig (const LSet set, const int length,
    454455               LObject* L,const kStrategy strat);
     456int posInLSigRing (const LSet set, const int length,
     457               LObject* L,const kStrategy strat);
    455458int posInLRing (const LSet set, const int length,
    456459               LObject* L,const kStrategy strat);
     
    519522void message (int i,int* reduc,int* olddeg,kStrategy strat,int red_result);
    520523void messageStat (int hilbcount,kStrategy strat);
     524void messageStatSBA (int hilbcount,kStrategy strat);
    521525#ifdef KDEBUG
    522526void messageSets (kStrategy strat);
Note: See TracChangeset for help on using the changeset viewer.