Changeset 04d263 in git


Ignore:
Timestamp:
Dec 17, 2018, 7:55:10 AM (5 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
Children:
178bd314b094b88f138dbec9672178af0208dc44
Parents:
b79a7b8c27d91ed198f466f037bf00be2240c054
Message:
Fix lpGlDimBound
Location:
Singular/LIB
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/fpaprops.lib

    rb79a7b r04d263  
    10011001  // delete variables in LM(G1) from the ring
    10021002  def save = basering;
    1003   ring R = basering;
     1003  def R = basering;
    10041004  if (size(G1) > 0) {
    10051005    while (size(G1) > 0) {
    10061006      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 */
    10081012        ideal G1 = imap(save,G1);
    10091013        G1 = simplify(G1, 2); // remove zero generators
     
    10791083  list LG = lpId2ivLi(lead(G));
    10801084  int n = lpBlockSize(basering);
    1081   int degbound = attrib(basering, "uptodeg");
     1085  int degbound = lpDegBound(basering);
    10821086
    10831087  list V;
     
    13761380}
    13771381
    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  
    32413241  int shiftInvariant = 1;
    32423242
    3243   int n = lpDegBound(basering);
    32443243  int d = lpDegBound(basering);
    32453244
Note: See TracChangeset for help on using the changeset viewer.