Changeset 63da27 in git
- Timestamp:
- Sep 23, 2010, 4:39:36 PM (13 years ago)
- Branches:
- (u'spielwiese', '828514cf6e480e4bafc26df99217bf2a1ed1ef45')
- Children:
- ef8e31eb483d52603fe20fe9d261320e2fd2b4ee
- Parents:
- 0879467b3486695745e782f3a4ad5ef36e73127d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/multigrading.lib
r087946 r63da27 1 1 /////////////////////////////////////////////////////////////////// 2 Version="$Id: multigrading.lib 0.1 2010-02-13$";2 version="$Id$"; 3 3 category="Combinatorial Commutative Algebra"; 4 4 info=" … … 12 12 OVERVIEW: using this library allows one can virtually add multigrading to Singular. 13 13 For more see http://code.google.com/p/convex-singular/wiki/Multigrading 14 15 NOTE: this is a proof of concept using Singular attributes. 16 17 REFERENCE: 18 E. Miller, B. Sturmfels: 'Combinatorial Commutative Algebra', 19 M. Kreuzer, L. Robbiano: 'Computational Commutative Algebra' 14 For theoretical references see: 15 E. Miller, B. Sturmfels: 'Combinatorial Commutative Algebra' and 16 M. Kreuzer, L. Robbiano: 'Computational Commutative Algebra'. 17 18 NOTE: 'mDegBasis' relies on 4ti2 for computing Hilbert Bases. 19 20 PROCEDURES: 21 setBaseMultigrading(M,T); attach multiweights/torsion matrices to the basering 22 getVariableWeights([R]); get matrix of multidegrees of vars attached to a ring 23 getTorsion([R]); get torsion matrix attached to a ring 24 25 setModuleGrading(M,v); attach multiweights of units to a module and return it 26 getModuleGrading(M); get multiweights of module units (attached to M) 27 28 mDeg(A); compute the multidegree of A 29 mDegBasis(d); compute all monomials of multidegree d 30 mDegPartition(p); compute the multigraded-homogenous components of p 31 32 isTorsionFree(); test whether the current multigrading is torsion free 33 isTorsionElement(p); test whether p has zero multidegree 34 isHomogenous(a); test whether 'a' is multigraded-homogenous 35 36 equalMDeg(e1,e2[,V]); test whether e1==e2 in the current multigrading 37 38 mDegGroebner(M); compute the multigraded GB/SB of M 39 mDegSyzygy(M); compute the multigraded syzygies of M 40 mDegResolution(M,l[,m]); compute the multigraded resolution of M 41 42 defineHomogenous(p); get a torsion matrix wrt which p becomes homogenous 43 pushForward(f); find the finest grading on the image ring, homogenizing f 44 45 hermite(A); compute the Hermite Normal Form of a matrix 46 47 hilbertSeries(M); compute the multigraded Hilbert Series of M 48 49 (parameters in square brackets [] are optional) 20 50 21 51 KEYWORDS: multigradeding, multidegree, multiweights, multigraded-homogenous 22 23 24 REQUIRES: 4ti2 for Hilbert Bases needed for mDegBasis25 26 PROCEDURES:27 setBaseMultigrading(M,T) attach multiweights/torsion matrices to the basering28 getVariableWeights([R]) get matrix of multidegrees of vars attached to a ring29 getTorsion([R]) get torsion matrix attached to a ring30 31 setModuleGrading(M,v) attach multiweights of units to a module and return it32 getModuleGrading(M) get multiweights of module units (attached to M)33 34 mDeg(A) compute the multidegree of A35 mDegBasis(d) compute all monomials of multidegree d36 mDegPartition(p) compute the multigraded-homogenous components of p37 38 isTorsionFree() test whether the current multigrading is torsion free39 isTorsionElement(p) test whether p has zero multidegree40 isHomogenous(a) test whether 'a' is multigraded-homogenous41 42 equalMDeg(e1,e2[,V]) test whether e1==e2 in the current multigrading43 44 mDegGroebner(M) compute the multigraded GB/SB of M45 mDegSyzygy(M) compute the multigraded syzygies of M46 mDegResolution(M,l[,m]) compute the multigraded resolution of M47 48 defineHomogenous(p) get a torsion matrix wrt which p becomes homogenous49 pushForward(f) find the finest grading on the image ring, homogenizing f50 51 hermite(A) compute the Hermite Normal Form of a matrix52 53 hilbertSeries(M) compute the multigraded Hilbert Series of M54 55 (parameters in square brackets [] are optional)56 52 "; 57 53 … … 59 55 // newMap(map F, intmat Q, list #) 60 56 61 62 63 57 LIB "standard.lib"; // for groebner 64 58 65 59 /******************************************************/ 66 60 proc setBaseMultigrading(intmat M, list #) 67 "USAGE: setBaseMultigrading(M[, T]) 68 PURPOSE: attach M abd T to the basering, where M is the matrix of the weights of variables, L is the torsion 61 "USAGE: setBaseMultigrading(M[, T]); M, T are integer matrices 62 PURPOSE: attaches weights of variables and torsion to the basering. 63 NOTE: M encodes the weights of variables column-wise. 64 The torsion is given by the lattice spanned by the columns of the integer 65 matrix T in Z^nrows(M) over Z. 69 66 RETURN: nothing 70 67 EXAMPLE: example setBaseMultigrading; shows an example … … 990 987 /******************************************************/ 991 988 proc equalMDeg(intvec exp1, intvec exp2, list #) 992 "USAGE: equalMDeg(exp1, exp2[, V]) where exp1,exp2 are exponents of terms [, V is multidegree of module components]; 993 PURPOSE: Tests if the exponent vectors of two monomials represent the same multidegree. 989 "USAGE: equalMDeg(exp1, exp2[, V]); intvec exp1, exp2, intmat V 990 PURPOSE: Tests if the exponent vectors of two monomials (given by exp1 and exp2) 991 represent the same multidegree. 992 NOTE: the integer matrix V encodes multidegrees of module components, 993 if module component is present in exp1 and exp2 994 994 " 995 995 { … … 1012 1012 if( (size(#) == 0) or (typeof(#[1])!="intmat") ) 1013 1013 { 1014 ERROR("Sorry: wrong or missing module-unit-weights-matrix !");1014 ERROR("Sorry: wrong or missing module-unit-weights-matrix V!"); 1015 1015 } 1016 1016 intmat V = #[1]; … … 1544 1544 while( size(tt) > 0 ) 1545 1545 { 1546 1547 if( equalMDeg( leadexp(tt), m, V ) ) // TODO: we make no caching of matrices (M,T,H,V), which remain the same!1546 // TODO: we make no caching of matrices (M,T,H,V), which remain the same! 1547 if( equalMDeg( leadexp(tt), m, V ) ) 1548 1548 { 1549 1549 mp = mp + lead(tt); // "mp", mp; … … 1850 1850 j=system("sh","hilbert -q -n sing4ti2"); ////////// be quiet + no loggin!!! 1851 1851 1852 j=system("sh","awk \'BEGIN{ORS=\",\";}{print $0;}\' sing4ti2.hil | sed s/[\\\ \\\t\\\v\\\f]/,/g | sed s/,+/,/g |sed s/,,/,/g|sed s/,,/,/g > sing4ti2.converted"); 1852 j=system("sh", "awk \'BEGIN{ORS=\",\";}{print $0;}\' sing4ti2.hil " + 1853 "| sed s/[\\\ \\\t\\\v\\\f]/,/g " + 1854 "| sed s/,+/,/g|sed s/,,/,/g " + 1855 "| sed s/,,/,/g " + 1856 "> sing4ti2.converted" ); 1853 1857 if( defined(keepfiles) <= 0) 1854 1858 { … … 1896 1900 1897 1901 ring r=0,(x1,x2,x3,x4,x5,x6,x7,x8,x9),dp; 1898 intmat M[7][9]=1,1,1,-1,-1,-1,0,0,0,1,1,1,0,0,0,-1,-1,-1,0,1,1,-1,0,0,-1,0,0,1,0,1,0,-1,0,0,-1,0,1,1,0,0,0,-1,0,0,-1,0,1,1,0,-1,0,0,0,-1,1,1,0,0,-1,0,-1,0,0; 1902 intmat M[7][9]= 1903 1, 1, 1, -1, -1, -1, 0, 0, 0, 1904 1, 1, 1, 0, 0, 0,-1,-1,-1, 1905 0, 1, 1, -1, 0, 0,-1, 0, 0, 1906 1, 0, 1, 0, -1, 0, 0,-1, 0, 1907 1, 1, 0, 0, 0, -1, 0, 0,-1, 1908 0, 1, 1, 0, -1, 0, 0, 0,-1, 1909 1, 1, 0, 0, -1, 0,-1, 0, 0; 1899 1910 hilbert4ti2intmat(M); 1900 1911 hermite(M);
Note: See TracChangeset
for help on using the changeset viewer.