Changeset e07fa9 in git


Ignore:
Timestamp:
May 30, 2016, 5:04:07 PM (8 years ago)
Author:
Adi Popescu <adi_popescum@…>
Branches:
(u'spielwiese', '5b153614cbc72bfa198d75b1e9e33dab2645d9fe')
Children:
f7bea23987abbaaa9c84481f22f59611ceb0e522
Parents:
2f028dd4b166529bf248a0c0616012602dbd2939
Message:
add: posInIdealMonFirst
Location:
kernel/GBEngine
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • kernel/GBEngine/kutil.cc

    r2f028d re07fa9  
    46884688  }
    46894689}
     4690
     4691// sorts by degree and pLtCmp in the block between start,end;
     4692// but puts pure monomials at the beginning
     4693int posInIdealMonFirst (const ideal F, const poly p,int start,int end)
     4694{
     4695  if(end < 0 || end >= IDELEMS(F))
     4696    end = IDELEMS(F);
     4697  if (end<0) return 0;
     4698  if(pNext(p) == NULL) return start;
     4699  polyset set=F->m;
     4700  int o = p_Deg(p,currRing);
     4701  int op;
     4702  int i;
     4703  int an = start;
     4704  for(i=start;i<end;i++)
     4705    if(set[i] != NULL && pNext(set[i]) == NULL)
     4706      an++;
     4707  if(an == end-1)
     4708    return end;
     4709  int en= end;
     4710  loop
     4711  {
     4712    if(an>=en)
     4713      return en;
     4714    if (an == en-1)
     4715    {
     4716      op = p_Deg(set[an],currRing);
     4717      if ((op < o)
     4718      || ((op == o) && (pLtCmp(set[an],p) == -1)))
     4719        return en;
     4720      return an;
     4721    }
     4722    i=(an+en) / 2;
     4723    op = p_Deg(set[i],currRing);
     4724    if ((op < o)
     4725    || ((op == o) && (pLtCmp(set[i],p) == -1)))
     4726      an=i;
     4727    else
     4728      en=i;
     4729  }
     4730}
     4731
    46904732
    46914733/*2
  • kernel/GBEngine/kutil.h

    r2f028d re07fa9  
    428428int posInSMonFirst (const kStrategy strat, const int length, const poly p,
    429429            const int ecart_p);
     430int posInIdealMonFirst (const ideal F, const poly p,int start = 0,int end = -1);
    430431int posInT0 (const TSet set,const int length,LObject &p);
    431432int posInT1 (const TSet set,const int length,LObject &p);
Note: See TracChangeset for help on using the changeset viewer.