Changeset c5dc3d in git


Ignore:
Timestamp:
Nov 18, 1999, 7:43:58 PM (25 years ago)
Author:
Thomas Siebert <siebert@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '4188d308699580d975efd0f6cca8dcb41c396f70')
Children:
b47732ef9f553140e8a89c34abf89d850c8cf74f
Parents:
66502b8276a2e9122fc865791501fa86a14f2749
Message:
Bugfixes in syzygies


git-svn-id: file:///usr/local/Singular/svn/trunk@3857 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/syz.cc

    r66502b8 rc5dc3d  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: syz.cc,v 1.29 1999-11-16 12:39:31 obachman Exp $ */
     4/* $Id: syz.cc,v 1.30 1999-11-18 18:43:57 siebert Exp $ */
    55
    66/*
     
    408408  BOOLEAN completeMinim;
    409409  BOOLEAN oldDegBound=TEST_OPT_DEGBOUND;
     410  BOOLEAN setRegularity=TRUE;
    410411  int wlength=*length;
    411412
     
    458459    if (w!=NULL) { delete w;w=NULL; }
    459460    w = w1;
     461    j = 0;
     462    while ((j<IDELEMS(res[0])) && (res[0]->m[j]==NULL)) j++;
     463    if (j<IDELEMS(res[0]))
     464    {
     465      if (pFDeg(res[0]->m[j])!=pTotaldegree(res[0]->m[j]))
     466        setRegularity = FALSE;
     467    }
     468  }
     469  else
     470  {
     471    setRegularity = FALSE;
    460472  }
    461473   
     
    484496    }
    485497/*--- interreducing first -----------------------------------*/
     498    if (syzIndex>0)
     499    {
     500      int rkI=idRankFreeModule(res[syzIndex]);
     501      rSetSyzComp(rkI);
     502    }
    486503    if (minim || (syzIndex!=0))
    487504    {
    488       if (syzIndex>0)
    489       {
    490         int rkI=idRankFreeModule(res[syzIndex]);
    491         rSetSyzComp(rkI);
    492       }
    493505      temp = kInterRed(res[syzIndex],currQuotient);
    494506      idDelete(&res[syzIndex]);
     
    500512    if ((currQuotient==NULL)&&(syzIndex==0)&& (!TEST_OPT_DEGBOUND))
    501513    {
    502       res[/*syzIndex+*/1] = idSyzygies(res[0/*syzIndex*/],hom,&w,FALSE,TRUE,&Kstd1_deg);
     514      res[/*syzIndex+*/1] = idSyzygies(res[0/*syzIndex*/],hom,&w,FALSE,setRegularity,&Kstd1_deg);
    503515      if ((!TEST_OPT_NOTREGULARITY) && (Kstd1_deg>0)) test |= Sy_bit(OPT_DEGBOUND);
    504516    }
  • Singular/syz0.cc

    r66502b8 rc5dc3d  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: syz0.cc,v 1.25 1999-11-15 17:20:53 obachman Exp $ */
     4/* $Id: syz0.cc,v 1.26 1999-11-18 18:43:57 siebert Exp $ */
    55/*
    66* ABSTRACT: resolutions
     
    185185
    186186/*-------------initializing the sets--------------------*/
    187   ideal idF=(ideal)AllocSizeOf(ip_sideal);
     187  ideal idF=(ideal)Alloc0SizeOf(ip_sideal);
    188188  ST=(polyset)Alloc0(Fl*sizeof(poly));
    189189  S=(polyset)Alloc0(Fl*sizeof(poly));
     
    198198  tmax = 2*Fl;
    199199  idF->m=F;IDELEMS(idF)=Fmax;
     200  idF->nrows=1;
    200201  rkF=idRankFreeModule(idF);
    201   FreeSizeOf((ADDRESS)idF,ip_sideal);
    202202/*-------------sorting of F for index handling------------*/
    203203  if (noSort)
     
    206206    F=syInitSort(F,rkF,Fmax,1,&modcomp);
    207207  }
     208#ifndef __OPTIMIZE__
     209Print("Neue Anordnung: ");
     210idF->m=F;IDELEMS(idF)=Fmax;
     211idF->nrows=1;
     212idPrint(idF);
     213FreeSizeOf((ADDRESS)idF,ip_sideal);
     214#endif
    208215/*----------------construction of the new ordering----------*/
    209216  pSetSchreyerOrdM(F,Fl,rkF);
     
    910917        if ((currRing->OrdSgn != 1) && (hom!=isHomog))
    911918        {
    912           for (i=0; i<IDELEMS(res[1]); i++)
    913           {
    914             res[1]->m[i] = prMoveR( res[1]->m[i], origR);
     919          for (i=0; i<IDELEMS(res[0]); i++)
     920          {
     921            res[0]->m[i] = prMoveR( res[0]->m[i], origR);
    915922          }
    916923        }
     
    922929          }
    923930        }
    924         idTest(res[1]);
     931        idTest(res[0]);
    925932      }
    926933    }
  • Singular/syz2.cc

    r66502b8 rc5dc3d  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: syz2.cc,v 1.8 1999-11-15 17:20:54 obachman Exp $ */
     4/* $Id: syz2.cc,v 1.9 1999-11-18 18:43:58 siebert Exp $ */
    55/*
    66* ABSTRACT: resolutions
     
    4646#define USE_HEURISTIC2
    4747
    48 extern void rSetmS(poly p, int* Components, long* ShiftedComponents);
    4948#ifdef SHOW_CRIT
    5049static int crit;
     
    127126            p = pOne();
    128127            pLcm((syzstr->resPairs[index])[i].p,toHandle,p);
    129             rSetmS(p,Components, ShiftedComponents);
     128            pSetm(p);
    130129            j = 0;
    131130            while (j<i)
     
    232231          tso.p = NULL;
    233232          tso.length = -1;
    234           currcomponents = syzstr->truecomponents[index];
    235           currShiftedComponents = syzstr->ShiftedComponents[index];
    236           rChangeSComps(currcomponents,
    237                         currShiftedComponents,
    238                         IDELEMS(syzstr->res[index])); // actueller index
    239233          number coefgcd =
    240234            nGcd(pGetCoeff(tso.p1),pGetCoeff(tso.p2));
     
    252246          tso.syz = pAdd(pp,tso.syz);
    253247          nDelete(&coefgcd);
    254           currcomponents = syzstr->truecomponents[index-1];
    255           currShiftedComponents = syzstr->ShiftedComponents[index-1];
    256248          pSetComp(tso.lcm,pGetComp((syzstr->resPairs[index])[r1].syz));
    257           rChangeSComps(currcomponents,
    258                         currShiftedComponents,
    259                         IDELEMS(syzstr->res[index])); // actueller index
    260249#ifdef SHOW_PROT
    261250Print("erzeuge Paar im Modul %d,%d mit: \n",index,tso.order);
     
    292281* set the vectors of truecomponents
    293282*/
    294 static BOOLEAN syOrder_Hilb(poly p,syStrategy syzstr,int index,
    295                     int realcomp)
    296 {
    297   int i=IDELEMS(syzstr->res[index-1])+1,j=0,k,tc,orc,ie;
    298   int *trind1=syzstr->truecomponents[index-1];
    299   int *trind=syzstr->truecomponents[index];
    300   long *shind=syzstr->ShiftedComponents[index];
    301   poly pp;
    302   polyset o_r=syzstr->orderedRes[index]->m;
    303   BOOLEAN ret = FALSE;
    304 
    305   // if != 0, then new element can go into same component
    306   // i.e., we do not need to leave space in shifted components
    307   long same_comp = 0;
    308 
    309   if (p==NULL) return FALSE;
    310   if (realcomp==0) realcomp=1;
    311   ie = IDELEMS(syzstr->orderedRes[index]);
    312   while ((ie>0) && (syzstr->orderedRes[index]->m[ie-1]==NULL)) ie--;
    313   if (ie==0)
    314   {
    315     j = 0;
    316   }
    317   else
    318   {
    319     if (index>1)
    320       tc = trind1[pGetComp(p)];
    321     else
    322       tc = pGetComp(p);
    323     loop
    324     {
    325       orc = pGetComp(o_r[j]);
    326       if (trind1[orc]>tc+1) break;
    327       else if (trind1[orc] == tc+1)
    328       {
    329         same_comp = 1;
    330       }
    331       j++;
    332       if (j==ie) break;
    333     }
    334   }
    335   if (j == ie)
    336   {
    337     // new element is the last in ordered module
    338     if (same_comp == 0)
    339       same_comp = SYZ_SHIFT_BASE;
    340 
    341     // test wheter we have enough space for new shifted component
    342     if ((LONG_MAX - same_comp) <= shind[ie])
    343     {
    344       long new_space = syReorderShiftedComponents(shind, ie+1);
    345       assume((LONG_MAX - same_comp) > shind[ie]);
    346       ret = TRUE;
    347       if (TEST_OPT_PROT) Print("(T%u)", new_space);
    348     }
    349 
    350     // yes, then set new shifted component
    351     assume(ie == 0 || shind[ie] > 0);
    352     shind[ie+1] = shind[ie] + same_comp;
    353   }
    354   else
    355   {
    356     // new element must come in between
    357     // i.e. at place j+1
    358     long prev, next;
    359 
    360     // test whether new component can get shifted value
    361     prev = shind[j];
    362     next = shind[j+1];
    363     assume(next > prev);
    364     if ((same_comp && prev + 2 >= next) || (!same_comp && next - prev < 4))
    365     {
    366        long new_space = syReorderShiftedComponents(shind, ie+1);
    367       prev = shind[j];
    368       next = shind[j+1];
    369       assume((same_comp && prev + 2 < next) || (!same_comp && next - prev >= 4));
    370       ret = TRUE;
    371      if (TEST_OPT_PROT) Print("(B%u)", new_space);
    372     }
    373 
    374     // make room for insertion of j+1 shifted component
    375     for (k=ie+1; k > j+1; k--) shind[k] = shind[k-1];
    376 
    377     if (same_comp)
    378     {
    379       // can simply add one
    380       shind[j+1] = prev + 1;
    381       assume(shind[j+1] + 1 < shind[j+2]);
    382     }
    383     else
    384     {
    385       // need to leave more breathing room - i.e. value goes in
    386       // between
    387       shind[j+1]  = prev + ((next - prev) >> 1);
    388       assume (shind[j] + 1 < shind[j+1] && shind[j+1] + 1 < shind[j+2]);
    389     }
    390   }
    391 
    392   if (o_r[j]!=NULL)
    393   {
    394     for (k=ie;k>j;k--)
    395     {
    396       o_r[k] = o_r[k-1];
    397     }
    398   }
    399   o_r[j] = p;
    400   for (k=0;k<IDELEMS((syzstr->res)[index]);k++)
    401   {
    402     if (trind[k]>j)
    403       trind[k] += 1;
    404   }
    405   for (k=IDELEMS((syzstr->res)[index])-1;k>realcomp;k--)
    406     trind[k] = trind[k-1];
    407   trind[realcomp] = j+1;
    408   return ret;
     283static void syOrder_Hilb(poly p,syStrategy syzstr,int index)
     284{
     285  int i=IDELEMS(syzstr->orderedRes[index]);
     286
     287  while ((i>0) && (syzstr->orderedRes[index]->m[i-1]==NULL)) i--;
     288  syzstr->orderedRes[index]->m[i] = p;
    409289}
    410290
     
    435315  tso.syz = pHead(syz);
    436316  pSetComp(tso.syz,newEl+1);
     317  pSetm(tso.syz);
    437318  tso.lcm = pHead(tso.syz);
    438319  tso.length = pLength(syz);
    439   if (syOrder_Hilb(syz,syzstr,index,newEl+1))
    440     syResetShiftedComponents(syzstr, index+1,1);
    441   rSetmS(tso.syz,syzstr->truecomponents[index],syzstr->ShiftedComponents[index]);
     320  syOrder_Hilb(syz,syzstr,index);
    442321#ifdef SHOW_PROT
    443322Print("erzeuge Halbpaar im Module %d,%d mit: \n",index,tso.order);
     
    742621Print("syz: ");pWrite(redset[j].syz);
    743622#endif
    744             currcomponents = syzstr->truecomponents[index];
    745             currShiftedComponents = syzstr->ShiftedComponents[index];
    746             rChangeSComps(currcomponents,
    747                           currShiftedComponents,
    748                           IDELEMS(syzstr->res[index]));
    749623            sySPRedSyz(syzstr,redset[j],q);
    750             currcomponents = syzstr->truecomponents[index-1];
    751             currShiftedComponents = syzstr->ShiftedComponents[index-1];
    752             rChangeSComps(currcomponents,
    753                           currShiftedComponents,
    754                           IDELEMS(syzstr->res[index-1]));
    755624            number up = kBucketPolyRed(syzstr->bucket,redset[j].p,
    756625                         redset[j].length, NULL);
     
    771640        }
    772641        kBucketClear(syzstr->bucket,&tso.p,&tso.length);
    773         currcomponents = syzstr->truecomponents[index];
    774         currShiftedComponents = syzstr->ShiftedComponents[index];
    775         rChangeSComps(currcomponents,
    776                       currShiftedComponents,
    777                       IDELEMS(syzstr->res[index]));
    778642        int il;
    779643        kBucketClear(syzstr->syz_bucket,&tso.syz,&il);
    780         currcomponents = syzstr->truecomponents[index-1];
    781         currShiftedComponents = syzstr->ShiftedComponents[index-1];
    782         rChangeSComps(currcomponents,
    783                       currShiftedComponents,
    784                       IDELEMS(syzstr->res[index-1]));
    785644      }
    786645#ifdef SHOW_PROT
     
    816675        if (ks==IDELEMS(syzstr->res[index+1]))
    817676          syEnlargeFields(syzstr,index+1);
    818         currcomponents = syzstr->truecomponents[index];
    819         currShiftedComponents = syzstr->ShiftedComponents[index];
    820             rChangeSComps(currcomponents,
    821                           currShiftedComponents,
    822                           IDELEMS(syzstr->res[index]));
    823677        syzstr->res[index+1]->m[ks] = syRed_Hilb(tso.syz,syzstr,index+1);
    824         currcomponents = syzstr->truecomponents[index-1];
    825         currShiftedComponents = syzstr->ShiftedComponents[index-1];
    826             rChangeSComps(currcomponents,
    827                           currShiftedComponents,
    828                           IDELEMS(syzstr->res[index-1]));
    829678        if (syzstr->res[index+1]->m[ks]!=NULL)
    830679        {
     
    1104953 
    1105954  // Creare dp,S ring and change to it
    1106   syzstr->syRing = rCurrRingAssure_dp_S();
     955  syzstr->syRing = rCurrRingAssure_dp_C();
    1107956  assume(syzstr->syRing != origR);
    1108957
     
    1110959  currcomponents = (int*)Alloc0((arg->rank+1)*sizeof(int));
    1111960  currShiftedComponents = (long*)Alloc0((arg->rank+1)*sizeof(long));
    1112   for (i=0;i<=arg->rank;i++)
    1113   {
    1114     currShiftedComponents[i] = (i)*SYZ_SHIFT_BASE;
    1115     currcomponents[i] = i;
    1116   }
    1117   rChangeSComps(currcomponents, currShiftedComponents, arg->rank);
    1118961
    1119962/*--- initializes the data structures---------------*/
     
    11681011    else
    11691012      i = syInitSyzMod(syzstr,index);
    1170     currcomponents = syzstr->truecomponents[max(index-1,0)];
    1171     currShiftedComponents = syzstr->ShiftedComponents[max(index-1,0)];
    1172     rChangeSComps(currcomponents, currShiftedComponents,
    1173                   IDELEMS(syzstr->res[max(index-1,0)]));
    11741013    j = syInitSyzMod(syzstr,index+1);
    11751014    if (index>0)
Note: See TracChangeset for help on using the changeset viewer.