Changeset 3939bc in git for Singular/LIB/primdec.lib
- Timestamp:
- May 29, 1998, 5:02:06 PM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- 1d4300694bf8c8b67ec71e837ab58b13264fedf7
- Parents:
- 311499b3c35b89d435a5b5b44c51e0ace5b13c6c
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/primdec.lib
r311499 r3939bc 1 // $Id: primdec.lib,v 1.2 0 1998-05-20 13:03:56 schmidtExp $1 // $Id: primdec.lib,v 1.21 1998-05-29 15:02:00 Singular Exp $ 2 2 //////////////////////////////////////////////////////////////////////////////// 3 3 // primdec.lib // … … 8 8 // algorithms for primary decomposition based on // 9 9 // the ideas of Shimoyama/Yokoyama // 10 // written by Wolfram Decker and Hans Schoenemann // 10 // written by Wolfram Decker and Hans Schoenemann // 11 11 //////////////////////////////////////////////////////////////////////////////// 12 12 13 version="$Id: primdec.lib,v 1.2 0 1998-05-20 13:03:56 schmidtExp $";13 version="$Id: primdec.lib,v 1.21 1998-05-29 15:02:00 Singular Exp $"; 14 14 info=" 15 15 LIBRARY: primdec.lib: PROCEDURE FOR PRIMARY DECOMPOSITION … … 193 193 ideal fac=tsil[2]; 194 194 poly f=tsil[3]; 195 195 196 196 ideal star=quotient(laedi,f); 197 197 action=1; … … 208 208 g=1; 209 209 verg=laedi; 210 210 211 211 for(j=1;j<=size(fac);j++) 212 212 { … … 217 217 } 218 218 verg=quotient(laedi,g); 219 219 220 220 if(specialIdealsEqual(verg,star)==1) 221 221 { … … 231 231 } 232 232 } 233 l=star,fac,f; 233 l=star,fac,f; 234 234 return(l); 235 235 } … … 239 239 { 240 240 poly keep=p; 241 241 242 242 int i; 243 243 poly q=act[1][1]^act[2][1]; … … 252 252 "ERROR IN FACTOR"; 253 253 basering; 254 254 255 255 act; 256 256 keep; 257 257 pause; 258 258 259 259 p; 260 260 q; … … 478 478 m=m-1; 479 479 } 480 //check whether i[m] =(c*var(n)+h)^e modulo prm for some 480 //check whether i[m] =(c*var(n)+h)^e modulo prm for some 481 481 //h in K[var(n+1),...,var(nvars(basering))], c in K 482 482 //if not (0) is returned, else var(n)+h is added to prm … … 655 655 { 656 656 attrib(l[2*i-1],"isSB",1); 657 657 658 658 if((size(ser)>0)&&(size(reduce(ser,l[2*i-1],1))==0)&&(deg(l[2*i-1][1])>0)) 659 659 { 660 660 "Achtung in split"; 661 661 662 662 l[2*i-1]=ideal(1); 663 663 l[2*i]=ideal(1); … … 724 724 return(primary); 725 725 } 726 727 j=interred(j); 726 727 j=interred(j); 728 728 attrib(j,"isSB",1); 729 729 if(vdim(j)==deg(j[1])) 730 { 730 { 731 731 act=factor(j[1]); 732 732 for(@k=1;@k<=size(act[1]);@k++) … … 746 746 primary[2*@k]=interred(@qh); 747 747 attrib( primary[2*@k-1],"isSB",1); 748 748 749 749 if((size(ser)>0)&&(size(reduce(ser,primary[2*@k-1],1))==0)) 750 750 { 751 751 primary[2*@k-1]=ideal(1); 752 primary[2*@k]=ideal(1); 752 primary[2*@k]=ideal(1); 753 753 } 754 754 } … … 824 824 } 825 825 else 826 { 826 { 827 827 primary[1]=j; 828 828 if((size(#)>0)&&(act[2][1]>1)) … … 843 843 if(size(#)==0) 844 844 { 845 845 846 846 primary=splitPrimary(primary,ser,@wr,act); 847 847 848 848 } 849 849 … … 868 868 } 869 869 } 870 870 871 871 @k=0; 872 872 ideal keep; … … 894 894 jmap2[zz]=primary[2*@k-1][@n]; 895 895 @qht[@n]=var(zz); 896 896 897 897 } 898 898 } … … 906 906 phi1=@P,jmap1; 907 907 phi=@P,jmap; 908 908 909 909 for(@n=1;@n<=nva;@n++) 910 910 { … … 915 915 916 916 @qh=phi(@qht); 917 917 918 918 if(npars(@P)>0) 919 919 { … … 943 943 kill @Phelp1; 944 944 @qh=clearSB(@qh); 945 attrib(@qh,"isSB",1); 945 attrib(@qh,"isSB",1); 946 946 ser1=phi1(ser); 947 947 @lh=zero_decomp (@qh,phi(ser1),@wr); 948 948 // @lh=zero_decomp (@qh,psi(ser),@wr); 949 950 949 950 951 951 kill lres0; 952 952 list lres0; … … 1547 1547 map phi=@P,qr[2]; 1548 1548 i=qr[1]; 1549 1549 1550 1550 execute "ring gnir = ("+charstr(basering)+"),("+varstr(basering)+"),(" 1551 1551 +ordstr(basering)+");"; … … 1788 1788 } 1789 1789 } 1790 1790 1791 1791 homo=homog(i); 1792 1792 1793 1793 if(homo==1) 1794 1794 { … … 1837 1837 option(redSB); 1838 1838 1839 ideal ser=fetch(@P,ser); 1839 ideal ser=fetch(@P,ser); 1840 1840 1841 1841 if(homo==1) … … 1891 1891 } 1892 1892 } 1893 1893 1894 1894 //---------------------------------------------------------------- 1895 1895 //j is the ring … … 1929 1929 return(primary); 1930 1930 } 1931 1931 1932 1932 //------------------------------------------------------------------ 1933 1933 //the zero-dimensional case … … 1983 1983 indep=maxIndependSet(@j); 1984 1984 } 1985 1985 1986 1986 ideal jkeep=@j; 1987 1987 … … 2007 2007 ideal jwork=std(imap(gnir,@j),@hilb); 2008 2008 } 2009 2009 2010 2010 } 2011 2011 else … … 2018 2018 di=dim(jwork); 2019 2019 keepdi=di; 2020 2020 2021 2021 setring gnir; 2022 2022 for(@m=1;@m<=size(indep);@m++) … … 2034 2034 attrib(@j,"isSB",1); 2035 2035 ideal ser=fetch(gnir,ser); 2036 2036 2037 2037 } 2038 2038 else … … 2051 2051 } 2052 2052 ideal ser=phi(ser); 2053 2054 } 2055 option(noredSB); 2053 2054 } 2055 option(noredSB); 2056 2056 if((deg(@j[1])==0)||(dim(@j)<jdim)) 2057 2057 { … … 2109 2109 } 2110 2110 //the primary decomposition of j*K(var(nnp+1),..,var(nva))[..the rest..] 2111 option(redSB); 2111 option(redSB); 2112 2112 list uprimary= zero_decomp(@j,ser,@wr); 2113 2113 option(noredSB); … … 2171 2171 //mentioned above is really computed 2172 2172 for(@n=@n3/2+1;@n<=@n2/2;@n++) 2173 { 2173 { 2174 2174 if(specialIdealsEqual(quprimary[2*@n-1],quprimary[2*@n])) 2175 2175 { … … 2186 2186 } 2187 2187 } 2188 2188 2189 2189 if(size(@h)>0) 2190 2190 { … … 2196 2196 if(@wr!=1) 2197 2197 { 2198 @q=minSat(jwork,@h)[2]; 2198 @q=minSat(jwork,@h)[2]; 2199 2199 } 2200 2200 else … … 2216 2216 } 2217 2217 jwork=std(jwork,@q); 2218 keepdi=dim(jwork); 2218 keepdi=dim(jwork); 2219 2219 if(keepdi<di) 2220 2220 { … … 2241 2241 { 2242 2242 keepdi=di-1; 2243 } 2243 } 2244 2244 //--------------------------------------------------------------- 2245 2245 //notice that j=sat(j,gh) intersected with (j,gh^n) … … 2272 2272 2273 2273 if(size(ser)>0) 2274 { 2275 ser=intersect(htest,ser); 2274 { 2275 ser=intersect(htest,ser); 2276 2276 } 2277 2277 else 2278 2278 { 2279 2279 ser=htest; 2280 } 2280 } 2281 2281 setring gnir; 2282 2282 ser=imap(@Phelp,ser); 2283 2283 } 2284 2284 if(size(reduce(ser,peek,1))!=0) 2285 { 2285 { 2286 2286 for(@m=1;@m<=size(restindep);@m++) 2287 2287 { 2288 2288 // if(restindep[@m][3]>=keepdi) 2289 // { 2289 // { 2290 2290 isat=0; 2291 2291 @n2=0; 2292 2292 option(redSB); 2293 2293 2294 2294 if(restindep[@m][1]==varstr(basering)) 2295 2295 //this is the good case, nothing to do, just to have the same notations … … 2318 2318 } 2319 2319 option(noredSB); 2320 2320 2321 2321 for (lauf=1;lauf<=size(@j);lauf++) 2322 2322 { … … 2367 2367 } 2368 2368 //the primary decomposition of j*K(var(nnp+1),..,var(nva))[..the rest..] 2369 2369 2370 2370 option(redSB); 2371 2371 list uprimary= zero_decomp(@j,ser,@wr); 2372 2372 option(noredSB); 2373 2374 2373 2374 2375 2375 //we need the intersection of the ideals in the list quprimary with the 2376 2376 //polynomialring, i.e. let q=(f1,...,fr) in the quotientring such an ideal … … 2407 2407 @n2=size(quprimary); 2408 2408 @n3=@n2; 2409 2409 2410 2410 for(@n1=1;@n1<=size(collectprimary)/2;@n1++) 2411 2411 { … … 2420 2420 } 2421 2421 } 2422 2423 2422 2423 2424 2424 //here the intersection with the polynomialring 2425 2425 //mentioned above is really computed … … 2460 2460 ser=imap(@Phelp,ser); 2461 2461 } 2462 2462 2463 2463 // } 2464 } 2464 } 2465 2465 if(size(reduce(ser,peek,1))!=0) 2466 2466 { … … 2482 2482 } 2483 2483 } 2484 2484 2485 2485 } 2486 2486 //------------------------------------------------------------ … … 2488 2488 //the final result: primary 2489 2489 //------------------------------------------------------------ 2490 2490 2491 2491 setring @P; 2492 2492 primary=imap(gnir,quprimary); … … 2520 2520 return(phi(j)); 2521 2521 } 2522 2522 2523 2523 2524 2524 /////////////////////////////////////////////////////////////////////////////// … … 2534 2534 return(ideal(0)); 2535 2535 } 2536 2536 2537 2537 def @P = basering; 2538 2538 list indep,allindep,restindep,fett,@mu; … … 2594 2594 2595 2595 return(ideal(@p)); 2596 } 2596 } 2597 2597 //------------------------------------------------------------------ 2598 2598 //the case of a complete intersection … … 2610 2610 if (jdim==0) 2611 2611 { 2612 @j1=finduni(@j); 2612 @j1=finduni(@j); 2613 2613 for(@k=1;@k<=size(@j1);@k++) 2614 2614 { … … 2625 2625 return(@j); 2626 2626 } 2627 2627 2628 2628 //------------------------------------------------------------------ 2629 2629 //search for a maximal independent set indep,i.e. … … 2634 2634 2635 2635 indep=maxIndependSet(@j); 2636 2636 2637 2637 di=dim(@j); 2638 2638 … … 2763 2763 { 2764 2764 fac=ideal(0); 2765 for(lauf=1;lauf<=ncols(@h);lauf++) 2765 for(lauf=1;lauf<=ncols(@h);lauf++) 2766 2766 { 2767 2767 if(deg(@h[lauf])>0) … … 2777 2777 } 2778 2778 2779 2779 2780 2780 @mu=mstd(quotient(@j+ideal(@q),rad)); 2781 2781 @j=@mu[1]; 2782 2782 attrib(@j,"isSB",1); 2783 2783 2784 2784 } 2785 2785 if((deg(rad[1])>0)&&(deg(collectrad[1])>0)) … … 2796 2796 2797 2797 te=simplify(reduce(te*rad,@j),2); 2798 2798 2799 2799 if((dim(@j)<di)||(size(te)==0)) 2800 2800 { … … 2810 2810 { 2811 2811 return(rad); 2812 } 2812 } 2813 2813 // rad=intersect(rad,radicalKL(@mu,rad,@wr)); 2814 2814 rad=intersect(rad,radicalKL(@mu,ideal(1),@wr)); … … 2829 2829 il=#[1]; 2830 2830 } 2831 2831 2832 2832 option(redSB); 2833 2833 list m=mstd(i); … … 2846 2846 return(quotient(I,J)); 2847 2847 } 2848 2848 2849 2849 for(l=1;l<=cod;l++) 2850 2850 { … … 2864 2864 if(il==1) 2865 2865 { 2866 2866 2867 2867 return(radI1); 2868 2868 } … … 2874 2874 return(radI1); 2875 2875 } 2876 return(intersect(radI1,radicalEHV(I2,re,il))); 2876 return(intersect(radI1,radicalEHV(I2,re,il))); 2877 2877 } 2878 2878 } … … 2904 2904 } 2905 2905 return(ann); 2906 } 2907 2906 } 2907 2908 2908 /////////////////////////////////////////////////////////////////////////////// 2909 2909 … … 2915 2915 { 2916 2916 matrix f=transpose(re[n+1]); //Hom(_,R) 2917 module k= res(f,2)[2];//the kernel2917 module k=nres(f,2)[2]; //the kernel 2918 2918 matrix g=transpose(re[n]); //the image of Hom(_,R) 2919 2919 … … 2924 2924 ideal ann=Ann(transpose(re[n])); 2925 2925 } 2926 return(ann); 2926 return(ann); 2927 2927 } 2928 2928 /////////////////////////////////////////////////////////////////////////////// … … 2937 2937 re=intersect1(re,quotient(a,module(b[i]))); 2938 2938 } 2939 return(re); 2939 return(re); 2940 2940 } 2941 2941 … … 2944 2944 2945 2945 proc analyze(list pr) 2946 { 2946 { 2947 2947 int ii,jj; 2948 2948 for(ii=1;ii<=size(pr)/2;ii++) … … 2964 2964 } 2965 2965 } 2966 } 2966 } 2967 2967 } 2968 2968 … … 2976 2976 { 2977 2977 def r=basering; 2978 2978 2979 2979 int j,k; 2980 2980 map phi; 2981 2981 poly p; 2982 2982 2983 2983 ideal iwork=i; 2984 2984 ideal imap1=maxideal(1); 2985 2985 ideal imap2=maxideal(1); 2986 2986 2987 2987 2988 2988 for(j=1;j<=nvars(basering);j++) … … 2999 2999 iwork[k]=var(j); 3000 3000 imap1=maxideal(1); 3001 imap2[j]=-p; 3001 imap2[j]=-p; 3002 3002 break; 3003 3003 } … … 3007 3007 } 3008 3008 3009 3009 3010 3010 /////////////////////////////////////////////////////// 3011 3011 // ini_mod … … 3605 3605 } 3606 3606 } 3607 3607 dimSP=dim(SP); 3608 3608 for(j=size(m);j>=1; j--) 3609 3609 { … … 3802 3802 { 3803 3803 f=polys[k]; 3804 3804 degf=deg(f); 3805 3805 } 3806 3806 } … … 4012 4012 return(0); 4013 4013 } 4014 4015 4014 4015 4016 4016 proc quotient2(module a,module b) 4017 4017 { … … 4030 4030 setring @newP; 4031 4031 ideal re=imap(@newr,re); 4032 return(re); 4032 return(re); 4033 4033 } 4034 4034 /////////////////////////////////////////////////////////////////////////////// … … 4043 4043 re[i]=he; 4044 4044 } 4045 return(re); 4045 return(re); 4046 4046 } 4047 4047 /////////////////////////////////////////////////////////////////////////////// … … 4056 4056 re[2*i]=l[i][2]; 4057 4057 } 4058 return(re); 4058 return(re); 4059 4059 } 4060 4060 … … 4066 4066 4067 4067 proc primdecGTZ(ideal i) 4068 "USAGE: primdecGTZ(i); i ideal 4069 RETURN: list = list of primary ideals 4068 "USAGE: primdecGTZ(i); i ideal 4069 RETURN: list = list of primary ideals 4070 4070 and their associated primes 4071 4071 NOTE: Algorithm of Gianni, Traeger, Zacharias … … 4087 4087 4088 4088 proc primdecSY(ideal i) 4089 "USAGE: primdecSY(i); i ideal 4090 RETURN: list = list of primary ideals 4089 "USAGE: primdecSY(i); i ideal 4090 RETURN: list = list of primary ideals 4091 4091 and their associated primes 4092 4092 NOTE: Algorithm of Shimoyama-Yokoyama … … 4149 4149 proc equiRadical(ideal i) 4150 4150 "USAGE: equiRadical(i); i ideal 4151 RETURN: ideal = the intersection of associated primes 4151 RETURN: ideal = the intersection of associated primes 4152 4152 of i of dimension of i 4153 4153 NOTE: … … 4170 4170 "USAGE: radical(i); i ideal 4171 4171 RETURN: ideal = the radical of i 4172 NOTE: a combination of the algorithms of Krick/Logar 4172 NOTE: a combination of the algorithms of Krick/Logar 4173 4173 and Eisenbud/Huneke/Vasconcelos 4174 4174 EXAMPLE: example radical; shows an example … … 4179 4179 if(size(#)>0) 4180 4180 { 4181 il=#[1]; 4181 il=#[1]; 4182 4182 } 4183 4183 ideal re=1; … … 4186 4186 map phi=@P,qr[2]; 4187 4187 i=qr[1]; 4188 4188 4189 4189 list pr=facstd(i); 4190 4190 … … 4223 4223 int odim=dim(pr[1]); 4224 4224 int count=1; 4225 4225 4226 4226 for(j=2;j<=s;j++) 4227 4227 { … … 4281 4281 else 4282 4282 { 4283 list re=mres(i,0);4284 } 4283 list re=mres(i,0); 4284 } 4285 4285 for(e=cod;e<=nvars(basering);e++) 4286 4286 { … … 4293 4293 } 4294 4294 return(er); 4295 } 4295 } 4296 4296 example 4297 4297 { "EXAMPLE:"; echo = 2; … … 4306 4306 proc testPrimary(list pr, ideal k) 4307 4307 "USAGE: testPrimary(pr,k) pr=primdecGTZ(k) or primdecSY(k) 4308 RETURN: int = 1, if the intersection of the primary ideals 4308 RETURN: int = 1, if the intersection of the primary ideals 4309 4309 in pr is k, 0 if not 4310 4310 NOTE:
Note: See TracChangeset
for help on using the changeset viewer.