Changeset 673fd0 in git
- Timestamp:
- Mar 9, 2018, 4:54:02 PM (5 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
- Children:
- d716d197c47435132c94ea960586a0aa872edc20
- Parents:
- 1ca84fd791c9b47186c4e1a2aec26ffb2206611a
- Location:
- Singular/LIB
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/fpaprops.lib
r1ca84f r673fd0 1278 1278 } 1279 1279 1280 proc isOrderingShiftInvariant(int withHoles)1281 "USAGE:1282 RETURN: int1283 ASSUME: - basering is a Letterplace ring.1284 "1285 {1286 int shiftInvariant = 1;1287 1288 int n = attrib(basering, "lV");1289 int d = attrib(basering, "uptodeg");1290 1291 ideal monomials;1292 if (withHoles) {1293 monomials = delete(lpMonomialsWithHoles(d-1), 1); // ignore the first element (1)1294 } else {1295 monomials = lpMaxIdeal(d-1, 0);1296 }1297 1298 for (int i = 1; i <= size(monomials); i++) {1299 poly monom = monomials[i];1300 int lastblock = lastBlock(monom);1301 for (int s = 1; s <= d - lastblock; s++) {1302 for (int s2 = 0; s2 < s; s2++) { // paranoid, check every pair1303 poly first = shiftPoly(monom,s2);1304 poly second = shiftPoly(monom,s);1305 if (!(first > second)) {1306 dbprint(string(first) + " <= " + string(second));1307 shiftInvariant = 0;1308 }1309 kill first; kill second;1310 } kill s2;1311 } kill s;1312 kill monom; kill lastblock;1313 } kill i;1314 1315 return(shiftInvariant);1316 }1317 example1318 {1319 "EXAMPLE:"; echo = 2;1320 ring r = 0,(x,y,z),dp;1321 def R = makeLetterplaceRing(5);1322 setring R;1323 isOrderingShiftInvariant(0);// should be 11324 1325 ring r = 0,(x,y,z),dp;1326 def R = makeLetterplaceRing(5);1327 list RL = ringlist(R);1328 RL[3][1][1] = "wp";1329 intvec weights = 1,1,1,1,1,1,1,2,3,1,1,1,1,1,1;1330 RL[3][1][2] = weights;1331 def Rw = setLetterplaceAttributes(ring(RL),5,3);1332 setring Rw;1333 printlevel = voice + 1;1334 isOrderingShiftInvariant(0);1335 isOrderingShiftInvariant(1);1336 }1337 1338 static proc lpMonomialsWithHoles(int d)1339 {1340 if (d < 0) {1341 ERROR("d must not be negative")1342 }1343 1344 ideal monomials = 1;1345 if (d == 0) {1346 return (monomials);1347 }1348 1349 int lV = attrib(basering, "lV"); // variable count1350 ideal prevMonomials = lpMonomialsWithHoles(d - 1);1351 1352 for (int i = 1; i <= size(prevMonomials); i++) {1353 /* if (deg(prevMonomials[i]) >= d - 1) { */1354 for (int j = 1; j <= lV; j++) {1355 poly m = prevMonomials[i];1356 m = m * var(j + (d-1)*lV);1357 monomials = monomials, m;1358 kill m;1359 } kill j;1360 /* } */1361 } kill i;1362 1363 if (d > 1) {1364 // removes the 11365 monomials[1] = 0;1366 monomials = simplify(monomials,2);1367 1368 monomials = prevMonomials, monomials;1369 }1370 return (monomials);1371 } -
Singular/LIB/freegb.lib
r1ca84f r673fd0 3495 3495 } 3496 3496 3497 3497 proc isOrderingShiftInvariant(int withHoles) 3498 "USAGE: 3499 RETURN: int 3500 ASSUME: - basering is a Letterplace ring. 3501 " 3502 { 3503 int shiftInvariant = 1; 3504 3505 int n = attrib(basering, "lV"); 3506 int d = attrib(basering, "uptodeg"); 3507 3508 ideal monomials; 3509 if (withHoles) { 3510 monomials = delete(lpMonomialsWithHoles(d-1), 1); // ignore the first element (1) 3511 } else { 3512 monomials = lpMaxIdeal(d-1, 0); 3513 } 3514 3515 for (int i = 1; i <= size(monomials); i++) { 3516 poly monom = monomials[i]; 3517 int lastblock = lastBlock(monom); 3518 for (int s = 1; s <= d - lastblock; s++) { 3519 for (int s2 = 0; s2 < s; s2++) { // paranoid, check every pair 3520 poly first = shiftPoly(monom,s2); 3521 poly second = shiftPoly(monom,s); 3522 if (!(first > second)) { 3523 dbprint(string(first) + " <= " + string(second)); 3524 shiftInvariant = 0; 3525 } 3526 kill first; kill second; 3527 } kill s2; 3528 } kill s; 3529 kill monom; kill lastblock; 3530 } kill i; 3531 3532 return(shiftInvariant); 3533 } 3534 example 3535 { 3536 "EXAMPLE:"; echo = 2; 3537 ring r = 0,(x,y,z),dp; 3538 def R = makeLetterplaceRing(5); 3539 setring R; 3540 isOrderingShiftInvariant(0);// should be 1 3541 3542 ring r = 0,(x,y,z),dp; 3543 def R = makeLetterplaceRing(5); 3544 list RL = ringlist(R); 3545 RL[3][1][1] = "wp"; 3546 intvec weights = 1,1,1,1,1,1,1,2,3,1,1,1,1,1,1; 3547 RL[3][1][2] = weights; 3548 def Rw = setLetterplaceAttributes(ring(RL),5,3); 3549 setring Rw; 3550 printlevel = voice + 1; 3551 isOrderingShiftInvariant(0); 3552 isOrderingShiftInvariant(1); 3553 } 3554 3555 static proc lpMonomialsWithHoles(int d) 3556 { 3557 if (d < 0) { 3558 ERROR("d must not be negative") 3559 } 3560 3561 ideal monomials = 1; 3562 if (d == 0) { 3563 return (monomials); 3564 } 3565 3566 int lV = attrib(basering, "lV"); // variable count 3567 ideal prevMonomials = lpMonomialsWithHoles(d - 1); 3568 3569 for (int i = 1; i <= size(prevMonomials); i++) { 3570 /* if (deg(prevMonomials[i]) >= d - 1) { */ 3571 for (int j = 1; j <= lV; j++) { 3572 poly m = prevMonomials[i]; 3573 m = m * var(j + (d-1)*lV); 3574 monomials = monomials, m; 3575 kill m; 3576 } kill j; 3577 /* } */ 3578 } kill i; 3579 3580 if (d > 1) { 3581 // removes the 1 3582 monomials[1] = 0; 3583 monomials = simplify(monomials,2); 3584 3585 monomials = prevMonomials, monomials; 3586 } 3587 return (monomials); 3588 } 3498 3589 3499 3590
Note: See TracChangeset
for help on using the changeset viewer.