Changeset 28500c in git for Singular/LIB/normal.lib
- Timestamp:
- Jul 27, 1998, 11:13:02 AM (26 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- d8cc2a7cea0a2cbf24ab556a355de8a20e298df6
- Parents:
- ae35b679235b164e70dad2c057963595f25bdd23
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/normal.lib
rae35b67 r28500c 6 6 /////////////////////////////////////////////////////////////////////////////// 7 7 8 version="$Id: normal.lib,v 1. 7 1998-06-17 09:23:17 pfisterExp $";8 version="$Id: normal.lib,v 1.8 1998-07-27 09:13:02 obachman Exp $"; 9 9 info=" 10 10 LIBRARY: normal.lib: PROCEDURE FOR NORMALIZATION (I) … … 254 254 ideal endphi = maxideal(1); 255 255 ideal endid = fetch(P,id); 256 L=substpart(endid,endphi,homo,rw); 257 def lastRing=L[1]; 258 setring lastRing; 259 256 260 attrib(endid,"isCohenMacaulay",isCo); 257 261 attrib(endid,"isPrim",isPr); … … 261 265 attrib(endid,"isCompleteIntersection",0); 262 266 attrib(endid,"isRad",0); 263 export endid; 264 export endphi; 265 L = newR1; 267 // export endid; 268 // export endphi; 269 // L = newR1; 270 L=lastRing; 266 271 L = insert(L,1,1); 267 272 dbprint(printlevel-voice+3,"// case R = Hom(J,J)"); … … 270 275 "R=Hom(rad(J),rad(J))"; 271 276 " "; 272 newR1;277 lastRing; 273 278 " "; 274 279 "the new ideal"; … … 284 289 id; 285 290 " "; 286 setring newR1;291 setring lastRing; 287 292 "the map"; 288 293 " "; … … 385 390 ideal endphi = ideal(X(1..nvars(R))); 386 391 387 map phi = basering,maxideal(1); 388 list Le = elimpart(endid); 389 //this proc and the next loop try to 390 q = size(Le[2]); //substitute as many variables as possible 391 rw1 = 0; 392 rw1[nvars(basering)] = 0; 393 rw1 = rw1+1; 394 395 while( size(Le[2]) != 0 ) 396 { 397 endid = Le[1]; 398 map ps = newRing,Le[5]; 399 phi = phi(ps); 400 kill ps; 401 402 for( ii=1; ii<=size(rw1); ii++ ) 403 { 404 if( Le[4][ii]==0 ) 405 { 406 rw1[ii]=0; //look for substituted vars 407 } 408 } 409 Le=elimpart(endid); 410 q = q + size(Le[2]); 411 } 412 endphi = phi(endphi); 413 414 //---------- return ----------------------------------------------------------- 415 // in the homogeneous case put weights for the remaining vars correctly, i.e. 416 // delete from rw those weights for which the corresponding entry of rw1 is 0 417 418 if (homo==1 && nvars(newRing)-q >1 && size(endid) >0 ) 419 { 420 jj=1; 421 for( ii=2; ii<size(rw1); ii++) 422 { 423 jj++; 424 if( rw1[ii]==0 ) 425 { 426 rw=rw[1..jj-1],rw[jj+1..size(rw)]; 427 jj=jj-1; 428 } 429 } 430 if( rw1[1]==0 ) { rw=rw[2..size(rw)]; } 431 if( rw1[size(rw1)]==0 ){ rw=rw[1..size(rw)-1]; } 432 433 ring lastRing = char(R),(T(1..nvars(newRing)-q)),(a(rw),dp); 434 } 435 else 436 { 437 ring lastRing = char(R),(T(1..nvars(newRing)-q)),dp; 438 } 439 440 ideal lastmap; 441 q = 1; 442 for(ii=1; ii<=size(rw1); ii++ ) 443 { 444 if ( rw1[ii]==1 ) { lastmap[ii] = T(q); q=q+1; } 445 if ( rw1[ii]==0 ) { lastmap[ii] = 0; } 446 } 447 map phi = newRing,lastmap; 448 ideal endid = phi(endid); 449 ideal endphi = phi(endphi); 392 L=substpart(endid,endphi,homo,rw); 393 def lastRing=L[1]; 394 setring lastRing; 450 395 attrib(endid,"isCohenMacaulay",isCo); 451 396 attrib(endid,"isPrim",isPr); … … 455 400 attrib(endid,"isCompleteIntersection",0); 456 401 attrib(endid,"isRad",0); 457 export(endid);458 export(endphi);459 if(y==1)402 // export(endid); 403 // export(endphi); 404 if(y==1) 460 405 { 461 406 "the new ring after reduction of the number of variables"; … … 652 597 example 653 598 { "EXAMPLE:"; echo = 2; 654 //Theo1 655 ring r=32003,(x,y,z),wp(2,3,6); 656 ideal i=zy2-zx3-x6; 657 658 list pr=normal(i); 659 def r1=pr[1]; 660 setring r1; 661 KK; 662 setring r; 599 ring r = 0,(x,y,z),dp; 600 663 601 } 664 602 … … 690 628 int depth,lauf,prdim; 691 629 int ti=timer; 692 630 693 631 if(size(i)==0) 694 632 { … … 794 732 } 795 733 MB=SM[2]; 796 execute "ring newR6="+charstr(basering)+",("+varstr(basering)+"),(" 797 +ordstr(basering)+");"; 798 ideal KK=fetch(BAS,MB); 799 ideal PP=fetch(BAS,ihp); 734 intvec rw; 735 list LL=substpart(MB,ihp,0,rw); 736 def newR6=LL[1]; 737 setring newR6; 738 ideal KK=endid; 739 ideal PP=endphi; 740 // execute "ring newR6="+charstr(basering)+",("+varstr(basering)+"),(" 741 // +ordstr(basering)+");"; 742 // ideal KK=fetch(BAS,MB); 743 // ideal PP=fetch(BAS,ihp); 800 744 export PP; 801 745 export KK; … … 814 758 } 815 759 MB=maxideal(1); 816 execute "ring newR5="+charstr(basering)+",("+varstr(basering)+"),(" 817 +ordstr(basering)+");"; 818 ideal KK=fetch(BAS,MB); 819 ideal PP=fetch(BAS,ihp); 760 intvec rw; 761 list LL=substpart(MB,ihp,0,rw); 762 def newR5=LL[1]; 763 setring newR5; 764 ideal KK=endid; 765 ideal PP=endphi; 766 // execute "ring newR5="+charstr(basering)+",("+varstr(basering)+"),(" 767 // +ordstr(basering)+");"; 768 // ideal KK=fetch(BAS,MB); 769 // ideal PP=fetch(BAS,ihp); 820 770 export PP; 821 771 export KK; … … 836 786 } 837 787 MB=SM[2]; 838 execute "ring newR4="+charstr(basering)+",("+varstr(basering)+"),(" 839 +ordstr(basering)+");"; 840 ideal KK=fetch(BAS,MB); 841 ideal PP=fetch(BAS,ihp); 788 intvec rw; 789 list LL=substpart(MB,ihp,0,rw); 790 def newR4=LL[1]; 791 setring newR4; 792 ideal KK=endid; 793 ideal PP=endphi; 794 // execute "ring newR4="+charstr(basering)+",("+varstr(basering)+"),(" 795 // +ordstr(basering)+");"; 796 // ideal KK=fetch(BAS,MB); 797 // ideal PP=fetch(BAS,ihp); 842 798 export PP; 843 799 export KK; … … 916 872 } 917 873 MB=SM[2]; 918 execute "ring newR3="+charstr(basering)+",("+varstr(basering)+"),(" 919 +ordstr(basering)+");"; 920 ideal KK=fetch(BAS,MB); 921 ideal PP=fetch(BAS,ihp); 874 intvec rw; 875 list LL=substpart(MB,ihp,0,rw); 876 // execute "ring newR3="+charstr(basering)+",("+varstr(basering)+"),(" 877 // +ordstr(basering)+");"; 878 def newR3=LL[1]; 879 setring newR3; 880 // ideal KK=fetch(BAS,MB); 881 // ideal PP=fetch(BAS,ihp); 882 ideal KK=endid; 883 ideal PP=endphi; 922 884 export PP; 923 885 export KK; … … 1150 1112 setring lastR; 1151 1113 ideal KK=endid; 1152 ideal PP= fetch(BAS,ihp);1114 ideal PP=endphi; 1153 1115 export PP; 1154 1116 export KK; … … 1232 1194 example 1233 1195 { "EXAMPLE:";echo = 2; 1234 //Theo1 1235 ring r=32003,(x,y,z),wp(2,3,6); 1236 ideal i=zy2-zx3-x6; 1196 LIB"normal.lib"; 1197 //Huneke 1198 ring qr=31991,(a,b,c,d,e),dp; 1199 ideal i= 1200 5abcde-a5-b5-c5-d5-e5, 1201 ab3c+bc3d+a3be+cd3e+ade3, 1202 a2bc2+b2cd2+a2d2e+ab2e2+c2de2, 1203 abc5-b4c2d-2a2b2cde+ac3d2e-a4de2+bcd2e3+abe5, 1204 ab2c4-b5cd-a2b3de+2abc2d2e+ad4e2-a2bce3-cde5, 1205 a3b2cd-bc2d4+ab2c3e-b5de-d6e+3abcd2e2-a2be4-de6, 1206 a4b2c-abc2d3-ab5e-b3c2de-ad5e+2a2bcde2+cd2e4, 1207 b6c+bc6+a2b4e-3ab2c2de+c4d2e-a3cde2-abd3e2+bce5; 1237 1208 1238 1209 list pr=normal(i); … … 1240 1211 setring r1; 1241 1212 KK; 1242 setring r;1243 1213 } 1244 1214 1215 proc substpart(ideal endid,ideal endphi, int homo, intvec rw) 1216 { 1217 def newRing=basering; 1218 int ii,jj; 1219 map phi = basering,maxideal(1); 1220 list Le = elimpart(endid); 1221 //this proc and the next loop try to 1222 int q = size(Le[2]); //substitute as many variables as possible 1223 intvec rw1 = 0; //indices of substituted variables 1224 rw1[nvars(basering)] = 0; 1225 rw1 = rw1+1; 1226 1227 while( size(Le[2]) != 0 ) 1228 { 1229 endid = Le[1]; 1230 map ps = newRing,Le[5]; 1231 phi = ps(phi); 1232 kill ps; 1233 1234 for( ii=1; ii<=size(rw1); ii++ ) 1235 { 1236 if( Le[4][ii]==0 ) 1237 { 1238 rw1[ii]=0; //look for substituted vars 1239 } 1240 } 1241 Le=elimpart(endid); 1242 q = q + size(Le[2]); 1243 } 1244 endphi = phi(endphi); 1245 1246 //---------- return ----------------------------------------------------------- 1247 // in the homogeneous case put weights for the remaining vars correctly, i.e. 1248 // delete from rw those weights for which the corresponding entry of rw1 is 0 1249 1250 if (homo==1 && nvars(newRing)-q >1 && size(endid) >0 ) 1251 { 1252 jj=1; 1253 for( ii=2; ii<size(rw1); ii++) 1254 { 1255 jj++; 1256 if( rw1[ii]==0 ) 1257 { 1258 rw=rw[1..jj-1],rw[jj+1..size(rw)]; 1259 jj=jj-1; 1260 } 1261 } 1262 if( rw1[1]==0 ) { rw=rw[2..size(rw)]; } 1263 if( rw1[size(rw1)]==0 ){ rw=rw[1..size(rw)-1]; } 1264 1265 ring lastRing = char(basering),(T(1..nvars(newRing)-q)),(a(rw),dp); 1266 } 1267 else 1268 { 1269 ring lastRing = char(basering),(T(1..nvars(newRing)-q)),dp; 1270 } 1271 1272 ideal lastmap; 1273 q = 1; 1274 for(ii=1; ii<=size(rw1); ii++ ) 1275 { 1276 if ( rw1[ii]==1 ) { lastmap[ii] = T(q); q=q+1; } 1277 if ( rw1[ii]==0 ) { lastmap[ii] = 0; } 1278 } 1279 map phi = newRing,lastmap; 1280 ideal endid = phi(endid); 1281 ideal endphi = phi(endphi); 1282 export(endid); 1283 export(endphi); 1284 list L = lastRing; 1285 setring newRing; 1286 return(L); 1287 } 1245 1288 1246 1289
Note: See TracChangeset
for help on using the changeset viewer.