Changeset 04d263 in git
- Timestamp:
- Dec 17, 2018, 7:55:10 AM (5 years ago)
- Branches:
- (u'spielwiese', 'd1b01e9d51ade4b46b745d3bada5c5f3696be3a8')
- Children:
- 178bd314b094b88f138dbec9672178af0208dc44
- Parents:
- b79a7b8c27d91ed198f466f037bf00be2240c054
- Location:
- Singular/LIB
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/fpaprops.lib
rb79a7b r04d263 1001 1001 // delete variables in LM(G1) from the ring 1002 1002 def save = basering; 1003 ringR = basering;1003 def R = basering; 1004 1004 if (size(G1) > 0) { 1005 1005 while (size(G1) > 0) { 1006 1006 if (lpBlockSize(R) > 1) { 1007 ring R = lpDelVar(lp2iv(G1[1])[1]); // TODO replace with proper method 1007 def @R = R - string(G1[1]); 1008 R = @R; 1009 kill @R; 1010 setring R; 1011 /* ring R = lpDelVar(lp2iv(G1[1])[1]); // TODO replace with proper method */ 1008 1012 ideal G1 = imap(save,G1); 1009 1013 G1 = simplify(G1, 2); // remove zero generators … … 1079 1083 list LG = lpId2ivLi(lead(G)); 1080 1084 int n = lpBlockSize(basering); 1081 int degbound = attrib(basering, "uptodeg");1085 int degbound = lpDegBound(basering); 1082 1086 1083 1087 list V; … … 1376 1380 } 1377 1381 1378 // TODO: use original ring attrib to create a new letterplace ring 1379 // removes a variable from a letterplace ring (a bit of a hack) 1380 static proc lpDelVar(int index) { 1381 int lV = lpBlockSize(basering); // number of variables in the main block 1382 int d = attrib(basering, "uptodeg"); // degree bround 1383 list LR = ringlist(basering); 1384 1385 if (!(index >= 1 && index <= lV)) { return (basering); } // invalid index 1386 1387 // remove frome the variable list 1388 for (int i = (d-1)*lV + index; i >= 1; i = i - lV) { 1389 LR[2] = delete(LR[2], i); 1390 } kill i; 1391 1392 // remove from a ordering 1393 intvec aiv = LR[3][1][2]; 1394 aiv = aiv[1..(d*lV-d)]; 1395 LR[3][1][2] = aiv; 1396 1397 // remove block orderings 1398 int del = (lV - index); 1399 int cnt = -1; 1400 for (int i = size(LR[3]); i >= 2; i--) { 1401 if (LR[3][i][2] != 0) { 1402 for (int j = size(LR[3][i][2]); j >= 1; j--) { 1403 cnt++; // next 1 1404 if (cnt%lV == del) { 1405 // delete 1406 if (size(LR[3][i][2]) > 1) { // if we have more than one element left, delete one 1407 LR[3][i][2] = delete(LR[3][i][2],j); 1408 } else { // otherwise delete the whole block 1409 LR[3] = delete(LR[3], i); 1410 break; 1411 } 1412 } 1413 } kill j; 1414 } 1415 } kill i; 1416 1417 def R = setLetterplaceAttributes(ring(LR),d,lV-1); 1418 return (R); 1419 } 1420 example 1421 { 1422 "EXAMPLE:"; echo = 2; 1423 ring r = 0,(x,y,z),dp; 1424 def A = makeLetterplaceRing(3); 1425 setring A; A; 1426 def R = lpDelVar(2); setring R; R; 1427 } 1382 // no longer working with new interface and new orderings 1383 /* // TODO: use original ring attrib to create a new letterplace ring */ 1384 /* // removes a variable from a letterplace ring (a bit of a hack) */ 1385 /* static proc lpDelVar(int index) { */ 1386 /* int lV = lpBlockSize(basering); // number of variables in the main block */ 1387 /* int d = lpDegBound(basering); // degree bround */ 1388 /* list LR = ringlist(basering); */ 1389 1390 /* if (!(index >= 1 && index <= lV)) { return (basering); } // invalid index */ 1391 1392 /* // remove frome the variable list */ 1393 /* for (int i = (d-1)*lV + index; i >= 1; i = i - lV) { */ 1394 /* LR[2] = delete(LR[2], i); */ 1395 /* } kill i; */ 1396 1397 /* // remove from a ordering */ 1398 /* intvec aiv = LR[3][1][2]; */ 1399 /* aiv = aiv[1..(d*lV-d)]; */ 1400 /* LR[3][1][2] = aiv; */ 1401 1402 /* // remove block orderings */ 1403 /* int del = (lV - index); */ 1404 /* int cnt = -1; */ 1405 /* for (int i = size(LR[3]); i >= 2; i--) { */ 1406 /* if (LR[3][i][2] != 0) { */ 1407 /* for (int j = size(LR[3][i][2]); j >= 1; j--) { */ 1408 /* cnt++; // next 1 */ 1409 /* if (cnt%lV == del) { */ 1410 /* // delete */ 1411 /* if (size(LR[3][i][2]) > 1) { // if we have more than one element left, delete one */ 1412 /* LR[3][i][2] = delete(LR[3][i][2],j); */ 1413 /* } else { // otherwise delete the whole block */ 1414 /* LR[3] = delete(LR[3], i); */ 1415 /* break; */ 1416 /* } */ 1417 /* } */ 1418 /* } kill j; */ 1419 /* } */ 1420 /* } kill i; */ 1421 1422 /* def R = setLetterplaceAttributes(ring(LR),d,lV-1); */ 1423 /* return (R); */ 1424 /* } */ 1425 /* example */ 1426 /* { */ 1427 /* "EXAMPLE:"; echo = 2; */ 1428 /* ring r = 0,(x,y,z),dp; */ 1429 /* def A = makeLetterplaceRing(3); */ 1430 /* setring A; A; */ 1431 /* def R = lpDelVar(2); setring R; R; */ 1432 /* } */ -
Singular/LIB/freegb.lib
rb79a7b r04d263 3241 3241 int shiftInvariant = 1; 3242 3242 3243 int n = lpDegBound(basering);3244 3243 int d = lpDegBound(basering); 3245 3244
Note: See TracChangeset
for help on using the changeset viewer.