Changeset 0be039 in git


Ignore:
Timestamp:
Mar 16, 2018, 6:27:45 PM (6 years ago)
Author:
Karim Abou Zeid <karim23697@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
52ac0882b123798821765bb16d5ba4b371ced4cd
Parents:
95a42a2dacdcadb5c004cb3520b5c252dfe8e784df09c0184ffc4aaf31c02b8691e68734f25fc3b3
Message:
Merge branch 'lpDivision' into stable
Location:
Singular/LIB
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/fpadim.lib

    rdf09c0 r0be039  
    23782378  return (words);
    23792379}
    2380 example {
     2380example
     2381{
    23812382  "EXAMPLE:"; echo = 2;
    23822383  ring r = 0,(a,b,c),dp;
     
    23992400  return(ivL2lpI(ivMaxIdeal(d, donly)));
    24002401}
    2401 example {
     2402example
     2403{
    24022404  "EXAMPLE:"; echo = 2;
    24032405  ring r = 0,(a,b,c),dp;
     
    24892491  return(I);
    24902492}
    2491 example {
     2493example
     2494{
    24922495  "EXAMPLE:"; echo = 2;
    24932496  ring r = 0,(x,y),dp;
  • Singular/LIB/fpaprops.lib

    rdf09c0 r0be039  
    1919PROCEDURES:
    2020  lpNoetherian(<GB>);     check whether A/<GB> is (left/right) noetherian
    21   lpIsSemiPrime(<GB>);    check whether A/<GB> is semi prime
    22   lpIsPrime(<GB>);        check whether A/<GB> is prime
     21  lpIsSemiPrime(<GB>);    check whether A/<LM(GB)> is semi prime
     22  lpIsPrime(<GB>);        check whether A/<LM(GB)> is prime
    2323  lpGkDim(<GB>);          compute the Gelfand Kirillov dimension of A/<GB>
    2424  lpGlDimBound(<GB>);     compute an upper bound for the global dimension of A/<GB>
     
    3737@*      2 right noetherian
    3838@*      3 noetherian
    39 PURPOSE: Check whether R/<G> is (left/right) noetherian, where R is the basering
     39PURPOSE: Check whether A/<G> is (left/right) noetherian
    4040ASSUME: - basering is a Letterplace ring
    4141@*      - G is a Groebner basis
     
    108108  return (3 - inFlag - outFlag);
    109109}
    110 example {
     110example
     111{
    111112  "EXAMPLE:"; echo = 2;
    112113  ring r = 0,(x,y),dp;
     
    198199"USAGE: lpIsSemiPrime(G); G an ideal in a Letterplace ring
    199200RETURN: boolean
    200 PURPOSE: Check whether R/<G> is semi prime, where R is the basering
     201PURPOSE: Check whether A/<LM(G)> is semi prime, that is when p * (A/<LM(G)>) * p != 0 for all p in (A/<LM(G)> - {0}).
    201202ASSUME: - basering is a Letterplace ring
    202203      - G is a Groebner basis
     
    249250  return (1);
    250251}
    251 example {
     252example
     253{
    252254  "EXAMPLE:"; echo = 2;
    253255  ring r = 0,(x1,x2),dp;
     
    298300"USAGE: lpIsPrime(G); G an ideal in a Letterplace ring
    299301RETURN: boolean
    300 PURPOSE: Check whether R/<G> is prime, where R is the basering
     302PURPOSE: Check whether A/<LM(G)> is prime, that is when p1 * (A/<LM(G)>) * p2 != 0 for all p1, p2 in (A/<LM(G)> - {0}).
    301303ASSUME: - basering is a Letterplace ring
    302304      - G is a Groebner basis
     
    362364  return (1);
    363365}
    364 example {
     366example
     367{
    365368  "EXAMPLE:"; echo = 2;
    366369  ring r = 0,(x,y),dp;
     
    681684  return (UG);
    682685}
    683 example {
     686example
     687{
    684688  "EXAMPLE:"; echo = 2;
    685689  ring r = 0,(x,y,z),dp;
     
    10471051    for (int j = 1; j <= size(ivfi); j++) {
    10481052      int varindex = ivfi[j];
    1049       int subindex = lpIndexOf(s1, var(varindex));
    1050       if (subindex > 0) {
    1051         s2[subindex] = lpNF(s2[subindex],G);
    1052         fis = lpMult(fis, s2[subindex]);
    1053       } else {
    1054         fis = lpMult(fis, lpNF(iv2lp(varindex),G));
    1055       }
    1056       /*fis = lpNF(fis,G);*/
    1057       kill varindex; kill subindex;
     1053      if (varindex > 0) {
     1054        int subindex = lpIndexOf(s1, var(varindex));
     1055        if (subindex > 0) {
     1056          s2[subindex] = lpNF(s2[subindex],G);
     1057          fis = lpMult(fis, s2[subindex]);
     1058        } else {
     1059          fis = lpMult(fis, lpNF(iv2lp(varindex),G));
     1060        }
     1061        /*fis = lpNF(fis,G);*/
     1062        kill subindex;
     1063      }
     1064      kill varindex;
    10581065    } kill j;
    10591066    kill ivfi;
     
    10651072  return (fs);
    10661073}
    1067 example {
     1074example
     1075{
     1076  "EXAMPLE:"; echo = 2;
    10681077  //////// EXAMPLE A ////////
    10691078  ring r = 0,(x,y,z),dp;
     
    11441153    for (int j = 1; j <= size(ivfi); j++) {
    11451154      int varindex = ivfi[j];
    1146       int subindex = lpIndexOf(s1, var(varindex));
    1147       if (subindex > 0) {
    1148         tmpDegBound = tmpDegBound + deg(s2[subindex]);
    1149       } else {
    1150         tmpDegBound = tmpDegBound + 1;
    1151       }
    1152       kill varindex; kill subindex;
     1155      if (varindex > 0) {
     1156        int subindex = lpIndexOf(s1, var(varindex));
     1157        if (subindex > 0) {
     1158          tmpDegBound = tmpDegBound + deg(s2[subindex]);
     1159        } else {
     1160          tmpDegBound = tmpDegBound + 1;
     1161        }
     1162        kill subindex;
     1163      }
     1164      kill varindex;
    11531165    } kill j;
    11541166    if (tmpDegBound > maxDegBound) {
     
    11601172  // increase degbound by 50% when ideal is provided
    11611173  // needed for lpNF
    1162   maxDegBound = maxDegBound + maxDegBound/2;
     1174  maxDegBound = maxDegBound + (maxDegBound div 2);
    11631175
    11641176  return (maxDegBound);
    11651177}
    1166 example {
     1178example
     1179{
    11671180  // see lpSubstitute()
    11681181}
     
    11871200  return (maxDegBound);
    11881201}
    1189 example {
     1202example
     1203{
    11901204  // see lpSubstitute()
    11911205}
  • Singular/LIB/freegb.lib

    r95a42a2 r0be039  
    5151LIB "qhmoduli.lib"; // for Max
    5252LIB "bfun.lib"; // for inForm
     53LIB "fpadim.lib"; // for intvec conversion
    5354
    5455proc tstfreegb()
     
    32783279}
    32793280
     3281proc lpDivision(poly p, ideal I)
     3282"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
     3283RETURN: list L
     3284NOTE: - L[1] NF(p,I)
     3285      - L[2] list of expressions [i,l_{ij},r_{ij}] with \sum_{i,j} l_{ij} g_i r_{ij} = p - NF(p,I)
     3286"
     3287{
     3288  if (p == 0 || size(I) == 0) {
     3289    list L = 0;
     3290    list empty;
     3291    L[2] = empty;
     3292    return (L);
     3293  }
     3294  poly pNF = lpNF(p,I);
     3295  p = p - pNF;
     3296
     3297  // make new ring
     3298  def save = basering;
     3299  int norigvars = nvars(r);
     3300  string tagvarstr = "(tag_1";
     3301  for (int i = 2; i <= size(I); i++) {
     3302    tagvarstr = tagvarstr + ",tag_" + string(i);
     3303  } kill i;
     3304  tagvarstr = tagvarstr + ")";
     3305  string field = string(ringlist(r)[1]);
     3306  execute("ring @tags = " + field + "," + tagvarstr + ",dp;");
     3307  ring @tagged = (r + @tags);
     3308  def @R = makeLetterplaceRing(attrib(save,"uptodeg")); setring @R;
     3309
     3310  // restore vars
     3311  poly p = imap(save, p);
     3312  poly pNF = imap(save, pNF);
     3313  ideal I = imap(save, I);
     3314  for (int i = 1; i <= size(I); i++) {
     3315    I[i] = I[i] - var(norigvars + i);
     3316  } kill i;
     3317
     3318  list summands;
     3319  list L = pNF;
     3320  poly pTaggedNF = lpNF(p,I);
     3321  pTaggedNF = pTaggedNF * leadcoef(p); // somehow pTaggedNF gets normalized
     3322  for (int i = 1; i <= size(pTaggedNF); i++) {
     3323    intvec iv = lp2iv(pTaggedNF[i]);
     3324    for (int j = 1; j <= size(iv); j++) {
     3325      if (iv[j] > norigvars) {
     3326        intvec left;
     3327        intvec right;
     3328        if (j > 1) {
     3329          left = iv[1..(j-1)];
     3330        }
     3331        if (j < size(iv)) {
     3332          right = iv[(j+1)..size(iv)];
     3333        }
     3334        list summand = (iv[j] - norigvars), leadcoef(pTaggedNF[i])*iv2lp(left), iv2lp(right);
     3335        summands = insert(summands, summand, size(summands));
     3336
     3337        kill left;
     3338        kill right;
     3339        kill summand;
     3340        break;
     3341      }
     3342    } kill j;
     3343    kill iv;
     3344  } kill i;
     3345
     3346  L[2] = summands;
     3347
     3348  setring save;
     3349  list L = imap(@R,L);
     3350  return (L);
     3351}
     3352
     3353proc lpGBPres2Poly(list L, ideal I)
     3354"ASSUME: L is a valid Groebner presentation as for example the result of lpDivision
     3355RETURN: poly
     3356NOTE: 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]
     3357"
     3358{
     3359  poly p;
     3360  for (int i = 1; i <= size(L[2]); i++) {
     3361    p = p + lpMult(lpMult(L[2][i][2], I[L[2][i][1]]), L[2][i][3]);
     3362  }
     3363  p = p + L[1];
     3364  return (p);
     3365}
     3366
    32803367//procedures to convert monomials into the DVec representation, all static
    32813368////////////////////////////////////////////////////////
Note: See TracChangeset for help on using the changeset viewer.