Changeset 9ec166 in git
- Timestamp:
- Feb 7, 2012, 3:54:23 PM (11 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- ae816e1c041b7e2bc87647e5ca3d90eb79662487
- Parents:
- 81c5cb527652f63d452271f23b77c68d09305948
- git-author:
- Lars Kastner <lars.kastner@yahoo.dk>2012-02-07 15:54:23+01:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-02-07 19:23:14+01:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/multigrading.lib
r81c5cb r9ec166 15 15 16 16 OVERVIEW: This library allows one to virtually add multigradings to Singular: 17 grade multivariate polynomial rings with arbitrary (fin. gen. Abelian) groups. 17 grade multivariate polynomial rings with arbitrary (fin. gen. Abelian) groups. 18 18 For more see http://code.google.com/p/convex-singular/wiki/Multigrading 19 19 For theoretical references see: … … 425 425 // And now a quick-and-dirty fix of Singular inability to handle attribs of attribs: 426 426 // For the use of a group as an attribute for multigraded rings 427 G[3] = attrib(L, attrGroupHNF); 427 G[3] = attrib(L, attrGroupHNF); 428 428 G[4] = attrib(L, attrGroupSNF); 429 429 430 430 431 431 attrib(G, isGroup, (1==1)); // mark it "a group" … … 584 584 585 585 isGroup(G); 586 586 587 587 printGroup(G); 588 588 … … 960 960 961 961 962 def T = G[2]; 962 def T = G[2]; 963 963 964 964 if( size(#) >= i ) … … 970 970 ERROR("Sorry wrong arguments!"); 971 971 } 972 972 973 973 if( a == "hermite" ) 974 974 { … … 1107 1107 0,1,3,4; 1108 1108 setBaseMultigrading(MM); 1109 1109 1110 1110 module M = ideal( xw-yz, x2z-y3, xz2-y2w, yw2-z3); 1111 1111 … … 1131 1131 print(v); 1132 1132 print(setModuleGrading(v)); 1133 1133 1134 1134 isHomogeneous(v); 1135 1135 … … 1573 1573 while(av[1]*bv[1] != 0) 1574 1574 { 1575 bv = bv - (bv[1] - bv[1]%av[1]) divav[1] * av;1575 bv = bv - (bv[1] - bv[1]%av[1])/av[1] * av; 1576 1576 save = bv; 1577 1577 bv = av; … … 1664 1664 -46,32,37,42,15; 1665 1665 lll(m); 1666 1666 1667 1667 list l = 1668 1668 intvec(13,25,37, 83, 294), … … 1698 1698 // D; 1699 1699 intvec v; 1700 if((cc==1)||(rr==1)) 1701 { 1700 if((cc==1)||(rr==1)){ 1702 1701 if(size(#)==0) 1703 1702 { 1704 1703 return(D); 1705 } 1706 else 1704 } else 1707 1705 { 1708 1706 return(list(P,D,Q)); 1709 1707 } 1710 1708 } 1711 while(D[k+1,k+1] !=0) 1712 { 1713 if(D[k+1,k+1]%D[k,k]!=0) 1714 { 1709 while(D[k+1,k+1] !=0){ 1710 if(D[k+1,k+1]%D[k,k]!=0){ 1715 1711 b = D[k, k]; c = D[k+1, k+1]; 1716 1712 v = gcdcomb(D[k,k],D[k+1,k+1]); 1717 1713 transform = unitMatrix(cc); 1718 1714 transform[k+1,k] = 1; 1719 a = -v[3]*D[k+1,k+1] divv[1];1715 a = -v[3]*D[k+1,k+1]/v[1]; 1720 1716 transform[k, k+1] = a; 1721 1717 transform[k+1, k+1] = a+1; … … 1727 1723 transform[k,k] = v[2]; 1728 1724 transform[k,k+1] = v[3]; 1729 transform[k+1,k] = -c divv[1];1730 transform[k+1,k+1] = b divv[1];1725 transform[k+1,k] = -c/v[1]; 1726 transform[k+1,k+1] = b/v[1]; 1731 1727 D = transform * D; 1732 1728 P = transform * P; … … 1738 1734 } 1739 1735 k++; 1740 if((k==rr) || (k==cc)) 1741 { 1736 if((k==rr) || (k==cc)){ 1742 1737 break; 1743 1738 } 1744 1739 } 1745 1740 //"here is the size ",size(#); 1746 if(size(#) == 0) 1747 { 1741 if(size(#) == 0){ 1748 1742 return(D); 1749 } 1750 else 1751 { 1743 } else { 1752 1744 return(list(P, D, Q)); 1753 1745 } … … 1829 1821 v2 = A[1..rr,j]; 1830 1822 transform = unitMatrix(cc); 1831 transform[j,j] = v1[row] divgcdvec[1];1823 transform[j,j] = v1[row]/gcdvec[1]; 1832 1824 transform[column, column] = gcdvec[2]; 1833 transform[column,j] = -v2[row] divgcdvec[1];1825 transform[column,j] = -v2[row]/gcdvec[1]; 1834 1826 transform[j,column] = gcdvec[3]; 1835 1827 q = q*transform; … … 1848 1840 if(A[row, j]!=0){ 1849 1841 transform = unitMatrix(cc); 1850 transform[column, j] = (-A[row,j]+A[row, j]%A[row, column]) divA[row, column];1842 transform[column, j] = (-A[row,j]+A[row, j]%A[row, column])/A[row, column]; 1851 1843 if(A[row,j]<0){ 1852 1844 transform[column,j]=transform[column,j]+1;} … … 1938 1930 ideal I = a, b; 1939 1931 print(multiDeg(I)); 1940 1932 1941 1933 intmat m[5][2]=multiDeg(a),multiDeg(b); m=transpose(m); 1942 1934 … … 1945 1937 1946 1938 print(m); 1947 1939 1948 1940 areZeroElements(m); 1949 1941 … … 1982 1974 kill a; 1983 1975 } 1984 1976 1985 1977 if( i == 1 ) 1986 1978 { … … 2009 2001 { 2010 2002 v = H[1..r,i]; 2011 mdeg = mdeg-(mdeg[row]-mdeg[row]%v[row]) divv[row]*v;2003 mdeg = mdeg-(mdeg[row]-mdeg[row]%v[row])/v[row]*v; 2012 2004 } 2013 2005 } … … 2206 2198 intmat newgrad[pp][np]; 2207 2199 2208 //This will set the finest grading on the image ring. We will proceed by coarsening this grading until f becomes homogeneous. 2200 //This will set the finest grading on the image ring. We will proceed by coarsening this grading until f becomes homogeneous. 2209 2201 for(i=1;i<=np;i++){ newgrad[p+i,i]=1;} 2210 2202 … … 2224 2216 for(j=1;j<=n;j++){ toadd1[i,j]=oldgrad[i,j];} 2225 2217 } 2226 2218 2227 2219 // This will make the images of homogeneous elements homogeneous, namely the variables of the preimage ring. 2228 2220 for(i=1;i<=n;i++){ … … 2271 2263 columns=columns+ncols(newlat[k]); 2272 2264 } 2273 2265 2274 2266 //The following is just for reducing the size of the matrices. 2275 2267 gragr=hermiteNormalForm(gragr); … … 4770 4762 3,6,12; 4771 4763 4772 intmat B = latticeBasis(L); 4764 intmat B = latticeBasis(L); 4773 4765 print(B); // should result in a matrix whose columns generate the same lattice as [1,2,3] and [0,3,6]: 4774 4766 … … 4851 4843 // generate the same lattice as [-1,2,-1,0],[2,-3,0,1] 4852 4844 intmat B = kernelLattice(LL); 4853 4845 4854 4846 print(B); 4855 4847 … … 5079 5071 // we want a matrix with column operations so we transpose 5080 5072 intmat BB = transpose(B); 5081 list L = hermiteNormalForm(BB, "transform"); 5073 list L = hermiteNormalForm(BB, "transform"); 5082 5074 intmat U = transpose(L[2]); 5083 5075 5084 5076 5085 5077 // delete rows 1 to r 5086 5078 intmat Udel[nrows(U) - r][ncols(U)]; … … 5306 5298 2,1, 5307 5299 3,2; 5308 5300 5309 5301 intmat D = intInverse(C); 5310 5302 … … 5609 5601 5610 5602 // should return a (3x2)-matrix whose columns 5611 // generate the same lattice as [1, 2, 3] and [0, 1, 2] 5603 // generate the same lattice as [1, 2, 3] and [0, 1, 2] 5612 5604 intmat R = primitiveSpan(V); 5613 5605 print(R); … … 5619 5611 5620 5612 // should return a (2x2)-matrix whose columns 5621 // generate the same lattice as [1, 0] and [0, 1] 5613 // generate the same lattice as [1, 0] and [0, 1] 5622 5614 intmat S = primitiveSpan(W); 5623 5615 print(S);
Note: See TracChangeset
for help on using the changeset viewer.