Changeset 09b38e in git
 Timestamp:
 Mar 30, 2011, 6:35:05 PM (12 years ago)
 Branches:
 (u'jengelhdatetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
 Children:
 2caede44bc1e423ef32297874f5a15517729e721
 Parents:
 a796fbdaa0242a20ef39e60d40c2d02dba2c9eb4
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/multigrading.lib
ra796fb r09b38e 37 37 printGroup(G); print a group 38 38 39 areIsomorphicGroups(G,H); test wheter G an H are isomorphic groups40 39 isGroup(G); test whether G is a valid group 41 40 isGroupHomomorphism(L1,L2,A); test wheter A defines a group homomrphism from L1 to L2 … … 58 57 isPrimitiveSublattice(A); test whether A generates a primitive sublattice. 59 58 intInverse(A); computes the integral inverse matrix of the intmat A 60 intAdjoint(A,i,j); delete row i and column j of the intmat A.61 59 integralSection(P); for a given linear surjective map P of lattices this procedure returns an integral section of P. 62 60 primitiveSpan(A); computes a basis for the minimal primitive sublattice that contains the given vectors (by A). … … 522 520 static proc areIsomorphicGroups(def G, def H) 523 521 "USAGE: areIsomorphicGroups(G, H); G and H are groups 524 PURPOSE: ?522 PURPOSE: Check whether G and H define isomorphic groups. 525 523 RETURN: int, 1 for TRUE, 0 otherwise 526 524 EXAMPLE: example areIsomorphicGroups; shows an example … … 1267 1265 1268 1266 1269 proc multiDegTensor(module m, module n){ 1267 proc multiDegTensor(module m, module n) 1268 " 1269 USAGE: multiDegTensor(m, n), m,n modules or matrices. 1270 PURPOSE: Computes the multigraded tensor product of to multigraded modules. 1271 RETURN: A module. 1272 EXAMPLE: example multiDegTensor; shows an example 1273 " 1274 { 1270 1275 matrix M = m; 1271 1276 matrix N = n; … … 1442 1447 /******************************************************/ 1443 1448 proc isGroupHomomorphism(def L1, def L2, intmat A) 1444 "USAGE: gisGoupHomomorphism(L1,L2,A); L1 and L2 are groups, A is an integer matrix1449 "USAGE: isGoupHomomorphism(L1,L2,A); L1 and L2 are groups, A is an integer matrix 1445 1450 PURPOSE: checks whether A defines a group homomorphism phi: L1 > L2 1446 1451 RETURN: int, 1 if A defines the homomorphism and 0 otherwise … … 4573 4578 example 4574 4579 { 4580 "EXAMPLE:"; echo=2; 4575 4581 4576 4582 intmat A[3][4] = … … 4584 4590 print(r); // Should be 2 4585 4591 4586 kill A; 4592 // another example 4593 intmat B[2][2] = 4594 1,2, 4595 1,2; 4596 4597 int d = intRank(B); 4598 4599 print(B); 4600 print(d); // Should be 1 4601 4602 kill A, B, r, d; 4587 4603 4588 4604 } … … 4596 4612 The procedure checks whether each generator of L is 4597 4613 contained in S. 4598 RETURN: 0 if false, 1 if true4614 RETURN: integer, 0 if false, 1 if true 4599 4615 EXAMPLE: example isSublattice; shows an example 4600 4616 " … … 4747 4763 4748 4764 intmat B = latticeBasis(L); 4749 print(B); // should be a matrix with columns [1,2,3] and [0,3,6] 4765 print(B); // should result in a matrix whose columns generate the same lattice as [1,2,3] and [0,3,6]: 4766 4767 // another example 4768 intmat C[2][4] = 4769 1,1,2,0, 4770 2,3,4,0; 4771 4772 // should result in a matrix whose 4773 // colums create the same lattice as 4774 // [0,1],[1,0] 4775 intmat D = latticeBasis(C); 4776 4777 print(D); 4750 4778 4751 4779 kill B,L; … … 4812 4840 3,6,9,12; 4813 4841 4814 // should be a 4x2 matrix w ith colums4815 // [1,2,1,0],[2,3,0,1]4842 // should be a 4x2 matrix whose columns 4843 // generate the same lattice as [1,2,1,0],[2,3,0,1] 4816 4844 intmat B = kernelLattice(LL); 4817 4845 4818 4846 print(B); 4847 4848 // another example 4849 intmat C[2][4] = 4850 1,0,2,0, 4851 0,1,2,0; 4852 4853 // should result in a matrix whose 4854 // colums create the same lattice as 4855 // [2,2,1,0], [0,0,0,1] 4856 intmat D = kernelLattice(C); 4857 4858 print(D); 4819 4859 4820 4860 kill B; … … 4854 4894 } 4855 4895 4856 4857 // print(Con);4858 4859 4896 intmat L = kernelLattice(Con); 4860 /* 4861 print(L); 4862 print(ncols(P)); 4863 print(ncols(L)); 4864 */ 4897 4865 4898 // delete rows ncols(P)+1 to nrows(L) out of L 4866 4899 intmat Del[ncols(P)][ncols(L)]; … … 4895 4928 // should be a (3x2)matrix with columns e.g. [1,1,1] and [0,3,2] (the generated lattice should be identical) 4896 4929 print(preimageLattice(P,B)); 4930 4931 // another example 4932 intmat W[3][3] = 4933 1,0,0, 4934 0,1,1, 4935 0,2,0; 4936 4937 intmat Z[3][2] = 4938 1,0, 4939 0,1, 4940 0,0; 4941 4942 // should be a (3x2)matrix with columns e.g. [1,0,0] and [0,0,1] (the generated lattice should be identical) 4943 print(preimageLattice(W,Z)); 4944 4897 4945 } 4898 4946 … … 4933 4981 // should be 0 4934 4982 int b = isPrimitiveSublattice(A); 4935 b; 4936 4937 if( b != 0 ){ ERROR("Sorry, something went wrong..."); } 4938 4939 kill A,b; 4983 print(b); 4984 4985 // another example 4986 4987 intmat B[2][2] = 4988 1,0, 4989 0,1; 4990 4991 // should be 1 4992 int c = isPrimitiveSublattice(B); 4993 print(c); 4994 4995 kill A, b, B, c; 4940 4996 } 4941 4997 … … 4956 5012 } 4957 5013 4958 if ( isPrimitiveSublattice(A) == 1 ) 5014 5015 if ( isPrimitiveSublattice(P) == 1 ) 4959 5016 { 4960 5017 return(1); … … 4967 5024 "EXAMPLE"; echo = 2; 4968 5025 4969 intmat A[ 3][2] =5026 intmat A[2][3] = 4970 5027 1,3,5, 4971 5028 2,4,6; … … 4975 5032 print(b); 4976 5033 4977 kill A,b; 5034 // another example 5035 intmat B[2][3] = 5036 1,1,5, 5037 2,3,6; 5038 5039 // should be 1 5040 int c = isIntegralSurjective(B); 5041 print(c); 5042 5043 kill A, b, B, c; 4978 5044 } 4979 5045 … … 5055 5121 print(projectLattice(BB)); 5056 5122 5057 // one moreexample5123 // another example 5058 5124 5059 5125 intmat BBB[3][4] = … … 5154 5220 5155 5221 // should result in a (3x2)matrix with columns 5156 // e.g. [ 3, 3, 3], [3, 0, 3] (the lattice should be the same)5222 // e.g. [0, 3, 6], [3, 0, 3] (the lattice should be the same) 5157 5223 print(intersectLattices(A,B)); 5158 } 5224 5225 // another example 5226 intmat C[2][3] = 5227 1,0,0, 5228 3,2,5; 5229 5230 intmat D[2][3] = 5231 4,5,0, 5232 0,5,0; 5233 5234 // should result in a (3x2)matrix whose columns generate the 5235 // same lattice as [1,5], [0, 20] 5236 print(intersectLattices(C,D)); 5237 } 5238 5239 //////////////////////////////////// 5159 5240 5160 5241 proc intInverse(intmat A); … … 5213 5294 print(A * B); 5214 5295 5215 kill A,B; 5296 // another example 5297 intmat C[2][2] = 5298 2,1, 5299 3,2; 5300 5301 intmat D = intInverse(C); 5302 5303 // should be the unit matrix 5304 print(C * D); 5305 5306 kill A, B, C, D; 5216 5307 } 5217 5308 5218 5309 5219 5310 /******************************************************/ 5220 proc intAdjoint(intmat A, int indrow, int indcol)5311 static proc intAdjoint(intmat A, int indrow, int indcol) 5221 5312 "USAGE: intAdjoint(A); intmat A 5222 5313 PURPOSE: return the matrix where the given row and column are deleted. … … 5392 5483 proc productgroup(G,H) 5393 5484 "USAGE: productgroup(G,H); list G, list H 5394 PURPOSE: returns a representation of theG x H5485 PURPOSE: Returns a representation of the group G x H 5395 5486 RETURNS: list 5396 5487 EXAMPLE: example productgroup(G,H); shows an example … … 5457 5548 /******************************************************/ 5458 5549 proc primitiveSpan(intmat V); 5459 "USAGE: isIntegralSurjective(V); intmat V5550 "USAGE: primitiveSpan(V); intmat V 5460 5551 PURPOSE: compute an integral basis for the minimal primitive 5461 5552 sublattice that contains the given vectors, i.e. the columns of V. 5462 5553 RETURNS: int, where 0 is false and 1 is true. 5463 EXAMPLE: example isIntegralSurjective; shows an example5554 EXAMPLE: example primitiveSpan; shows an example 5464 5555 " 5465 5556 { … … 5504 5595 "EXAMPLE"; echo = 2; 5505 5596 5506 intmat V[ 2][4] =5597 intmat V[3][2] = 5507 5598 1,4, 5508 5599 2,5, 5509 5600 3,6; 5510 5601 5511 // should return a ( 4x2)matrix withcolumns5512 // [1, 2, 3] and [1, 1, 1] (or similar)5602 // should return a (3x2)matrix whose columns 5603 // generate the same lattice as [1, 2, 3] and [0, 1, 2] 5513 5604 intmat R = primitiveSpan(V); 5514 5605 print(R); 5515 5606 5516 kill V,R; 5607 // another example 5608 intmat W[2][2] = 5609 1,0, 5610 0,1; 5611 5612 // should return a (2x2)matrix whose columns 5613 // generate the same lattice as [1, 0] and [0, 1] 5614 intmat S = primitiveSpan(W); 5615 print(S); 5616 5617 kill V, R, S, W; 5517 5618 } 5518 5619
Note: See TracChangeset
for help on using the changeset viewer.