Changeset 9053a74 in git


Ignore:
Timestamp:
Aug 5, 2010, 1:50:46 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
Children:
d50eb21c2697c056fe1918daf1a568d4c1a37da8
Parents:
99bdcf719779ed8127742694cda3e29f272e2683
Message:
tr 224: std(ideal,ideal)

git-svn-id: file:///usr/local/Singular/svn/trunk@13085 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/iparith.cc

    r99bdcf r9053a74  
    32923292  return FALSE;
    32933293}
     3294static BOOLEAN jjSTD_1(leftv res, leftv u, leftv v);
     3295static void jjSTD_1_ID(leftv res, ideal i0, int t0, ideal p0, attr a)
     3296/* destroys i0, p0 */
     3297/* result (with attributes) in res */
     3298/* i0: SB*/
     3299/* t0: type of p0*/
     3300/* p0 new elements*/
     3301/* a attributes of i0*/
     3302{
     3303  int tp;
     3304  if (t0==IDEAL_CMD) tp=POLY_CMD;
     3305  else               tp=VECTOR_CMD;
     3306  for (int i=IDELEMS(p0)-1; i>=0; i--)
     3307  {
     3308    poly p=p0->m[i];
     3309    p0->m[i]=NULL;
     3310    if (p!=NULL)
     3311    {
     3312      sleftv u0,v0;
     3313      memset(&u0,0,sizeof(sleftv));
     3314      memset(&v0,0,sizeof(sleftv));
     3315      v0.rtyp=tp;
     3316      v0.data=(void*)p;
     3317      u0.rtyp=t0;
     3318      u0.data=i0;
     3319      u0.attribute=a;
     3320      setFlag(&u0,FLAG_STD);
     3321      jjSTD_1(res,&u0,&v0);
     3322      i0=(ideal)res->data;
     3323      res->data=NULL;
     3324      a=res->attribute;
     3325      res->attribute=NULL;
     3326      u0.CleanUp();
     3327      v0.CleanUp();
     3328      res->CleanUp();
     3329    }
     3330  }
     3331  idDelete(&p0);
     3332  res->attribute=a;
     3333  res->data=(void *)i0;
     3334  res->rtyp=t0;
     3335}
    32943336static BOOLEAN jjSTD_1(leftv res, leftv u, leftv v)
    32953337{
     
    33033345    i0=idInit(1,i1->rank); // TODO: rank is wrong (if v is a vector!)
    33043346    i0->m[0]=(poly)v->Data();
    3305   }
    3306   else /*IDEAL*/
    3307   {
    3308     i0=(ideal)v->CopyD(); // TODO: memory leak? !
    3309   }
    3310   int ii0=idElem(i0); /* size of i0 */
    3311   int ii1=idElem(i1); /* size of i1 */
    3312   i1=idSimpleAdd(i1,i0); //
    3313   memset(i0->m,0,sizeof(poly)*IDELEMS(i0)); // TODO: memory leak? !!
    3314   idDelete(&i0);
    3315   intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
    3316   tHomog hom=testHomog;
    3317 
    3318   if (w!=NULL)
    3319   {
    3320     if (!idTestHomModule(i1,currQuotient,w))
    3321     {
    3322       // no warnung: this is legal, if i in std(i,p)
    3323       // is homogeneous, but p not
    3324       w=NULL;
    3325     }
    3326     else
    3327     {
    3328       w=ivCopy(w);
    3329       hom=isHomog;
    3330     }
    3331   }
    3332   BITSET save_test=test;
    3333   test|=Sy_bit(OPT_SB_1);
    3334   /* ii0 appears to be the position of the first element of il that
    3335      does not belong to the old SB ideal */
    3336   result=kStd(i1,currQuotient,hom,&w,NULL,0,ii0);
    3337   test=save_test;
    3338   idDelete(&i1);
    3339   idSkipZeroes(result);
    3340   res->data = (char *)result;
     3347    int ii0=idElem(i0); /* size of i0 */
     3348    i1=idSimpleAdd(i1,i0); //
     3349    memset(i0->m,0,sizeof(poly)*IDELEMS(i0));
     3350    idDelete(&i0);
     3351    intvec *w=(intvec *)atGet(u,"isHomog",INTVEC_CMD);
     3352    tHomog hom=testHomog;
     3353
     3354    if (w!=NULL)
     3355    {
     3356      if (!idTestHomModule(i1,currQuotient,w))
     3357      {
     3358        // no warnung: this is legal, if i in std(i,p)
     3359        // is homogeneous, but p not
     3360        w=NULL;
     3361      }
     3362      else
     3363      {
     3364        w=ivCopy(w);
     3365        hom=isHomog;
     3366      }
     3367    }
     3368    BITSET save_test=test;
     3369    test|=Sy_bit(OPT_SB_1);
     3370    /* ii0 appears to be the position of the first element of il that
     3371       does not belong to the old SB ideal */
     3372    result=kStd(i1,currQuotient,hom,&w,NULL,0,ii0);
     3373    test=save_test;
     3374    idDelete(&i1);
     3375    idSkipZeroes(result);
     3376    if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
     3377    res->data = (char *)result;
     3378  }
     3379  else /*IDEAL/MODULE*/
     3380  {
     3381    attr a=NULL;
     3382    if (u->attribute!=NULL) a=u->attribute->Copy();
     3383    jjSTD_1_ID(res,(ideal)u->CopyD(),r,(ideal)v->CopyD(),a);
     3384  }
    33413385  if(!TEST_OPT_DEGBOUND) setFlag(res,FLAG_STD);
    3342   if (w!=NULL) atSet(res,omStrDup("isHomog"),w,INTVEC_CMD);
    33433386  return FALSE;
    33443387}
Note: See TracChangeset for help on using the changeset viewer.