Changeset cb980ab in git
- Timestamp:
- Jul 9, 2010, 9:36:58 AM (13 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 45945a262d8ca4e4d859a9967db621f41ed4c0b6
- Parents:
- 0a4a70481cf50125462e9c1eea5eb085d8ec905a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/primdec.lib
r0a4a704 rcb980ab 21 21 Krick, Logar, Laplagne and Kemper (implementation by Gerhard Pfister and Santiago Laplagne). 22 22 They work in any characteristic.@* 23 Baserings must have a global ordering and no quotient ideal. 23 Some of the algorithms in this library require a global ordering. 24 qrings are not possible as baserings in this library. 25 For local or mixed orderings, most procedures handle the appropriate 26 ring changes internally; otherwise an error message will be printed. 24 27 25 28 … … 50 53 LIB "triang.lib"; 51 54 LIB "absfact.lib"; 55 LIB "ring.lib"; 52 56 /////////////////////////////////////////////////////////////////////////////// 53 57 // … … 1888 1892 } 1889 1893 /////////////////////////////////////////////////////////////////////////////// 1890 static proc cleanPrimaryS(list l)1891 {1892 int i;1893 list lh;1894 for(i=1;i<=size(l);i++)1895 {1896 l[i][2]=std(l[i][2]);1897 if(deg(l[i][2][1])>0)1898 {1899 lh[size(lh)+1]=l[i];1900 }1901 }1902 return(lh);1903 }1904 1905 ///////////////////////////////////////////////////////////////////////////////1906 static proc cleanPrimeS(list l)1907 {1908 int i;1909 list lh;1910 for(i=1;i<=size(l);i++)1911 {1912 l[i]=std(l[i]);1913 if(deg(l[i][1])>0)1914 {1915 lh[size(lh)+1]=l[i];1916 }1917 }1918 return(lh);1919 }1920 1921 ///////////////////////////////////////////////////////////////////////////////1922 1894 1923 1895 … … 2365 2337 " 2366 2338 { 2339 if(attrib(basering,"global")!=1) 2340 { 2341 ERROR( 2342 "// Not implemented for this ordering, please change to global ordering." 2343 ); 2344 } 2367 2345 intvec op ; 2368 2346 def P = basering; 2369 if(attrib(basering,"global")!=1)2370 {2371 def PG=changeord("dp");2372 setring PG;2373 ideal i=imap(P,i);2374 list L=equidim(i,#);2375 setring P;2376 list L=imap(PG,L);2377 L=cleanPrimeS(L);2378 return(L);2379 }2380 2347 list eq; 2381 2348 intvec w; … … 2476 2443 " 2477 2444 { 2445 if(attrib(basering,"global")!=1) 2446 { 2447 ERROR( 2448 "// Not implemented for this ordering, please change to global ordering." 2449 ); 2450 } 2478 2451 def P = basering; 2479 if(attrib(basering,"global")!=1)2480 {2481 def PG=changeord("dp");2482 setring PG;2483 ideal i=imap(P,i);2484 ideal L=equidimMax(i);2485 setring P;2486 ideal L=imap(PG,L);2487 L=std(L);2488 return(L);2489 }2490 2452 ideal eq; 2491 2453 intvec w; … … 3751 3713 if((reduce(f,std(h))!=0)||(reduce(diff(f,var(i)),std(h))!=0)) 3752 3714 { 3753 ERROR(" ERROR inGCD");3715 ERROR("FEHLER IN GCD"); 3754 3716 } 3755 3717 poly g1=lift(h,f)[1][1]; // f/h … … 3882 3844 " 3883 3845 { 3846 if(attrib(basering,"global")!=1) 3847 { 3848 ERROR( 3849 "// Not implemented for this ordering, please change to global ordering." 3850 ); 3851 } 3884 3852 if((char(basering)<100)&&(char(basering)!=0)) 3885 3853 { 3886 3854 "WARNING: The characteristic is too small, the result may be wrong"; 3887 3855 } 3888 if(attrib(basering,"global")!=1)3889 {3890 def P=basering;3891 def PG=changeord("dp");3892 setring PG;3893 ideal i=imap(P,i);3894 ideal L=radicalEHV(i);3895 setring P;3896 ideal L=imap(PG,L);3897 L=std(L);3898 return(L);3899 }3900 3901 3856 ideal J,I,I0,radI0,L,radI1,I2,radI2; 3902 3857 int l,n; … … 4399 4354 if((choose<0) or (choose>3)) 4400 4355 { 4401 ERROR(" <int> must be 0 or 1 or 2 or 3");4356 ERROR("ERROR: <int> must be 0 or 1 or 2 or 3"); 4402 4357 } 4403 4358 option(notWarnSB); … … 5149 5104 /////////////////////////////////////////////////////////////////////////////// 5150 5105 5151 proc primdecGTZ(ideal i )5106 proc primdecGTZ(ideal i, list #) 5152 5107 "USAGE: primdecGTZ(i); i ideal 5153 5108 RETURN: a list pr of primary ideals and their associated primes: … … 5156 5111 pr[i][2] the i-th prime component. 5157 5112 @end format 5158 NOTE: Algorithm of Gianni/Trager/Zacharias. 5159 Designed for characteristic 0, works also in char k > 0, if it 5160 terminates (may result in an infinite loop in small characteristic!) 5113 NOTE: - Algorithm of Gianni/Trager/Zacharias. 5114 - Designed for characteristic 0, works also in char k > 0, if it 5115 terminates (may result in an infinite loop in small characteristic!) 5116 - For local orderings, the result is considered in the localization 5117 of the polynomial ring, not in the power series ring 5118 - For local and mixed orderings, the decomposition in the 5119 corresponding global ring is returned if the string 'global' 5120 is specified as second argument 5161 5121 EXAMPLE: example primdecGTZ; shows an example 5162 5122 " 5163 5123 { 5124 if(size(#)>0) 5125 { 5126 int keep_comp=1; 5127 } 5164 5128 if(attrib(basering,"global")!=1) 5165 5129 { 5166 def P=basering; 5167 def PG=changeord("dp"); 5168 setring PG; 5169 ideal i=imap(P,i); 5170 list L=primdecGTZ(i); 5171 setring P; 5172 list L=imap(PG,L); 5173 L=cleanPrimaryS(L); 5174 return(L); 5130 // algorithms only work in global case! 5131 // pass to appropriate global ring 5132 def r=basering; 5133 def s=changeord("dp"); 5134 setring s; 5135 ideal i=imap(r,i); 5136 // decompose and go back 5137 list li=primdecGTZ(i); 5138 setring r; 5139 def li=imap(s,li); 5140 // clean up 5141 if(!defined(keep_comp)) 5142 { 5143 for(int k=size(li);k>=1;k--) 5144 { 5145 if(mindeg(std(lead(li[k][2]))[1])==0) 5146 { 5147 // 1 contained in ideal, i.e. component does not meet origin in local ordering 5148 li=delete(li,k); 5149 } 5150 } 5151 } 5152 return(li); 5175 5153 } 5154 5176 5155 if(minpoly!=0) 5177 5156 { 5178 5157 return(algeDeco(i,0)); 5179 5158 ERROR( 5180 " Not implemented yet for algebraic extensions.Simulate the ring extension by adding the minpoly to the ideal"5159 "// Not implemented yet for algebraic extensions.Simulate the ring extension by adding the minpoly to the ideal" 5181 5160 ); 5182 5161 } … … 5193 5172 } 5194 5173 /////////////////////////////////////////////////////////////////////////////// 5195 proc absPrimdecGTZ(ideal I )5174 proc absPrimdecGTZ(ideal I, list #) 5196 5175 "USAGE: absPrimdecGTZ(I); I ideal 5197 5176 ASSUME: Ground field has characteristic 0. 5198 RETURN: a ring containing two lists: @code{absolute_primes} (the absolute5199 prime components of I ) and @code{primary_decomp} (the output of5200 @code{primdecGTZ(I)} ).5177 RETURN: a ring containing two lists: @code{absolute_primes}, the absolute 5178 prime components of I, and @code{primary_decomp}, the output of 5179 @code{primdecGTZ(I)}. 5201 5180 The list absolute_primes has to be interpreted as follows: 5202 5181 each entry describes a class of conjugated absolute primes, … … 5208 5187 polynomial of a minimal finite field extension over which the 5209 5188 absolute prime component is defined. 5189 For local orderings, the result is considered in the localization 5190 of the polynomial ring, not in the power series ring. 5191 For local and mixed orderings, the decomposition in the 5192 corresponding global ring is returned if the string 'global' 5193 is specified as second argument 5210 5194 NOTE: Algorithm of Gianni/Trager/Zacharias combined with the 5211 5195 @code{absFactorize} command. … … 5220 5204 } 5221 5205 5206 if(size(#)>0) 5207 { 5208 int keep_comp=1; 5209 } 5210 5222 5211 if(attrib(basering,"global")!=1) 5223 5212 { 5224 ERROR( 5225 "Not implemented for this ordering, please change to global ordering." 5226 ); 5213 // algorithm automatically passes to the global case 5214 // hence prepare to go back to an appropriate new ring 5215 def r=basering; 5216 ideal max_of_r=maxideal(1); 5217 def s=changeord("dp"); 5218 setring s; 5219 def I=imap(r,I); 5220 def S=absPrimdecGTZ(I); 5221 setring S; 5222 ring r1=char(basering),var(nvars(r)+1),dp; 5223 def rS=r+r1; 5224 // move objects to appropriate ring and clean up 5225 setring rS; 5226 def max_of_r=imap(r,max_of_r); 5227 attrib(max_of_r,"isSB",1); 5228 def absolute_primes=imap(S,absolute_primes); 5229 def primary_decomp=imap(S,primary_decomp); 5230 if(!defined(keep_comp)) 5231 { 5232 ideal tempid; 5233 for(int k=size(absolute_primes);k>=1;k--) 5234 { 5235 tempid=absolute_primes[k][1]; 5236 tempid[1]=0; // ignore minimal polynomial 5237 if(size(reduce(lead(tempid),max_of_r))!=0) 5238 { 5239 // 1 contained in ideal, i.e. component does not meet origin in local ordering 5240 absolute_primes=delete(absolute_primes,k); 5241 } 5242 } 5243 for(k=size(primary_decomp);k>=1;k--) 5244 { 5245 if(mindeg(std(lead(primary_decomp[k][2]))[1])==0) 5246 { 5247 // 1 contained in ideal, i.e. component does not meet origin in local ordering 5248 primary_decomp=delete(primary_decomp,k); 5249 } 5250 } 5251 kill tempid; 5252 } 5253 export(primary_decomp); 5254 export(absolute_primes); 5255 return(rS); 5227 5256 } 5228 5257 if(minpoly!=0) … … 5230 5259 //return(algeDeco(i,0)); 5231 5260 ERROR( 5232 " Not implemented yet for algebraic extensions.Simulate the ring extension by adding the minpoly to the ideal"5261 "// Not implemented yet for algebraic extensions.Simulate the ring extension by adding the minpoly to the ideal" 5233 5262 ); 5234 5263 } … … 5289 5318 primary_decomp[i]=list(L[i][1],L[i][2]); 5290 5319 } 5291 for(ii=1;ii<=size(absolute_primes);ii++)5292 {5293 absolute_primes[ii][1]=interred(absolute_primes[ii][1]);5294 }5295 5320 export(primary_decomp); 5296 5321 export(absolute_primes); 5297 5322 setring R; 5298 dbprint( printlevel-voice+3," 5299 // def S = absPrimdecGTZ(i); creates a ring, 5300 // which comes with two lists: 5301 // absolute_primes -- the absolute prime components, 5302 // and primary_decomp -- the primary and prime 5303 // components over the current basering). 5304 // Type setring S; absolute_primes; 5305 // to access the data. 5306 "); 5323 dbprint( printlevel-voice+3," 5324 // 'absPrimdecGTZ' created a ring, in which two lists absolute_primes (the 5325 // absolute prime components) and primary_decomp (the primary and prime 5326 // components over the current basering) are stored. 5327 // To access the list of absolute prime components, type (if the name S was 5328 // assigned to the return value): 5329 setring S; absolute_primes; "); 5330 5307 5331 return(Rz); 5308 5332 } … … 5334 5358 if c=3, minAssGTZ and facstd are used. 5335 5359 @end format 5360 For local orderings, the result is considered in the localization 5361 of the polynomial ring, not in the power series ring. 5362 For local and mixed orderings, the decomposition in the 5363 corresponding global ring is returned if the string 'global' 5364 is specified as third argument 5336 5365 EXAMPLE: example primdecSY; shows an example 5337 5366 " 5338 5367 { 5368 if(size(#)>1) 5369 { 5370 int keep_comp=1; 5371 } 5339 5372 if(attrib(basering,"global")!=1) 5340 5373 { 5341 def P=basering; 5342 def PG=changeord("dp"); 5343 setring PG; 5344 ideal i=imap(P,i); 5345 list L=primdecSY(i,#); 5346 setring P; 5347 list L=imap(PG,L); 5348 L=cleanPrimaryS(L); 5349 return(L); 5374 // algorithms only work in global case! 5375 // pass to appropriate global ring 5376 def r=basering; 5377 def s=changeord("dp"); 5378 setring s; 5379 ideal i=imap(r,i); 5380 // decompose and go back 5381 list li=primdecSY(i); 5382 setring r; 5383 def li=imap(s,li); 5384 // clean up 5385 if(!defined(keep_comp)) 5386 { 5387 for(int k=size(li);k>=1;k--) 5388 { 5389 if(mindeg(std(lead(li[k][2]))[1])==0) 5390 { 5391 // 1 contained in ideal, i.e. component does not meet origin in local ordering 5392 li=delete(li,k); 5393 } 5394 } 5395 } 5396 return(li); 5350 5397 } 5351 5352 5398 i=simplify(i,2); 5353 5399 if ((i[1]==0)||(i[1]==1)) … … 5356 5402 return(list(L)); 5357 5403 } 5404 5358 5405 if(minpoly!=0) 5359 5406 { 5360 5407 return(algeDeco(i,1)); 5361 5408 } 5362 if (size(#) ==1)5409 if (size(#)!=0) 5363 5410 { return(prim_dec(i,#[1])); } 5364 5411 else … … 5384 5431 5385 5432 RETURN: a list, the minimal associated prime ideals of I. 5386 NOTE: Designed for characteristic 0, works also in char k > 0 based 5387 on an algorithm of Yokoyama 5433 NOTE: - Designed for characteristic 0, works also in char k > 0 based 5434 on an algorithm of Yokoyama 5435 - For local orderings, the result is considered in the localization 5436 of the polynomial ring, not in the power series ring 5437 - For local and mixed orderings, the decomposition in the 5438 corresponding global ring is returned if the string 'global' 5439 is specified as second argument 5388 5440 EXAMPLE: example minAssGTZ; shows an example 5389 5441 " 5390 5442 { 5443 if(size(#)>0) 5444 { 5445 int keep_comp=1; 5446 } 5447 5448 if(attrib(basering,"global")!=1) 5449 { 5450 // algorithms only work in global case! 5451 // pass to appropriate global ring 5452 def r=basering; 5453 def s=changeord("dp"); 5454 setring s; 5455 ideal i=imap(r,i); 5456 // decompose and go back 5457 list li=minAssGTZ(i); 5458 setring r; 5459 def li=imap(s,li); 5460 // clean up 5461 if(!defined(keep_comp)) 5462 { 5463 for(int k=size(li);k>=1;k--) 5464 { 5465 if(mindeg(std(lead(li[k]))[1])==0) 5466 { 5467 // 1 contained in ideal, i.e. component does not meet origin in local ordering 5468 li=delete(li,k); 5469 } 5470 } 5471 } 5472 return(li); 5473 } 5474 5391 5475 int j; 5392 5476 string algorithm; … … 5426 5510 } 5427 5511 } 5428 }5429 if(attrib(basering,"global")!=1)5430 {5431 def P=basering;5432 def PG=changeord("dp");5433 setring PG;5434 ideal i=imap(P,i);5435 list L=minAssGTZ(i,#);5436 setring P;5437 list L=imap(PG,L);5438 L=cleanPrimeS(L);5439 return(L);5440 5512 } 5441 5513 … … 5465 5537 Otherwise, the system tries to find an optimal ordering, 5466 5538 which in some cases may considerably speed up the algorithm. @* 5539 For local orderings, the result is considered in the localization 5540 of the polynomial ring, not in the power series ring 5541 For local and mixed orderings, the decomposition in the 5542 corresponding global ring is returned if the string 'global' 5543 is specified as third argument 5467 5544 EXAMPLE: example minAssChar; shows an example 5468 5545 " 5469 5546 { 5547 if(size(#)>1) 5548 { 5549 int keep_comp=1; 5550 } 5470 5551 if(attrib(basering,"global")!=1) 5471 5552 { 5472 def P=basering; 5473 def PG=changeord("dp"); 5474 setring PG; 5475 ideal i=imap(P,i); 5476 list L=minAssChar(i,#); 5477 setring P; 5478 list L=imap(PG,L); 5479 L=cleanPrimeS(L); 5480 return(L); 5553 // algorithms only work in global case! 5554 // pass to appropriate global ring 5555 def r=basering; 5556 def s=changeord("dp"); 5557 setring s; 5558 ideal i=imap(r,i); 5559 // decompose and go back 5560 list li=minAssChar(i); 5561 setring r; 5562 def li=imap(s,li); 5563 // clean up 5564 if(!defined(keep_comp)) 5565 { 5566 for(int k=size(li);k>=1;k--) 5567 { 5568 if(mindeg(std(lead(li[k]))[1])==0) 5569 { 5570 // 1 contained in ideal, i.e. component does not meet origin in local ordering 5571 li=delete(li,k); 5572 } 5573 } 5574 } 5575 return(li); 5481 5576 } 5482 5483 if (size(#)==1) 5577 if (size(#)>0) 5484 5578 { return(min_ass_prim_charsets(i,#[1])); } 5485 5579 else … … 5504 5598 " 5505 5599 { 5506 if(attrib(basering,"global")!=1) 5507 { 5508 def P=basering; 5509 def PG=changeord("dp"); 5510 setring PG; 5511 ideal i=imap(P,i); 5512 ideal L=equiRadical(i); 5513 setring P; 5514 ideal L=imap(PG,L); 5515 L=std(L); 5516 return(L); 5517 } 5518 5600 if(attrib(basering,"global")!=1) 5601 { 5602 ERROR( 5603 "// Not implemented for this ordering, please change to global ordering." 5604 ); 5605 } 5519 5606 return(radical(i, 1)); 5520 5607 } … … 5545 5632 " 5546 5633 { 5547 dbprint(printlevel - voice, "Radical, version 2006.05.08"); 5548 if(attrib(basering,"global")!=1) 5549 { 5550 def P=basering; 5551 def PG=changeord("dp"); 5552 setring PG; 5553 ideal i=imap(P,i); 5554 ideal L=radical(i,#); 5555 setring P; 5556 ideal L=imap(PG,L); 5557 L=std(L); 5558 return(L); 5559 } 5560 5634 dbprint(printlevel - voice, "Radical, version 2006.05.08"); 5635 if(attrib(basering,"global")!=1) 5636 { 5637 // algorithms only work in global case! 5638 // pass to appropriate global ring 5639 def r=basering; 5640 def s=changeord("dp"); 5641 setring s; 5642 ideal i=imap(r,i); 5643 // compute radical and go back 5644 def j=radical(i); 5645 setring r; 5646 def j=imap(s,j); 5647 return(j); 5648 } 5561 5649 if(size(i) == 0){return(ideal(0));} 5562 5650 int j; … … 6325 6413 if(attrib(basering,"global")!=1) 6326 6414 { 6327 def P=basering; 6328 def PG=changeord("dp"); 6329 setring PG; 6330 ideal i=imap(P,i); 6331 list L=prepareAss(i); 6332 setring P; 6333 list L=imap(PG,L); 6334 L=cleanPrimeS(L); 6335 return(L); 6336 } 6337 6415 ERROR( 6416 "// Not implemented for this ordering, please change to global ordering." 6417 ); 6418 } 6338 6419 ideal j=std(i); 6339 6420 int cod=nvars(basering)-dim(j); … … 6378 6459 " 6379 6460 { 6380 if(attrib(basering,"global")!=1) 6381 { 6382 def P=basering; 6383 def PG=changeord("dp"); 6384 setring PG; 6385 ideal i=imap(P,i); 6386 ideal L=equidimMaxEHV(i); 6387 setring P; 6388 ideal L=imap(PG,L); 6389 L=std(L); 6390 return(L); 6391 } 6392 6461 if(attrib(basering,"global")!=1) 6462 { 6463 ERROR( 6464 "// Not implemented for this ordering, please change to global ordering." 6465 ); 6466 } 6393 6467 ideal j=groebner(i); 6394 6468 int cod=nvars(basering)-dim(j); … … 6453 6527 " 6454 6528 { 6529 if(attrib(basering,"global")!=1) 6530 { 6531 ERROR( 6532 "// Not implemented for this ordering, please change to global ordering." 6533 ); 6534 } 6455 6535 def R=basering; 6456 if(attrib(basering,"global")!=1)6457 {6458 def PG=changeord("dp");6459 setring PG;6460 ideal i=imap(R,I);6461 list L=zerodec(i);6462 setring R;6463 list L=imap(PG,L);6464 L=cleanPrimeS(L);6465 return(L);6466 }6467 6468 6536 poly q; 6469 6537 int j,time;
Note: See TracChangeset
for help on using the changeset viewer.