Changeset d69ff5 in git


Ignore:
Timestamp:
Sep 30, 2010, 4:10:51 PM (14 years ago)
Author:
Stefan Steidel <steidel@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
5e2dd1408b0e0191298d3cb3cb7327a1ff7c9464
Parents:
9d58ee75e7b3473e2e455debed865a8f8a4c97b6
Message:
Documentation and procedure intersectZ not static anymore

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

Legend:

Unmodified
Added
Removed
  • Singular/LIB/primdecint.lib

    r9d58ee7 rd69ff5  
    55LIBRARY:  primdecint.lib   primary decomposition over the integers
    66
    7 AUTHORS:  G. Pfister      pfister@mathematik.uni-kl.de
    8 @*        A. Sadiq        afshanatiq@gmail.com
    9 @*        S. Steidel      steidel@mathematik.uni-kl.de
     7AUTHORS:  G. Pfister       pfister@mathematik.uni-kl.de
     8@*        A. Sadiq         afshanatiq@gmail.com
     9@*        S. Steidel       steidel@mathematik.uni-kl.de
    1010
    1111OVERVIEW:
    1212
    13   A library for computing the primary decomposition of an ideal in the polynomial
    14   ring over the integers, Z[x_1,...,x_n].
     13  A library for computing the primary decomposition of an ideal in the
     14  polynomial ring over the integers, Z[x_1,...,x_n].
    1515
    1616PROCEDURES:
     
    2020 heightZ(I);        compute the height of I
    2121 equidimZ(I);       compute the equidimensional part of I
     22 intersectZ(I,J)    compute the intersection of I and J
    2223";
    2324
     
    2930"USAGE:  primdecZ(I); I ideal
    3031NOTE:    If size(#) > 0, then #[1] is the number of available processors for
    31          the computation. Parallelization is just applicable using 32-bit Singular
    32          version since MP-links are not compatible with 64-bit Singular version.
     32         the computation. Parallelization is just applicable using 32-bit
     33         Singular version since MP-links are not compatible with 64-bit Singular
     34         version.
    3335RETURN:  a list pr of primary ideals and their associated primes:
    3436@format
     
    4143   if(size(I)==0){return(list(ideal(0),ideal(0)));}
    4244
    43    //--------------------  Initialize optional parameters  ------------------------
     45//--------------------  Initialize optional parameters  ------------------------
    4446   if(size(#) > 0)
    4547   {
     
    4951         if((n > 1) && (1 - system("with","MP")))
    5052         {
    51             "========================================================================";
    52             "There is no MP available on your system. Since this is necessary to     ";
    53             "parallelize the algorithm, the computation will be done without forking.";
    54             "========================================================================";
     53     "========================================================================";
     54     "There is no MP available on your system. Since this is necessary to     ";
     55     "parallelize the algorithm, the computation will be done without forking.";
     56     "========================================================================";
    5557            n = 1;
    5658         }
     
    6264         if((n > 1) && (1 - system("with","MP")))
    6365         {
    64             "========================================================================";
    65             "There is no MP available on your system. Since this is necessary to     ";
    66             "parallelize the algorithm, the computation will be done without forking.";
    67             "========================================================================";
     66     "========================================================================";
     67     "There is no MP available on your system. Since this is necessary to     ";
     68     "parallelize the algorithm, the computation will be done without forking.";
     69     "========================================================================";
    6870            n = 1;
    6971         }
     
    128130
    129131//-----  Create n1 links l(1),...,l(n1), open all of them and compute  ---------
    130 //-----  standard basis for the primes L[1][2],...,L[1][n + 1].              ---------
     132//-----  standard basis for the primes L[1][2],...,L[1][n + 1].        ---------
    131133
    132134         for(i = 1; i <= n; i++)
     
    199201      for(i=1;i<=size(A);i++)
    200202      {
    201       //=== computes for all p in L the minimal associated primes of IZ/p[variables]
     203      //=== computes for all p in L the minimal associated primes of
     204      //=== IZ/p[variables]
    202205         p = int(A[i][2]);
    203206         if(printlevel >= 10)
     
    315318   ideal J=imap(R,J);
    316319   J=std(J);
    317    //=== the primary decomposition over Q which gives the primary decomposition
    318    //=== of I:h for a suitable integer h
     320   //=== the primary decomposition over Q which gives the primary
     321   //=== decomposition of I:h for a suitable integer h
    319322   list pr=primdecGTZ(J);
    320323   for(i=1;i<=size(pr);i++)
     
    384387}
    385388
    386 ///////////////////////////////////////////////////////////////////////////////
     389////////////////////////////////////////////////////////////////////////////////
    387390
    388391proc minAssZ(ideal I)
     
    419422      for(i=1;i<=size(L);i++)
    420423      {
    421       //=== computes for all p in L the minimal associated primes of IZ/p[variables]
     424      //=== computes for all p in L the minimal associated primes of
     425      //=== IZ/p[variables]
    422426         p=int(L[i]);
    423427         setring R;
     
    451455   ideal J=imap(R,J);
    452456   J=std(J);
    453    //=== the primary decomposition over Q which gives the primary decomposition
    454    //=== of I:h for a suitable integer h
     457   //=== the primary decomposition over Q which gives the primary
     458   //=== decomposition of I:h for a suitable integer h
    455459   list pr=minAssGTZ(J);
    456460   for(i=1;i<=size(pr);i++)
     
    519523}
    520524
    521 ///////////////////////////////////////////////////////////////////////////////
     525////////////////////////////////////////////////////////////////////////////////
    522526
    523527proc heightZ(ideal I)
     
    611615}
    612616
    613 ///////////////////////////////////////////////////////////////////////////////
     617////////////////////////////////////////////////////////////////////////////////
    614618
    615619proc radicalZ(ideal I)
     
    711715}
    712716
    713 ///////////////////////////////////////////////////////////////////////////////
     717////////////////////////////////////////////////////////////////////////////////
    714718
    715719proc equidimZ(ideal I)
     
    766770      for(i=1;i<=size(L);i++)
    767771      {
    768       //=== computes for all p in L the minimal associated primes of IZ/p[variables]
     772      //=== computes for all p in L the minimal associated primes of
     773      //=== IZ/p[variables]
    769774         p=int(L[i]);
    770775         j=Le[i];
     
    844849   ideal J=imap(R,J);
    845850   J=std(J);
    846    //=== the equidimensional part over Q which gives the equdimensional part
    847    //=== of I:h for a suitable integer h
     851   //=== the equidimensional part over Q which gives the equdimensional
     852   //=== part of I:h for a suitable integer h
    848853   ideal E=1;
    849854   if(nvars(R)-he==dim(J))
     
    888893}
    889894
    890 ///////////////////////////////////////////////////////////////////////////////
     895////////////////////////////////////////////////////////////////////////////////
     896
     897proc intersectZ(ideal I, ideal J)
     898"USAGE:  intersectZ(I,J); I,J ideals
     899RETURN:  the intersection of the input ideals
     900NOTE:    this is needed because intersect(I,J) does not work, should be replaced
     901         by intersect later
     902EXAMPLE: example intersectZ; shows an example
     903{
     904   def R = basering;
     905   execute("ring S=integer,(t,"+varstr(R)+"),(dp(1),dp(nvars(R)));");
     906   ideal I=imap(R,I);
     907   ideal J=imap(R,J);
     908   ideal K=addIdealZ(t*I,(1-t)*J);
     909   K=stdZ(K);
     910   int i;
     911   ideal L;
     912   for(i=1;i<=size(K);i++)
     913   {
     914      if(lead(K[i])/t==0){L[size(L)+1]=K[i];}
     915   }
     916   setring R;
     917   ideal L=imap(S,L);
     918   return(L);
     919}
     920example
     921{ "EXAMPLE:";  echo = 2;
     922   ring R=integer,(a,b,c,d),dp;
     923   ideal I1=9,a,b;
     924   ideal I2=3,c;
     925   ideal I3=11,2a,7b;
     926   ideal I4=13a2,17b4;
     927   ideal I5=9c5,6d5;
     928   ideal I6=17,a15,b15,c15,d15;
     929   ideal I=intersectZ(I1,I2); I;
     930   I=intersectZ(I,I3); I;
     931   I=intersectZ(I,I4); I;
     932   I=intersectZ(I,I5); I;
     933   I=intersectZ(I,I6); I;
     934}
     935
     936////////////////////////////////////////////////////////////////////////////////
    891937
    892938static proc modp(ideal J, int p, int nu)
     
    921967static proc coefPrimeZ(ideal I)
    922968{
    923 //=== computes the primes occuring in the product of the leading coefficients of I
     969//=== computes the primes occuring in the product of the leading coefficients
     970//=== of I
    924971   number h=1;
    925972   int i;
    926973   for(i=1;i<=size(I);i++)
    927974   {
    928       h=h*leadcoef(I[i]);  //besser machen (gleich zerlegen, nict ausmultiplizieren)
     975      h=h*leadcoef(I[i]);  // besser machen (gleich zerlegen,
     976                           // nicht ausmultiplizieren)
    929977   }
    930978   def R=basering;
     
    937985}
    938986
    939 ///////////////////////////////////////////////////////////////////////////////
     987////////////////////////////////////////////////////////////////////////////////
    940988
    941989static proc coefZ(ideal I)
     
    943991//=== assume IQ[variables]=<g_1,...,g_s>, Groebner basis, g_i in Z[variables]
    944992//=== computes an integer h such that
    945 //=== <g_1,...,g_s>Z[variables]:h^infinity = IQ[variables] intersected with Z[variables]
     993//===   <g_1,...,g_s>Z[variables]:h^infinity = IQ[variables] intersected
     994//===                                          with Z[variables]
    946995//=== returns a list with IQ[variables] intersected with Z[variables] and h
    947996   int h=1;
     
    9781027}
    9791028
    980 ///////////////////////////////////////////////////////////////////////////////
     1029////////////////////////////////////////////////////////////////////////////////
    9811030
    9821031static proc specialPowerZ(ideal I, int m)
     
    9911040}
    9921041
    993 ///////////////////////////////////////////////////////////////////////////////
     1042////////////////////////////////////////////////////////////////////////////////
    9941043
    9951044static proc separatorsZ(int j, list B)
     
    10151064}
    10161065
    1017 ///////////////////////////////////////////////////////////////////////////////
     1066////////////////////////////////////////////////////////////////////////////////
    10181067
    10191068static proc extractZ(ideal J, int j, list L, list B)
    10201069{
    1021    //=== P is an associated prime of J, the corresponding primary ideal is computed
     1070   //=== P is an associated prime of J, the corresponding primary ideal is
     1071   //=== computed,
    10221072   //=== L is a list of maximal independent sets for P in Z/p[variables]
    10231073   def R=basering;
     
    10361086      if(L[1][3]!=0)
    10371087      {
    1038          //=== if u in x is an independent set of L then we compute a Groebnerbasis in Z[u][x-u]
     1088         //=== if u in x is an independent set of L then we compute a Groebner
     1089         //=== Basis in Z[u][x-u]
    10391090         execute("ring S=integer,("+L[1][1]+"),lp;");
    10401091         ideal I=imap(R,I);
     
    10801131      for(i=1;i<=size(C);i++)
    10811132      {
    1082          if(deg(C[i])>0){h=h*C[i];}  //das muss noch besser gemacht werden, nicht ausmultiplizieren!
     1133         if(deg(C[i])>0){h=h*C[i];}  // das muss noch besser gemacht werden,
     1134                                     // nicht ausmultiplizieren!
    10831135      }
    10841136      setring Shelp;
     
    10951147   return(I);
    10961148}
    1097 ///////////////////////////////////////////////////////////////////////////////
     1149////////////////////////////////////////////////////////////////////////////////
    10981150
    10991151static proc normalizeZ(ideal I)
    11001152{
    1101 //=== if I[1]=q in Z, it replaces all other coeffs of polys in I by there value mod q
    1102 //=== std should do this automatically and then tis procedure should be removed
     1153//=== if I[1]=q in Z, it replaces all other coeffs of polys in I by there value
     1154//=== mod q, std should do this automatically and then this procedure should be
     1155//=== removed
    11031156   if(deg(I[1])>0){return(I);}
    11041157   int i,j;
     
    11191172}
    11201173
    1121 ///////////////////////////////////////////////////////////////////////////////
     1174////////////////////////////////////////////////////////////////////////////////
    11221175
    11231176static proc satZ(ideal I,poly h)
     
    11341187}
    11351188
    1136 ///////////////////////////////////////////////////////////////////////////////
     1189////////////////////////////////////////////////////////////////////////////////
    11371190
    11381191static proc prepareQuotientring (int nnp)
     
    11631216}
    11641217
    1165 ///////////////////////////////////////////////////////////////////////////////
     1218////////////////////////////////////////////////////////////////////////////////
    11661219
    11671220static proc maxIndependSet (ideal j)
     
    12161269}
    12171270
    1218 ///////////////////////////////////////////////////////////////////////////////
     1271////////////////////////////////////////////////////////////////////////////////
    12191272
    12201273static proc quotientOneZ(ideal I, poly f)
     
    12251278   int i;
    12261279   ideal K=intersectZ(I,ideal(f));
    1227    //=== K[i]/f; does not work in rings with integer! This should be replaced later
     1280   //=== K[i]/f; does not work in rings with integer! This should be replaced
     1281   //=== later
    12281282   execute("ring Rhelp=0,("+varstr(R)+"),dp;");
    12291283   ideal K=imap(R,K);
     
    12381292}
    12391293
    1240 ///////////////////////////////////////////////////////////////////////////////
     1294////////////////////////////////////////////////////////////////////////////////
    12411295
    12421296static proc quotientZ(ideal I, ideal J)
     
    12531307}
    12541308
    1255 ///////////////////////////////////////////////////////////////////////////////
     1309////////////////////////////////////////////////////////////////////////////////
    12561310
    12571311static proc reduceZ(poly f, ideal I)
     
    12991353}
    13001354
    1301 ///////////////////////////////////////////////////////////////////////////////
     1355////////////////////////////////////////////////////////////////////////////////
    13021356
    13031357static proc stdZ(ideal I)
     
    13181372}
    13191373
    1320 ///////////////////////////////////////////////////////////////////////////////
    1321 
    1322 proc intersectZ(ideal I, ideal J)
    1323 {
    1324 //=== this is needed because intersect(I,J) does not work, should be replaced
    1325 //=== by intersect later
    1326    def R = basering;
    1327    execute("ring S=integer,(t,"+varstr(R)+"),(dp(1),dp(nvars(R)));");
    1328    ideal I=imap(R,I);
    1329    ideal J=imap(R,J);
    1330    ideal K=addIdealZ(t*I,(1-t)*J);
    1331    K=stdZ(K);
    1332    int i;
    1333    ideal L;
    1334    for(i=1;i<=size(K);i++)
    1335    {
    1336       if(lead(K[i])/t==0){L[size(L)+1]=K[i];}
    1337    }
    1338    setring R;
    1339    ideal L=imap(S,L);
    1340    return(L);
    1341 }
    1342 
    1343 ///////////////////////////////////////////////////////////////////////////////
     1374////////////////////////////////////////////////////////////////////////////////
    13441375
    13451376static proc addIdealZ(ideal I,ideal J)
     
    13541385}
    13551386
    1356 ///////////////////////////////////////////////////////////////////////////////
     1387////////////////////////////////////////////////////////////////////////////////
    13571388
    13581389static proc testPrimaryZ(ideal I, list L)
     
    13701401}
    13711402
    1372 ///////////////////////////////////////////////////////////////////////////////
     1403////////////////////////////////////////////////////////////////////////////////
    13731404
    13741405/*
     
    13971428ring R3=integer,(w,z,y,x),dp;
    13981429ideal I=xzw+(-y^2+y)*z^2,
    1399          (-x^2+x)*w^2+yzw,
    1400          ((y^4-2*y^3+y^2)*x-y^4+y^3)*z^3,
    1401          y2z2w+(-y*4+2*y^3-y^2)*z3;
     1430        (-x^2+x)*w^2+yzw,
     1431        ((y^4-2*y^3+y^2)*x-y^4+y^3)*z^3,
     1432        y2z2w+(-y*4+2*y^3-y^2)*z3;
    14021433
    14031434ring R4=integer,(w,z,y,x),dp;
    14041435ideal I=-2*yxzw+(-yx-y^2+y)*z^2,
    1405          xw^2-yz^2,
    1406          (yx^2-(2*y^2+2*y)*x+y^3-2*y^2+y)*z^3,
    1407          (-2*y^2+2*y)*z^2*w+(yx-3*y^2-y)*z^3;
     1436        xw^2-yz^2,
     1437        (yx^2-(2*y^2+2*y)*x+y^3-2*y^2+y)*z^3,
     1438        (-2*y^2+2*y)*z^2*w+(yx-3*y^2-y)*z^3;
    14081439
    14091440ring R5=integer,(x,y,z),dp;
     
    14491480ring R11=integer,(w,z,y,x),dp;
    14501481ideal I=(4*y^2*x^2+(4*y^3+4*y^2-y)*x-y^2-y)*z^2,
    1451 Â         (x+y+1)*zw+(-4*y^2*x-4*y^3-4*y^2)*z^2,
    1452 Â         (-x-2*y^2 - 2*y - 1)*zw + (8*y^3*x + 8*y^4 + 8*y^3 + 2*y^2+y)*z^2,
    1453          ((y^3 + y^2)*x - y^2 - y)*z^2,
    1454          (y +1)*zw + (-y^3 -y^2)*z^2,
    1455          (x + 1)*zw +(- y^2 -y)*z^2,
    1456          (x^2 +x)*w^2 + (-yx - y)*zw;
     1482        (x+y+1)*zw+(-4*y^2*x-4*y^3-4*y^2)*z^2,
     1483        (-x-2*y^2 - 2*y - 1)*zw + (8*y^3*x + 8*y^4 + 8*y^3 + 2*y^2+y)*z^2,
     1484        ((y^3 + y^2)*x - y^2 - y)*z^2,
     1485        (y +1)*zw + (-y^3 -y^2)*z^2,
     1486        (x + 1)*zw +(- y^2 -y)*z^2,
     1487        (x^2 +x)*w^2 + (-yx - y)*zw;
    14571488
    14581489ring R12=integer,(w,z,y,x),dp;
     
    14631494
    14641495ring R13=integer,(w,z,y,x),dp;
    1465 ideal I= (((12*y+8)*x^2 +(2*y+2)*x)*zw +((-15*y^2 -4*y)*x-4*y^2 -y)*z^2,
     1496ideal I=(((12*y+8)*x^2 +(2*y+2)*x)*zw +((-15*y^2 -4*y)*x-4*y^2 -y)*z^2,
    14661497        -x*w^2 +((-12*y -8)*x+2*y)*zw +(15*y^2+4*y)*z^2,
    14671498        (81*y^4*x^2 +(-54*y^3 -12*y^2)*x-12*y^3 -3*y^2)*z^3, 
    14681499        (-24*yx+6*y^2-6*y)*z^2*w + (-81*y^4*x + 81*y^3 + 24*y^2)*z^3,
    1469         (48*x^2 + (-30*y + 12)*x - 6*y)*z^2*w + ((81*y^3 -54*y^2 -24*y)*x-21*y^2 -6*y)*z^3,
    1470         (-96*yx-18*y^3 +18*y^2-24*y)*z^2*w +(243*y^5*x-243*y^4 +72*y^3+48*y^2)*z^3,
    1471          6*y*z^2*w^2 +((576*y+384)*x^2 + (-81*y^3 -306*y^2 -168*y+96)*x+81*y^2-18*y)*z^3*w +((-720*y^2 - 192*y)*x + 450*y^3 - 60*y^2 - 48*y)*z^4);
     1500        (48*x^2 + (-30*y + 12)*x - 6*y)*z^2*w + ((81*y^3 -54*y^2 -24*y)*x
     1501        -21*y^2 -6*y)*z^3,
     1502        (-96*yx-18*y^3 +18*y^2-24*y)*z^2*w +(243*y^5*x-243*y^4 +72*y^3
     1503        +48*y^2)*z^3,
     1504        6*y*z^2*w^2 +((576*y+384)*x^2 + (-81*y^3 -306*y^2 -168*y+96)*x+81*y^2
     1505        -18*y)*z^3*w +((-720*y^2 - 192*y)*x + 450*y^3 - 60*y^2 - 48*y)*z^4);
    14721506
    14731507ring R14=integer,(x(1),x(2),x(3),x(4)),dp;
    1474 ideal I= 181*49^2,
    1475          x(4)^4,
    1476          x(1)*x(4)^3,
    1477          x(1)*x(2)*x(4)^2,
    1478          x(2)^2*x(4)^2,
    1479          x(2)^2*x(3)*x(4),
    1480          x(1)*x(2)*x(3)*x(4),
    1481          x(1)*x(3)^2*x(4),
    1482          x(3)^3*x(4);
     1508ideal I=181*49^2,
     1509        x(4)^4,
     1510        x(1)*x(4)^3,
     1511        x(1)*x(2)*x(4)^2,
     1512        x(2)^2*x(4)^2,
     1513        x(2)^2*x(3)*x(4),
     1514        x(1)*x(2)*x(3)*x(4),
     1515        x(1)*x(3)^2*x(4),
     1516        x(3)^3*x(4);
    14831517
    14841518
     
    14891523        (z^3 - z^2)*x^4 + (2*z^3 -2*z^2)*x^3 + (z^3 -z^2)*x^2,
    14901524        z*y^2*x^2, z*y*x^4 +z*y*x^3,
    1491         2*y^2*x^4 +6*y^2*x^3 +6*y^2*x^2 + (y^3 +y^2)*x, z*x^5 + (z^2 +z)*x^4 + (2*z^2 -z)*x^3 + (z^2 -z)*x^2,
     1525        2*y^2*x^4 +6*y^2*x^3 +6*y^2*x^2 + (y^3 +y^2)*x, z*x^5 + (z^2 +z)*x^4
     1526        + (2*z^2 -z)*x^3 + (z^2 -z)*x^2,
    14921527        y*x^6 + 3*y*x^5 + 3*y*x^4 + y*x^3;
    14931528
Note: See TracChangeset for help on using the changeset viewer.