Changeset 09b38e in git


Ignore:
Timestamp:
Mar 30, 2011, 6:35:05 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', '0bc2210f8055033868008a3836878db65ec6f89e')
Children:
2caede44bc1e423ef32297874f5a15517729e721
Parents:
a796fbdaa0242a20ef39e60d40c2d02dba2c9eb4
Message:
*Lars Kastner: Added return documentation to multiDegTensor. Bug fixed.

From: Oleksandr Motsak <motsak@mathematik.uni-kl.de>

git-svn-id: file:///usr/local/Singular/svn/trunk@14086 2c84dea3-7e68-4137-9b89-c4e89433aadc
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/multigrading.lib

    ra796fb r09b38e  
    3737printGroup(G);             print a group
    3838
    39 areIsomorphicGroups(G,H);     test wheter G an H are isomorphic groups
    4039isGroup(G);                   test whether G is a valid group
    4140isGroupHomomorphism(L1,L2,A); test wheter A defines a group homomrphism from L1 to L2
     
    5857isPrimitiveSublattice(A); test whether A generates a primitive sublattice.
    5958intInverse(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.
    6159integralSection(P);       for a given linear surjective map P of lattices this procedure returns an integral section of P.
    6260primitiveSpan(A);         computes a basis for the minimal primitive sublattice that contains the given vectors (by A).
     
    522520static proc areIsomorphicGroups(def G, def H)
    523521"USAGE: areIsomorphicGroups(G, H); G and H are groups
    524 PURPOSE: ?
     522PURPOSE: Check whether G and H define isomorphic groups.
    525523RETURN: int, 1 for TRUE, 0 otherwise
    526524EXAMPLE: example areIsomorphicGroups; shows an example
     
    12671265
    12681266
    1269 proc multiDegTensor(module m, module n){
     1267proc multiDegTensor(module m, module n)
     1268"
     1269USAGE: multiDegTensor(m, n), m,n  modules or matrices.
     1270PURPOSE: Computes the multigraded tensor product of to multigraded modules.
     1271RETURN: A module.
     1272EXAMPLE: example multiDegTensor; shows an example
     1273"
     1274{
    12701275  matrix M = m;
    12711276  matrix N = n;
     
    14421447/******************************************************/
    14431448proc isGroupHomomorphism(def L1, def L2, intmat A)
    1444 "USAGE: gisGoupHomomorphism(L1,L2,A); L1 and L2 are groups, A is an integer matrix
     1449"USAGE: isGoupHomomorphism(L1,L2,A); L1 and L2 are groups, A is an integer matrix
    14451450PURPOSE: checks whether A defines a group homomorphism phi: L1 --> L2
    14461451RETURN: int, 1 if A defines the homomorphism and 0 otherwise
     
    45734578example
    45744579{
     4580  "EXAMPLE:"; echo=2;
    45754581
    45764582  intmat A[3][4] =
     
    45844590  print(r); // Should be 2
    45854591
    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;
    45874603
    45884604}
     
    45964612The procedure checks whether each generator of L is
    45974613contained in S.
    4598 RETURN: 0 if false, 1 if true
     4614RETURN: integer, 0 if false, 1 if true
    45994615EXAMPLE: example isSublattice; shows an example
    46004616"
     
    47474763
    47484764  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);
    47504778
    47514779  kill B,L;
     
    48124840    3,6,9,12;
    48134841
    4814   // should be a 4x2 matrix with colums
    4815   // [-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]
    48164844  intmat B = kernelLattice(LL);
    4817 
     4845 
    48184846  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);
    48194859
    48204860  kill B;
     
    48544894  }
    48554895
    4856 
    4857 //  print(Con);
    4858 
    48594896  intmat L = kernelLattice(Con);
    4860 /*
    4861   print(L);
    4862   print(ncols(P));
    4863   print(ncols(L));
    4864 */
     4897
    48654898  // delete rows ncols(P)+1 to nrows(L) out of L
    48664899  intmat Del[ncols(P)][ncols(L)];
     
    48954928  // should be a (3x2)-matrix with columns e.g. [1,1,-1] and [0,3,-2] (the generated lattice should be identical)
    48964929  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
    48974945}
    48984946
     
    49334981  // should be 0
    49344982  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;
    49404996}
    49414997
     
    49565012  }
    49575013
    4958   if ( isPrimitiveSublattice(A) == 1 )
     5014
     5015  if ( isPrimitiveSublattice(P) == 1 )
    49595016  {
    49605017    return(1);
     
    49675024  "EXAMPLE"; echo = 2;
    49685025
    4969   intmat A[3][2] =
     5026  intmat A[2][3] =
    49705027    1,3,5,
    49715028    2,4,6;
     
    49755032  print(b);
    49765033
    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;
    49785044}
    49795045
     
    50555121  print(projectLattice(BB));
    50565122
    5057   // one more example
     5123  // another example
    50585124
    50595125  intmat BBB[3][4] =
     
    51545220
    51555221  // 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)
    51575223  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////////////////////////////////////
    51595240
    51605241proc intInverse(intmat A);
     
    52135294  print(A * B);
    52145295
    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;
    52165307}
    52175308
    52185309
    52195310/******************************************************/
    5220 proc intAdjoint(intmat A, int indrow, int indcol)
     5311static proc intAdjoint(intmat A, int indrow, int indcol)
    52215312"USAGE: intAdjoint(A); intmat A
    52225313PURPOSE: return the matrix where the given row and column are deleted.
     
    53925483proc productgroup(G,H)
    53935484"USAGE: productgroup(G,H); list G, list H
    5394 PURPOSE: returns a representation of the G x H
     5485PURPOSE: Returns a representation of the group G x H
    53955486RETURNS: list
    53965487EXAMPLE: example productgroup(G,H); shows an example
     
    54575548/******************************************************/
    54585549proc primitiveSpan(intmat V);
    5459 "USAGE: isIntegralSurjective(V); intmat V
     5550"USAGE: primitiveSpan(V); intmat V
    54605551PURPOSE: compute an integral basis for the minimal primitive
    54615552sublattice that contains the given vectors, i.e. the columns of V.
    54625553RETURNS: int, where 0 is false and 1 is true.
    5463 EXAMPLE: example isIntegralSurjective; shows an example
     5554EXAMPLE: example primitiveSpan; shows an example
    54645555"
    54655556{
     
    55045595  "EXAMPLE"; echo = 2;
    55055596
    5506   intmat V[2][4] =
     5597  intmat V[3][2] =
    55075598    1,4,
    55085599    2,5,
    55095600    3,6;
    55105601
    5511   // should return a (4x2)-matrix with columns
    5512   // [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]
    55135604  intmat R = primitiveSpan(V);
    55145605  print(R);
    55155606
    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;
    55175618}
    55185619
Note: See TracChangeset for help on using the changeset viewer.