Changeset 9ec166 in git for Singular


Ignore:
Timestamp:
Feb 7, 2012, 3:54:23 PM (12 years ago)
Author:
Lars Kastner <lars.kastner@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
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
Message:
update multigrading.lib to r617

Added return documentation to multiDegTensor.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/multigrading.lib

    r81c5cb r9ec166  
    1515
    1616OVERVIEW: This library allows one to virtually add multigradings to Singular:
    17 grade multivariate polynomial rings with arbitrary (fin. gen. Abelian) groups.
     17grade multivariate polynomial rings with arbitrary (fin. gen. Abelian) groups. 
    1818For more see http://code.google.com/p/convex-singular/wiki/Multigrading
    1919For theoretical references see:
     
    425425  // And now a quick-and-dirty fix of Singular inability to handle attribs of attribs:
    426426  // For the use of a group as an attribute for multigraded rings
    427   G[3] = attrib(L, attrGroupHNF);
     427  G[3] = attrib(L, attrGroupHNF); 
    428428  G[4] = attrib(L, attrGroupSNF);
    429 
     429 
    430430
    431431  attrib(G, isGroup, (1==1)); // mark it "a group"
     
    584584
    585585  isGroup(G);
    586 
     586 
    587587  printGroup(G);
    588588
     
    960960
    961961
    962   def T = G[2];
     962  def T = G[2]; 
    963963
    964964  if( size(#) >= i )
     
    970970      ERROR("Sorry wrong arguments!");
    971971    }
    972 
     972   
    973973    if( a == "hermite" )
    974974    {
     
    11071107                  0,1,3,4;
    11081108  setBaseMultigrading(MM);
    1109 
     1109 
    11101110  module M = ideal(  xw-yz, x2z-y3, xz2-y2w, yw2-z3);
    11111111
     
    11311131  print(v);
    11321132  print(setModuleGrading(v));
    1133 
     1133 
    11341134  isHomogeneous(v);
    11351135
     
    15731573  while(av[1]*bv[1] != 0)
    15741574  {
    1575     bv = bv - (bv[1] - bv[1]%av[1]) div av[1] * av;
     1575    bv = bv - (bv[1] - bv[1]%av[1])/av[1] * av;
    15761576    save = bv;
    15771577    bv = av;
     
    16641664                  -46,32,37,42,15;
    16651665  lll(m);
    1666 
     1666 
    16671667  list l =
    16681668      intvec(13,25,37, 83, 294),
     
    16981698  // D;
    16991699  intvec v;
    1700   if((cc==1)||(rr==1))
    1701   {
     1700  if((cc==1)||(rr==1)){
    17021701    if(size(#)==0)
    17031702    {
    17041703      return(D);
    1705     }
    1706     else
     1704    } else
    17071705    {
    17081706      return(list(P,D,Q));
    17091707    }
    17101708  }
    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){
    17151711      b = D[k, k]; c = D[k+1, k+1];
    17161712      v = gcdcomb(D[k,k],D[k+1,k+1]);
    17171713      transform = unitMatrix(cc);
    17181714      transform[k+1,k] = 1;
    1719       a = -v[3]*D[k+1,k+1] div v[1];
     1715      a = -v[3]*D[k+1,k+1]/v[1];
    17201716      transform[k, k+1] = a;
    17211717      transform[k+1, k+1] = a+1;
     
    17271723      transform[k,k] = v[2];
    17281724      transform[k,k+1] = v[3];
    1729       transform[k+1,k] = -c div v[1];
    1730       transform[k+1,k+1] = b div v[1];
     1725      transform[k+1,k] = -c/v[1];
     1726      transform[k+1,k+1] = b/v[1];
    17311727      D = transform * D;
    17321728      P = transform * P;
     
    17381734    }
    17391735    k++;
    1740     if((k==rr) || (k==cc))
    1741     {
     1736    if((k==rr) || (k==cc)){
    17421737      break;
    17431738    }
    17441739  }
    17451740  //"here is the size ",size(#);
    1746   if(size(#) == 0)
    1747   {
     1741  if(size(#) == 0){
    17481742    return(D);
    1749   }
    1750   else
    1751   {
     1743  } else {
    17521744    return(list(P, D, Q));
    17531745  }
     
    18291821              v2 = A[1..rr,j];
    18301822              transform = unitMatrix(cc);
    1831               transform[j,j] = v1[row] div gcdvec[1];
     1823              transform[j,j] = v1[row]/gcdvec[1];
    18321824              transform[column, column] = gcdvec[2];
    1833               transform[column,j] = -v2[row] div gcdvec[1];
     1825              transform[column,j] = -v2[row]/gcdvec[1];
    18341826              transform[j,column] = gcdvec[3];
    18351827              q = q*transform;
     
    18481840        if(A[row, j]!=0){
    18491841          transform = unitMatrix(cc);
    1850           transform[column, j] = (-A[row,j]+A[row, j]%A[row, column]) div A[row, column];
     1842          transform[column, j] = (-A[row,j]+A[row, j]%A[row, column])/A[row, column];
    18511843          if(A[row,j]<0){
    18521844            transform[column,j]=transform[column,j]+1;}
     
    19381930  ideal I = a, b;
    19391931  print(multiDeg(I));
    1940 
     1932 
    19411933  intmat m[5][2]=multiDeg(a),multiDeg(b); m=transpose(m);
    19421934
     
    19451937
    19461938  print(m);
    1947 
     1939 
    19481940  areZeroElements(m);
    19491941
     
    19821974    kill a;
    19831975  }
    1984 
     1976 
    19851977  if( i == 1 )
    19861978  {
     
    20092001      {
    20102002        v = H[1..r,i];
    2011         mdeg = mdeg-(mdeg[row]-mdeg[row]%v[row]) div v[row]*v;
     2003        mdeg = mdeg-(mdeg[row]-mdeg[row]%v[row])/v[row]*v;
    20122004      }
    20132005    }
     
    22062198  intmat newgrad[pp][np];
    22072199
    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. 
    22092201  for(i=1;i<=np;i++){ newgrad[p+i,i]=1;}
    22102202
     
    22242216    for(j=1;j<=n;j++){ toadd1[i,j]=oldgrad[i,j];}
    22252217  }
    2226 
     2218 
    22272219  // This will make the images of homogeneous elements homogeneous, namely the variables of the preimage ring.
    22282220  for(i=1;i<=n;i++){
     
    22712263    columns=columns+ncols(newlat[k]);
    22722264  }
    2273 
     2265 
    22742266  //The following is just for reducing the size of the matrices.
    22752267  gragr=hermiteNormalForm(gragr);
     
    47704762    3,6,12;
    47714763
    4772   intmat B = latticeBasis(L);
     4764  intmat B = latticeBasis(L); 
    47734765  print(B); // should result in a matrix whose columns generate the same lattice as  [1,2,3] and [0,3,6]:
    47744766
     
    48514843  // generate the same lattice as [-1,2,-1,0],[2,-3,0,1]
    48524844  intmat B = kernelLattice(LL);
    4853 
     4845 
    48544846  print(B);
    48554847
     
    50795071      // we want a matrix with column operations so we transpose
    50805072      intmat BB = transpose(B);
    5081       list L = hermiteNormalForm(BB, "transform");
     5073      list L = hermiteNormalForm(BB, "transform"); 
    50825074      intmat U = transpose(L[2]);
    50835075
    5084 
     5076 
    50855077      // delete rows 1 to r
    50865078      intmat Udel[nrows(U) - r][ncols(U)];
     
    53065298    2,1,
    53075299    3,2;
    5308 
     5300 
    53095301  intmat D  = intInverse(C);
    53105302
     
    56095601
    56105602  // 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] 
    56125604  intmat R = primitiveSpan(V);
    56135605  print(R);
     
    56195611
    56205612  // 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] 
    56225614  intmat S = primitiveSpan(W);
    56235615  print(S);
Note: See TracChangeset for help on using the changeset viewer.