Changeset 7f7c25e in git for Singular/LIB/primdec.lib
- Timestamp:
- Jul 26, 2006, 1:50:30 PM (18 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- f3c6e5cf695bf90001021f22fdfc176f564b03fb
- Parents:
- 739993c19abcae1d08bb208d1f452f3858ae25ce
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/primdec.lib
r739993 r7f7c25e 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: primdec.lib,v 1.12 3 2006-07-25 18:00:01Singular Exp $";2 version="$Id: primdec.lib,v 1.124 2006-07-26 11:50:30 Singular Exp $"; 3 3 category="Commutative Algebra"; 4 4 info=" … … 13 13 Gianni, Trager and Zacharias (implementation by Gerhard Pfister), 14 14 respectively based on the ideas of Shimoyama and Yokoyama (implementation 15 by Wolfram Decker and Hans Schoenemann). 16 @* The procedures are implemented to be used in characteristic 0.17 @* They also work in positive characteristic >> 0.18 @*In small characteristic and for algebraic extensions, primdecGTZ19 may not terminate. 15 by Wolfram Decker and Hans Schoenemann).@* 16 The procedures are implemented to be used in characteristic 0.@* 17 They also work in positive characteristic >> 0.@* 18 In small characteristic and for algebraic extensions, primdecGTZ 19 may not terminate.@* 20 20 Algorithms for the computation of the radical based on the ideas of 21 Krick, Logar and Kemper (implementation by Gerhard Pfister). 21 Krick, Logar, Laplagne and Kemper (implementation by Gerhard Pfister and Santiago Laplagne). 22 They work in any characteristic. 22 23 23 24 PROCEDURES: … … 25 26 primdecGTZ(I); complete primary decomposition via Gianni,Trager,Zacharias 26 27 primdecSY(I...); complete primary decomposition via Shimoyama-Yokoyama 27 minAssGTZ(I); the minimal associated primes via Gianni,Trager,Zacharias 28 minAssGTZ(I); the minimal associated primes via Gianni,Trager,Zacharias (with modifications by Laplagne) 28 29 minAssChar(I...); the minimal associated primes using characteristic sets 29 30 testPrimary(L,k); tests the result of the primary decomposition 30 radical(I); computes the radical of I via Krick/Logarand Kemper31 radicalEHV(I); computes the radical of I via 31 radical(I); computes the radical of I via Krick/Logar (with modifications by Laplagne) and Kemper 32 radicalEHV(I); computes the radical of I via Eisenbud,Huneke,Vasconcelos 32 33 equiRadical(I); the radical of the equidimensional part of the ideal I 33 34 prepareAss(I); list of radicals of the equidimensional components of I … … 837 838 proc zero_decomp (ideal j,ideal ser,int @wr,list #) 838 839 "USAGE: zero_decomp(j,ser,@wr); j,ser ideals, @wr=0 or 1 839 (@wr=0 for primary decomposition, @wr=1 for computa ion of associated840 (@wr=0 for primary decomposition, @wr=1 for computation of associated 840 841 primes) 841 842 RETURN: list = list of primary ideals and their radicals (at even positions … … 2067 2068 valid = 0; 2068 2069 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 } ;2070 if (#[j] == 0) {facstdOption = "noFacstd"; valid = 1;} // If #[j] == 0, facstd is not used. 2071 if (#[j] == 1) {facstdOption = "facstd"; valid = 1;} // If #[j] == 1, facstd is used. 2072 } 2072 2073 if(typeof(#[j]) == "string"){ 2073 2074 if(#[j] == "GTZ" || #[j] == "SL") { 2074 2075 algorithm = #[j]; 2075 2076 valid = 1; 2076 } ;2077 } 2077 2078 if(#[j] == "noFacstd" || #[j] == "facstd") { 2078 2079 facstdOption = #[j]; 2079 2080 valid = 1; 2080 } ;2081 } ;2081 } 2082 } 2082 2083 if(valid == 0) { 2083 2084 dbprint(1, "Warning! The following input parameter was not recognized:", #[j]); 2084 } ;2085 } ;2086 } ;2085 } 2086 } 2087 } 2087 2088 2088 2089 list q = simplifyIdeal(i); … … 2137 2138 // Lines changed 2138 2139 if (algorithm == "GTZ") { 2139 qr = decomp(pr[k], 2);2140 } else {2141 qr = minAssSL(pr[k]);2142 };2140 qr = decomp(pr[k], 2); 2141 } else { 2142 qr = minAssSL(pr[k]); 2143 } 2143 2144 for(j = 1; j <= size(qr) / 2; j++) 2144 2145 { … … 2159 2160 } else { 2160 2161 re[1] = minAssSL(i); 2161 };2162 } 2162 2163 re = union(re); 2163 2164 option(set, op); 2164 2165 return(phi(re)); 2165 } ;2166 } 2166 2167 2167 2168 q = facstd(i); … … 2199 2200 } else { 2200 2201 re[j] = minAssSL(q[j]); 2201 };2202 } 2202 2203 // Debug 2203 2204 dbprint(printlevel - voice, "Number of components obtained for this component:", size(re[j]) / 2); 2204 2205 dbprint(printlevel - voice, "re[j]:", re[j]); 2205 } ;2206 } 2206 2207 re = union(re); 2207 2208 … … 5197 5198 5198 5199 proc primdecSY(ideal i, list #) 5199 "USAGE: primdecSY( i); i ideal, c int5200 "USAGE: primdecSY(I, c); I ideal, c int (optional) 5200 5201 RETURN: a list pr of primary ideals and their associated primes: 5201 5202 @format … … 5206 5207 @format 5207 5208 if c=0, the given ordering of the variables is used, 5208 if c=1, minAssChar tries to use an optimal ordering ,5209 if c=1, minAssChar tries to use an optimal ordering (default), 5209 5210 if c=2, minAssGTZ is used, 5210 5211 if c=3, minAssGTZ and facstd are used. … … 5245 5246 /////////////////////////////////////////////////////////////////////////////// 5246 5247 proc minAssGTZ(ideal i,list #) 5247 "USAGE: minAssGTZ(i); i ideal 5248 Optional parameters in list #: (can be entered in any order) 5249 0, "facstd" -> uses facstd to first decompose the ideal (default) 5250 1, "noFacstd" -> does not use facstd 5251 "SL" -> the new algorithm is used (default) 5252 "GTZ" -> the old algorithm is used 5253 RETURN: a list, the minimal associated prime ideals of i. 5248 "USAGE: minAssGTZ(I[, l]); I ideal, l list (optional) 5249 @* Optional parameters in list l (can be entered in any order): 5250 @* 0, \"facstd\" -> uses facstd to first decompose the ideal (default) 5251 @* 1, \"noFacstd\" -> does not use facstd 5252 @* \"GTZ\" -> the original algorithm by Gianni, Trager and Zacharias is used 5253 @* \"SL\" -> GTZ algorithm with modificiations by Laplagne is used (default) 5254 5255 RETURN: a list, the minimal associated prime ideals of I. 5254 5256 NOTE: Designed for characteristic 0, works also in char k > 0 based 5255 5257 on an algorithm of Yokoyama … … 5270 5272 valid = 0; 5271 5273 if((typeof(#[j]) == "int") or (typeof(#[j]) == "number")) { 5272 if (#[j] == 1) {facstdOption = "noFacstd"; valid = 1;} ;// If #[j] == 1, facstd is not used.5273 if (#[j] == 0) {facstdOption = "facstd"; valid = 1;} ;// If #[j] == 0, facstd is used.5274 } ;5274 if (#[j] == 1) {facstdOption = "noFacstd"; valid = 1;} // If #[j] == 1, facstd is not used. 5275 if (#[j] == 0) {facstdOption = "facstd"; valid = 1;} // If #[j] == 0, facstd is used. 5276 } 5275 5277 if(typeof(#[j]) == "string"){ 5276 5278 if((#[j] == "GTZ") || (#[j] == "SL")) { 5277 5279 algorithm = #[j]; 5278 5280 valid = 1; 5279 } ;5281 } 5280 5282 if((#[j] == "noFacstd") || (#[j] == "facstd")) { 5281 5283 facstdOption = #[j]; 5282 5284 valid = 1; 5283 } ;5284 } ;5285 } 5286 } 5285 5287 if(valid == 0) { 5286 5288 dbprint(1, "Warning! The following input parameter was not recognized:", #[j]); 5287 } ;5288 } ;5289 } ;5289 } 5290 } 5291 } 5290 5292 5291 5293 if(ord_test(basering)!=1) … … 5298 5300 { 5299 5301 return(algeDeco(i,2)); 5300 } ;5302 } 5301 5303 5302 5304 list result; … … 5316 5318 /////////////////////////////////////////////////////////////////////////////// 5317 5319 proc minAssChar(ideal i, list #) 5318 "USAGE: minAssChar( i[,c]); i ideal, c int.5320 "USAGE: minAssChar(I[,c]); i ideal, c int (optional). 5319 5321 RETURN: list, the minimal associated prime ideals of i. 5320 5322 NOTE: If c=0, the given ordering of the variables is used. @* … … 5348 5350 /////////////////////////////////////////////////////////////////////////////// 5349 5351 proc equiRadical(ideal i) 5350 "USAGE: equiRadical( i); iideal5351 RETURN: ideal, intersection of associated primes of iof maximal dimension.5352 NOTE: A combination of the algorithms of Krick/Logar and Kemper is used.5352 "USAGE: equiRadical(I); I ideal 5353 RETURN: ideal, intersection of associated primes of I of maximal dimension. 5354 NOTE: A combination of the algorithms of Krick/Logar (with modifications by Laplagne) and Kemper is used. 5353 5355 Works also in positive characteristic (Kempers algorithm). 5354 5356 EXAMPLE: example equiRadical; shows an example … … 5361 5363 ); 5362 5364 } 5363 return(radical(i, 1));5365 return(radical(i, 1)); 5364 5366 } 5365 5367 example … … 5375 5377 /////////////////////////////////////////////////////////////////////////////// 5376 5378 proc radical(ideal i, list #) 5377 "USAGE: radical( i); i ideal.5378 Optional parameters in list #: (can be entered in any order)5379 1, \"equiRad\" -> equiRadical is computed5380 0, \"fullRad\" -> full radical is computed (default)5381 \"SL\" -> Laplagne algorithm is used (default)5382 \"KL\" -> Krick/Logar algorithm is used5383 \"facstd\" ->uses facstd to first decompose the ideal (default for non homogeneous ideals)5384 \"noFacstd\" ->does not use facstd (default for homogeneous ideals)5385 RETURN: ideal, the radical of i(or the equiradical if required in the input parameters)5386 NOTE: A combination of the algorithms of Krick/Logar or Laplagneand Kemper is used.5379 "USAGE: radical(I[, l]); I ideal, l list (optional) 5380 @* Optional parameters in list l (can be entered in any order): 5381 @* 0, \"fullRad\" -> full radical is computed (default) 5382 @* 1, \"equiRad\" -> equiRadical is computed 5383 @* \"KL\" -> Krick/Logar algorithm is used 5384 @* \"SL\" -> modifications by Laplagne are used (default) 5385 @* \"facstd\" -> uses facstd to first decompose the ideal (default for non homogeneous ideals) 5386 @* \"noFacstd\" -> does not use facstd (default for homogeneous ideals) 5387 RETURN: ideal, the radical of I (or the equiradical if required in the input parameters) 5388 NOTE: A combination of the algorithms of Krick/Logar (with modifications by Laplagne) and Kemper is used. 5387 5389 Works also in positive characteristic (Kempers algorithm). 5388 5390 EXAMPLE: example radical; shows an example … … 5404 5406 // Set input parameters 5405 5407 algorithm = "SL"; // Default: SL algorithm 5406 il = 0; // Default: Full radical (not only equi dim part)5408 il = 0; // Default: Full radical (not only equiRadical) 5407 5409 if (homog(i) == 1) { // Default: facStd is used, except if the ideal is homogeneous. 5408 5410 useFac = 0; 5409 5411 } else { 5410 5411 } ;5412 useFac = 1; 5413 } 5412 5414 if(size(#) > 0){ 5413 5414 5415 5416 5417 5418 5419 };5420 5421 5422 5423 valid = 1};5424 5425 5426 valid = 1};5427 5428 5429 valid = 1};5430 5431 5432 valid = 1};5433 5434 5435 valid = 1};5436 5437 5438 valid = 1};5439 };5440 5441 5442 };5443 };5444 } ;5415 int valid; 5416 for(j = 1; j <= size(#); j++){ 5417 valid = 0; 5418 if((typeof(#[j]) == "int") or (typeof(#[j]) == "number")) { 5419 il = #[j]; // If il == 1, equiRadical is computed 5420 valid = 1; 5421 } 5422 if(typeof(#[j]) == "string"){ 5423 if(#[j] == "KL") { 5424 algorithm = "KL"; 5425 valid = 1} 5426 if(#[j] == "SL") { 5427 algorithm = "SL"; 5428 valid = 1} 5429 if(#[j] == "noFacstd") { 5430 useFac = 0; 5431 valid = 1} 5432 if(#[j] == "facstd") { 5433 useFac = 1; 5434 valid = 1} 5435 if(#[j] == "equiRad") { 5436 il = 1; 5437 valid = 1} 5438 if(#[j] == "fullRad") { 5439 il = 0; 5440 valid = 1} 5441 } 5442 if(valid == 0) { 5443 dbprint(1, "Warning! The following input parameter was not recognized:", #[j]); 5444 } 5445 } 5446 } 5445 5447 5446 5448 if(size(i) == 0){return(ideal(0));} … … 5448 5450 intvec op = option(get); 5449 5451 list qr = simplifyIdeal(i); 5450 // SL - Line removed. The ideal isave was never used.5451 //ideal isave=i;5452 5452 map phi = @P, qr[2]; 5453 5453 … … 5459 5459 if(di == 0) 5460 5460 { 5461 i = zeroRad(i, qr[1]);5462 return(interred(phi(i)));5461 i = zeroRad(i, qr[1]); 5462 return(interred(phi(i))); 5463 5463 } 5464 5464 … … 5467 5467 if(useFac == 1) 5468 5468 { 5469 pr = facstd(i);5469 pr = facstd(i); 5470 5470 } else { 5471 5472 } ;5471 pr = i 5472 } 5473 5473 option(set, op); 5474 5474 int s = size(pr); 5475 5475 if(useFac == 1) { 5476 5476 dbprint(printlevel - voice, "Number of components returned by facstd: ", s); 5477 } ;5477 } 5478 5478 for(j = 1; j <= s; j++) 5479 5479 { … … 5485 5485 dbprint(printlevel-voice, "The dimension is: ", dim(pr[s+1-j])); 5486 5486 5487 5488 5489 5490 5491 5492 };5487 if(algorithm == "KL") { 5488 rad = intersect(rad, radicalKL(pr[s + 1 - j], rad, il)); 5489 } 5490 if(algorithm == "SL") { 5491 rad = intersect(rad, radicalSL(pr[s + 1 - j], il)); 5492 } 5493 5493 } else 5494 5494 { 5495 5496 5497 5498 5499 5500 } ;5495 // SL Debug 5496 dbprint(printlevel-voice, "The radical of this component is not needed."); 5497 dbprint(printlevel-voice, "size(reduce(rad, pr[s + 1 - j], 1))", size(reduce(rad, pr[s + 1 - j], 1))); 5498 dbprint(printlevel-voice, "dim(pr[s + 1 - j])", dim(pr[s + 1 - j])); 5499 dbprint(printlevel-voice, "il", il); 5500 } 5501 5501 } 5502 5502 return(interred(phi(rad))); … … 5522 5522 // 5523 5523 static proc radicalKL(ideal I, ideal ser, list #) { 5524 // ideal I 5525 // ideal ser 5526 // list # 5524 // ideal I The ideal for which the radical is computed 5525 // ideal ser Used to reduce components already obtained 5526 // list # If #[1] = 1, equiradical is computed. 5527 5527 5528 5528 // I needs to be a Groebner basis. 5529 5529 if (attrib(I, "isSB") != 1) { 5530 5531 } ;5530 I = groebner(I); 5531 } 5532 5532 5533 5533 ideal rad; // The radical … … 5538 5538 rad = result[1]; 5539 5539 if (done == 0) { 5540 5541 } ;5540 rad = intersect(rad, radicalKL(result[2], ideal(1), #)); 5541 } 5542 5542 return(rad); 5543 5543 }; … … 5567 5567 if (attrib(I, "isSB") != 1) { 5568 5568 I = groebner(I); 5569 } ;5569 } 5570 5570 iDim = dim(I); 5571 5571 … … 5573 5573 if (size(#) > 0) { 5574 5574 il = #[1]; 5575 } ;5575 } 5576 5576 5577 5577 while(stop == 0) { … … 5586 5586 if (il == 1){ 5587 5587 if (attrib(primes[k], "isSB") != 1) { 5588 5589 } ;5588 primes[k] = groebner(primes[k]); 5589 } 5590 5590 if (iDim == dim(primes[k])) { 5591 5592 } ;5593 } ;5594 } ;5591 equiRad = intersect(equiRad, primes[k]); 5592 } 5593 } 5594 } 5595 5595 } else { 5596 5597 } ;5598 } ;5596 stop = 1; 5597 } 5598 } 5599 5599 if (il == 0) { 5600 5600 return(rad); 5601 5601 } else { 5602 5602 return(equiRad); 5603 } ;5603 } 5604 5604 }; 5605 5605 … … 5877 5877 } else { 5878 5878 done = 0; 5879 } ;5879 } 5880 5880 // SL 2006.04.21 2 5881 5881 … … 5898 5898 // Output: ideal. Intersection of some primes of I different from the ones in P. 5899 5899 { 5900 5901 5902 5903 5904 5905 5906 5907 5908 };5909 5910 5911 5912 5913 5914 };5915 5916 5917 5918 5919 5920 5921 5922 };5923 5924 5925 5926 5927 5928 5929 int allMaximal = 0; 5930 ideal re = 1; 5931 list emptyList = list(); 5900 int k = 1; // Counter 5901 int good = 0; // Checks if an element of P is in rad(I) 5902 5903 dbprint (printlevel-voice, "// We search for an element in P - sqrt(I)."); 5904 while ((k <= size(P)) and (good == 0)) { 5905 dbprint (printlevel-voice, "// We try with:", P[k]); 5906 good = 1 - rad_con(P[k], I); 5907 k++; 5908 } 5909 k--; 5910 if (good == 0) { 5911 dbprint (printlevel-voice, "// No element was found, P = sqrt(I)."); 5912 list emptyList = list(); 5913 return (emptyList); 5914 } 5915 dbprint(printlevel - voice, "// That one was good!"); 5916 dbprint(printlevel - voice, "// We saturate I with respect to this element."); 5917 if (P[k] != 1) { 5918 ideal J = sat(I, P[k])[1]; 5919 } else { 5920 dbprint(printlevel - voice, "// The polynomial is 1, the saturation in not actually computed."); 5921 ideal J = I; 5922 } 5923 5924 // We now call proc radicalNew; 5925 dbprint(printlevel - voice, "// We do the reduction to the zerodimensional case, via radical."); 5926 dbprint(printlevel - voice, "// The ideal is ", J); 5927 dbprint(printlevel - voice, "// The dimension is ", dim(groebner(J))); 5928 5929 int allMaximal = 0; // Compute the zerodim reduction for only one indep set. 5930 ideal re = 1; // No reduction is need, there are not redundant components. 5931 list emptyList = list(); // Look for primes of any dimension, not only of max dimension. 5932 5932 list result = radicalReduction(J, re, allMaximal, emptyList); 5933 5933 5934 5934 return(result[1]); 5935 5935 }; 5936 5936 … … 5947 5947 5948 5948 proc newMaxIndependSetDp(ideal j, list #) 5949 "USAGE: newMaxIndependentSetDp( i); iideal (returns all maximal independent sets of the corresponding leading terms ideal)5950 newMaxIndependentSetDp( i, 0); iideal (returns only one maximal independent set)5949 "USAGE: newMaxIndependentSetDp(I); I ideal (returns all maximal independent sets of the corresponding leading terms ideal) 5950 newMaxIndependentSetDp(I, 0); I ideal (returns only one maximal independent set) 5951 5951 RETURN: list = #1. new varstring with the maximal independent set at the end, 5952 5952 #2. ordstring with the corresponding dp block ordering, … … 5964 5964 int allMaximal; 5965 5965 if (size(#) > 0) { 5966 5966 allMaximal = #[1]; 5967 5967 } else { 5968 5969 } ;5968 allMaximal = 1; 5969 } 5970 5970 5971 5971 int nMax; … … 5973 5973 nMax = size(v); 5974 5974 } else { 5975 5976 } ;5975 nMax = 1; 5976 } 5977 5977 5978 5978 for(n = 1; n <= nMax; n++) … … 6081 6081 /////////////////////////////////////////////////////////////////////////////// 6082 6082 proc prepareAss(ideal i) 6083 "USAGE: prepareAss( i); iideal6084 RETURN: list, the radicals of the maximal dimensional components of i.6083 "USAGE: prepareAss(I); I ideal 6084 RETURN: list, the radicals of the maximal dimensional components of I. 6085 6085 NOTE: Uses algorithm of Eisenbud/Huneke/Vasconcelos. 6086 6086 EXAMPLE: example prepareAss; shows an example … … 6129 6129 /////////////////////////////////////////////////////////////////////////////// 6130 6130 proc equidimMaxEHV(ideal i) 6131 "USAGE: equidimMaxEHV( i); iideal6132 RETURN: ideal, the equidimensional component (of maximal dimension) of i.6131 "USAGE: equidimMaxEHV(I); I ideal 6132 RETURN: ideal, the equidimensional component (of maximal dimension) of I. 6133 6133 NOTE: Uses algorithm of Eisenbud, Huneke and Vasconcelos. 6134 6134 EXAMPLE: example equidimMaxEHV; shows an example … … 6340 6340 if(size(#)>0) 6341 6341 { 6342 int count = 1;6343 if(typeof(#[count]) == "string") {6344 if ((#[count] == "oneIndep") or (#[count] == "allIndep")){6345 indepOption = #[count];6346 count++;6347 };6348 };6349 if(typeof(#[count]) == "string") {6350 if ((#[count] == "intersect") or (#[count] == "noIntersect")){6351 intersectOption = #[count];6352 count++;6353 };6354 };6355 if((typeof(#[count]) == "int") or (typeof(#[count]) == "number"))6356 {6357 if ((#[count]==1)||(#[count]==2)||(#[count]==3))6358 {6359 @wr=#[count];6360 if(@wr==3){abspri = 1; @wr = 0;}6361 count++;6362 };6363 };6364 if(size(#)>count)6365 {6366 6367 6368 6369 };6370 };6371 if(abspri)6372 {6373 list absprimary,abskeep,absprimarytmp,abskeeptmp;6374 }6375 homo=homog(i);6376 if(homo==1)6377 {6378 if(attrib(i,"isSB")!=1)6379 {6380 //ltras=mstd(i);6381 tras=groebner(i);6382 ltras=tras,tras;6383 attrib(ltras[1],"isSB",1);6384 }6385 else6386 {6387 ltras=i,i;6388 attrib(ltras[1],"isSB",1);6389 }6390 tras = ltras[1];6391 attrib(tras,"isSB",1);6392 if(dim(tras)==0)6393 {6342 int count = 1; 6343 if(typeof(#[count]) == "string") { 6344 if ((#[count] == "oneIndep") or (#[count] == "allIndep")){ 6345 indepOption = #[count]; 6346 count++; 6347 } 6348 } 6349 if(typeof(#[count]) == "string") { 6350 if ((#[count] == "intersect") or (#[count] == "noIntersect")){ 6351 intersectOption = #[count]; 6352 count++; 6353 } 6354 } 6355 if((typeof(#[count]) == "int") or (typeof(#[count]) == "number")) 6356 { 6357 if ((#[count]==1)||(#[count]==2)||(#[count]==3)) 6358 { 6359 @wr=#[count]; 6360 if(@wr==3){abspri = 1; @wr = 0;} 6361 count++; 6362 } 6363 } 6364 if(size(#)>count) 6365 { 6366 seri=1; 6367 peek=#[count + 1]; 6368 ser=#[count + 2]; 6369 } 6370 } 6371 if(abspri) 6372 { 6373 list absprimary,abskeep,absprimarytmp,abskeeptmp; 6374 } 6375 homo=homog(i); 6376 if(homo==1) 6377 { 6378 if(attrib(i,"isSB")!=1) 6379 { 6380 //ltras=mstd(i); 6381 tras=groebner(i); 6382 ltras=tras,tras; 6383 attrib(ltras[1],"isSB",1); 6384 } 6385 else 6386 { 6387 ltras=i,i; 6388 attrib(ltras[1],"isSB",1); 6389 } 6390 tras = ltras[1]; 6391 attrib(tras,"isSB",1); 6392 if(dim(tras)==0) 6393 { 6394 6394 primary[1]=ltras[2]; 6395 6395 primary[2]=maxideal(1); … … 6399 6399 l[1]=maxideal(1); 6400 6400 l[2]=maxideal(1); 6401 if (intersectOption == "intersect") {6402 return(list(l, maxideal(1)));6403 } else {6404 return(l);6405 };6401 if (intersectOption == "intersect") { 6402 return(list(l, maxideal(1))); 6403 } else { 6404 return(l); 6405 } 6406 6406 } 6407 6407 if (intersectOption == "intersect") { 6408 return(list(primary, primary[1])); 6409 } else { 6410 return(primary); 6411 }; 6412 6408 return(list(primary, primary[1])); 6409 } else { 6410 return(primary); 6411 } 6413 6412 } 6414 6413 for(@n=1;@n<=nvars(basering);@n++) … … 6426 6425 if(size(i)==0) 6427 6426 { 6428 6427 primary=i,i; 6429 6428 if (intersectOption == "intersect") { 6430 6429 return(list(primary, i)); 6431 6430 } else { 6432 6431 return(primary); 6433 };6432 } 6434 6433 } 6435 6434 … … 6449 6448 if(!lp) 6450 6449 { 6451 ideal @j=std(fetch(@P,i),@hilb,@w);6450 ideal @j=std(fetch(@P,i),@hilb,@w); 6452 6451 } 6453 6452 else … … 6496 6495 primary[1]=i; 6497 6496 primary[2]=i; 6498 if (intersectOption == "intersect") {6499 return(list(primary, i));6500 } else {6501 return(primary);6502 };6497 if (intersectOption == "intersect") { 6498 return(list(primary, i)); 6499 } else { 6500 return(primary); 6501 } 6503 6502 } 6504 6503 if(size(fried)>0) … … 6540 6539 } else { 6541 6540 list pr = result; 6542 } ;6541 } 6543 6542 6544 6543 setring gnir; … … 6548 6547 @j=pr[@k]+fried; 6549 6548 pr[@k]=@j; 6550 } ;6549 } 6551 6550 if (intersectOption == "intersect") { 6552 ideal intersection = imap(@deirf, intersection);6553 @j = intersection + fried;6554 intersection = @j;6555 };6556 setring @P;6557 if (intersectOption == "intersect") {6558 return(list(imap(gnir,pr), imap(gnir,intersection)));6559 } else {6560 return(imap(gnir,pr));6561 };6551 ideal intersection = imap(@deirf, intersection); 6552 @j = intersection + fried; 6553 intersection = @j; 6554 } 6555 setring @P; 6556 if (intersectOption == "intersect") { 6557 return(list(imap(gnir,pr), imap(gnir,intersection))); 6558 } else { 6559 return(imap(gnir,pr)); 6560 } 6562 6561 } 6563 6562 } … … 6570 6569 setring @P; 6571 6570 primary=ideal(1),ideal(1); 6572 if (intersectOption == "intersect") {6573 return(list(primary, ideal(1)));6574 } else {6575 return(primary);6576 };6571 if (intersectOption == "intersect") { 6572 return(list(primary, ideal(1))); 6573 } else { 6574 return(primary); 6575 } 6577 6576 } 6578 6577 … … 6583 6582 if(nvars(basering)==1) 6584 6583 { 6585 6586 6584 list fac=factor(@j[1]); 6587 6585 list gprimary; … … 6602 6600 if (intersectOption == "intersect") { 6603 6601 generator = generator * fac[1][@k]; 6604 }; 6605 }; 6606 if (intersectOption == "intersect") { 6607 gIntersection = generator; 6608 }; 6609 6602 } 6603 } 6604 if (intersectOption == "intersect") { 6605 gIntersection = generator; 6606 } 6610 6607 setring @P; 6611 6608 primary=fetch(gnir,gprimary); 6612 if (intersectOption == "intersect") {6609 if (intersectOption == "intersect") { 6613 6610 ideal intersection = fetch(gnir,gIntersection); 6614 } ;6611 } 6615 6612 6616 6613 //HIER … … 6629 6626 for(ab=1;ab<=size(primary);ab++) { 6630 6627 intersection = intersect(intersection, primary[ab][2]); 6631 } ;6632 } ;6628 } 6629 } 6633 6630 if (intersectOption == "intersect") { 6634 return(list(primary, intersection));6631 return(list(primary, intersection)); 6635 6632 } else { 6636 return(primary);6637 } ;6633 return(primary); 6634 } 6638 6635 } 6639 6636 … … 6667 6664 primary=resu; 6668 6665 } 6669 if (intersectOption == "intersect") { 6670 return(list(primary, fetch(gnir,@j))); 6671 } else { 6672 return(primary); 6673 }; 6674 6666 if (intersectOption == "intersect") { 6667 return(list(primary, fetch(gnir,@j))); 6668 } else { 6669 return(primary); 6670 } 6675 6671 } 6676 6672 … … 6690 6686 if(@wr!=1) 6691 6687 { 6692 allindep = newMaxIndependSetLp(@j, indepOption);6688 allindep = newMaxIndependSetLp(@j, indepOption); 6693 6689 for(@m=1;@m<=size(allindep);@m++) 6694 6690 { … … 6758 6754 absprimary = absprimary + result[2]; 6759 6755 abskeep = abskeep + result[3]; 6760 };6756 } 6761 6757 @h = result[5]; 6762 6758 ser = result[4]; 6763 6764 6765 6766 6767 6759 if(size(@h)>0) 6760 { 6761 //--------------------------------------------------------------- 6762 //we change to @Phelp to have the ordering dp for saturation 6763 //--------------------------------------------------------------- 6768 6764 6769 6765 setring @Phelp; … … 6817 6813 ser = imap(@Phelp, ser); 6818 6814 @j = imap(@Phelp, jwork); 6819 } ;6815 } 6820 6816 } 6821 6817 … … 6881 6877 if(size(reduce(ser,peek,1))!=0) 6882 6878 { 6883 for(@m=1;@m<=size(restindep);@m++)6879 for(@m=1;@m<=size(restindep);@m++) 6884 6880 { 6885 6881 // if(restindep[@m][3]>=keepdi) … … 7018 7014 hpl=hpl,leadcoef(uprimary[@n][@n1]); 7019 7015 } 7020 7016 saturn[@n]=hpl; 7021 7017 } 7022 7018 //------------------------------------------------------------------ … … 7166 7162 } else { 7167 7163 return(primary); 7168 } ;7164 } 7169 7165 } 7170 7166 example … … 7179 7175 } 7180 7176 7181 // 7182 proc newReduction(ideal @j, ideal ser, intvec @hilb, intvec @w, int jdim, int abspri, int @wr, list data) 7177 // This was part of proc decomp. 7178 // In proc newDecompStep, used for the computation of the minimal associated primes, 7179 // this part was separated as a soubrutine to make the code more clear. 7180 // Also, since the reduction is performed twice in proc newDecompStep, it should use both times this routine. 7181 // This is not yet implemented, since the reduction is not exactly the same and some changes should be made. 7182 static proc newReduction(ideal @j, ideal ser, intvec @hilb, intvec @w, int jdim, int abspri, int @wr, list data) 7183 7183 { 7184 7184 string @va; … … 7324 7324 7325 7325 int zeroMinAss = @wr; 7326 if (@wr == 2) {zeroMinAss = 1;} ;7327 7326 if (@wr == 2) {zeroMinAss = 1;} 7327 list uprimary= newZero_decomp(@j, ser, zeroMinAss); 7328 7328 7329 7329 //HIER … … 7447 7447 7448 7448 proc minAss(ideal i,list #) 7449 "USAGE: minAss(i); i ideal 7450 minAss(i,#); i ideal, # list: same as minAssGTZ 7451 RETURN: a list, the minimal associated prime ideals of i. 7449 "USAGE: minAss(I[, l]); i ideal, l list (optional) of parameters, same as minAssGTZ 7450 RETURN: a list, the minimal associated prime ideals of I. 7452 7451 NOTE: Designed for characteristic 0, works also in char k > 0 based 7453 7452 on an algorithm of Yokoyama … … 7515 7514 } else { 7516 7515 stop = 1 7517 } ;7518 } ;7516 } 7517 } 7519 7518 // Returns only the primary components, not the radical. 7520 7519 return(primaryDec); … … 7536 7535 good = 1 - rad_con(P[k], I); 7537 7536 k++; 7538 } ;7537 } 7539 7538 k--; 7540 7539 if (good == 0) { … … 7542 7541 dbprint (printlevel - voice, "// No element was found, P = sqrt(I)."); 7543 7542 return (list(primaryDec, ideal(0))); 7544 } ;7543 } 7545 7544 // Debug 7546 7545 dbprint (printlevel - voice, "// We found h = ", P[k]); … … 7589 7588 } else { 7590 7589 indepOption = "allIndep"; 7591 } ;7590 } 7592 7591 7593 7592 int nMax; … … 7596 7595 } else { 7597 7596 nMax = 1; 7598 } ;7597 } 7599 7598 7600 7599 for(n = 1; n <= nMax; n++) … … 7658 7657 proc newZero_decomp (ideal j, ideal ser, int @wr, list #) 7659 7658 "USAGE: newZero_decomp(j,ser,@wr); j,ser ideals, @wr=0 or 1 7660 (@wr=0 for primary decomposition, @wr=1 for computa ion of associated7659 (@wr=0 for primary decomposition, @wr=1 for computation of associated 7661 7660 primes) 7662 7661 if #[1] = "nest", then #[2] indicates the nest level (number of recursive calls) … … 7701 7700 if (#[1] == "nest") { 7702 7701 nestLevel = #[2]; 7703 } ;7702 } 7704 7703 # = list(); 7705 } ;7706 } ;7704 } 7705 } 7707 7706 7708 7707 if(vdim(j)==deg(j[1])) … … 7860 7859 } 7861 7860 7862 if(nestLevel > 1){primary=extF(primary);} ;7861 if(nestLevel > 1){primary=extF(primary);} 7863 7862 7864 7863 //test whether all ideals in the decomposition are primary and
Note: See TracChangeset
for help on using the changeset viewer.