Changeset e7d857 in git
 Timestamp:
 Mar 9, 2018, 1:34:25 PM (5 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
 Children:
 ce5d1bd5855860c909fa9377861c9d1b7a8e52ba
 Parents:
 1af34f3a9d6f48f7bc59d937c310ee496a6c7258
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/freegb.lib
r1af34f re7d857 49 49 LIB "qhmoduli.lib"; // for Max 50 50 LIB "bfun.lib"; // for inForm 51 LIB "fpadim.lib"; // for intvec conversion 51 52 52 53 proc tstfreegb() … … 3276 3277 } 3277 3278 3279 proc lpDivision(poly p, ideal I) 3280 "ASSUME: I is a Groebner basis G = {g1,...,gN}, the original ring of the Letterplace ring has the name 'r' and no variable is called 'tag_i' for i in 1...N 3281 RETURN: list L 3282 NOTE:  L[1] NF(p,I) 3283  L[2] list of expressions [i,l_{ij},r_{ij}] with \sum_{i,j} l_{ij} g_i r_{ij} = p  NF(p,I) 3284 " 3285 { 3286 if (p == 0  size(I) == 0) { 3287 list L = 0; 3288 list empty; 3289 L[2] = empty; 3290 return (L); 3291 } 3292 poly pNF = lpNF(p,I); 3293 p = p  pNF; 3294 3295 // make new ring 3296 def save = basering; 3297 int norigvars = nvars(r); 3298 string tagvarstr = "(tag_1"; 3299 for (int i = 2; i <= size(I); i++) { 3300 tagvarstr = tagvarstr + ",tag_" + string(i); 3301 } 3302 tagvarstr = tagvarstr + ")"; 3303 string field = string(ringlist(r)[1]); 3304 execute("ring @tags = " + field + "," + tagvarstr + ",dp;"); 3305 ring @tagged = (r + @tags); 3306 def @R = makeLetterplaceRing(attrib(save,"uptodeg")); setring @R; 3307 3308 // restore vars 3309 poly p = imap(save, p); 3310 poly pNF = imap(save, pNF); 3311 ideal I = imap(save, I); 3312 for (int i = 1; i <= size(I); i++) { 3313 I[i] = I[i] + var(norigvars + i); 3314 } 3315 3316 list summands; 3317 list L = pNF; 3318 poly pTaggedNF = lpNF(p,I); 3319 pTaggedNF = pTaggedNF * leadcoef(p); // somehow pTaggedNF gets normalized 3320 for (int i = 1; i <= size(pTaggedNF); i++) { 3321 intvec iv = lp2iv(pTaggedNF[i]); 3322 for (int j = 1; j <= size(iv); j++) { 3323 if (iv[j] > norigvars) { 3324 intvec left; 3325 intvec right; 3326 if (j > 1) { 3327 left = iv[1..(j1)]; 3328 } 3329 if (j < size(iv)) { 3330 right = iv[(j+1)..size(iv)]; 3331 } 3332 list summand = (iv[j]  norigvars), leadcoef(pTaggedNF[i])*iv2lp(left), iv2lp(right); 3333 summands = insert(summands, summand, size(summands)); 3334 break; 3335 } 3336 } 3337 } 3338 3339 L[2] = summands; 3340 3341 setring save; 3342 list L = imap(@R,L); 3343 return(L); 3344 } 3345 3346 proc lpGBPres2Poly(list L, ideal I) 3347 "ASSUME: L is a valid Groebner presentation as for example the result of lpDivision 3348 RETURN: poly 3349 NOTE: computes p = \sum_{i,j} l_{ij} g_i r_{ij} + NF(p,I) = \sum_{i} L[2][i][2] I[L[2][i][1]] L[2][i][3] + L[1] 3350 " 3351 { 3352 poly p; 3353 for (int i = 1; i <= size(L[2]); i++) { 3354 p = p + lpMult(lpMult(L[2][i][2], I[L[2][i][1]]), L[2][i][3]); 3355 } 3356 p = p + L[1]; 3357 return (p); 3358 } 3359 3278 3360 //procedures to convert monomials into the DVec representation, all static 3279 3361 ////////////////////////////////////////////////////////
Note: See TracChangeset
for help on using the changeset viewer.