Ignore:
Timestamp:
Sep 15, 2014, 11:08:21 AM (10 years ago)
Author:
Yue Ren <ren@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
dffd1541cc74564f509bd5d284948852484430b0
Parents:
9c03260ac0404405e4994f73b30ef46f079535d8
git-author:
Yue Ren <ren@mathematik.uni-kl.de>2014-09-15 11:08:21+02:00
git-committer:
Yue Ren <ren@mathematik.uni-kl.de>2015-02-06 13:47:05+01:00
Message:
chg: status update 15.09.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/dyn_modules/gfanlib/initial.cc

    r9c0326 rb71400a  
    3636  for (int i=0; i<W.getHeight(); i++)
    3737    d[i] = wDeg(p,r,W[i]);
     38  return d;
     39}
     40
     41gfan::ZVector WDeg(const poly p, const ring r, const gfan::ZVector w, const gfan::ZMatrix W)
     42{
     43  gfan::ZVector d = gfan::ZVector(W.getHeight()+1);
     44  d[0] = wDeg(p,r,w);
     45  for (int i=0; i<W.getHeight(); i++)
     46    d[i+1] = wDeg(p,r,W[i]);
    3847  return d;
    3948}
     
    166175}
    167176
     177poly initial(const poly p, const ring r, const gfan::ZVector w, const gfan::ZMatrix W)
     178{
     179  int n = rVar(r);
     180  poly q0 = p_Head(p,r);
     181  poly q1 = q0;
     182  gfan::ZVector d = WDeg(p,r,w,W);
     183  for (poly currentTerm = p->next; currentTerm; pIter(currentTerm))
     184  {
     185    gfan::ZVector e = WDeg(currentTerm,r,w,W);
     186    if (d<e)
     187    {
     188      p_Delete(&q0,r);
     189      q0 = p_Head(p,r);
     190      q1 = q0;
     191      d = e;
     192    }
     193    else
     194      if (d==e)
     195      {
     196        pNext(q1) = p_Head(currentTerm,r);
     197        pIter(q1);
     198      }
     199  }
     200  return q0;
     201}
     202
     203
    168204/***
    169205 * Runs the above procedure over all generators of an ideal.
     
    179215}
    180216
     217ideal initial(const ideal I, const ring r, const gfan::ZVector w, const gfan::ZMatrix W)
     218{
     219  int k = idSize(I); ideal inI = idInit(k);
     220  for (int i=0; i<k; i++)
     221    inI->m[i] = initial(I->m[i],r,w,W);
     222  return inI;
     223}
    181224
    182225#ifndef NDEBUG
Note: See TracChangeset for help on using the changeset viewer.