Changeset b71400a in git for Singular/dyn_modules/gfanlib/initial.cc
- Timestamp:
- Sep 15, 2014, 11:08:21 AM (10 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/dyn_modules/gfanlib/initial.cc
r9c0326 rb71400a 36 36 for (int i=0; i<W.getHeight(); i++) 37 37 d[i] = wDeg(p,r,W[i]); 38 return d; 39 } 40 41 gfan::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]); 38 47 return d; 39 48 } … … 166 175 } 167 176 177 poly 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 168 204 /*** 169 205 * Runs the above procedure over all generators of an ideal. … … 179 215 } 180 216 217 ideal 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 } 181 224 182 225 #ifndef NDEBUG
Note: See TracChangeset
for help on using the changeset viewer.