Changeset 768b28 in git
 Timestamp:
 Feb 3, 2010, 10:37:45 AM (13 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a657104b677b4c461d018cbf3204d72d34ad66a9')
 Children:
 538d63bfc3ca276e2733bf749ab86a1685ec5dad
 Parents:
 f679897a09a02b4b0b17aed9982a4f6c8356c1d3
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/primdec.lib
rf679897 r768b28 5 5 LIBRARY: primdec.lib Primary Decomposition and Radical of Ideals 6 6 AUTHORS: Gerhard Pfister, pfister@mathematik.unikl.de (GTZ)@* 7 Wolfram Decker, decker@math ematik.unikl.de(SY)@*7 Wolfram Decker, decker@math.unisb.de (SY)@* 8 8 Hans Schoenemann, hannes@mathematik.unikl.de (SY)@* 9 9 Santiago Laplagne, slaplagn@dm.uba.ar (GTZ) … … 50 50 LIB "triang.lib"; 51 51 LIB "absfact.lib"; 52 LIB "ring.lib"; 52 53 /////////////////////////////////////////////////////////////////////////////// 53 54 // … … 5100 5101 /////////////////////////////////////////////////////////////////////////////// 5101 5102 5102 proc primdecGTZ(ideal i )5103 proc primdecGTZ(ideal i, list #) 5103 5104 "USAGE: primdecGTZ(i); i ideal 5104 5105 RETURN: a list pr of primary ideals and their associated primes: … … 5107 5108 pr[i][2] the ith prime component. 5108 5109 @end format 5109 NOTE: Algorithm of Gianni/Trager/Zacharias. 5110 Designed for characteristic 0, works also in char k > 0, if it 5111 terminates (may result in an infinite loop in small characteristic!) 5110 NOTE:  Algorithm of Gianni/Trager/Zacharias. 5111  Designed for characteristic 0, works also in char k > 0, if it 5112 terminates (may result in an infinite loop in small characteristic!) 5113  For local orderings, the result is considered in the localization 5114 of the polynomial ring, not in the power series ring 5115  For local and mixed orderings, the decomposition in the 5116 corresponding global ring is returned if the string 'global' 5117 is specified as second argument 5112 5118 EXAMPLE: example primdecGTZ; shows an example 5113 5119 " 5114 5120 { 5121 if(size(#)>0) 5122 { 5123 int keep_comp=1; 5124 } 5115 5125 if(attrib(basering,"global")!=1) 5116 5126 { 5117 ERROR( 5118 "// Not implemented for this ordering, please change to global ordering." 5119 ); 5127 // algorithms only work in global case! 5128 // pass to appropriate global ring 5129 def r=basering; 5130 def s=changeord("dp"); 5131 setring s; 5132 ideal i=imap(r,i); 5133 // decompose and go back 5134 list li=primdecGTZ(i); 5135 setring r; 5136 def li=imap(s,li); 5137 // clean up 5138 if(!defined(keep_comp)) 5139 { 5140 for(int k=size(li);k>=1;k) 5141 { 5142 if(mindeg(std(lead(li[k][2]))[1])==0) 5143 { 5144 // 1 contained in ideal, i.e. component does not meet origin in local ordering 5145 li=delete(li,k); 5146 } 5147 } 5148 } 5149 return(li); 5120 5150 } 5151 5121 5152 if(minpoly!=0) 5122 5153 { … … 5138 5169 } 5139 5170 /////////////////////////////////////////////////////////////////////////////// 5140 proc absPrimdecGTZ(ideal I )5171 proc absPrimdecGTZ(ideal I, list #) 5141 5172 "USAGE: absPrimdecGTZ(I); I ideal 5142 5173 ASSUME: Ground field has characteristic 0. 5143 RETURN: a ring containing two lists: @code{absolute_primes} (the absolute5144 prime components of I ) and @code{primary_decomp} (the output of5145 @code{primdecGTZ(I)} ).5174 RETURN: a ring containing two lists: @code{absolute_primes}, the absolute 5175 prime components of I, and @code{primary_decomp}, the output of 5176 @code{primdecGTZ(I)}. 5146 5177 The list absolute_primes has to be interpreted as follows: 5147 5178 each entry describes a class of conjugated absolute primes, … … 5153 5184 polynomial of a minimal finite field extension over which the 5154 5185 absolute prime component is defined. 5186 For local orderings, the result is considered in the localization 5187 of the polynomial ring, not in the power series ring. 5188 For local and mixed orderings, the decomposition in the 5189 corresponding global ring is returned if the string 'global' 5190 is specified as second argument 5155 5191 NOTE: Algorithm of Gianni/Trager/Zacharias combined with the 5156 5192 @code{absFactorize} command. … … 5165 5201 } 5166 5202 5203 if(size(#)>0) 5204 { 5205 int keep_comp=1; 5206 } 5207 5167 5208 if(attrib(basering,"global")!=1) 5168 5209 { 5169 ERROR( 5170 "// Not implemented for this ordering, please change to global ordering." 5171 ); 5210 // algorithm automatically passes to the global case 5211 // hence prepare to go back to an appropriate new ring 5212 def r=basering; 5213 ideal max_of_r=maxideal(1); 5214 def s=changeord("dp"); 5215 setring s; 5216 def I=imap(r,I); 5217 def S=absPrimdecGTZ(I); 5218 setring S; 5219 ring r1=char(basering),var(nvars(r)+1),dp; 5220 def rS=r+r1; 5221 // move objects to appropriate ring and clean up 5222 setring rS; 5223 def max_of_r=imap(r,max_of_r); 5224 attrib(max_of_r,"isSB",1); 5225 def absolute_primes=imap(S,absolute_primes); 5226 def primary_decomp=imap(S,primary_decomp); 5227 if(!defined(keep_comp)) 5228 { 5229 ideal tempid; 5230 for(int k=size(absolute_primes);k>=1;k) 5231 { 5232 tempid=absolute_primes[k][1]; 5233 tempid[1]=0; // ignore minimal polynomial 5234 if(size(reduce(lead(tempid),max_of_r))!=0) 5235 { 5236 // 1 contained in ideal, i.e. component does not meet origin in local ordering 5237 absolute_primes=delete(absolute_primes,k); 5238 } 5239 } 5240 for(k=size(primary_decomp);k>=1;k) 5241 { 5242 if(mindeg(std(lead(primary_decomp[k][2]))[1])==0) 5243 { 5244 // 1 contained in ideal, i.e. component does not meet origin in local ordering 5245 primary_decomp=delete(primary_decomp,k); 5246 } 5247 } 5248 kill tempid; 5249 } 5250 export(primary_decomp); 5251 export(absolute_primes); 5252 return(rS); 5172 5253 } 5173 5254 if(minpoly!=0) … … 5274 5355 if c=3, minAssGTZ and facstd are used. 5275 5356 @end format 5357 For local orderings, the result is considered in the localization 5358 of the polynomial ring, not in the power series ring. 5359 For local and mixed orderings, the decomposition in the 5360 corresponding global ring is returned if the string 'global' 5361 is specified as third argument 5276 5362 EXAMPLE: example primdecSY; shows an example 5277 5363 " 5278 5364 { 5365 if(size(#)>1) 5366 { 5367 int keep_comp=1; 5368 } 5279 5369 if(attrib(basering,"global")!=1) 5280 5370 { 5281 ERROR( 5282 "// Not implemented for this ordering, please change to global ordering." 5283 ); 5371 // algorithms only work in global case! 5372 // pass to appropriate global ring 5373 def r=basering; 5374 def s=changeord("dp"); 5375 setring s; 5376 ideal i=imap(r,i); 5377 // decompose and go back 5378 list li=primdecSY(i); 5379 setring r; 5380 def li=imap(s,li); 5381 // clean up 5382 if(!defined(keep_comp)) 5383 { 5384 for(int k=size(li);k>=1;k) 5385 { 5386 if(mindeg(std(lead(li[k][2]))[1])==0) 5387 { 5388 // 1 contained in ideal, i.e. component does not meet origin in local ordering 5389 li=delete(li,k); 5390 } 5391 } 5392 } 5393 return(li); 5284 5394 } 5285 5395 i=simplify(i,2); … … 5289 5399 return(list(L)); 5290 5400 } 5401 5291 5402 if(minpoly!=0) 5292 5403 { 5293 5404 return(algeDeco(i,1)); 5294 5405 } 5295 if (size(#) ==1)5406 if (size(#)!=0) 5296 5407 { return(prim_dec(i,#[1])); } 5297 5408 else … … 5317 5428 5318 5429 RETURN: a list, the minimal associated prime ideals of I. 5319 NOTE: Designed for characteristic 0, works also in char k > 0 based 5320 on an algorithm of Yokoyama 5430 NOTE:  Designed for characteristic 0, works also in char k > 0 based 5431 on an algorithm of Yokoyama 5432  For local orderings, the result is considered in the localization 5433 of the polynomial ring, not in the power series ring 5434  For local and mixed orderings, the decomposition in the 5435 corresponding global ring is returned if the string 'global' 5436 is specified as second argument 5321 5437 EXAMPLE: example minAssGTZ; shows an example 5322 5438 " 5323 5439 { 5440 if(size(#)>0) 5441 { 5442 int keep_comp=1; 5443 } 5444 5445 if(attrib(basering,"global")!=1) 5446 { 5447 // algorithms only work in global case! 5448 // pass to appropriate global ring 5449 def r=basering; 5450 def s=changeord("dp"); 5451 setring s; 5452 ideal i=imap(r,i); 5453 // decompose and go back 5454 list li=minAssGTZ(i); 5455 setring r; 5456 def li=imap(s,li); 5457 // clean up 5458 if(!defined(keep_comp)) 5459 { 5460 for(int k=size(li);k>=1;k) 5461 { 5462 if(mindeg(std(lead(li[k]))[1])==0) 5463 { 5464 // 1 contained in ideal, i.e. component does not meet origin in local ordering 5465 li=delete(li,k); 5466 } 5467 } 5468 } 5469 return(li); 5470 } 5471 5324 5472 int j; 5325 5473 string algorithm; … … 5361 5509 } 5362 5510 5363 if(attrib(basering,"global")!=1)5364 {5365 ERROR(5366 "// Not implemented for this ordering, please change to global ordering."5367 );5368 }5369 5511 if(minpoly!=0) 5370 5512 { … … 5392 5534 Otherwise, the system tries to find an optimal ordering, 5393 5535 which in some cases may considerably speed up the algorithm. @* 5536 For local orderings, the result is considered in the localization 5537 of the polynomial ring, not in the power series ring 5538 For local and mixed orderings, the decomposition in the 5539 corresponding global ring is returned if the string 'global' 5540 is specified as third argument 5394 5541 EXAMPLE: example minAssChar; shows an example 5395 5542 " 5396 5543 { 5544 if(size(#)>1) 5545 { 5546 int keep_comp=1; 5547 } 5397 5548 if(attrib(basering,"global")!=1) 5398 5549 { 5399 ERROR( 5400 "// Not implemented for this ordering, please change to global ordering." 5401 ); 5550 // algorithms only work in global case! 5551 // pass to appropriate global ring 5552 def r=basering; 5553 def s=changeord("dp"); 5554 setring s; 5555 ideal i=imap(r,i); 5556 // decompose and go back 5557 list li=minAssChar(i); 5558 setring r; 5559 def li=imap(s,li); 5560 // clean up 5561 if(!defined(keep_comp)) 5562 { 5563 for(int k=size(li);k>=1;k) 5564 { 5565 if(mindeg(std(lead(li[k]))[1])==0) 5566 { 5567 // 1 contained in ideal, i.e. component does not meet origin in local ordering 5568 li=delete(li,k); 5569 } 5570 } 5571 } 5572 return(li); 5402 5573 } 5403 if (size(#) ==1)5574 if (size(#)>0) 5404 5575 { return(min_ass_prim_charsets(i,#[1])); } 5405 5576 else … … 5461 5632 if(attrib(basering,"global")!=1) 5462 5633 { 5463 ERROR( 5464 "// Not implemented for this ordering, please change to global ordering." 5465 ); 5634 // algorithms only work in global case! 5635 // pass to appropriate global ring 5636 def r=basering; 5637 def s=changeord("dp"); 5638 setring s; 5639 ideal i=imap(r,i); 5640 // compute radical and go back 5641 def j=radical(i); 5642 setring r; 5643 def j=imap(s,j); 5644 return(j); 5466 5645 } 5467 5646 if(size(i) == 0){return(ideal(0));}
Note: See TracChangeset
for help on using the changeset viewer.