Changeset 23ca1f7 in git


Ignore:
Timestamp:
Aug 31, 2016, 2:53:53 PM (7 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
Children:
9a1960b6e0ed640233d9cfb3dc5fc29208eee68c
Parents:
e180f5613c396d33aa3316cd450d3a1e80d69129
Message:
fix: tr. #762 (hres(ideal(1),0))
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/syz2.cc

    re180f5 r23ca1f7  
    909909{
    910910  ideal reor,toreor;
    911   int i,j,k,l,m,togo;
     911  int k,l,m,togo;
    912912  syzstr->betti = new intvec(maxdeg,maxindex+1,0);
    913   (*syzstr->betti)[0] = 1;
    914   for (i=1;i<=syzstr->length;i++)
    915   {
    916     if ((syzstr->orderedRes[i]!=NULL) && !idIs0(syzstr->orderedRes[i]))
    917     {
    918       toreor = syzstr->orderedRes[i];
    919       k = IDELEMS(toreor);
    920       while ((k>0) && (toreor->m[k-1]==NULL)) k--;
    921       reor = idInit(k,toreor->rank);
    922       togo = IDELEMS(syzstr->res[i]);
    923       for (j=0;j<k;j++)
    924       {
    925         if (toreor->m[j]!=NULL) (IMATELEM(*syzstr->betti,p_FDeg(toreor->m[j],currRing)-i+1,i+1))++;
    926         reor->m[j] = toreor->m[j];
    927         toreor->m[j] = NULL;
    928       }
    929       m = 0;
    930       for (j=0;j<togo;j++)
    931       {
    932         if (syzstr->res[i]->m[j]!=NULL)
     913  if (syzstr->betti->length()>0)
     914  {
     915    (*syzstr->betti)[0] = 1;
     916    for (int i=1;i<=syzstr->length;i++)
     917    {
     918      if ((syzstr->orderedRes[i]!=NULL) && !idIs0(syzstr->orderedRes[i]))
     919      {
     920        toreor = syzstr->orderedRes[i];
     921        k = IDELEMS(toreor);
     922        while ((k>0) && (toreor->m[k-1]==NULL)) k--;
     923        reor = idInit(k,toreor->rank);
     924        togo = IDELEMS(syzstr->res[i]);
     925        for (int j=0;j<k;j++)
    933926        {
    934           l = 0;
    935           while ((l<k) && (syzstr->res[i]->m[j]!=reor->m[l])) l++;
    936           if (l<k)
     927          if (toreor->m[j]!=NULL) (IMATELEM(*syzstr->betti,p_FDeg(toreor->m[j],currRing)-i+1,i+1))++;
     928          reor->m[j] = toreor->m[j];
     929          toreor->m[j] = NULL;
     930        }
     931        m = 0;
     932        for (int j=0;j<togo;j++)
     933        {
     934          if (syzstr->res[i]->m[j]!=NULL)
    937935          {
    938             toreor->m[m] = reor->m[l];
    939             reor->m[l] = NULL;
    940             m++;
     936            l = 0;
     937            while ((l<k) && (syzstr->res[i]->m[j]!=reor->m[l])) l++;
     938            if (l<k)
     939            {
     940              toreor->m[m] = reor->m[l];
     941              reor->m[l] = NULL;
     942              m++;
     943            }
    941944          }
    942945        }
    943       }
    944       idDelete(&reor);
     946        idDelete(&reor);
     947      }
    945948    }
    946949  }
Note: See TracChangeset for help on using the changeset viewer.