Changeset fdde6ce in git for Singular/LIB/schreyer.lib
- Timestamp:
- May 10, 2012, 5:56:36 PM (11 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- b0ca43c93260d239fb0b76a8aa762b1ea55d09a2
- Parents:
- f3746721cf443ba4cbafcb32045986a9aa9ca197
- git-author:
- Oleksandr Motsak <motsak@mathematik.uni-kl.de>2012-05-10 17:56:36+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
rf37467 rfdde6ce 532 532 if( @DEBUG ) 533 533 { 534 "SSinit:: StartingISRing";534 "SSinit::NewRing(C, lex)"; 535 535 basering; 536 536 // DetailedPrint(basering); … … 588 588 589 589 attrib(S, "InducionStart", @RANK); 590 attrib(S, "LEAD2SYZ", 1); 591 attrib(S, "TAILREDSYZ", 0); 592 attrib(S, "DEBUG", @DEBUG); 590 593 591 594 if( @DEBUG ) … … 635 638 proc SSComputeLeadingSyzygyTerms(def L) 636 639 { 637 int @DEBUG = !system("with", "ndebug"); 640 if( typeof( attrib(basering, "DEBUG") ) == "int" ) 641 { 642 int @DEBUG = attrib(basering, "DEBUG"); 643 } else 644 { 645 int @DEBUG = !system("with", "ndebug"); 646 } 638 647 639 648 if( @DEBUG ) … … 717 726 718 727 /// Compute Syz(L), where L is a monomial (leading) module 719 proc SSCompute2LeadingSyzygyTerms(def L) 720 { 721 int @DEBUG = !system("with", "ndebug"); 728 proc SSCompute2LeadingSyzygyTerms(def L, int @TAILREDSYZ) 729 { 730 if( typeof( attrib(basering, "DEBUG") ) == "int" ) 731 { 732 int @DEBUG = attrib(basering, "DEBUG"); 733 } else 734 { 735 int @DEBUG = !system("with", "ndebug"); 736 } 722 737 723 738 if( @DEBUG ) … … 725 740 "SSCompute2LeadingSyzygyTerms::Input: "; 726 741 L; 742 "@TAILREDSYZ: ", @TAILREDSYZ; 727 743 } 728 744 … … 770 786 } 771 787 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; 788 if( @TAILREDSYZ ) 789 { 790 // Make sure that 2nd syzygy terms are not reducible by 1st 791 def opts = option(get); 792 option(redSB); option(redTail); 793 S = std(S); // binomial module 794 option(set, opts); 795 // kill opts; 796 } else 797 { 798 S = simplify(S, 2 + 32); 799 } 778 800 779 801 S = sort(S, "ds", 1)[1]; // ,1 => reversed! … … 810 832 811 833 /// TODO: save shortcut LM(m) * "t" -> ? 812 proc SSReduce(poly m, def t, def L, def T, def LS) 813 { 814 int @DEBUG = !system("with", "ndebug"); 834 proc SSReduceTerm(poly m, def t, def L, def T, list #) 835 { 836 if( typeof( attrib(basering, "DEBUG") ) == "int" ) 837 { 838 int @DEBUG = attrib(basering, "DEBUG"); 839 } else 840 { 841 int @DEBUG = !system("with", "ndebug"); 842 } 815 843 816 844 if( @DEBUG ) … … 822 850 "L: ", L; 823 851 "T: ", T; 824 "LS: ", LS; 852 if( size(#) > 0 ) 853 { 854 "LSyz: ", #; 855 } 825 856 // "attrib(LS, 'isSB')", attrib(LS, "isSB"); 826 857 } … … 837 868 bigint c = leadcomp(t); 838 869 int r = int(c); 839 840 870 841 871 def a, b, nf, bb; … … 855 885 // "b: ", b; 856 886 bb = b * gen(k); 857 nf = NF(bb, LS); 858 887 nf = bb; 888 889 if( size(#) > 0 ) 890 { 891 if( typeof(#[1]) == "module" ) 892 { 893 nf = NF(bb, #[1]); 859 894 // "NF: ", nf; 895 } 896 } 897 860 898 // while the complement (the fraction) is not reducible by leading syzygies 861 899 if( nf != 0 ) 862 900 { 863 s = bb + SSTraverse(b, k, L, T, LS); 901 /// TODO: save shortcut LM(m) * T[i] -> ? 902 903 // choose ANY such reduction... (with the biggest index?) 904 s = bb + SSTraverseTail(b, T[k], L, T, #); 864 905 break; 865 906 } … … 869 910 if( @DEBUG ) 870 911 { 871 "SSReduce ::Output: ", s;912 "SSReduceTerm::Output: ", s; 872 913 } 873 914 return (s); 874 915 } 875 916 876 /// TODO: save shortcut LM(m) * T[i] -> ? 877 proc SSTraverse(poly m, int i, def L, def T, def LS) 878 { 879 int @DEBUG = !system("with", "ndebug"); 917 // TODO: store m * @tail -.-^-.-^-.--> ? 918 proc SSTraverseTail(poly m, def @tail, def L, def T, list #) 919 { 920 if( typeof( attrib(basering, "DEBUG") ) == "int" ) 921 { 922 int @DEBUG = attrib(basering, "DEBUG"); 923 } else 924 { 925 int @DEBUG = !system("with", "ndebug"); 926 } 880 927 881 928 if( @DEBUG ) … … 883 930 "SSTraverse::Input: "; 884 931 885 "index: ", i;886 932 "mult: ", m; 887 888 "lead: ", L[i]; 889 "tail: ", T[i]; 890 891 "LSyz: ", LS; 892 // "attrib(LS, 'isSB')", attrib(LS, "isSB"); 893 } 894 895 // reduce the product m * ( L[i] + T[i] ): 896 // SSReduce(m, L[i], L, T, LS); 897 898 def @tail = T[i]; def @l; 933 "tail: ", @tail; // T[i]; 934 935 if( size(#) > 0 ) 936 { 937 "LSyz: "; #[1]; 938 } 939 } 899 940 900 941 vector s = 0; 901 942 943 def @l; 944 945 // iterate tail-terms in ANY order! 902 946 while( size(@tail) > 0 ) 903 947 { 904 948 @l = lead(@tail); 905 s = s + SSReduce (m, @l, L, T, LS);949 s = s + SSReduceTerm(m, @l, L, T, #); 906 950 @tail = @tail - @l; 907 951 } … … 909 953 if( @DEBUG ) 910 954 { 911 "SSTraverse ::Output: ", s;955 "SSTraverseTail::Output: ", s; 912 956 } 913 957 return (s); … … 918 962 // module (N, LL, TT) = SSComputeSyzygy(L, T); 919 963 // Compute Syz(L ++ T) = N = LL ++ TT 920 proc SSComputeSyzygy(/*def M, */ def L, def T) 921 { 922 int @DEBUG = !system("with", "ndebug"); 923 964 proc SSComputeSyzygy(def L, def T) 965 { 966 if( typeof( attrib(basering, "DEBUG") ) == "int" ) 967 { 968 int @DEBUG = attrib(basering, "DEBUG"); 969 } else 970 { 971 int @DEBUG = !system("with", "ndebug"); 972 } 973 924 974 if( @DEBUG ) 925 975 { … … 930 980 // "iCompShift: ", iCompShift; 931 981 932 // "M: "; M;933 982 "L: "; L; 934 983 "T: "; T; 935 984 } 936 985 937 def a, a2; bigint c; int r, r2, k; poly aa, aa2; 938 986 def a; bigint c; int r, k; poly aa; 987 988 int @LEAD2SYZ = 0; 989 if( typeof( attrib(basering, "LEAD2SYZ") ) == "int" ) 990 { 991 @LEAD2SYZ = attrib(basering, "LEAD2SYZ"); 992 } 993 994 int @TAILREDSYZ = 1; 995 if( typeof( attrib(basering, "TAILREDSYZ") ) == "int" ) 996 { 997 @TAILREDSYZ = attrib(basering, "TAILREDSYZ"); 998 // @TAILREDSYZ; 999 } 1000 939 1001 /// Get the critical leading syzygy terms 940 // module LL = SSComputeLeadingSyzygyTerms(L); 941 942 module LL, LL2; (LL, LL2) = SSCompute2LeadingSyzygyTerms(L); 1002 if( @LEAD2SYZ ) // & 2nd syz. term 1003 { 1004 def a2; int r2; poly aa2; 1005 module LL, LL2; 1006 (LL, LL2) = SSCompute2LeadingSyzygyTerms(L, @TAILREDSYZ); // ++ 1007 } else 1008 { 1009 module LL = SSComputeLeadingSyzygyTerms(L); 1010 } 943 1011 944 1012 module TT, SYZ; 945 1013 946 1014 if( size(LL) > 0 ) 947 { 1015 { 1016 list LS; 1017 1018 if( @TAILREDSYZ ) 1019 { 1020 LS = list(LL); 1021 } 1022 948 1023 vector @tail; 949 1024 … … 952 1027 // leading syz. term: 953 1028 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); 1029 // "A: ", a, " --->>>> ", aa, " **** [", r, "]: "; 1030 1031 /// TODO: save shortcut (aa) * T[r] -> ? 1032 @tail = SSTraverseTail(aa, T[r], L, T, LS); 1033 1034 // get the 2nd syzygy term... 1035 1036 if( @LEAD2SYZ ) // with the 2nd syz. term: 1037 { 1038 a2 = LL2[k]; c = leadcomp(a2); r2 = int(c); aa2 = leadmonomial(a2); 1039 @tail = @tail + 1040 /// TODO: save shortcut (aa2) * T[r2] -> ? 1041 a2 + SSTraverseTail(aa2, T[r2], L, T, LS); 1042 } else 1043 { 1044 @tail = @tail + SSReduceTerm(aa, L[r], L, T, LS); 1045 } 957 1046 958 1047 959 // "A: ", a, " --->>>> ", aa, " **** [", r, "]: ";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 ;965 1048 TT[k] = @tail; 966 1049 SYZ[k] = a + @tail; … … 968 1051 } 969 1052 970 /* 1053 /* 971 1054 def opts = option(get); option(redSB); option(redTail); 972 module SYZ = std(syz(M)); // TODO: !!!!!!!!!!!1055 module SYZ = std(syz(M)); 973 1056 option(set, opts); kill opts; 974 975 "SYZ: "; SYZ; print(SYZ); 976 977 "shifted SYZ: "; SYZ; print(SYZ); 978 979 module LL, TT; 980 981 LL = lead(SYZ); // TODO: WRONG ORDERING!!!!!!!! 982 TT = Tail(SYZ); 1057 1058 module LL = lead(SYZ); // TODO: WRONG ORDERING!!!!!!!! 1059 module TT = Tail(SYZ); 983 1060 */ 984 1061
Note: See TracChangeset
for help on using the changeset viewer.