Changeset 4e3305 in git
 Timestamp:
 Jan 21, 2015, 12:25:22 AM (9 years ago)
 Branches:
 (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
 Children:
 ca38640ca6928ad815ae7b2bd1f3516f383315affae8e849c66b071ec3b0afcb4779e35629c0d034
 Parents:
 374d8e1b4eb33ca5848ce22e0d05e58ecc908065
 gitauthor:
 Oleksandr Motsak <motsak@mathematik.unikl.de>20150121 00:25:22+01:00
 gitcommitter:
 Oleksandr Motsak <motsak@mathematik.unikl.de>20150121 00:27:24+01:00
 File:

 1 edited
Legend:
 Unmodified
 Added
 Removed

Singular/LIB/gradedModules.lib
r374d8e r4e3305 15 15 16 16 grzero() presentation of basering(0)^1 17 grobj(M,w) construct a graded module object 17 18 grshift(M,d) shift graded module M by d 18 19 grtwist(r,d) presentation of basering(d)^r … … 304 305 // grades & ordering permutation for N. d[p] should be sorted! 305 306 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 310 308 311 309 d = d[p]; … … 439 437 else { (N,d) = reorder(M, 1); } 440 438 441 kill M; module M = transpose(N); 442 attrib( M, "isHomog", d ); // set the grading 439 kill M; module M = grobj(transpose(N), d); 443 440 444 441 // "b"; grview(M); … … 447 444 // reverse order: 448 445 (N,d) = reorder(M, 1); kill M; 449 450 /*451 module M = transpose(N);452 attrib( M, "isHomog", d ); // set the grading453 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 grading461 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 */470 446 471 447 // "e"; grview( N ); … … 524 500 if( size(#) > 0 ) { (N,d) = reorder(M, 1, #[1]); } 525 501 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); 528 503 529 504 // "b"; grview(M); … … 533 508 (N,d) = reorder(M, 1); kill M; 534 509 535 module M = transpose(N); 536 attrib( M, "isHomog", d ); // set the grading 510 module M = grobj(transpose(N), d); 537 511 538 512 // "c"; grview(M); … … 611 585 { 612 586 module Z = 0; 613 attrib(Z,"isHomog",intvec(0)); 614 return (Z); 587 return ( grobj(Z,intvec(0)) ); 615 588 } 616 589 … … 653 626 module T; T[r] = 0; T = T, module(transpose(B)); 654 627 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)); 660 630 } 661 631 example … … 666 636 grview(grpower( grshift(grzero(), 10), 5 ) ); 667 637 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) ); 671 639 grview(A); 672 640 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) ); 675 642 grview(B); 676 643 677 defC = grsum(A,B);644 module C = grsum(A,B); 678 645 679 646 print(C); … … 681 648 grview(C); 682 649 683 defD = grsum(650 module D = grsum( 684 651 grsum(grpower(A,2), grtwist(1,1)), 685 652 grsum(grtwist(1,2), grpower(B,2)) … … 690 657 grview(D); 691 658 692 defD10 = grshift(D, 10);659 module D10 = grshift(D, 10); 693 660 694 661 print(D10); … … 696 663 grview(D10); 697 664 698 defDD = grorder(D10);665 module DD = grorder(D10); 699 666 700 667 print(DD); … … 702 669 grview(DD); 703 670 704 defTTT = grtranspose(DD);671 module TTT = grtranspose(DD); 705 672 706 673 print(TTT); 707 674 homog(TTT); 708 675 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 709 683 } 710 684 … … 715 689 { 716 690 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))) )); 719 692 } 720 693 … … 731 704 { 732 705 module Z; Z[a] = 0; 733 attrib(Z, "isHomog", intvec(d:a)); 734 attrib(Z, "rank", a); 706 Z = grobj(Z, intvec(d:a)); 735 707 736 708 ASSUME(2, grisequal(Z, grpower( grshift(grzero(), d), a ) )); // optional check 737 709 return(Z); 738 } 710 } 711 712 proc 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.