Changeset 0266ac in git
- Timestamp:
- Jun 20, 2006, 5:59:42 PM (17 years ago)
- Branches:
- (u'spielwiese', '91fdef05f09f54b8d58d92a472e9c4a43aa4656f')
- Children:
- e6cbed94a014891c3db90b82149bb853254bb0d9
- Parents:
- 88b2dd92d922dd2e8a9f9759e7edde2f1e1d2829
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/primdec.lib
r88b2dd r0266ac 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: primdec.lib,v 1.1 19 2006-06-20 11:55:10Singular Exp $";2 version="$Id: primdec.lib,v 1.120 2006-06-20 15:59:42 Singular Exp $"; 3 3 category="Commutative Algebra"; 4 4 info=" … … 1022 1022 } 1023 1023 1024 if(voice>=8){ primary=extF(primary) }1024 if(voice>=8){primary=extF(primary);}; 1025 1025 1026 1026 //test whether all ideals in the decomposition are primary and … … 2064 2064 if(size(#) > 0){ 2065 2065 int valid; 2066 for(j = 1; j <= size(#); j++) 2067 { 2066 for(j = 1; j <= size(#); j++){ 2068 2067 valid = 0; 2069 if((typeof(#[j]) == "int") or (typeof(#[j]) == "number")) 2070 { 2071 if (#[j] == 0) {facstdOption = "noFacstd"; valid = 1;} // facstd is not used. 2072 if (#[j] == 1) {facstdOption = "facstd"; valid = 1;} // facstd is used. 2073 } 2074 if(typeof(#[j]) == "string") 2075 { 2076 if(#[j] == "GTZ" || #[j] == "SL") 2077 { 2068 if((typeof(#[j]) == "int") or (typeof(#[j]) == "number")) { 2069 if (#[j] == 0) {facstdOption = "noFacstd"; valid = 1;}; // If #[j] == 0, facstd is not used. 2070 if (#[j] == 1) {facstdOption = "facstd"; valid = 1;}; // If #[j] == 1, facstd is used. 2071 }; 2072 if(typeof(#[j]) == "string"){ 2073 if(#[j] == "GTZ" || #[j] == "SL") { 2078 2074 algorithm = #[j]; 2079 2075 valid = 1; 2080 } 2081 if(#[j] == "noFacstd" || #[j] == "facstd") 2082 { 2076 }; 2077 if(#[j] == "noFacstd" || #[j] == "facstd") { 2083 2078 facstdOption = #[j]; 2084 2079 valid = 1; 2085 } 2086 } 2087 if(valid == 0) 2088 { 2080 }; 2081 }; 2082 if(valid == 0) { 2089 2083 dbprint(1, "Warning! The following input parameter was not recognized:", #[j]); 2090 } 2091 } 2092 } 2084 }; 2085 }; 2086 }; 2093 2087 2094 2088 list q = simplifyIdeal(i); … … 2142 2136 attrib(pr[k], "isSB", 1); 2143 2137 // Lines changed 2144 if (algorithm == "GTZ") 2145 { 2138 if (algorithm == "GTZ") { 2146 2139 qr = decomp(pr[k], 2); 2147 } 2148 else 2149 { 2140 } else { 2150 2141 qr = newMinAssSL(pr[k]); 2151 }2142 }; 2152 2143 for(j = 1; j <= size(qr) / 2; j++) 2153 2144 { … … 2163 2154 2164 2155 // Lines changed 2165 if ((facstdOption == "noFacstd") || (dim(i) == 0)) 2166 { 2167 if (algorithm == "GTZ") 2168 { 2169 re[1] = decomp(i, 2); 2170 } 2171 else 2172 { 2173 re[1] = newMinAssSL(i); 2174 } 2175 re = union(re); 2176 option(set, op); 2177 return(phi(re)); 2178 } 2156 if ((facstdOption == "noFacstd") || (dim(i) == 0)) { 2157 if (algorithm == "GTZ") { 2158 re[1] = decomp(i, 2); 2159 } else { 2160 re[1] = newMinAssSL(i); 2161 }; 2162 re = union(re); 2163 option(set, op); 2164 return(phi(re)); 2165 }; 2179 2166 2180 2167 q = facstd(i); … … 2196 2183 } 2197 2184 kill gnir; 2198 } 2185 }; 2199 2186 */ 2200 2187 … … 2208 2195 dbprint(printlevel - voice, "We compute the decomp of component", j); 2209 2196 // Lines changed 2210 if (algorithm == "GTZ") 2211 { 2212 re[j] = decomp(q[j], 2); 2213 } 2214 else 2215 { 2216 re[j] = newMinAssSL(q[j]); 2217 } 2197 if (algorithm == "GTZ") { 2198 re[j] = decomp(q[j], 2); 2199 } else { 2200 re[j] = newMinAssSL(q[j]); 2201 }; 2218 2202 // Debug 2219 2203 dbprint(printlevel - voice, "Number of components obtained for this component:", size(re[j]) / 2); 2220 2204 dbprint(printlevel - voice, "re[j]:", re[j]); 2221 } 2205 }; 2222 2206 re = union(re); 2223 2207 … … 5518 5502 if(size(#) > 0){ 5519 5503 int valid; 5520 for(j = 1; j <= size(#); j++) 5521 { 5504 for(j = 1; j <= size(#); j++){ 5522 5505 valid = 0; 5523 if((typeof(#[j]) == "int") or (typeof(#[j]) == "number")) 5524 { 5525 if (#[j] == 1) {facstdOption = "noFacstd"; valid = 1;} // facstd is not used. 5526 if (#[j] == 0) {facstdOption = "facstd"; valid = 1;} // facstd is used. 5527 } 5528 if(typeof(#[j]) == "string") 5529 { 5530 if((#[j] == "GTZ") || (#[j] == "SL")) 5531 { 5506 if((typeof(#[j]) == "int") or (typeof(#[j]) == "number")) { 5507 if (#[j] == 1) {facstdOption = "noFacstd"; valid = 1;}; // If #[j] == 1, facstd is not used. 5508 if (#[j] == 0) {facstdOption = "facstd"; valid = 1;}; // If #[j] == 0, facstd is used. 5509 }; 5510 if(typeof(#[j]) == "string"){ 5511 if((#[j] == "GTZ") || (#[j] == "SL")) { 5532 5512 algorithm = #[j]; 5533 5513 valid = 1; 5534 } 5535 if((#[j] == "noFacstd") || (#[j] == "facstd")) 5536 { 5514 }; 5515 if((#[j] == "noFacstd") || (#[j] == "facstd")) { 5537 5516 facstdOption = #[j]; 5538 5517 valid = 1; 5539 } 5540 } 5541 if(valid == 0) 5542 { 5518 }; 5519 }; 5520 if(valid == 0) { 5543 5521 dbprint(1, "Warning! The following input parameter was not recognized:", #[j]); 5544 } 5545 } 5546 } 5522 }; 5523 }; 5524 }; 5547 5525 5548 5526 if(ord_test(basering)!=1) … … 5555 5533 { 5556 5534 return(algeDeco(i,2)); 5557 } 5535 }; 5558 5536 5559 5537 list result; … … 5661 5639 5662 5640 // Set input parameters 5663 algorithm = "SL"; // Default: SL algorithm 5664 il = 0; // Default: Full radical (not only equidim part) 5665 if (homog(i) == 1) 5666 { // Default: facStd is used, except if the ideal is homogeneous. 5667 useFac = 0; 5668 } 5669 else 5670 { 5671 useFac = 1; 5672 } 5673 if(size(#) > 0) 5674 { 5675 int valid; 5676 for(j = 1; j <= size(#); j++) 5677 { 5678 valid = 0; 5679 if((typeof(#[j]) == "int") or (typeof(#[j]) == "number")) 5680 { 5681 il = #[j]; // If il == 1, equiRadical is computed 5682 valid = 1; 5683 } 5684 if(typeof(#[j]) == "string") 5685 { 5686 if(#[j] == "KL") 5687 { 5688 algorithm = "KL"; 5689 valid = 1 5690 } 5691 if(#[j] == "KLdp") 5692 { 5693 algorithm = "KLdp"; 5694 valid = 1 5695 } 5696 if(#[j] == "SL") 5697 { 5698 algorithm = "SL"; 5699 valid = 1 5700 } 5701 if(#[j] == "noFacstd") 5702 { 5703 useFac = 0; 5704 valid = 1 5705 } 5706 if(#[j] == "facstd") 5707 { 5708 useFac = 1; 5709 valid = 1 5710 } 5711 if(#[j] == "equiRad") 5712 { 5713 il = 1; 5714 valid = 1 5715 } 5716 if(#[j] == "fullRad") 5717 { 5718 il = 0; 5719 valid = 1 5720 } 5721 } 5722 if(valid == 0) 5723 { 5724 dbprint(1, "Warning! The following input parameter was not recognized:", #[j]); 5725 } 5726 } 5727 } 5641 algorithm = "SL"; // Default: SL algorithm 5642 il = 0; // Default: Full radical (not only equidim part) 5643 if (homog(i) == 1) { // Default: facStd is used, except if the ideal is homogeneous. 5644 useFac = 0; 5645 } else { 5646 useFac = 1; 5647 }; 5648 if(size(#) > 0){ 5649 int valid; 5650 for(j = 1; j <= size(#); j++){ 5651 valid = 0; 5652 if((typeof(#[j]) == "int") or (typeof(#[j]) == "number")) { 5653 il = #[j]; // If il == 1, equiRadical is computed 5654 valid = 1; 5655 }; 5656 if(typeof(#[j]) == "string"){ 5657 if(#[j] == "KL") { 5658 algorithm = "KL"; 5659 valid = 1}; 5660 if(#[j] == "KLdp") { 5661 algorithm = "KLdp"; 5662 valid = 1}; 5663 if(#[j] == "SL") { 5664 algorithm = "SL"; 5665 valid = 1}; 5666 if(#[j] == "noFacstd") { 5667 useFac = 0; 5668 valid = 1}; 5669 if(#[j] == "facstd") { 5670 useFac = 1; 5671 valid = 1}; 5672 if(#[j] == "equiRad") { 5673 il = 1; 5674 valid = 1}; 5675 if(#[j] == "fullRad") { 5676 il = 0; 5677 valid = 1}; 5678 }; 5679 if(valid == 0) { 5680 dbprint(1, "Warning! The following input parameter was not recognized:", #[j]); 5681 }; 5682 }; 5683 }; 5728 5684 5729 5685 if(size(i) == 0){return(ideal(0));} … … 5751 5707 { 5752 5708 pr = facstd(i); 5753 } 5754 else 5755 { 5756 pr = i 5757 } 5709 } else { 5710 pr = i 5711 }; 5758 5712 option(set, op); 5759 5713 int s = size(pr); 5760 if(useFac == 1) 5761 { 5714 if(useFac == 1) { 5762 5715 dbprint(printlevel - voice, "Number of components returned by facstd: ", s); 5763 } 5716 }; 5764 5717 for(j = 1; j <= s; j++) 5765 5718 { 5766 attrib(pr[s + 1 - j], "isSB", 1); 5767 if((size(reduce(rad, pr[s + 1 - j], 1)) != 0) && ((dim(pr[s + 1 - j]) == di) || !il)) 5768 { 5769 // SL Debug messages 5770 dbprint(printlevel-voice, "We shall compute the radical of ", pr[s + 1 - j]); 5771 dbprint(printlevel-voice, "The dimension is: ", dim(pr[s+1-j])); 5772 5773 if(algorithm == "KL") 5774 { 5775 rad = intersect(rad, radicalKL(pr[s + 1 - j], rad, il)); 5776 } 5777 if(algorithm == "KLdp") 5778 { 5779 rad = intersect(rad, newRadicalKL(pr[s + 1 - j], rad, il)); 5780 } 5781 if(algorithm == "SL") 5782 { 5783 rad = intersect(rad, newRadicalSL(pr[s + 1 - j], il)); 5784 } 5785 } 5786 else 5787 { 5788 // SL Debug 5789 dbprint(printlevel-voice, "The radical of this component is not needed."); 5790 dbprint(printlevel-voice, "size(reduce(rad, pr[s + 1 - j], 1))", size(reduce(rad, pr[s + 1 - j], 1))); 5791 dbprint(printlevel-voice, "dim(pr[s + 1 - j])", dim(pr[s + 1 - j])); 5792 dbprint(printlevel-voice, "il", il); 5793 } 5719 attrib(pr[s + 1 - j], "isSB", 1); 5720 if((size(reduce(rad, pr[s + 1 - j], 1)) != 0) && ((dim(pr[s + 1 - j]) == di) || !il)) 5721 { 5722 // SL Debug messages 5723 dbprint(printlevel-voice, "We shall compute the radical of ", pr[s + 1 - j]); 5724 dbprint(printlevel-voice, "The dimension is: ", dim(pr[s+1-j])); 5725 5726 if(algorithm == "KL") { 5727 rad = intersect(rad, radicalKL(pr[s + 1 - j], rad, il)); 5728 } 5729 if(algorithm == "KLdp") { 5730 rad = intersect(rad, newRadicalKL(pr[s + 1 - j], rad, il)); 5731 } 5732 if(algorithm == "SL") { 5733 rad = intersect(rad, newRadicalSL(pr[s + 1 - j], il)); 5734 }; 5735 } else 5736 { 5737 // SL Debug 5738 dbprint(printlevel-voice, "The radical of this component is not needed."); 5739 dbprint(printlevel-voice, "size(reduce(rad, pr[s + 1 - j], 1))", size(reduce(rad, pr[s + 1 - j], 1))); 5740 dbprint(printlevel-voice, "dim(pr[s + 1 - j])", dim(pr[s + 1 - j])); 5741 dbprint(printlevel-voice, "il", il); 5742 }; 5794 5743 } 5795 5744 return(interred(phi(rad))); … … 5816 5765 // and radicalKL removed. 5817 5766 // 5818 static proc newRadicalKL(ideal I, ideal ser, list #) 5819 { 5820 // I The ideal for which the radical is computed 5821 // ideal ser Same as in radicalKL (used to reduce components already obtained) 5822 // list # If #[1] = 1, equiradical is computed. 5823 5824 // I needs to be a Groebner basis. 5825 if (attrib(I, "isSB") != 1) 5826 { 5827 I = groebner(I); 5828 } 5829 5830 ideal rad; // The radical 5831 int allIndep = 1; // All max independent sets are used 5832 5833 list result = newRadicalReduction(I, ser, allIndep, #); 5834 int done = result[3]; 5835 rad = result[1]; 5836 if (done == 0) 5837 { 5838 rad = intersect(rad, newRadicalKL(result[2], ideal(1), #)); 5839 } 5840 return(rad); 5841 } 5767 static proc newRadicalKL(ideal I, ideal ser, list #) { 5768 // I The ideal for which the radical is computed 5769 // ideal ser Same as in radicalKL (used to reduce components already obtained) 5770 // list # If #[1] = 1, equiradical is computed. 5771 5772 // I needs to be a Groebner basis. 5773 if (attrib(I, "isSB") != 1) { 5774 I = groebner(I); 5775 }; 5776 5777 ideal rad; // The radical 5778 int allIndep = 1; // All max independent sets are used 5779 5780 list result = newRadicalReduction(I, ser, allIndep, #); 5781 int done = result[3]; 5782 rad = result[1]; 5783 if (done == 0) { 5784 rad = intersect(rad, newRadicalKL(result[2], ideal(1), #)); 5785 }; 5786 return(rad); 5787 }; 5788 5842 5789 5843 5790 /////////////////////////////////////////////////////////////////////////////// … … 5854 5801 // obtained in intermediate steps. 5855 5802 { 5856 ideal rad = 1; 5857 ideal equiRad = 1; 5858 list primes; 5859 int k; // Counter 5860 int il; // If il = 1, only the equiradical is required. 5861 int iDim; // The dimension of I 5862 int stop = 0; // Checks if the radical has been obtained 5863 5864 if (attrib(I, "isSB") != 1) 5865 { 5866 I = groebner(I); 5867 } 5868 iDim = dim(I); 5869 5870 // Checks if only equiradical is required 5871 if (size(#) > 0) 5872 { 5873 il = #[1]; 5874 } 5875 5876 while(stop == 0) 5877 { 5878 dbprint (printlevel-voice, "// We call radLoopR to find new prime ideals."); 5879 primes = newRadicalSLIteration(I, rad); // A list of primes or intersections of primes, not included in P 5880 dbprint (printlevel - voice, "// Output of Iteration Step:"); 5881 dbprint (printlevel - voice, primes); 5882 if (size(primes) > 0) 5883 { 5884 dbprint (printlevel - voice, "// We intersect P with the ideal just obtained."); 5885 for(k = 1; k <= size(primes); k++) 5886 { 5887 rad = intersect(rad, primes[k]); 5888 if (il == 1) 5889 { 5890 if (attrib(primes[k], "isSB") != 1) 5891 { 5892 primes[k] = groebner(primes[k]); 5893 } 5894 if (iDim == dim(primes[k])) 5895 { 5896 equiRad = intersect(equiRad, primes[k]); 5897 } 5898 } 5899 } 5900 } 5901 else 5902 { 5903 stop = 1; 5904 } 5905 } 5906 if (il == 0) 5907 { 5908 return(rad); 5909 } 5910 else 5911 { 5912 return(equiRad); 5913 } 5914 } 5803 ideal rad = 1; 5804 ideal equiRad = 1; 5805 list primes; 5806 int k; // Counter 5807 int il; // If il = 1, only the equiradical is required. 5808 int iDim; // The dimension of I 5809 int stop = 0; // Checks if the radical has been obtained 5810 5811 if (attrib(I, "isSB") != 1) { 5812 I = groebner(I); 5813 }; 5814 iDim = dim(I); 5815 5816 // Checks if only equiradical is required 5817 if (size(#) > 0) { 5818 il = #[1]; 5819 }; 5820 5821 while(stop == 0) { 5822 dbprint (printlevel-voice, "// We call radLoopR to find new prime ideals."); 5823 primes = newRadicalSLIteration(I, rad); // A list of primes or intersections of primes, not included in P 5824 dbprint (printlevel - voice, "// Output of Iteration Step:"); 5825 dbprint (printlevel - voice, primes); 5826 if (size(primes) > 0) { 5827 dbprint (printlevel - voice, "// We intersect P with the ideal just obtained."); 5828 for(k = 1; k <= size(primes); k++) { 5829 rad = intersect(rad, primes[k]); 5830 if (il == 1){ 5831 if (attrib(primes[k], "isSB") != 1) { 5832 primes[k] = groebner(primes[k]); 5833 }; 5834 if (iDim == dim(primes[k])) { 5835 equiRad = intersect(equiRad, primes[k]); 5836 }; 5837 }; 5838 }; 5839 } else { 5840 stop = 1; 5841 }; 5842 }; 5843 if (il == 0) { 5844 return(rad); 5845 } else { 5846 return(equiRad); 5847 }; 5848 }; 5915 5849 5916 5850 ////////////////////////////////////////////////////////////////////////// … … 5927 5861 // This is not used in the new algorithm. It is part of KL algorithm 5928 5862 5929 static proc newRadicalReduction(ideal I, ideal ser, int allIndep, list #) 5930 { 5863 static proc newRadicalReduction(ideal I, ideal ser, int allIndep, list #) { 5931 5864 // allMaximal 1 -> Indicates that the reduction to the zerodim case 5932 5865 // must be done for all indep set of the leading terms ideal … … 5936 5869 // It is used to set the value of done.) 5937 5870 5938 attrib(I, "isSB", 1); // I needs to be a reduced standard basis5939 list indep, fett;5940 intvec @w, @hilb, op;5941 int @wr, @n, @m, lauf, di;5942 ideal fac, @h, collectrad, lsau;5943 poly @q;5944 string @va, quotring;5945 5946 def @P = basering;5947 int jdim = dim(I); // Computes the dimension of I5948 int homo = homog(I); // Finds out if I is homogeneous5949 ideal rad = ideal(1); // The unit ideal5950 ideal te = ser;5951 if(size(#) > 0)5952 {5953 @wr = #[1];5954 }5955 if(homo == 1)5956 {5957 for(@n = 1; @n <= nvars(basering); @n++)5958 {5959 @w[@n] = ord(var(@n));5960 }5961 @hilb = hilb(I, 1, @w);5962 }5963 5964 // SL 2006.04.11 1 Debug messages5965 dbprint(printlevel-voice, "//Computes the radical of the ideal:", I);5966 // SL 2006.04.11 2 Debug messages5871 attrib(I, "isSB", 1); // I needs to be a reduced standard basis 5872 list indep, fett; 5873 intvec @w, @hilb, op; 5874 int @wr, @n, @m, lauf, di; 5875 ideal fac, @h, collectrad, lsau; 5876 poly @q; 5877 string @va, quotring; 5878 5879 def @P = basering; 5880 int jdim = dim(I); // Computes the dimension of I 5881 int homo = homog(I); // Finds out if I is homogeneous 5882 ideal rad = ideal(1); // The unit ideal 5883 ideal te = ser; 5884 if(size(#) > 0) 5885 { 5886 @wr = #[1]; 5887 } 5888 if(homo == 1) 5889 { 5890 for(@n = 1; @n <= nvars(basering); @n++) 5891 { 5892 @w[@n] = ord(var(@n)); 5893 } 5894 @hilb = hilb(I, 1, @w); 5895 } 5896 5897 // SL 2006.04.11 1 Debug messages 5898 dbprint(printlevel-voice, "//Computes the radical of the ideal:", I); 5899 // SL 2006.04.11 2 Debug messages 5967 5900 5968 5901 //--------------------------------------------------------------------------- … … 5970 5903 //--------------------------------------------------------------------------- 5971 5904 5972 if (jdim==-1)5973 {5974 return(ideal(1), ideal(1), 1);5975 }5905 if (jdim==-1) 5906 { 5907 return(ideal(1), ideal(1), 1); 5908 } 5976 5909 5977 5910 //--------------------------------------------------------------------------- … … 5979 5912 //--------------------------------------------------------------------------- 5980 5913 5981 if (jdim==0)5982 {5983 return(zeroRad(I), ideal(1), 1);5984 }5985 5986 //-------------------------------------------------------------------------5987 //search for a maximal independent set indep,i.e.5988 //look for subring such that the intersection with the ideal is zero5989 //j intersected with K[var(indep[3]+1),...,var(nvar)] is zero,5990 //indep[1] is the new varstring, indep[2] the string for the block-ordering5991 //-------------------------------------------------------------------------5992 5993 // SL 2006-04-24 1 If allIndep = 0, then it only computes one maximal5994 // independent set.5995 // This looks better for the new algorithm but not for KL5996 // algorithm5997 list parameters = allIndep;5998 indep = newMaxIndependSet(I, parameters);5999 // SL 2006-04-24 26000 6001 for(@m = 1; @m <= size(indep); @m++)6002 {6003 if((indep[@m][1] == varstr(basering)) && (@m == 1))6004 //this is the good case, nothing to do, just to have the same notations6005 //change the ring6006 {6007 execute("ring gnir1 = ("+charstr(basering)+"),("+varstr(basering)+"),("5914 if (jdim==0) 5915 { 5916 return(zeroRad(I), ideal(1), 1); 5917 } 5918 5919 //------------------------------------------------------------------------- 5920 //search for a maximal independent set indep,i.e. 5921 //look for subring such that the intersection with the ideal is zero 5922 //j intersected with K[var(indep[3]+1),...,var(nvar)] is zero, 5923 //indep[1] is the new varstring, indep[2] the string for the block-ordering 5924 //------------------------------------------------------------------------- 5925 5926 // SL 2006-04-24 1 If allIndep = 0, then it only computes one maximal 5927 // independent set. 5928 // This looks better for the new algorithm but not for KL 5929 // algorithm 5930 list parameters = allIndep; 5931 indep = newMaxIndependSet(I, parameters); 5932 // SL 2006-04-24 2 5933 5934 for(@m = 1; @m <= size(indep); @m++) 5935 { 5936 if((indep[@m][1] == varstr(basering)) && (@m == 1)) 5937 //this is the good case, nothing to do, just to have the same notations 5938 //change the ring 5939 { 5940 execute("ring gnir1 = ("+charstr(basering)+"),("+varstr(basering)+"),(" 6008 5941 +ordstr(basering)+");"); 6009 ideal @j = fetch(@P, I);6010 attrib(@j, "isSB", 1);6011 }6012 else6013 {6014 @va = string(maxideal(1));6015 6016 execute("ring gnir1 = (" + charstr(basering) + "), (" + indep[@m][1] + "),("5942 ideal @j = fetch(@P, I); 5943 attrib(@j, "isSB", 1); 5944 } 5945 else 5946 { 5947 @va = string(maxideal(1)); 5948 5949 execute("ring gnir1 = (" + charstr(basering) + "), (" + indep[@m][1] + "),(" 6017 5950 + indep[@m][2] + ");"); 6018 execute("map phi = @P," + @va + ";"); 6019 if(homo == 1) 6020 { 6021 ideal @j = std(phi(I), @hilb, @w); 5951 execute("map phi = @P," + @va + ";"); 5952 if(homo == 1) 5953 { 5954 ideal @j = std(phi(I), @hilb, @w); 5955 } 5956 else 5957 { 5958 ideal @j = groebner(phi(I)); 5959 } 5960 } 5961 if((deg(@j[1]) == 0) || (dim(@j) < jdim)) 5962 { 5963 setring @P; 5964 break; 5965 } 5966 for (lauf = 1; lauf <= size(@j); lauf++) 5967 { 5968 fett[lauf] = size(@j[lauf]); 5969 } 5970 //------------------------------------------------------------------------ 5971 // We have now the following situation: 5972 // j intersected with K[var(nnp+1),..,var(nva)] is zero so we may pass 5973 // to this quotientring, j is there still a standardbasis, the 5974 // leading coefficients of the polynomials there (polynomials in 5975 // K[var(nnp+1),..,var(nva)]) are collected in the list h, 5976 // we need their LCM, gh, because of the following: 5977 // let (j:gh^n)=(j:gh^infinity) then j*K(var(nnp+1),..,var(nva))[..rest..] 5978 // intersected with K[var(1),...,var(nva)] is (j:gh^n) 5979 // on the other hand j = ((j, gh^n) intersected with (j : gh^n)) 5980 5981 //------------------------------------------------------------------------ 5982 // The arrangement for the quotientring K(var(nnp+1),..,var(nva))[..rest..] 5983 // and the map phi:K[var(1),...,var(nva)] -----> 5984 // K(var(nnpr+1),..,var(nva))[..the rest..] 5985 //------------------------------------------------------------------------ 5986 quotring = newPrepareQuotientRing(nvars(basering) - indep[@m][3]); 5987 //------------------------------------------------------------------------ 5988 // We pass to the quotientring K(var(nnp+1),..,var(nva))[..the rest..] 5989 //------------------------------------------------------------------------ 5990 5991 execute(quotring); 5992 5993 // @j considered in the quotientring 5994 ideal @j = imap(gnir1, @j); 5995 5996 kill gnir1; 5997 5998 // j is a standardbasis in the quotientring but usually not minimal 5999 // here it becomes minimal 6000 6001 @j = clearSB(@j, fett); 6002 6003 // We need later LCM(h[1],...) = gh for saturation 6004 ideal @h; 6005 if(deg(@j[1]) > 0) 6006 { 6007 for(@n = 1; @n <= size(@j); @n++) 6008 { 6009 @h[@n] = leadcoef(@j[@n]); 6010 } 6011 op = option(get); 6012 option(redSB); 6013 @j = interred(@j); //to obtain a reduced standardbasis 6014 attrib(@j, "isSB", 1); 6015 option(set, op); 6016 6017 // SL 1 Debug messages 6018 dbprint(printlevel - voice, "zero_rad", basering, @j, dim(groebner(@j))); 6019 ideal zero_rad = zeroRad(@j); 6020 dbprint(printlevel - voice, "zero_rad passed"); 6021 // SL 2 6022 6022 } 6023 6023 else 6024 6024 { 6025 ideal @j = groebner(phi(I)); 6026 } 6027 } 6028 if((deg(@j[1]) == 0) || (dim(@j) < jdim)) 6029 { 6030 setring @P; 6031 break; 6032 } 6033 for (lauf = 1; lauf <= size(@j); lauf++) 6034 { 6035 fett[lauf] = size(@j[lauf]); 6036 } 6037 //------------------------------------------------------------------------ 6038 // We have now the following situation: 6039 // j intersected with K[var(nnp+1),..,var(nva)] is zero so we may pass 6040 // to this quotientring, j is there still a standardbasis, the 6041 // leading coefficients of the polynomials there (polynomials in 6042 // K[var(nnp+1),..,var(nva)]) are collected in the list h, 6043 // we need their LCM, gh, because of the following: 6044 // let (j:gh^n)=(j:gh^infinity) then j*K(var(nnp+1),..,var(nva))[..rest..] 6045 // intersected with K[var(1),...,var(nva)] is (j:gh^n) 6046 // on the other hand j = ((j, gh^n) intersected with (j : gh^n)) 6047 6048 //------------------------------------------------------------------------ 6049 // The arrangement for the quotientring K(var(nnp+1),..,var(nva))[..rest..] 6050 // and the map phi:K[var(1),...,var(nva)] -----> 6051 // K(var(nnpr+1),..,var(nva))[..the rest..] 6052 //------------------------------------------------------------------------ 6053 quotring = newPrepareQuotientRing(nvars(basering) - indep[@m][3]); 6054 //------------------------------------------------------------------------ 6055 // We pass to the quotientring K(var(nnp+1),..,var(nva))[..the rest..] 6056 //------------------------------------------------------------------------ 6057 6058 execute(quotring); 6059 6060 // @j considered in the quotientring 6061 ideal @j = imap(gnir1, @j); 6062 6063 // j is a standardbasis in the quotientring but usually not minimal 6064 // here it becomes minimal 6065 6066 @j = clearSB(@j, fett); 6067 6068 // We need later LCM(h[1],...) = gh for saturation 6069 ideal @h; 6070 if(deg(@j[1]) > 0) 6071 { 6072 for(@n = 1; @n <= size(@j); @n++) 6073 { 6074 @h[@n] = leadcoef(@j[@n]); 6075 } 6076 op = option(get); 6077 option(redSB); 6078 @j = interred(@j); //to obtain a reduced standardbasis 6079 attrib(@j, "isSB", 1); 6080 option(set, op); 6081 6082 // SL 1 Debug messages 6083 dbprint(printlevel - voice, "zero_rad", basering, @j, dim(groebner(@j))); 6084 ideal zero_rad = zeroRad(@j); 6085 dbprint(printlevel - voice, "zero_rad passed"); 6086 // SL 2 6087 } 6088 else 6089 { 6090 ideal zero_rad = ideal(1); 6091 } 6092 6093 // We need the intersection of the ideals in the list quprimary with the 6094 // polynomialring, i.e. let q=(f1,...,fr) in the quotientring such an ideal 6095 // but fi polynomials, then the intersection of q with the polynomialring 6096 // is the saturation of the ideal generated by f1,...,fr with respect to 6097 // h which is the lcm of the leading coefficients of the fi considered in 6025 ideal zero_rad = ideal(1); 6026 } 6027 6028 // We need the intersection of the ideals in the list quprimary with the 6029 // polynomialring, i.e. let q=(f1,...,fr) in the quotientring such an ideal 6030 // but fi polynomials, then the intersection of q with the polynomialring 6031 // is the saturation of the ideal generated by f1,...,fr with respect to 6032 // h which is the lcm of the leading coefficients of the fi considered in 6098 6033 // the quotientring: this is coded in saturn 6099 6034 … … 6186 6121 } else { 6187 6122 done = 0; 6188 } 6123 }; 6189 6124 // SL 2006.04.21 2 6190 6125 … … 6193 6128 return(result); 6194 6129 // SL 2006.04.21 2 6195 } 6130 }; 6196 6131 6197 6132 … … 6215 6150 good = 1 - rad_con(P[k], I); 6216 6151 k++; 6217 } 6152 }; 6218 6153 k--; 6219 6154 if (good == 0) { … … 6221 6156 list emptyList = list(); 6222 6157 return (emptyList); 6223 } 6158 }; 6224 6159 dbprint(printlevel - voice, "// That one was good!"); 6225 6160 dbprint(printlevel - voice, "// We saturate I with respect to this element."); … … 6229 6164 dbprint(printlevel - voice, "// The polynomial is 1, the saturation in not actually computed."); 6230 6165 ideal J = I; 6231 } 6166 }; 6232 6167 6233 6168 // We now call proc radicalNew; … … 6242 6177 6243 6178 return(result[1]); 6244 } 6179 }; 6245 6180 6246 6181 … … 6278 6213 } else { 6279 6214 allMaximal = 1; 6280 } 6215 }; 6281 6216 6282 6217 int nMax; … … 6285 6220 } else { 6286 6221 nMax = 1; 6287 } 6222 }; 6288 6223 6289 6224 for(n = 1; n <= nMax; n++) … … 6656 6591 indepOption = #[count]; 6657 6592 count++; 6658 } 6659 } 6593 }; 6594 }; 6660 6595 if(typeof(#[count]) == "string") { 6661 6596 if ((#[count] == "intersect") or (#[count] == "noIntersect")){ 6662 6597 intersectOption = #[count]; 6663 6598 count++; 6664 } 6665 } 6599 }; 6600 }; 6666 6601 if((typeof(#[count]) == "int") or (typeof(#[count]) == "number")) 6667 6602 { … … 6671 6606 if(@wr==3){abspri = 1; @wr = 0;} 6672 6607 count++; 6673 } 6674 } 6608 }; 6609 }; 6675 6610 if(size(#)>count) 6676 6611 { … … 6678 6613 peek=#[count + 1]; 6679 6614 ser=#[count + 2]; 6680 } 6681 } 6615 }; 6616 }; 6682 6617 if(abspri) 6683 6618 { … … 6714 6649 } else { 6715 6650 return(l); 6716 } 6651 }; 6717 6652 } 6718 6653 if (intersectOption == "intersect") { … … 6720 6655 } else { 6721 6656 return(primary); 6722 } 6657 }; 6723 6658 6724 6659 } … … 6742 6677 } else { 6743 6678 return(primary); 6744 } 6679 }; 6745 6680 } 6746 6681 … … 6811 6746 } else { 6812 6747 return(primary); 6813 } 6748 }; 6814 6749 } 6815 6750 if(size(fried)>0) … … 6851 6786 } else { 6852 6787 list pr = result; 6853 } 6788 }; 6854 6789 6855 6790 setring gnir; … … 6859 6794 @j=pr[@k]+fried; 6860 6795 pr[@k]=@j; 6861 } 6796 }; 6862 6797 if (intersectOption == "intersect") { 6863 6798 ideal intersection = imap(@deirf, intersection); 6864 6799 @j = intersection + fried; 6865 6800 intersection = @j; 6866 } 6801 }; 6867 6802 setring @P; 6868 6803 if (intersectOption == "intersect") { … … 6870 6805 } else { 6871 6806 return(imap(gnir,pr)); 6872 } 6807 }; 6873 6808 } 6874 6809 } … … 6885 6820 } else { 6886 6821 return(primary); 6887 } 6822 }; 6888 6823 } 6889 6824 … … 6913 6848 if (intersectOption == "intersect") { 6914 6849 generator = generator * fac[1][@k]; 6915 } 6916 } 6850 }; 6851 }; 6917 6852 if (intersectOption == "intersect") { 6918 6853 gIntersection = generator; 6919 } 6854 }; 6920 6855 6921 6856 setring @P; … … 6923 6858 if (intersectOption == "intersect") { 6924 6859 ideal intersection = fetch(gnir,gIntersection); 6925 } 6860 }; 6926 6861 6927 6862 //HIER … … 6940 6875 for(ab=1;ab<=size(primary);ab++) { 6941 6876 intersection = intersect(intersection, primary[ab][2]); 6942 } 6943 } 6877 }; 6878 }; 6944 6879 if (intersectOption == "intersect") { 6945 6880 return(list(primary, intersection)); 6946 6881 } else { 6947 6882 return(primary); 6948 } 6883 }; 6949 6884 } 6950 6885 … … 6982 6917 } else { 6983 6918 return(primary); 6984 } 6919 }; 6985 6920 6986 6921 } … … 7069 7004 absprimary = absprimary + result[2]; 7070 7005 abskeep = abskeep + result[3]; 7071 } 7006 }; 7072 7007 @h = result[5]; 7073 7008 ser = result[4]; … … 7128 7063 ser = imap(@Phelp, ser); 7129 7064 @j = imap(@Phelp, jwork); 7130 } 7065 }; 7131 7066 } 7132 7067 … … 7477 7412 } else { 7478 7413 return(primary); 7479 } 7414 }; 7480 7415 } 7481 7416 example … … 7635 7570 7636 7571 int zeroMinAss = @wr; 7637 if (@wr == 2) {zeroMinAss = 1;} 7572 if (@wr == 2) {zeroMinAss = 1;}; 7638 7573 list uprimary= newZero_decomp(@j, ser, zeroMinAss); 7639 7574 … … 7746 7681 7747 7682 return(quprimary, absprimary, abskeep, ser, @h); 7748 } 7683 }; 7749 7684 7750 7685 … … 7834 7769 for (k = 1; k <= size(pd); k++) { 7835 7770 P = intersect(P, pd[k]); 7836 } 7771 }; 7837 7772 */ 7838 7773 P = intersect(P, pd[2]); … … 7840 7775 dbprint(printlevel - voice, "// Intersection finished."); 7841 7776 } else { 7842 stop = 1 ;7843 } 7844 } 7777 stop = 1 7778 }; 7779 }; 7845 7780 //return(insert(primaryDec, P)); 7846 7781 // Returns only the primary components, not the radical. 7847 7782 return(primaryDec); 7848 } 7783 }; 7849 7784 7850 7785 /////////////////////////////////////////////////////////////////////////////// … … 7863 7798 good = 1 - rad_con(P[k], I); 7864 7799 k++; 7865 } 7800 }; 7866 7801 k--; 7867 7802 if (good == 0) { … … 7869 7804 dbprint (printlevel - voice, "// No element was found, P = sqrt(I)."); 7870 7805 return (list(primaryDec, ideal(0))); 7871 } 7806 }; 7872 7807 // Debug 7873 7808 dbprint (printlevel - voice, "// We found h = ", P[k]); … … 7920 7855 } else { 7921 7856 indepOption = "allIndep"; 7922 } 7857 }; 7923 7858 7924 7859 int nMax; … … 7927 7862 } else { 7928 7863 nMax = 1; 7929 } 7864 }; 7930 7865 7931 7866 for(n = 1; n <= nMax; n++) … … 8033 7968 if (#[1] == "nest") { 8034 7969 nestLevel = #[2]; 8035 } 7970 }; 8036 7971 # = list(); 8037 } 8038 } 7972 }; 7973 }; 8039 7974 8040 7975 if(vdim(j)==deg(j[1])) … … 8192 8127 } 8193 8128 8194 if(nestLevel > 1){primary=extF(primary) }8129 if(nestLevel > 1){primary=extF(primary);}; 8195 8130 8196 8131 //test whether all ideals in the decomposition are primary and
Note: See TracChangeset
for help on using the changeset viewer.