Changeset f75297 in git for Singular/LIB/fpadim.lib


Ignore:
Timestamp:
Mar 4, 2011, 1:01:27 AM (13 years ago)
Author:
Viktor Levandovskyy <levandov@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
8eea069dd83d32f7e8b90cd5e5ec75124c7d7903
Parents:
a8f29f505ce6c0d6ff17e0e4d9637d320299deee
Message:
*levandov: checkin from Aachen, bugfixes and improvements

git-svn-id: file:///usr/local/Singular/svn/trunk@13924 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/fpadim.lib

    ra8f29f rf75297  
    3838@*      on. The monomial x_1*x_3*x_2 for example will be stored as (1,3,2).
    3939@*      Multiplication is concatenation. Note that there is no algorithm for
    40 @*      computing the normal form yet, but for our case it is not needed.
     40@*      computing the normal form needed for our case.
    4141@*
    4242
     
    6464ivHilbert(L,n[,d]);        computes the Hilbert series of A/<L> in intvec format
    6565ivKDim(L,n[,d]);           computes the K-dimension of A/<L> in intvec format
     66ivMis2Base(M);             computes a K-basis of the factor algebra
    6667ivMis2Dim(M);              computes the K-dimension of the factor algebra
    6768ivOrdMisLex(M);            orders a list of intvecs lexicographically
     
    7475lpDimCheck(G);             checks if the K-dimension of A/<G> is infinite
    7576lpKDim(G[,d,n]);           computes the K-dimension of A/<G> in lp format
     77lpMis2Base(M);             computes a K-basis of the factor algebra
    7678lpMis2Dim(M);              computes the K-dimension of the factor algebra
    7779lpOrdMisLex(M);            orders an ideal of lp-monomials lexicographically
     
    164166"PURPOSE:checks, if all entries in M are variable-related
    165167"
    166 {int i,j;
     168{if ((nrows(M) == 1) && (ncols(M) == 1)) {if (M[1,1] == 0){return(0);}}
     169 int i,j;
    167170  for (i = 1; i <= nrows(M); i++)
    168171  {for (j = 1; j <= ncols(M); j++)
     
    12291232}
    12301233
     1234proc ivMis2Base(list M)
     1235"USAGE: ivMis2Base(M); M a list of intvecs
     1236RETURN: ideal, a K-base of the given algebra
     1237PURPOSE:Computing the K-base out of given mistletoes
     1238ASSUME: - The mistletoes have to be ordered lexicographically -> OrdMisLex.
     1239@*        Otherwise there might some elements missing.
     1240@*      - basering is a Letterplace ring.
     1241EXAMPLE: example ivMis2Base; shows examples
     1242"
     1243{
     1244//checkAssumptions(0,M);
     1245  intvec L,A;
     1246  if (size(M) == 0){ERROR("There are no mistletoes, so it appears your dimension is infinite!");}
     1247  if (isInList(L,M) > 0) {print("1 is a mistletoe, therefore 1 is the only basis element"); return(list(intvec(0)));}
     1248  int i,j,d,s;
     1249  list Rt;
     1250  Rt[1] = intvec(0);
     1251  L = M[1];
     1252  for (i = size(L); 1 <= i; i--) {Rt = insert(Rt,intvec(L[1..i]));}
     1253  for (i = 2; i <= size(M); i++)
     1254  {A = M[i]; L = M[i-1];
     1255   s = size(A);
     1256   if (s > size(L))
     1257   {d = size(L);
     1258    for (j = s; j > d; j--) {Rt = insert(Rt,intvec(A[1..j]));}
     1259    A = A[1..d];
     1260   }
     1261   if (size(L) > s){L = L[1..s];}
     1262   while (A <> L)
     1263   {Rt = insert(Rt, intvec(A));
     1264    if (size(A) > 1)
     1265    {A = A[1..(size(A)-1)];
     1266     L = L[1..(size(L)-1)];
     1267    }
     1268    else {break;}
     1269   }
     1270  }
     1271  return(Rt);
     1272}
     1273example
     1274{
     1275  "EXAMPLE:"; echo = 2;
     1276  ring r = 0,(x,y),dp;
     1277  def R = makeLetterplaceRing(5); // constructs a Letterplace ring
     1278  R;
     1279  setring R; // sets basering to Letterplace ring
     1280  intvec i1 = 1,2; intvec i2 = 2,1,2;
     1281  // the mistletoes are xy and yxy, which are already ordered lexicographically
     1282  list L = i1,i2;
     1283  ivMis2Base(L); // returns the basis of the factor algebra
     1284}
     1285
     1286
    12311287proc ivMis2Dim(list M)
    12321288"USAGE: ivMis2Dim(M); M a list of intvecs
     
    15951651@*        degbound <= attrib(basering,uptodeg) holds.
    15961652NOTE: - If L is the list returned, then L[1] is an integer, the K-dimension,
    1597 @*      L[2] is an intvec, the Hilbert series and L[3] is an ideal,
     1653@*      L[2] is an intvec, the Hilbert series and L[3] is an ideal, 
    15981654@*      the mistletoes
    15991655@*    - If degbound is set, there will be a degree bound added. 0 means no
     
    17291785  // ring is not necessary
    17301786  lpKDim(G,0); // procedure without any degree bound
     1787}
     1788
     1789proc lpMis2Base(ideal M)
     1790"USAGE: lpMis2Base(M); M an ideal
     1791RETURN: ideal, a K-basis of the factor algebra
     1792PURPOSE:Computing a K-basis out of given mistletoes
     1793ASSUME: - basering is a Letterplace ring.
     1794@*      - M contains only monomials
     1795NOTE:   - The mistletoes have to be ordered lexicographically -> OrdMisLex.
     1796EXAMPLE: example lpMis2Base; shows examples
     1797"
     1798{list L;
     1799  L = lpId2ivLi(M);
     1800  return(ivL2lpI(ivMis2Base(L)));
     1801}
     1802example
     1803{
     1804  "EXAMPLE:"; echo = 2;
     1805  ring r = 0,(x,y),dp;
     1806  def R = makeLetterplaceRing(5); // constructs a Letterplace ring
     1807  setring R; // sets basering to Letterplace ring
     1808  ideal L = x(1)*y(2),y(1)*x(2)*y(3);
     1809  // ideal containing the mistletoes
     1810  lpMis2Base(L); // returns the K-basis of the factor algebra
    17311811}
    17321812
     
    19682048  example ivHilbert;
    19692049  example ivKDim;
     2050  example ivMis2Base;
    19702051  example ivMis2Dim;
    19712052  example ivOrdMisLex;
     
    19782059  example lpDimCheck;
    19792060  example lpKDim;
     2061  example lpMis2Base;
    19802062  example lpMis2Dim;
    19812063  example lpOrdMisLex;
Note: See TracChangeset for help on using the changeset viewer.