Changeset 7ef5b6 in git
- Timestamp:
- Sep 24, 2010, 5:15:05 PM (13 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- f9c3c3dfd663c955942c98e53c85fa5af50c427a
- Parents:
- 22a129e7a48031d6420b3e495ec7f895ad49c0d2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/primdecint.lib
r22a129 r7ef5b6 29 29 proc primdecZ(ideal I, list #) 30 30 "USAGE: primdecZ(I); I ideal 31 NOTE: If size(#) > 0, then #[1] is the number of available processors for 32 the computation. Parallelization is just applicable using 32-bit Singular 31 NOTE: If size(#) > 0, then #[1] is the number of available processors for 32 the computation. Parallelization is just applicable using 32-bit Singular 33 33 version since MP-links are not compatible with 64-bit Singular version. 34 34 RETURN: a list pr of primary ideals and their associated primes: … … 42 42 if(size(I)==0){return(list(ideal(0),ideal(0)));} 43 43 44 44 45 45 //-------------------- Initialize optional parameters ------------------------ 46 46 if(size(#) > 0) … … 69 69 "========================================================================"; 70 70 n = 1; 71 } 71 } 72 72 ideal TES = #[2]; 73 73 } … … 79 79 } 80 80 81 81 82 82 if(deg(I[1])==0) 83 83 { … … 88 88 ideal J=stdZ(I); 89 89 } 90 90 91 91 ideal K,N; 92 92 def R=basering; … … 108 108 number q=imap(R,q); 109 109 //=== computes the primes occuring in a generator of I intersect Z 110 111 112 110 111 112 113 113 list L = primefactors(q); 114 115 116 114 115 116 117 117 list A; 118 118 119 119 ideal J = imap(R,J); 120 120 121 121 122 122 123 123 for(j=1;j<=size(L[3]);j++) 124 124 { … … 126 126 127 127 } 128 128 129 129 if(printlevel >= 10) 130 130 { … … 157 157 if(t > 60) { t = 60; } 158 158 int i_sleep = system("sh", "sleep "+string(t)); 159 159 160 160 j = n + 2; 161 161 162 162 while(j <= size(L[3]) + 1) 163 163 { … … 167 167 { 168 168 A[size(A)+1] = read(l(i)); // read the result from l(i) 169 169 170 170 if(j <= size(L[3])) 171 171 { … … 198 198 } 199 199 200 200 201 201 setring R; 202 202 list A = imap(Rhelp,A); 203 if(printlevel >= 10) 204 { 203 if(printlevel >= 10) 204 { 205 205 "A is computed in "+string(rtimer - RT)+" seconds."; 206 206 } … … 209 209 //=== computes for all p in L the minimal associated primes of IZ/p[variables] 210 210 p = int(A[i][2]); 211 if(printlevel >= 10) 212 { 213 "p = "+string(p); 211 if(printlevel >= 10) 212 { 213 "p = "+string(p); 214 214 RT = rtimer; 215 215 } … … 240 240 K=B[j]; 241 241 //=== compute maximal independent set for KZ/p[variables] 242 242 243 243 setring S; 244 244 J=imap(R,K); … … 268 268 { 269 269 K=B[j][2],p; 270 K=stdZ(K); 270 K=stdZ(K); 271 271 Q=B[j][1],p; 272 272 Q=stdZ(Q); … … 291 291 } 292 292 } 293 293 294 294 setring R; 295 295 if(!ex){return(P);} 296 296 J=stdZ(J); 297 TQ=intersectZ(TQ,TES); 297 TQ=intersectZ(TQ,TES); 298 298 if(size(reduce(TQ,J))!=0) 299 299 { … … 304 304 while(size(reduce(intersectZ(W,TQ),J))!=0) 305 305 { 306 //W=stdZ(addIdealZ(I,K^m)); 306 //W=stdZ(addIdealZ(I,K^m)); 307 307 W=stdZ(addIdealZ(I,specialPowerZ(K,m))); 308 308 m++; … … 347 347 if(h!=1) 348 348 { 349 M=primdecZ(J,n,Y); 349 M=primdecZ(J,n,Y); 350 350 j=0; 351 351 //=== remove useless primary ideals … … 401 401 " 402 402 { 403 if(size(I)==0){return(list(ideal(0)));} 403 if(size(I)==0){return(list(ideal(0)));} 404 404 if(deg(I[1])==0) 405 405 { … … 425 425 number q=imap(R,q); 426 426 //=== computes the primes occuring in a generator of I intersect Z 427 list L=PollardRho(q,5000,1); 427 list L=PollardRho(q,5000,1); 428 428 for(i=1;i<=size(L);i++) 429 429 { … … 435 435 setring S; 436 436 ideal J=imap(R,J); 437 list A=minAssGTZ(J); 437 list A=minAssGTZ(J); 438 438 setring R; 439 439 B=imap(S,A); … … 460 460 ideal J=imap(R,J); 461 461 J=std(J); 462 //=== the primary decomposition over Q which gives the primary decomposition 462 //=== the primary decomposition over Q which gives the primary decomposition 463 463 //=== of I:h for a suitable integer h 464 464 list pr=minAssGTZ(J); … … 536 536 " 537 537 { 538 if(size(I)==0){return(0);} 538 if(size(I)==0){return(0);} 539 539 if(deg(I[1])==0) 540 540 { … … 562 562 number q=imap(R,q); 563 563 //=== computes the primes occuring in a generator of I intersect Z 564 list L=PollardRho(q,5000,1); 564 list L=PollardRho(q,5000,1); 565 565 for(i=1;i<=size(L);i++) 566 566 { … … 573 573 ideal J=imap(R,J); 574 574 j=nvars(R)-dim(std(J)); 575 if(j<m){m=j;} 575 if(j<m){m=j;} 576 576 setring Rhelp; 577 577 kill S; … … 587 587 J=std(J); 588 588 m=nvars(R)-dim(J); 589 //=== the height over Q 589 //=== the height over Q 590 590 //=== of I:h for a suitable integer h 591 591 setring R; … … 628 628 " 629 629 { 630 if(size(I)==0){return(ideal(0));} 630 if(size(I)==0){return(ideal(0));} 631 631 if(deg(I[1])==0) 632 632 { … … 653 653 number q=imap(R,q); 654 654 //=== computes the primes occuring in a generator of I intersect Z 655 list L=PollardRho(q,5000,1); 655 list L=PollardRho(q,5000,1); 656 656 for(i=1;i<=size(L);i++) 657 657 { … … 663 663 setring S; 664 664 ideal J=imap(R,J); 665 ideal A=radical(J); 665 ideal A=radical(J); 666 666 setring R; 667 667 B=imap(S,A); … … 758 758 number s; 759 759 //=== computes the primes occuring in a generator of I intersect Z 760 list L=PollardRho(q,5000,1); 760 list L=PollardRho(q,5000,1); 761 761 list Le; 762 762 for(i=1;i<=size(L);i++) … … 791 791 { 792 792 //=== p is of multiplicity >1 in q 793 list A=minAssGTZ(J); 793 list A=minAssGTZ(J); 794 794 j=0; 795 795 while(j<size(A)) … … 825 825 N=stdZ(N); 826 826 Q=extractZ(N,j,IS,B); 827 TQ=intersectZ(TQ,Q); 827 TQ=intersectZ(TQ,Q); 828 828 } 829 829 setring Rhelp; … … 831 831 else 832 832 { 833 //=== p is of multiplicity 1 in q we can compute the 833 //=== p is of multiplicity 1 in q we can compute the 834 834 //=== equidimensional part directly 835 835 ideal E=equidimMax(J); … … 853 853 ideal J=imap(R,J); 854 854 J=std(J); 855 //=== the equidimensional part over Q which gives the equdimensional part 855 //=== the equidimensional part over Q which gives the equdimensional part 856 856 //=== of I:h for a suitable integer h 857 857 ideal E=1; … … 866 866 //=== find h in Z such that I is the intersection of I:h and I,h 867 867 //=== and I:h =IQ[variables] intersected with Z[varables] 868 int h =coefZ(J)[2]; 868 int h =coefZ(J)[2]; 869 869 J=J,h; 870 870 //=== call equidimensional part over Z for I,h … … 872 872 if(h!=1) 873 873 { 874 M=equidimZ(J); 874 M=equidimZ(J); 875 875 if(he==heightZ(M)) 876 876 { 877 877 E=intersectZ(M,E); 878 } 878 } 879 879 } 880 880 return(E); … … 902 902 903 903 { 904 904 905 905 def R = basering; 906 907 list rp = ringlist(R); 906 907 list rp = ringlist(R); 908 908 rp[1] = p; 909 909 def Rp = ring(rp); … … 915 915 list A = minAssGTZ(J); 916 916 setring R; 917 917 918 918 list A = imap(Rp,A); 919 919 920 920 return(list(A,p,nu)); 921 922 } 923 921 922 } 923 924 924 else 925 926 { 927 925 926 { 927 928 928 list A = primdecGTZ(J); 929 929 930 930 setring R; 931 931 932 932 list A = imap(Rp,A); 933 933 934 934 return(list(A,p,nu)); 935 936 } 935 936 } 937 937 938 938 } … … 963 963 static proc coefZ(ideal I) 964 964 { 965 //assume === IQ[variables]=<g_1,...,g_s>, Groebner basis, g_i in Z[variables] 966 //=== computes an integer h such that 965 //assume === IQ[variables]=<g_1,...,g_s>, Groebner basis, g_i in Z[variables] 966 //=== computes an integer h such that 967 967 //=== <g_1,...,g_s>Z[variables]:h^infinity = IQ[variables] intersected with Z[variables] 968 968 //=== returns a list with IQ[variables] intersected with Z[variables] and h … … 1045 1045 def R=basering; 1046 1046 ideal P=B[j]; 1047 1047 1048 1048 //=== first compute a pseudo primary ideal I, radical of I is P 1049 1049 //=== method of Eisenbud 1050 //ideal I=addIdealZ(J,specialPowerZ(P,20)); 1051 1050 //ideal I=addIdealZ(J,specialPowerZ(P,20)); 1051 1052 1052 //=== method of Shimoyama-Yokoyama 1053 poly s=separatorsZ(j,B); 1053 poly s=separatorsZ(j,B); 1054 1054 ideal I=satZ(J,s); 1055 1055 //=== size(L)=0 means P is maximal ideal and I is primary … … 1068 1068 ideal I=imap(S,I); 1069 1069 I[1]=0; 1070 I=simplify(I,2); 1071 //=== this is our way to obtain the coefficients in Z[u] of the 1070 I=simplify(I,2); 1071 //=== this is our way to obtain the coefficients in Z[u] of the 1072 1072 //=== leading terms of the Groebner basis above 1073 1073 string quotring=prepareQuotientring(nvars(basering)-L[1][3]); … … 1104 1104 { 1105 1105 if(deg(C[i])>0){h=h*C[i];} //das muss noch besser gemacht werden, nicht ausmultiplizieren! 1106 } 1106 } 1107 1107 setring Shelp; 1108 1108 poly h=imap(R,h); 1109 ideal fac=factorize(h,1); 1109 ideal fac=factorize(h,1); 1110 1110 setring R; 1111 1111 ideal fac=imap(Shelp,fac); 1112 1112 for(i=1;i<=size(fac);i++) 1113 1113 { 1114 I=satZ(I,fac[i]); 1114 I=satZ(I,fac[i]); 1115 1115 } 1116 1116 } … … 1190 1190 static proc maxIndependSet (ideal j) 1191 1191 { 1192 1192 1193 1193 //=== this is from primdec.lib, it is static there, should be imported later if it is no more static 1194 1194 int n,k,di; 1195 1195 1196 1196 list resu,hilf; 1197 1197 if(size(j)==0) … … 1421 1421 y2z2w+(-y*4+2*y^3-y^2)*z3; 1422 1422 1423 ring R4=integer,(w,z,y,x),dp; 1423 ring R4=integer,(w,z,y,x),dp; 1424 1424 ideal I=-2*yxzw+(-yx-y^2+y)*z^2, 1425 1425 xw^2-yz^2, … … 1452 1452 -y^2*(z+2)^2+2*(z+2)^4+x2-y2+(z+2)^2, 1453 1453 y3z9+3y2z10+3yz11+z12-y2z2+2z4; 1454 1455 ring R9=integer,(w,z,y,x),dp; 1454 1455 ring R9=integer,(w,z,y,x),dp; 1456 1456 ideal I=630, 1457 1457 ((y^2-y)*x-y^3+y^2)*z^2, 1458 1458 (x-y)*zw, 1459 1459 (x-y^2)*zw+(-y^2+y)*z^2, 1460 (-x^2+x)*w^2+(-yx+y)*zw; 1461 1462 ring R10=integer,(w,z,y,x),dp; 1460 (-x^2+x)*w^2+(-yx+y)*zw; 1461 1462 ring R10=integer,(w,z,y,x),dp; 1463 1463 ideal I=1260, 1464 1464 -yxzw+(-y^2+y)*z^2, 1465 1465 (-x^2+x)*w^2-yxzw, 1466 1466 ((-y^2+y)*x-y^3+2*y^2-y)*z^3, 1467 (y^2-y)*z^2*w+(-y^2+y)*z^2*w+(-y^2+y)*z^3; 1467 (y^2-y)*z^2*w+(-y^2+y)*z^2*w+(-y^2+y)*z^3; 1468 1468 1469 1469 ring R11=integer,(w,z,y,x),dp; 1470 ideal I=(4*y^2*x^2+(4*y^3+4*y^2-y)*x-y^2-y)*z^2, 1471  (x+y+1)*zw+(-4*y^2*x-4*y^3-4*y^2)*z^2, 1472  (-x-2*y^2 - 2*y - 1)*zw + (8*y^3*x + 8*y^4 + 8*y^3 + 2*y^2+y)*z^2, 1473 ((y^3 + y^2)*x - y^2 - y)*z^2, 1474 (y +1)*zw + (-y^3 -y^2)*z^2, 1475 (x + 1)*zw +(- y^2 -y)*z^2, 1476 (x^2 +x)*w^2 + (-yx - y)*zw; 1477 1478 ring R12=integer,(w,z,y,x),dp; 1470 ideal I=(4*y^2*x^2+(4*y^3+4*y^2-y)*x-y^2-y)*z^2, 1471  (x+y+1)*zw+(-4*y^2*x-4*y^3-4*y^2)*z^2, 1472  (-x-2*y^2 - 2*y - 1)*zw + (8*y^3*x + 8*y^4 + 8*y^3 + 2*y^2+y)*z^2, 1473 ((y^3 + y^2)*x - y^2 - y)*z^2, 1474 (y +1)*zw + (-y^3 -y^2)*z^2, 1475 (x + 1)*zw +(- y^2 -y)*z^2, 1476 (x^2 +x)*w^2 + (-yx - y)*zw; 1477 1478 ring R12=integer,(w,z,y,x),dp; 1479 1479 ideal I=72, 1480 1480 ((y^3 + y^2)*x - y^2 - y)*z^2, … … 1482 1482 (x + 1)*zw + (-y^2 -y)*z^2, (x^2 + x)*w^2 + (-yx - y)*zw; 1483 1483 1484 ring R13=integer,(w,z,y,x),dp; 1484 ring R13=integer,(w,z,y,x),dp; 1485 1485 ideal I= (((12*y+8)*x^2 +(2*y+2)*x)*zw +((-15*y^2 -4*y)*x-4*y^2 -y)*z^2, 1486 -x*w^2 +((-12*y -8)*x+2*y)*zw +(15*y^2+4*y)*z^2, 1487 (81*y^4*x^2 +(-54*y^3 -12*y^2)*x-12*y^3 -3*y^2)*z^3, 1488 (-24*yx+6*y^2-6*y)*z^2*w + (-81*y^4*x + 81*y^3 + 24*y^2)*z^3, 1489 (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, 1490 (-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, 1491 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); 1492 1493 ring R14=integer,(x(1),x(2),x(3),x(4)),dp; 1486 -x*w^2 +((-12*y -8)*x+2*y)*zw +(15*y^2+4*y)*z^2, 1487 (81*y^4*x^2 +(-54*y^3 -12*y^2)*x-12*y^3 -3*y^2)*z^3, 1488 (-24*yx+6*y^2-6*y)*z^2*w + (-81*y^4*x + 81*y^3 + 24*y^2)*z^3, 1489 (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, 1490 (-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, 1491 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); 1492 1493 ring R14=integer,(x(1),x(2),x(3),x(4)),dp; 1494 1494 ideal I= 181*49^2, 1495 1495 x(4)^4, 1496 1496 x(1)*x(4)^3, 1497 1497 x(1)*x(2)*x(4)^2, 1498 x(2)^2*x(4)^2, 1498 x(2)^2*x(4)^2, 1499 1499 x(2)^2*x(3)*x(4), 1500 x(1)*x(2)*x(3)*x(4), 1500 x(1)*x(2)*x(3)*x(4), 1501 1501 x(1)*x(3)^2*x(4), 1502 x(3)^3*x(4); 1503 1504 1502 x(3)^3*x(4); 1503 1504 1505 1505 ring R15=integer,(x,y,z),dp;  1506 1506 ideal I=32003*181*64, 1507 1507 ((z^2-z)*y^2 + (z^2 -z)*y)*x; (z*y^3 + z*y^2)*x, 1508 (y^4 - y^2)*x, (z^2 - z)*y*x^2, (y^3 - y^2)*x^2, 1508 (y^4 - y^2)*x, (z^2 - z)*y*x^2, (y^3 - y^2)*x^2, 1509 1509 (z^3 - z^2)*x^4 + (2*z^3 -2*z^2)*x^3 + (z^3 -z^2)*x^2, 1510 z*y^2*x^2, z*y*x^4 +z*y*x^3, 1511 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, 1512 y*x^6 + 3*y*x^5 + 3*y*x^4 + y*x^3; 1513 1514 1515 ring R16=integer,(x(1),x(2),x(3),x(4),x(5)),dp; 1516 ideal I=x(5)^5, 1510 z*y^2*x^2, z*y*x^4 +z*y*x^3, 1511 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, 1512 y*x^6 + 3*y*x^5 + 3*y*x^4 + y*x^3; 1513 1514 1515 ring R16=integer,(x(1),x(2),x(3),x(4),x(5)),dp; 1516 ideal I=x(5)^5, 1517 1517 x(1)*x(5)^4, 1518 x(1)*x(2)*x(5)^3, 1519 x(2)^2*x(5)^3, 1520 x(2)^2*x(3)*x(5)^2, 1521 x(1)*x(2)*x(3)*x(5)^2, 1522 x(1)*x(3)^2*x(5)^2, 1523 x(3)^3*x(5)^2, 1518 x(1)*x(2)*x(5)^3, 1519 x(2)^2*x(5)^3, 1520 x(2)^2*x(3)*x(5)^2, 1521 x(1)*x(2)*x(3)*x(5)^2, 1522 x(1)*x(3)^2*x(5)^2, 1523 x(3)^3*x(5)^2, 1524 1524 x(3)^3*x(4)*x(5), 1525 x(1)*x(3)^2*x(4)*x(5), 1526 x(1)*x(2)*x(3)*x(4)*x(5), 1527 x(2)^2*x(3)*x(4)*x(5), 1528 x(2)^2*x(4)^2*x(5), 1525 x(1)*x(3)^2*x(4)*x(5), 1526 x(1)*x(2)*x(3)*x(4)*x(5), 1527 x(2)^2*x(3)*x(4)*x(5), 1528 x(2)^2*x(4)^2*x(5), 1529 1529 x(1)*x(2)*x(4)^2*x(5), 1530 x(1)*x(4)^3*x(5), 1531 x(4)^4*x(5); 1530 x(1)*x(4)^3*x(5), 1531 x(4)^4*x(5); 1532 1532 I=intersectZ(I,ideal(64*181,x(1)^2)); 1533 1533 1534 1534 ring R17=integer,(x,y,z),dp;  1535 1535 ideal I=374, 1536 (z+2)^8-140z6+2622*(z+2)^4-1820*(z+2)^2+169, 1537     17y*(z+2)^4-374*y*(z+2)^2+221y+2z7-281z5+5240z3-3081z, 1538     204y2+136yz3-3128yz+z6-149z4+2739z2+117, 1539     17xz4-374xz2+221x+2z7-281z5+5240z3-3081z, 1540     136xy-136xz-136yz+2z6-281z4+5376z2-3081, 1541     204x2+136xz3-3128xz+z6-149z4+2739z2+117; 1542 1543 ring R18=integer,(B,D,F,b,d,f),dp; 1536 (z+2)^8-140z6+2622*(z+2)^4-1820*(z+2)^2+169, 1537     17y*(z+2)^4-374*y*(z+2)^2+221y+2z7-281z5+5240z3-3081z, 1538     204y2+136yz3-3128yz+z6-149z4+2739z2+117, 1539     17xz4-374xz2+221x+2z7-281z5+5240z3-3081z, 1540     136xy-136xz-136yz+2z6-281z4+5376z2-3081, 1541     204x2+136xz3-3128xz+z6-149z4+2739z2+117; 1542 1543 ring R18=integer,(B,D,F,b,d,f),dp; 1544 1544 ideal I=6, 1545 (b-d)*(B-D)-2*F+2, 1546 (b-d)*(B+D-2*F)+2*(B-D), 1547 (b-d)^2-2*(b+d)+f+1, 1545 (b-d)*(B-D)-2*F+2, 1546 (b-d)*(B+D-2*F)+2*(B-D), 1547 (b-d)^2-2*(b+d)+f+1, 1548 1548 B^2*b^3-1, 1549 1549 D^2*d^3-1, 1550 F^2*f^3-1; 1550 F^2*f^3-1; 1551 1551 1552 1552 ring R19=integer,(a,b,c,d,e,f),dp; … … 1579 1579 ring R22=integer,(s,p,S,P,T,F,f),dp;  1580 1580 ideal I=35, 1581 2*T-S*s-2*F+2, 1582 8*F*p-4*p*S-2*F*s^2+S*s^2+4*T-2*S*s, 1583 -2*s-4*p+s^2+f+1, 1584 s*T^2-p*s*P-p*S*T-2, 1585 p^3*P^2-1, 1586 F^2*f^3-1; 1581 2*T-S*s-2*F+2, 1582 8*F*p-4*p*S-2*F*s^2+S*s^2+4*T-2*S*s, 1583 -2*s-4*p+s^2+f+1, 1584 s*T^2-p*s*P-p*S*T-2, 1585 p^3*P^2-1, 1586 F^2*f^3-1; 1587 1587 */
Note: See TracChangeset
for help on using the changeset viewer.