Changeset 4e3305 in git


Ignore:
Timestamp:
Jan 21, 2015, 12:25:22 AM (9 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
ca38640ca6928ad815ae7b2bd1f3516f383315affae8e849c66b071ec3b0afcb4779e35629c0d034
Parents:
374d8e1b4eb33ca5848ce22e0d05e58ecc908065
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2015-01-21 00:25:22+01:00
git-committer:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2015-01-21 00:27:24+01:00
Message:
Added constructor for graded objects: grobj

add: example with zero column
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/gradedModules.lib

    r374d8e r4e3305  
    1515
    1616    grzero()        presentation of basering(0)^1
     17    grobj(M,w)      construct a graded module object
    1718    grshift(M,d)    shift graded module M by d
    1819    grtwist(r,d)    presentation of basering(d)^r
     
    304305  // grades & ordering permutation for N.  d[p] should be sorted!
    305306 
    306   def N = module(M[p]);  // reorder the starting ideal/module
    307 
    308   attrib( N, "isHomog", w ); // set the grading
    309   attrib( N, "rank", size(w) ); // set the grading
     307  def N = grobj(module(M[p]), w);  // reorder the starting ideal/module
    310308
    311309  d = d[p];
     
    439437 else              { (N,d) = reorder(M, -1); }
    440438
    441  kill M; module M = transpose(N);
    442  attrib( M, "isHomog", -d ); // set the grading
     439 kill M; module M = grobj(transpose(N), -d);
    443440
    444441// "b";  grview(M);
     
    447444 // reverse order:
    448445 (N,d) = reorder(M, 1); kill M;
    449 
    450 /*
    451  module M = transpose(N);
    452  attrib( M, "isHomog", -d ); // set the grading
    453 
    454 // "c";  grview(M);
    455  
    456  kill N,d; module N; intvec d;
    457  // reverse order:
    458  (N,d) = reorder(M, -1); kill M;
    459  module M = transpose(N);
    460  attrib( M, "isHomog", -d ); // set the grading
    461 
    462 // "d";  grview(M);
    463  
    464  kill N,d; module N; intvec d;
    465  // reverse order:
    466  (N,d) = reorder(M, 1);
    467  
    468  kill M;
    469 */
    470446
    471447// "e"; grview( N );
     
    524500  if( size(#) > 0 ) { (N,d) = reorder(M, 1, #[1]); }
    525501  else              { (N,d) = reorder(M, 1); } 
    526   kill M; module M = transpose(N);
    527   attrib( M, "isHomog", -d ); // set the grading
     502  kill M; module M = grobj(transpose(N), -d);
    528503
    529504// "b";  grview(M);
     
    533508  (N,d) = reorder(M, -1); kill M;
    534509 
    535   module M = transpose(N);
    536   attrib( M, "isHomog", -d ); // set the grading
     510  module M = grobj(transpose(N), -d);
    537511
    538512// "c";  grview(M);
     
    611585{
    612586 module Z = 0;
    613  attrib(Z,"isHomog",intvec(0));
    614  return (Z);
     587 return ( grobj(Z,intvec(0)) );
    615588}
    616589
     
    653626  module T; T[r] = 0; T = T, module(transpose(B));
    654627  module AB = module(A), transpose(T);
    655 
    656   attrib(AB, "isHomog", c);
    657   attrib(AB, "rank", size(c));
    658  
    659   return(AB);
     628 
     629  return(grobj(AB, c));
    660630}
    661631example
     
    666636  grview(grpower( grshift(grzero(), 10), 5 ) );
    667637 
    668   module A = [x+y, x, 0, 0], [0, x+y, y, 0];
    669   attrib(A,"isHomog", intvec(0,0,0,1));
    670   attrib(A,"rank", 4);
     638  module A = grobj( module([x+y, x, 0, 0], [0, x+y, y, 0]), intvec(0,0,0,1) ); 
    671639  grview(A);
    672640 
    673   matrix B[3][1] = 0,x,y;
    674   attrib(B,"isHomog", intvec(2,1,1));
     641  module B = grobj( module([0,x,y]), intvec(15,1,1) );
    675642  grview(B);
    676643
    677   def C = grsum(A,B);
     644  module C = grsum(A,B);
    678645
    679646  print(C);
     
    681648  grview(C);
    682649
    683   def D = grsum(
     650  module D = grsum(
    684651     grsum(grpower(A,2), grtwist(1,1)),
    685652     grsum(grtwist(1,2), grpower(B,2))
     
    690657  grview(D);
    691658
    692   def D10 = grshift(D, 10);
     659  module D10 = grshift(D, 10);
    693660
    694661  print(D10);
     
    696663  grview(D10);
    697664
    698   def DD = grorder(D10);
     665  module DD = grorder(D10);
    699666
    700667  print(DD);
     
    702669  grview(DD);
    703670
    704   def TTT = grtranspose(DD);
     671  module TTT = grtranspose(DD);
    705672
    706673  print(TTT);
    707674  homog(TTT);
    708675  grview(TTT);
     676
     677  module F = grobj( module([x,y,0]), intvec(1,1,5) );
     678  grview(B);
     679 
     680  module T = grsum( F, grsum( grtwist(1, 10), B ) );
     681  grview(T);
     682
    709683}
    710684
     
    715689{
    716690  intvec a = attrib(M, "isHomog");
    717   attrib(M, "isHomog", intvec( a + intvec(d:size(a))) );
    718   return (M);
     691  return (grobj(M, intvec( a + intvec(d:size(a))) ));
    719692}
    720693
     
    731704{
    732705  module Z; Z[a] = 0;
    733   attrib(Z, "isHomog", intvec(d:a));
    734   attrib(Z, "rank", a);
     706  Z = grobj(Z, intvec(d:a));
    735707
    736708  ASSUME(2, grisequal(Z, grpower( grshift(grzero(), d), a ) )); // optional check
    737709  return(Z);
    738 
     710}
     711
     712proc grobj(module M, intvec w)
     713""
     714{
     715  attrib(M, "isHomog", w);
     716  attrib(M, "rank", size(w));
     717  return (M);
     718}
Note: See TracChangeset for help on using the changeset viewer.