Changeset 91a72f in git


Ignore:
Timestamp:
Apr 13, 2011, 3:35:36 PM (13 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '38077648e7239f98078663eb941c3c979511150a')
Children:
2e4757cb3bb4e3e260951de51923af15aff13d29
Parents:
2e7dee867c4d33510424b140e95164e94fb8ef8b
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2011-04-13 15:35:36+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:12:31+01:00
Message:
fix intvec *id_Sort(ideal id,BOOLEAN nolex, const ring r)
Location:
libpolys/polys
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpolys/polys/simpleideals.cc

    r2e7dee r91a72f  
    403403
    404404#ifdef PDEBUG
    405 void idDBTest(ideal h1, int level, const char *f,const int l)
     405void id_DBTest(ideal h1, int level, const char *f,const int l, const ring r)
    406406{
    407407  int i;
     
    414414    /* to be able to test matrices: */
    415415    for (i=(h1->ncols*h1->nrows)-1; i>=0; i--)
    416       _p_Test(h1->m[i], currRing, level);
    417     int new_rk=idRankFreeModule(h1);
     416      _p_Test(h1->m[i], r, level);
     417    int new_rk=id_RankFreeModule(h1,r);
    418418    if(new_rk > h1->rank)
    419419    {
     
    437437  if (nolex)
    438438  {
    439     int r=pLmCmp(a,b);
     439    int r=p_LmCmp(a,b,r);
    440440    if (r!=0) return r;
    441     number h=nSub(pGetCoeff(a),pGetCoeff(b));
    442     r = -1+nIsZero(h)+2*nGreaterZero(h); /* -1: <, 0:==, 1: > */
    443     nDelete(&h);
     441    number h=n_Sub(pGetCoeff(a),pGetCoeff(b),r->cf);
     442    r = -1+n_IsZero(h,r->cf)+2*n_GreaterZero(h,r->cf); /* -1: <, 0:==, 1: > */
     443    n_Delete(&h, r->cf);
    444444    return r;
    445445  }
    446446  int l=rVar(r);
    447   while ((l>0) && (pGetExp(a,l)==pGetExp(b,l))) l--;
     447  while ((l>0) && (p_GetExp(a,l,r)==pGetExp(b,l,r))) l--;
    448448  if (l==0)
    449449  {
    450     if (pGetComp(a)==pGetComp(b))
    451     {
    452       number h=nSub(pGetCoeff(a),pGetCoeff(b));
    453       int r = -1+nIsZero(h)+2*nGreaterZero(h); /* -1: <, 0:==, 1: > */
    454       nDelete(&h);
     450    if (p_GetComp(a,r)==p_GetComp(b,r))
     451    {
     452      number h=n_Sub(pGetCoeff(a),pGetCoeff(b),r->cf);
     453      int r = -1+n_IsZero(h,r->cf)+2*n_GreaterZero(h,r->cf); /* -1: <, 0:==, 1: > */
     454      n_Delete(&h,r->cf);
    455455      return r;
    456456    }
    457     if (pGetComp(a)>pGetComp(b)) return 1;
    458   }
    459   else if (pGetExp(a,l)>pGetExp(b,l))
     457    if (p_GetComp(a,r)>p_GetComp(b,r)) return 1;
     458  }
     459  else if (p_GetExp(a,l,r)>p_GetExp(b,l,r))
    460460    return 1;
    461461  return -1;
     
    466466*uses lex-ordering when nolex = FALSE
    467467*/
    468 intvec *idSort(ideal id,BOOLEAN nolex)
     468intvec *id_Sort(ideal id,BOOLEAN nolex, const ring r)
    469469{
    470470  poly p,q;
     
    482482      diff = (actpos+1) / 2;
    483483      diff = (diff+1) / 2;
    484       lastcomp = pComp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex);
     484      lastcomp = p_Comp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex,r);
    485485      if (lastcomp<0)
    486486      {
     
    498498      while (notFound && (newpos>=0) && (newpos<actpos))
    499499      {
    500         newcomp = pComp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex);
     500        newcomp = p_Comp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex,r);
    501501        olddiff = diff;
    502502        if (diff>1)
     
    545545      if (newpos<0) newpos = 0;
    546546      if (newpos>actpos) newpos = actpos;
    547       while ((newpos<actpos) && (pComp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex)==0))
     547      while ((newpos<actpos) && (p_Comp_RevLex(id->m[i],id->m[(*result)[newpos]],nolex,r)==0))
    548548        newpos++;
    549549      for (j=actpos;j>newpos;j--)
  • libpolys/polys/simpleideals.h

    r2e7dee r91a72f  
    7171#endif
    7272
    73 ideal id_Copy (ideal h1,const ring r);
    7473#ifdef PDEBUG
    7574ideal id_DBCopy(ideal h1,const char *f,int l, const ring r);
    7675#define id_Copy(A,R) id_DBCopy(A,__FILE__,__LINE__,R)
     76#else
     77ideal id_Copy (ideal h1,const ring r);
    7778#endif
    7879  /*adds two ideals without simplifying the result*/
     
    99100void id_DelDiv(ideal id, const ring r);
    100101BOOLEAN id_IsConstant(ideal id, const ring r);
     102intvec *id_Sort(ideal id,BOOLEAN nolex, const ring r);
    101103
    102104#endif
Note: See TracChangeset for help on using the changeset viewer.