Changeset f37467 in git
- Timestamp:
- May 9, 2012, 7:34:48 PM (11 years ago)
- Branches:
- (u'spielwiese', '8d54773d6c9e2f1d2593a28bc68b7eeab54ed529')
- Children:
- fdde6cefc2a23bb663a3fe197b2e24bffacac361
- Parents:
- 4b2e47d69832168747120de4721b9900101c96c7
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-05-09 19:34:48+02:00
- git-committer:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-05-10 18:23:40+02:00
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/schreyer.lib
r4b2e47 rf37467 144 144 145 145 module M = imap(@save, M); 146 146 147 attrib(M, "isHomog", @V); 147 148 attrib(M, "isSB", 1); … … 157 158 } 158 159 159 // 0^th syz. property 160 if( size(module(transpose( transpose(M) * transpose(MRES) ))) > 0 ) 161 { 162 transpose( transpose(M) * transpose(MRES) ); 163 "transpose( transpose(M) * transpose(MRES) ) != 0!!!"; 164 $ 160 if( @DEBUG ) 161 { 162 // 0^th syz. property 163 if( size(module(transpose( transpose(M) * transpose(MRES) ))) > 0 ) 164 { 165 transpose( transpose(M) * transpose(MRES) ); 166 "transpose( transpose(M) * transpose(MRES) ) != 0!!!"; 167 $ 168 } 165 169 } 166 170 … … 278 282 // N; 279 283 280 if( size(N) > 0 ) 281 { 282 // next syz. property 283 if( size(module(transpose( transpose(N) * transpose(MRES) ))) > 0 ) 284 { 285 MRES; 286 287 "N: "; N; DetailedPrint(N, 10); 288 289 "K:"; K; DetailedPrint(K, 10); 290 291 "RANKS: ", @RANK; 292 293 "transpose( transpose(N) * transpose(MRES) ) != 0!!!"; 294 transpose( transpose(N) * transpose(MRES) ); 295 296 "transpose(N) * transpose(MRES): "; 297 transpose(N) * transpose(MRES); 298 DetailedPrint(module(_), 2); 299 $ 284 if( @DEBUG ) 285 { 286 if( size(N) > 0 ) 287 { 288 // next syz. property 289 if( size(module(transpose( transpose(N) * transpose(MRES) ))) > 0 ) 290 { 291 MRES; 292 293 "N: "; N; DetailedPrint(N, 10); 294 295 "K:"; K; DetailedPrint(K, 10); 296 297 "RANKS: ", @RANK; 298 299 "transpose( transpose(N) * transpose(MRES) ) != 0!!!"; 300 transpose( transpose(N) * transpose(MRES) ); 301 302 "transpose(N) * transpose(MRES): "; 303 transpose(N) * transpose(MRES); 304 DetailedPrint(module(_), 2); 305 $ 306 } 300 307 } 301 308 } … … 468 475 469 476 int @DEBUG = !system("with", "ndebug"); 477 470 478 if( @DEBUG ) 471 479 { … … 539 547 540 548 def M = imap(@save, M); 549 541 550 attrib(M, "isHomog", @V); 542 551 attrib(M, "isSB", 1); 543 544 552 attrib(M, "degrees", @DEGS); 545 553 546 554 def LEAD = imap(@save, LEAD); 555 547 556 attrib(LEAD, "isHomog", @V); 548 557 attrib(LEAD, "isSB", 1); … … 559 568 } 560 569 561 // 0^th syz. property 562 if( size(module(transpose( transpose(M) * transpose(MRES) ))) > 0 ) 563 { 564 transpose( transpose(M) * transpose(MRES) ); 565 "ERROR: transpose( transpose(M) * transpose(MRES) ) != 0!!!"; 566 $ 570 if( @DEBUG ) 571 { 572 // 0^th syz. property 573 if( size(module(transpose( transpose(M) * transpose(MRES) ))) > 0 ) 574 { 575 transpose( transpose(M) * transpose(MRES) ); 576 "ERROR: transpose( transpose(M) * transpose(MRES) ) != 0!!!"; 577 $ 578 } 567 579 } 568 580 … … 573 585 MRES = MRES, M; //? 574 586 575 attrib(MRES, "isHomog", @V); 576 587 attrib(MRES, "isHomog", @V); 588 577 589 attrib(S, "InducionStart", @RANK); 578 590 … … 619 631 620 632 621 proc SSComputeLeadingSyzygyTerms(def L, int iCompShift) 633 634 /// Compute L(Syz(L)) 635 proc SSComputeLeadingSyzygyTerms(def L) 622 636 { 623 637 int @DEBUG = !system("with", "ndebug"); … … 627 641 "SSComputeLeadingSyzygyTerms::Input: "; 628 642 L; 629 "iCompShift: ", iCompShift;630 643 } 631 644 … … 685 698 M = M[iv_ds]; 686 699 687 S = S, M * gen(i + iCompShift);700 S = S, M * gen(i); 688 701 } 689 702 690 703 S = simplify(S, 2); 691 704 705 S = sort(S, "ds", 1)[1]; // ,1 => reversed! // TODO: not needed? 692 706 693 707 if( @DEBUG ) … … 695 709 "SSComputeLeadingSyzygyTerms::Output: "; 696 710 S; 697 } 711 } 698 712 699 713 attrib(S, "isSB", 1); 700 714 701 715 return (S); 702 703 } 704 705 proc SSReduce(poly m, def t, def L, def T, module LS) 716 } 717 718 /// Compute Syz(L), where L is a monomial (leading) module 719 proc SSCompute2LeadingSyzygyTerms(def L) 720 { 721 int @DEBUG = !system("with", "ndebug"); 722 723 if( @DEBUG ) 724 { 725 "SSCompute2LeadingSyzygyTerms::Input: "; 726 L; 727 } 728 729 int i, j, r; 730 int N = ncols(L); 731 def a, b; 732 733 poly aa, bb, @lcm; 734 735 bigint c; 736 737 module M; 738 739 module S = 0; 740 741 for(i = 1; i <= N; i++) 742 { 743 a = L[i]; 744 // "a: ", a; 745 c = leadcomp(a); 746 r = int(c); 747 748 aa = leadmonomial(a); 749 750 M = 0; 751 752 for(j = i-1; j > 0; j--) 753 { 754 b = L[j]; 755 // "b: ", b; 756 757 if( leadcomp(b) == c ) 758 { 759 bb = leadmonomial(b); 760 @lcm = lcm(aa, bb); 761 762 M[j] = (@lcm / aa)* gen(i) - (@lcm / bb)* gen(j); 763 } 764 } 765 766 M = simplify(M, 2); 767 768 // TODO: add quotient relations here... 769 S = S, M; 770 } 771 772 // Make sure that 2nd syzygy terms are not reducible by 1st 773 def opts = option(get); 774 option(redSB); option(redTail); 775 S = std(S); // binomial module 776 option(set, opts); 777 // kill opts; 778 779 S = sort(S, "ds", 1)[1]; // ,1 => reversed! 780 781 if( @DEBUG ) 782 { 783 "SSCompute2LeadingSyzygyTerms::Syz(LEAD): "; S; 784 785 if( size(S) > 0 and size(L) > 0 ) 786 { 787 if( size(module(transpose( transpose(S) * transpose(L) ))) > 0 ) 788 { 789 transpose( transpose(S) * transpose(L) ); 790 "ERROR: transpose( transpose(S) * transpose(L) ) != 0!!!"; 791 $ 792 } 793 } 794 } 795 796 module S2 = Tail(S); 797 S = lead(S); // (C,lp) on base ring! 798 799 if( @DEBUG ) 800 { 801 "SSCompute2LeadingSyzygyTerms::Output: "; S; S2; 802 } 803 804 attrib(S, "isSB", 1); 805 806 return (S, S2); 807 } 808 809 // -------------------------------------------------------- // 810 811 /// TODO: save shortcut LM(m) * "t" -> ? 812 proc SSReduce(poly m, def t, def L, def T, def LS) 706 813 { 707 814 int @DEBUG = !system("with", "ndebug"); … … 716 823 "T: ", T; 717 824 "LS: ", LS; 825 // "attrib(LS, 'isSB')", attrib(LS, "isSB"); 718 826 } 719 827 … … 731 839 732 840 733 def a, b, nf ;841 def a, b, nf, bb; 734 842 735 843 // looking for an appropriate reducer … … 741 849 { 742 850 b = - (leadmonomial(product) / leadmonomial(L[k])); 851 743 852 // which divides the product 744 853 if( b != 0 ) 745 854 { 746 855 // "b: ", b; 747 nf = NF(b * gen(k), LS); 856 bb = b * gen(k); 857 nf = NF(bb, LS); 748 858 749 859 // "NF: ", nf; … … 751 861 if( nf != 0 ) 752 862 { 753 s = b * gen(k)+ SSTraverse(b, k, L, T, LS);863 s = bb + SSTraverse(b, k, L, T, LS); 754 864 break; 755 865 } … … 764 874 } 765 875 766 proc SSTraverse(poly m, int i, def L, def T, module LS) 876 /// TODO: save shortcut LM(m) * T[i] -> ? 877 proc SSTraverse(poly m, int i, def L, def T, def LS) 767 878 { 768 879 int @DEBUG = !system("with", "ndebug"); … … 779 890 780 891 "LSyz: ", LS; 892 // "attrib(LS, 'isSB')", attrib(LS, "isSB"); 781 893 } 782 894 … … 802 914 } 803 915 804 // module (N, LL, TT) = SSComputeSyzygy(L, T, @RANK); // shift syz.comp by @RANK! 805 proc SSComputeSyzygy(def M, def L, def T, int iCompShift) 916 // -------------------------------------------------------- // 917 918 // module (N, LL, TT) = SSComputeSyzygy(L, T); 919 // Compute Syz(L ++ T) = N = LL ++ TT 920 proc SSComputeSyzygy(/*def M, */ def L, def T) 806 921 { 807 922 int @DEBUG = !system("with", "ndebug"); … … 813 928 // DetailedPrint(basering); 814 929 815 "iCompShift: ", iCompShift;816 817 "M: "; M;930 // "iCompShift: ", iCompShift; 931 932 // "M: "; M; 818 933 "L: "; L; 819 934 "T: "; T; 820 935 } 821 936 822 def a; bigint c; int r, k; poly aa; 823 824 module LL = SSComputeLeadingSyzygyTerms(L, 0); // iCompShift // 0? 937 def a, a2; bigint c; int r, r2, k; poly aa, aa2; 938 939 /// Get the critical leading syzygy terms 940 // module LL = SSComputeLeadingSyzygyTerms(L); 941 942 module LL, LL2; (LL, LL2) = SSCompute2LeadingSyzygyTerms(L); 825 943 826 944 module TT, SYZ; … … 828 946 if( size(LL) > 0 ) 829 947 { 830 intvec iv_ds = sort(LL, "ds", 1)[2]; // ,1 => reversed!831 LL = LL[iv_ds];832 833 948 vector @tail; 834 949 835 950 for(k = ncols(LL); k > 0; k-- ) 836 951 { 837 a = LL[k]; 838 c = leadcomp(a); r = int(c); 839 840 if (r > 0) 841 { 842 aa = a[r]; 843 } else 844 { 845 aa = a; 846 } 952 // leading syz. term: 953 a = LL[k]; c = leadcomp(a); r = int(c); aa = leadmonomial(a); 954 955 // 2nd syz. term: 956 a2 = LL2[k]; c = leadcomp(a2); r2 = int(c); aa2 = leadmonomial(a2); 957 958 847 959 // "A: ", a, " --->>>> ", aa, " **** [", r, "]: "; 848 @tail = SSReduce(aa, L[r], L, T, LL) + SSTraverse(aa, r, L, T, LL); 960 @tail = a2 + 961 SSTraverse(aa, r, L, T, LL) + 962 SSTraverse(aa2, r2, L, T, LL) 963 // SSReduce(aa, L[r], L, T, LL) // get the 2nd syzygy term... 964 ; 849 965 TT[k] = @tail; 850 966 SYZ[k] = a + @tail; … … 852 968 } 853 969 854 module Z;855 Z = 0; Z[iCompShift] = 0; Z = Z, transpose(LL); LL = transpose(Z);856 Z = 0; Z[iCompShift] = 0; Z = Z, transpose(TT); TT = transpose(Z);857 Z = 0; Z[iCompShift] = 0; Z = Z, transpose(SYZ); SYZ = transpose(Z);858 859 860 970 /* 861 971 def opts = option(get); option(redSB); option(redTail); … … 949 1059 950 1060 // TODO: N = SYZ( M )!!! 951 module N, LL, TT; (N, LL, TT) = SSComputeSyzygy(M, L, T, @RANK); // shift syz.comp by @RANK! 1061 module N, LL, TT; 1062 (N, LL, TT) = SSComputeSyzygy(/*M, */L, T/*, @RANK*/); 1063 1064 // shift syz.comp by @RANK: 1065 module Z; 1066 Z = 0; Z[@RANK] = 0; Z = Z, transpose(LL); LL = transpose(Z); 1067 Z = 0; Z[@RANK] = 0; Z = Z, transpose(TT); TT = transpose(Z); 1068 Z = 0; Z[@RANK] = 0; Z = Z, transpose(N); N = transpose(Z); 1069 1070 1071 if( size(N) > 0 ) 1072 { 1073 if( @DEBUG ) 1074 { 1075 // next syz. property 1076 if( size(module(transpose( transpose(N) * transpose(MRES) ))) > 0 ) 1077 { 1078 "MRES", MRES; 1079 1080 "N: "; N; // DetailedPrint(N, 2); 1081 1082 "LL:"; LL; // DetailedPrint(LL, 1); 1083 "TT:"; TT; // DetailedPrint(TT, 10); 1084 1085 "RANKS: ", @RANK; 1086 1087 "transpose( transpose(N) * transpose(MRES) ) != 0!!!"; 1088 transpose( transpose(N) * transpose(MRES) ); 1089 1090 "transpose(N) * transpose(MRES): "; 1091 transpose(N) * transpose(MRES); 1092 // DetailedPrint(module(_), 2); 1093 $ 1094 } 1095 } 1096 } 952 1097 953 1098 attrib(N, "isHomog", @V); … … 955 1100 // TODO: correct the following: 956 1101 intvec @DEGS = deg(N[1..ncols(N)]); // no mod. comp. weights :( 957 attrib(N, "degrees", @DEGS); 958 959 if( size(N) > 0 ) 960 { 961 N; 962 MRES; 963 // next syz. property 964 if( size(module(transpose( transpose(N) * transpose(MRES) ))) > 0 ) 965 { 966 MRES; 967 968 "N: "; N; // DetailedPrint(N, 2); 969 970 "LL:"; LL; // DetailedPrint(LL, 1); 971 "TT:"; TT; // DetailedPrint(TT, 10); 972 973 "RANKS: ", @RANK; 974 975 "transpose( transpose(N) * transpose(MRES) ) != 0!!!"; 976 transpose( transpose(N) * transpose(MRES) ); 977 978 "transpose(N) * transpose(MRES): "; 979 transpose(N) * transpose(MRES); 980 // DetailedPrint(module(_), 2); 981 $ 982 } 983 } 1102 1103 1104 attrib(N, "degrees", @DEGS); 984 1105 985 1106 RES[@l + 1] = N; // list of all syzygy modules … … 988 1109 989 1110 MRES = MRES, N; 1111 990 1112 attrib(MRES, "isHomog", @V); 991 1113 … … 995 1117 { 996 1118 "SSstep::NextSyzOutput: "; 1119 N; 997 1120 // DetailedPrint(N); 998 1121 attrib(N); … … 1069 1192 module M = maxideal(1); M; 1070 1193 def S = SSres(M, 0); setring S; S; 1071 "Only the first syzygy: ";1072 RES; LRES; TRES;1073 1194 MRES; 1195 RES; 1196 ""; 1197 LRES; 1198 ""; 1199 TRES; 1074 1200 1075 1201 kill S; setring r; kill M; … … 1081 1207 1082 1208 def S = SSres(M, 0); setring S; S; 1083 "Only the first syzygy: ";1084 RES; LRES; TRES;1085 1209 MRES; 1210 RES; 1211 ""; 1212 LRES; 1213 ""; 1214 TRES; 1086 1215 } 1087 1216
Note: See TracChangeset
for help on using the changeset viewer.