Changeset 2e7410 in git for Singular/LIB/assprimeszerodim.lib
- Timestamp:
- Sep 24, 2010, 4:52:16 PM (14 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- f0e080284bc1a4ba286ba66df791c785e808feb8
- Parents:
- 1492bbce4e131a22de468dd41b9ced71d0fe3f93
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/assprimeszerodim.lib
-
Property
mode
changed from
100644
to100755
r1492bb r2e7410 1 1 //////////////////////////////////////////////////////////////////////////////// 2 2 version="$Id$"; 3 category = "Commutative algebra";3 category = "Commutative Algebra"; 4 4 info=" 5 LIBRARY: ass Primes.libassociated primes of a zero-dimensional ideal5 LIBRARY: assprimeszerodim.lib associated primes of a zero-dimensional ideal 6 6 7 7 AUTHORS: N. Idrees nazeranjawwad@gmail.com … … 11 11 OVERVIEW: 12 12 13 A library for computing the associated primes 13 A library for computing the associated primes and the radical of a 14 14 zero-dimensional ideal in the polynomial ring over the rational numbers, 15 Q[x_1,...,x_n] using modular computations.15 Q[x_1,...,x_n], using modular computations. 16 16 17 17 SEE ALSO: primdec_lib 18 18 19 19 PROCEDURES: 20 zeroR(I); computes the radical of I 20 21 assPrimes(I); computes the associated primes of I 21 zeroR(I); compute the radical of I22 22 "; 23 23 … … 30 30 "USAGE: zeroR(I,[n]); I ideal, optional: n number of processors (for parallel computing) 31 31 ASSUME: I is zero-dimensional in Q[variables] 32 NOTE: Parallelization is just applicable using 32-bit Singular version since 33 MP-links are not compatible with 64-bit Singular version. 32 34 RETURN: the radical of I 33 35 EXAMPLE: example zeroR; shows an example … … 64 66 65 67 //-------------------- Initialize the list of primes ------------------------- 66 // nach Umstellung von modstd.lib auf unsere neue Version: primeList(I,10) 67 intvec L = primeList(10); 68 intvec L = primeList(I,10); 68 69 L[5] = prime(random(100000000,536870912)); 69 70 … … 141 142 } 142 143 143 // hier deleteUnlucky einbauen, streichen, wenn der Grad nicht stimmt144 // insert deleteUnluckyPrimes 144 145 G = chinrem(CO1,CO2); 145 146 N = CO2[1]; … … 160 161 161 162 j = size(L) + 1; 162 163 // nach Umstellung von modstd.lib auf unsere neue Version: primeList(I,10,L) 164 L = primeList(10,L); 163 L = primeList(I,10,L); 165 164 166 165 if(n > 1) … … 198 197 199 198 proc assPrimes(list #) 200 "USAGE: assPrimes(I,[ n],[a]); I ideal or module,199 "USAGE: assPrimes(I,[a],[n]); I ideal or module, 201 200 optional: n number of processors (for parallel computing), a 202 - a =1: method of Eisenbud/Hunecke/Vasconcelos203 - a =2: method of Gianni/Trager/Zacharias204 - a =3: mathod of Monico205 assPrimes(I) chooses n=a=1201 - a = 1: method of Eisenbud/Hunecke/Vasconcelos 202 - a = 2: method of Gianni/Trager/Zacharias 203 - a = 3: mathod of Monico 204 assPrimes(I) chooses n = a = 1 206 205 ASSUME: I is zero-dimensional over Q[variables] 206 NOTE: Parallelization is just applicable using 32-bit Singular version since 207 MP-links are not compatible with 64-bit Singular version. 207 208 RETURN: a list pr of associated primes of I: 208 209 EXAMPLE: example assPrimes; shows an example … … 214 215 215 216 ideal I; 216 if(typeof(#[1]) =="ideal")217 if(typeof(#[1]) == "ideal") 217 218 { 218 219 I = #[1]; … … 223 224 I = Ann(M); 224 225 } 226 227 //--------------------- Initialize optional parameter ------------------------ 228 if(size(#) > 1) 229 { 230 if(size(#) == 2) 231 { 232 int alg = #[2]; 233 int n = 1; 234 } 235 if(size(#) == 3) 236 { 237 int alg = #[2]; 238 int n = #[3]; 239 if((n > 1) && (1 - system("with","MP"))) 240 { 241 "========================================================================"; 242 "There is no MP available on your system. Since this is necessary to "; 243 "parallelize the algorithm, the computation will be done without forking."; 244 "========================================================================"; 245 n = 1; 246 } 247 } 248 } 249 else 250 { 251 int alg = 1; 252 int n = 1; 253 } 225 254 226 255 def SPR = basering; 227 I = std(I);256 I = modStd(I,n); 228 257 int d = vdim(I); 229 258 if(d == -1) { ERROR("Ideal is not zero-dimensional."); } … … 263 292 "CPU-time for radical-check is "+string(timer - T)+" seconds."; 264 293 } 265 //--------------------- Initialize optional parameter ------------------------266 if(size(#) > 1)267 {268 if(size(#) == 2)269 {270 int alg = #[2];271 int n = 1;272 }273 if(size(#) == 3)274 {275 int alg = #[2];276 int n = #[3];277 if((n > 1) && (1 - system("with","MP")))278 {279 "========================================================================";280 "There is no MP available on your system. Since this is necessary to ";281 "parallelize the algorithm, the computation will be done without forking.";282 "========================================================================";283 n = 1;284 }285 }286 }287 else288 {289 int alg = 1;290 int n = 1;291 }292 294 293 295 export(SPR); … … 297 299 export(I_for_fork); // I available for each link 298 300 301 //-------------------- Initialize the list of primes ------------------------- 302 intvec L = primeList(I,10); 303 L[5] = prime(random(1000000000,2134567879)); 304 299 305 list Re; 300 306 … … 308 314 int j = 1; 309 315 int index = 1; 310 311 312 //-------------------- Initialize the list of primes -------------------------313 // nach Umstellung von modstd.lib auf unsere neue Version: primeList(I,10)314 intvec L = primeList(10);315 L[5] = prime(random(1000000000,2134567879));316 316 317 317 //----- If there is more than one processor available, we parallelize the ---- … … 359 359 for(i = 1; i <= n; i++) 360 360 { 361 if(status(l(i), "read", "ready")) 361 if(status(l(i), "read", "ready")) // ask if link l(i) is ready otherwise sleep for t seconds 362 362 { 363 P = read(l(i)); 363 P = read(l(i)); // read the result from l(i) 364 364 CO1[index] = P[1]; 365 365 CO2[index] = bigint(P[2]); … … 378 378 } 379 379 } 380 if(k == n) 380 if(k == n) // k describes the number of closed links 381 381 { 382 382 j++; … … 401 401 "CPU-time for computing list in assPrimes is "+string(timer - tt)+" seconds."; 402 402 } 403 //hier deleteUnlucky einbauen, streichen, wenn der Grad nicht stimmt 403 404 // insert deleteUnluckyPrimes 404 405 G = chinrem(CO1,CO2); 405 406 N = CO2[1]; … … 461 462 { 462 463 H[1][i] = quickSubst(H[1][i],f,I); 463 464 if(typeof(#[1])=="ideal") 465 { 466 Re[i-1] = #[1] + ideal(H[1][i]); 467 } 468 else 469 { 470 Re[i-1] = M + H[1][i]*freemodule(nrows(M)); 471 } 464 Re[i-1] = I + ideal(H[1][i]); 472 465 } 473 466 … … 514 507 j = size(L) + 1; 515 508 516 // nach Umstellung von modstd.lib auf unsere neue Version: primeList(I,10,L) 517 L = primeList(10,L); 509 setring(SPR); 510 L = primeList(I,10,L); 511 setring rHelp; 518 512 519 513 if(n > 1) … … 746 740 //////////////////////////////////////////////////////////////////////////////// 747 741 748 static proc primeList(int n, list #)749 "USAGE: primeList(n); (resp. primeList(n,L); )750 RETURN: the intvec of n greatest primes <= 536870912 (resp. n greatest751 primes < L[size(L)] union with L)752 EXAMPLE:example primList; shows an example753 "754 {755 intvec L;756 int i,p;757 if(size(#) == 0)758 {759 p = prime(536870912);760 L[1] = p;761 }762 else763 {764 L = #[1];765 p = prime(L[size(L)]-1);766 L[size(L)+1] = p;767 }768 if(p == 2){ERROR("no more primes");}769 for(i = 2; i <= n; i++)770 {771 p = prime(p-1);772 L[size(L)+1] = p;773 }774 return(L);775 }776 example777 { "EXAMPLE:"; echo = 2;778 intvec L=primeList(10);779 size(L);780 L[size(L)];781 L=primeList(5,L);782 size(L);783 L[size(L)];784 }785 786 ////////////////////////////////////////////////////////////////////////////////787 788 742 static proc zeroRadP(ideal I, int p) 789 743 { … … 874 828 875 829 //Test for zeroR 876 ring R = 0, (x,y),dp;830 ring R = 0,(x,y),dp; 877 831 ideal I = xy4-2xy2+x, x2-x, y4-2y2+1; 878 832 879 833 //Cyclic 6 880 ring R =0,x(1..6),dp;881 ideal I =cyclic(6);834 ring R = 0,x(1..6),dp; 835 ideal I = cyclic(6); 882 836 883 837 //Amrhei 884 ring R=0,(a,b,c,d,e,f),dp; 885 ideal I= 886 2fb+2ec+d2+a2+a, 887 2fc+2ed+2ba+b, 888 2fd+e2+2ca+c+b2, 889 2fe+2da+d+2cb, 890 f2+2ea+e+2db+c2, 891 2fa+f+2eb+2dc; 838 ring R = 0,(a,b,c,d,e,f),dp; 839 ideal I = 2fb+2ec+d2+a2+a, 840 2fc+2ed+2ba+b, 841 2fd+e2+2ca+c+b2, 842 2fe+2da+d+2cb, 843 f2+2ea+e+2db+c2, 844 2fa+f+2eb+2dc; 892 845 893 846 894 847 //Becker-Niermann 895 848 ring R = 0,(x,y,z),dp; 896 ideal I= 897 x2+xy2z-2xy+y4+y2+z2, 898 -x3y2+xy2z+xyz3-2xy+y4, 899 -2x2y+xy4+yz4-3; 849 ideal I = x2+xy2z-2xy+y4+y2+z2, 850 -x3y2+xy2z+xyz3-2xy+y4, 851 -2x2y+xy4+yz4-3; 900 852 901 853 //Roczen 902 ring R=0,(a,b,c,d,e,f,g,h,k,o),dp; 903 ideal I= 904 o+1, 905 k4+k, 906 hk, 907 h4+h, 908 gk, 909 gh, 910 g3+h3+k3+1, 911 fk, 912 f4+f, 913 eh, 914 ef, 915 f3h3+e3k3+e3+f3+h3+k3+1, 916 e3g+f3g+g, 917 e4+e, 918 dh3+dk3+d, 919 dg, 920 df, 921 de, 922 d3+e3+f3+1, 923 e2g2+d2h2+c, 924 f2g2+d2k2+b, 925 f2h2+e2k2+a; 854 ring R = 0,(a,b,c,d,e,f,g,h,k,o),dp; 855 ideal I = o+1, k4+k, hk, h4+h, gk, gh, g3+h3+k3+1, 856 fk, f4+f, eh, ef, f3h3+e3k3+e3+f3+h3+k3+1, 857 e3g+f3g+g, e4+e, dh3+dk3+d, dg, df, de, 858 d3+e3+f3+1, e2g2+d2h2+c, f2g2+d2k2+b, 859 f2h2+e2k2+a; 926 860 927 861 //4 bodies with equal masses, before symmetrisation. 928 862 //We are looking for the real positive solutions 929 ring R=0,(B,D,F,b,d,f),dp; 930 931 ring R=0,(B,b,D,d,F,f),dp; 932 ideal I=(b-d)*(B-D)-2*F+2, 933 (b-d)*(B+D-2*F)+2*(B-D), 934 (b-d)^2-2*(b+d)+f+1, 935 B^2*b^3-1,D^2*d^3-1,F^2*f^3-1; 936 937 ring R=0,(B,b,D,d,F,f),dp; 938 ideal I=(b-d)*(B-D)-F+1, 939 (b-d)*(B+D-F)+(B-D), 940 (b-d)^2-(b+d)+f+1, 941 B^2*b^3-1,D^2*d^3-1,F^2*f^3-1; 863 ring R = 0,(B,b,D,d,F,f),dp; 864 ideal I = (b-d)*(B-D)-2*F+2, 865 (b-d)*(B+D-2*F)+2*(B-D), 866 (b-d)^2-2*(b+d)+f+1, 867 B^2*b^3-1,D^2*d^3-1,F^2*f^3-1; 868 869 ring R = 0,(B,b,D,d,F,f),dp; 870 ideal I = (b-d)*(B-D)-F+1, 871 (b-d)*(B+D-F)+(B-D), 872 (b-d)^2-(b+d)+f+1, 873 B^2*b^3-1,D^2*d^3-1,F^2*f^3-1; 942 874 943 875 944 876 //prime 945 ring R=0,(x,y,z,t,u),dp; 946 947 ideal I=2x2-2y2+2z2-2t2+2u2-1, 877 ring R = 0,(x,y,z,t,u),dp; 878 ideal I = 2x2-2y2+2z2-2t2+2u2-1, 948 879 2x3-2y3+2z3-2t3+2u3-1, 949 2x4-2y4+2z4-2t4+2u4-1,950 2x5-2y5+2z5-2t5+2u5-1,951 2x6-2y6+2z6-2t6+2u6-1;880 2x4-2y4+2z4-2t4+2u4-1, 881 2x5-2y5+2z5-2t5+2u5-1, 882 2x6-2y6+2z6-2t6+2u6-1; 952 883 953 884 */ -
Property
mode
changed from
Note: See TracChangeset
for help on using the changeset viewer.