Changeset 4cc3cac in git for Singular/LIB/modstd.lib
- Timestamp:
- Oct 15, 2010, 5:14:22 PM (14 years ago)
- Branches:
- (u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
- Children:
- f5c66c42df72194ae4742e5389d25c7b955a5d4b
- Parents:
- aa1c72974a2501d06feacf3b3acebe16d3e1ef6f
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/modstd.lib
raa1c72 r4cc3cac 3 3 category = "Commutative Algebra"; 4 4 info=" 5 LIBRARY: modstd.lib Groebner basis of ideals5 LIBRARY: modstd.lib Groebner basis of ideals 6 6 7 7 AUTHORS: A. Hashemi Amir.Hashemi@lip6.fr … … 20 20 PROCEDURES: 21 21 modStd(I); standard basis of I using modular methods (chinese remainder) 22 modS(I,L); liftings to Q of standard bases of I mod p for p in L 22 23 modHenselStd(I); standard basis of I using modular methods (hensel lifting) 23 modS(I,L); liftings to Q of standard bases of I mod p for p in L24 24 "; 25 25 26 26 LIB "poly.lib"; 27 27 LIB "ring.lib"; 28 29 //////////////////////////////////////////////////////////////////////////////// 30 31 static proc mixedTest() 32 // decides whether the ordering of the basering is mixed 33 { 34 int i,p,m; 35 for(i = 1; i <= nvars(basering); i++) 36 { 37 if(var(i) > 1) 38 { 39 p++; 40 } 41 else 42 { 43 m++; 44 } 45 } 46 if((p > 0) && (m > 0)) { return(1); } 47 return(0); 48 } 28 49 29 50 //////////////////////////////////////////////////////////////////////////////// … … 44 65 " 45 66 { 67 def R = basering; 68 setring R; 69 46 70 attrib(J,"isSB",1); 47 71 int i,j,k; … … 50 74 { 51 75 int n = #[1]; 52 if((n > 1) && (n < ncols(I)) && system("with","MP")) 76 if(n >= ncols(I)) { n = ncols(I); } 77 if((n > 1) && system("with","MP")) 53 78 { 54 79 for(i = 1; i <= n - 1; i++) 55 80 { 56 81 link l(i) = "MPtcp:fork"; 82 //link l(i) = "ssi:fork"; 57 83 open(l(i)); 84 58 85 write(l(i), quote(redFork(eval(I[ncols(I)-i]), eval(J), 1))); 59 86 } … … 79 106 { 80 107 if(status(l(i), "read", "ready")) 81 { 108 { 82 109 if(read(l(i)) != 0) 83 110 { … … 225 252 proc deleteUnluckyPrimes(list T, list L, int ho, list #) 226 253 "USAGE: deleteUnluckyPrimes(T,L,ho,#); T/L list of polys/primes, ho integer 227 RETURN: lists T,L(,M),lT with T/L(/M) list of polys/primes(/type of #), lT ideal 254 RETURN: lists T,L(,M),lT with T/L(/M) list of polys/primes(/type of #), 255 lT ideal 228 256 NOTE: - if ho = 1, the polynomials in T are homogeneous, else ho = 0, 229 257 - lT is prevalent, i.e. the most appearing leading ideal in T … … 351 379 "USAGE: primeList(I,n); ( resp. primeList(I,n,L); ) I ideal, n integer 352 380 RETURN: the intvec of n greatest primes <= 2147483647 (resp. n greatest primes 353 < L[size(L)] union with L) such that none o tthese primes divides any381 < L[size(L)] union with L) such that none of these primes divides any 354 382 coefficient occuring in I 355 383 EXAMPLE: example primList; shows an example … … 490 518 "USAGE: modpStd(I,p,variant,#); I ideal, p integer, variant integer 491 519 ASSUME: If size(#) > 0, then #[1] is an intvec describing the Hilbert series. 492 RETURN: ideal - a standard basis of I mod p, integer - p (, matrix - if variant 493 = 5, the transformation matrix obtained from liftstd) 520 RETURN: ideal - a standard basis of I mod p, integer - p 494 521 NOTE: The procedure computes a standard basis of the ideal I modulo p and 495 522 fetches the result to the basering. If size(#) > 0 the Hilbert driven … … 497 524 The standard basis computation modulo p does also vary depending on the 498 525 integer variant, namely 499 @* - variant = 1: std(.,#[1]) resp. groebner, 500 @* - variant = 2: groebner, 501 @* - variant = 3: homogenize - std(.,#[1]) resp. groebner - dehomogenize, 502 @* - variant = 4: std(.,#[1]) resp. groebner, 503 @* - variant = 5: liftstd1. 526 @* - variant = 1/4: std(.,#[1]) resp. groebner, 527 @* - variant = 2/5: groebner, 528 @* - variant = 3/6: homog. - std(.,#[1]) resp. groebner - dehomog.. 504 529 EXAMPLE: example modpStd; shows an example 505 530 " … … 526 551 } 527 552 } 528 if(variant == 2) 553 554 if((variant == 2) || (variant == 5)) 529 555 { 530 556 i = groebner(i); 531 557 } 532 558 533 if( variant == 3)559 if((variant == 3) || (variant == 6)) 534 560 { 535 561 list rl = ringlist(@r); … … 577 603 kill HomR; 578 604 } 579 580 if(variant == 5) 581 { 582 matrix trans; 583 i,trans = liftstd1(i); 584 setring R0; 585 return(list(fetch(@r,i),p,fetch(@r,trans))); 586 } 587 605 588 606 setring R0; 589 607 return(list(fetch(@r,i),p)); … … 596 614 list P = modpStd(I,p,5); 597 615 P; 598 matrix(P[1])-matrix(I)*P[3];599 616 600 617 int q = 32003; … … 608 625 "USAGE: modStd(I); I ideal 609 626 ASSUME: If size(#) > 0, then # contains either 1, 2 or 4 integers such that 610 @* - #[1] is the number of available processors for the computation, 627 @* - #[1] is the number of available processors for the computation 628 (parallelization is just applicable using 32-bit Singular 629 version since MP-links are not compatible with 64-bit Singular 630 version), 611 631 @* - #[2] is an optional parameter for the exactness of the computation, 612 632 if #[2] = 1, the procedure computes a standard basis for sure, … … 619 639 result is a standard basis containing I and with high probability 620 640 a standard basis of I. 621 By default the procedure computes a standard basis of I with high 622 probability, but if the optional parameter #[2] = 1, it is exact. 641 By default the procedure computes a standard basis of I for sure, but 642 if the optional parameter #[2] = 0, it computes a standard basis of I 643 with high probability and a warning appears at the end. 623 644 The procedure distinguishes between different variants for the standard 624 645 basis computation in positive characteristic depending on the ordering … … 630 651 > 1 block) and exactness = 0, 631 652 @* - variant = 4, if I is homogeneous and exactness = 1, 632 @* - variant = 5, if I is not homogeneous and exactness = 1. 653 @* - variant = 5, if I is not homogeneous, 1-block-ordering and 654 exactness = 1, 655 @* - variant = 3, if I is not homogeneous, complicated ordering (lp or 656 > 1 block) and exactness = 1. 633 657 EXAMPLE: example modStd; shows an example 634 658 " … … 641 665 if((npars(R0) > 0) || (rl[1] > 0)) 642 666 { 643 ERROR("characteristic of basering should be zero, basering should have no parameters"); 667 ERROR("Characteristic of basering should be zero, basering should 668 have no parameters."); 644 669 } 645 670 … … 648 673 int pd = printlevel-voice+2; 649 674 int j = 1; 650 int pTest ;675 int pTest, sizeTest; 651 676 int en = 2134567879; 652 677 int an = 1000000000; … … 661 686 if((n1 > 1) && (1 - system("with","MP"))) 662 687 { 663 664 665 666 688 "========================================================================"; 689 "There is no MP available on your system. Since this is necessary to "; 690 "parallelize the algorithm, the computation will be done without forking."; 691 "========================================================================"; 667 692 n1 = 1; 668 693 } 669 int exactness = 0;694 int exactness = 1; 670 695 int n2 = 10; 671 696 int n3 = 10; … … 676 701 if((n1 > 1) && (1 - system("with","MP"))) 677 702 { 678 679 680 681 703 "========================================================================"; 704 "There is no MP available on your system. Since this is necessary to "; 705 "parallelize the algorithm, the computation will be done without forking."; 706 "========================================================================"; 682 707 n1 = 1; 683 708 } … … 691 716 if((n1 > 1) && (1 - system("with","MP"))) 692 717 { 693 694 695 696 718 "========================================================================"; 719 "There is no MP available on your system. Since this is necessary to "; 720 "parallelize the algorithm, the computation will be done without forking."; 721 "========================================================================"; 697 722 n1 = 1; 698 723 } … … 705 730 { 706 731 int n1 = 1; 707 int exactness = 0;732 int exactness = 1; 708 733 int n2 = 10; 709 734 int n3 = 10; … … 712 737 //------------------------- Save current options ----------------------------- 713 738 intvec opt = option(get); 714 739 715 740 option(redSB); 716 741 … … 726 751 int rt = rtimer; 727 752 728 if(h) 729 { 730 if(exactness == 0) { variant = 1; if(printlevel >= 10) { "variant = 1"; } } 731 if(exactness == 1) { variant = 4; if(printlevel >= 10) { "variant = 4"; } } 732 rl[1] = L[5]; 733 def @r = ring(rl); 734 setring @r; 735 def @s = changeord("dp"); 736 setring @s; 737 ideal I = std(fetch(R0,I)); 738 intvec hi = hilb(I,1); 739 setring R0; 740 kill @r,@s; 741 } 742 else 743 { 744 if(exactness == 0) 753 if(!mixedTest()) 754 { 755 if(h) 756 { 757 if(exactness == 0) 758 { 759 variant = 1; 760 if(printlevel >= 10) { "variant = 1"; } 761 } 762 if(exactness == 1) 763 { 764 variant = 4; 765 if(printlevel >= 10) { "variant = 4"; } 766 } 767 rl[1] = L[5]; 768 def @r = ring(rl); 769 setring @r; 770 def @s = changeord("dp"); 771 setring @s; 772 ideal I = std(fetch(R0,I)); 773 intvec hi = hilb(I,1); 774 setring R0; 775 kill @r,@s; 776 } 777 else 745 778 { 746 779 string ordstr_R0 = ordstr(R0); … … 749 782 if((find(ordstr_R0, "M") > 0) || (find(ordstr_R0, "a") > 0) || neg) 750 783 { 751 variant = 2; 752 if(printlevel >= 10) { "variant = 2"; } 784 if(exactness == 0) 785 { 786 variant = 2; 787 if(printlevel >= 10) { "variant = 2"; } 788 } 789 if(exactness == 1) 790 { 791 variant = 5; 792 if(printlevel >= 10) { "variant = 5"; } 793 } 753 794 } 754 795 else … … 757 798 if(system("nblocks") <= 2) 758 799 { 759 if(find(ordstr_R0, "M") + find(ordstr_R0, "lp") + find(ordstr_R0, "rp") <= 0) 800 if(find(ordstr_R0, "M") + find(ordstr_R0, "lp") 801 + find(ordstr_R0, "rp") <= 0) 760 802 { 761 803 order = "simple"; … … 765 807 if((order == "simple") || (size(rl) > 4)) 766 808 { 767 variant = 2; 768 if(printlevel >= 10) { "variant = 2"; } 809 if(exactness == 0) 810 { 811 variant = 2; 812 if(printlevel >= 10) { "variant = 2"; } 813 } 814 if(exactness == 1) 815 { 816 variant = 5; 817 if(printlevel >= 10) { "variant = 5"; } 818 } 769 819 } 770 820 else 771 821 { 772 variant = 3; 773 if(printlevel >= 10) { "variant = 3"; } 822 if(exactness == 0) 823 { 824 variant = 3; 825 if(printlevel >= 10) { "variant = 3"; } 826 } 827 if(exactness == 1) 828 { 829 variant = 6; 830 if(printlevel >= 10) { "variant = 6"; } 831 } 832 774 833 rl[1] = L[5]; 775 834 def @r = ring(rl); … … 796 855 } 797 856 } 798 799 if(exactness == 1) 800 { 801 variant = 5; 802 if(printlevel >= 10) { "variant = 5"; } 803 "============================================================="; 804 "WARNING: This variant is not applicable if ordering is mixed."; 805 "============================================================="; 806 matrix trans; 807 } 808 } 809 857 } 858 else 859 { 860 if(exactness == 1) { return(groebner(I)); } 861 if(h) 862 { 863 variant = 1; if(printlevel >= 10) { "variant = 1"; } 864 rl[1] = L[5]; 865 def @r = ring(rl); 866 setring @r; 867 def @s = changeord("dp"); 868 setring @s; 869 ideal I = std(fetch(R0,I)); 870 intvec hi = hilb(I,1); 871 setring R0; 872 kill @r,@s; 873 } 874 else 875 { 876 string ordstr_R0 = ordstr(R0); 877 int neg = 1 - attrib(R0,"global"); 878 879 if((find(ordstr_R0, "M") > 0) || (find(ordstr_R0, "a") > 0) || neg) 880 { 881 variant = 2; 882 if(printlevel >= 10) { "variant = 2"; } 883 } 884 else 885 { 886 string order; 887 if(system("nblocks") <= 2) 888 { 889 if(find(ordstr_R0, "M") + find(ordstr_R0, "lp") 890 + find(ordstr_R0, "rp") <= 0) 891 { 892 order = "simple"; 893 } 894 } 895 896 if((order == "simple") || (size(rl) > 4)) 897 { 898 variant = 2; 899 if(printlevel >= 10) { "variant = 2"; } 900 } 901 else 902 { 903 variant = 3; 904 if(printlevel >= 10) { "variant = 3"; } 905 906 rl[1] = L[5]; 907 def @r = ring(rl); 908 setring @r; 909 int nvar@r = nvars(@r); 910 intvec w; 911 for(i = 1; i <= nvar@r; i++) 912 { 913 w[i] = deg(var(i)); 914 } 915 w[nvar@r + 1] = 1; 916 917 list hiRi = hilbRing(fetch(R0,I),w); 918 intvec W = hiRi[2]; 919 def @s = hiRi[1]; 920 setring @s; 921 922 Id(1) = std(Id(1)); 923 intvec hi = hilb(Id(1), 1, W); 924 925 setring R0; 926 kill @r,@s; 927 } 928 } 929 } 930 } 931 810 932 list P,T1,T2,T3,LL; 811 933 … … 827 949 link l(i) = "MPtcp:fork"; 828 950 open(l(i)); 829 if((variant == 1) || (variant == 3) || (variant == 4)) 830 { 831 write(l(i), quote(modpStd(I_for_fork, eval(L[i + 1]), eval(variant), eval(hi)))); 951 if((variant == 1) || (variant == 3) || 952 (variant == 4) || (variant == 6)) 953 { 954 write(l(i), quote(modpStd(I_for_fork, eval(L[i + 1]), 955 eval(variant), eval(hi)))); 832 956 } 833 957 if((variant == 2) || (variant == 5)) 834 958 { 835 write(l(i), quote(modpStd(I_for_fork, eval(L[i + 1]), eval(variant)))); 959 write(l(i), quote(modpStd(I_for_fork, eval(L[i + 1]), 960 eval(variant)))); 836 961 } 837 962 } 838 963 839 964 int t = timer; 840 if((variant == 1) || (variant == 3) || (variant == 4) )965 if((variant == 1) || (variant == 3) || (variant == 4) || (variant == 6)) 841 966 { 842 967 P = modpStd(I_for_fork, L[1], variant, hi); … … 851 976 T1[1] = P[1]; 852 977 T2[1] = bigint(P[2]); 853 if(variant == 5) { T3[1] = P[3]; }854 978 index++; 855 979 … … 871 995 for(i = 1; i <= n1; i++) 872 996 { 873 if(status(l(i), "read", "ready")) // ask if link l(i) is ready otherwise sleep for t seconds 997 //--- ask if link l(i) is ready otherwise sleep for t seconds --- 998 if(status(l(i), "read", "ready")) 874 999 { 875 P = read(l(i)); // read the result from l(i) 1000 //--- read the result from l(i) --- 1001 P = read(l(i)); 876 1002 T1[index] = P[1]; 877 1003 T2[index] = bigint(P[2]); 878 if(variant == 5) { T3[index] = P[3]; }879 1004 index++; 880 1005 881 1006 if(j <= size(L)) 882 1007 { 883 if((variant == 1) || (variant == 3) || (variant == 4)) 1008 if((variant == 1) || (variant == 3) || 1009 (variant == 4) || (variant == 6)) 884 1010 { 885 write(l(i), quote(modpStd(I_for_fork, eval(L[j]), eval(variant), eval(hi)))); 1011 write(l(i), quote(modpStd(I_for_fork, eval(L[j]), 1012 eval(variant), eval(hi)))); 886 1013 j++; 887 1014 } 888 1015 if((variant == 2) || (variant == 5)) 889 1016 { 890 write(l(i), quote(modpStd(I_for_fork, eval(L[j]), eval(variant)))); 1017 write(l(i), quote(modpStd(I_for_fork, 1018 eval(L[j]), eval(variant)))); 891 1019 j++; 892 1020 } … … 899 1027 } 900 1028 } 901 if(k == n1) // k describes the number of closed links 1029 //--- k describes the number of closed links --- 1030 if(k == n1) 902 1031 { 903 1032 j++; … … 910 1039 while(j <= size(L)) 911 1040 { 912 if((variant == 1) || (variant == 3) || (variant == 4)) 1041 if((variant == 1) || (variant == 3) || 1042 (variant == 4) || (variant == 6)) 913 1043 { 914 1044 P = modpStd(I, L[j], variant, hi); … … 921 1051 T1[index] = P[1]; 922 1052 T2[index] = bigint(P[2]); 923 if(variant == 5) { T3[index] = P[3]; }924 1053 index++; 925 1054 j++; … … 933 1062 } 934 1063 935 if(pd >2){"lifting";}1064 if(pd > 2) { "lifting"; } 936 1065 937 1066 //------------------------ Delete unlucky primes ----------------------------- 938 1067 //------------- unlucky if and only if the leading ideal is wrong ------------ 939 1068 940 if(variant == 5) { LL = deleteUnluckyPrimes(T1,T2,h,T3); T3 = LL[3]; } 941 else { LL = deleteUnluckyPrimes(T1,T2,h); } 1069 LL = deleteUnluckyPrimes(T1,T2,h); 942 1070 T1 = LL[1]; 943 1071 T2 = LL[2]; … … 950 1078 H = chinrem(T1,T2); 951 1079 J = farey(H,N); 952 if(variant == 5) { trans = farey(chinrem(T3,T2), N); }953 1080 954 1081 //---------------- Test if we already have a standard basis of I -------------- 955 1082 956 1083 tt = timer; rt = rtimer; 957 if(pd > 2){ "list of primes:"; L; "pTest" ;} 958 if((variant == 1) || (variant == 3) || (variant == 4)) { pTest = pTestSB(I,J,L,variant,hi); } 959 if((variant == 2) || (variant == 5)) { pTest = pTestSB(I,J,L,variant); } 1084 if(pd > 2) { "list of primes:"; L; "pTest"; } 1085 if((variant == 1) || (variant == 3) || (variant == 4) || (variant == 6)) 1086 { 1087 pTest = pTestSB(I,J,L,variant,hi); 1088 } 1089 if((variant == 2) || (variant == 5)) 1090 { 1091 pTest = pTestSB(I,J,L,variant); 1092 } 960 1093 961 1094 if(printlevel >= 10) … … 964 1097 "Real-time for pTest is "+string(rtimer - rt)+" seconds."; 965 1098 } 966 1099 967 1100 if(pTest) 968 1101 { 969 1102 if(printlevel >= 10) 970 1103 { 971 "CPU-time for computation without final tests is "+string(timer - TT)+" seconds."; 972 "Real-time for computation without final tests is "+string(rtimer - RT)+" seconds."; 1104 "CPU-time for computation without final tests is 1105 "+string(timer - TT)+" seconds."; 1106 "Real-time for computation without final tests is 1107 "+string(rtimer - RT)+" seconds."; 973 1108 } 974 1109 975 1110 attrib(J,"isSB",1); 976 1111 tt = timer; rt = rtimer; 977 intsizeTest = 1 - isIncluded(I,J,n1);1112 sizeTest = 1 - isIncluded(I,J,n1); 978 1113 979 1114 if(printlevel >= 10) 980 1115 { 981 "CPU-time for checking if I subset <G> is "+string(timer - tt)+" seconds."; 982 "Real-time for checking if I subset <G> is "+string(rtimer - rt)+" seconds."; 1116 "CPU-time for checking if I subset <G> is 1117 "+string(timer - tt)+" seconds."; 1118 "Real-time for checking if I subset <G> is 1119 "+string(rtimer - rt)+" seconds."; 983 1120 } 984 1121 985 1122 if(sizeTest == 0) 986 1123 { 987 if( variant == 1)988 { 989 "=========================================================== ========";990 "WARNING: Ideal generated by output may be greater than input ideal.";991 "=========================================================== ========";1124 if((variant == 1) || (variant == 2) || (variant == 3)) 1125 { 1126 "==========================================================="; 1127 "WARNING: Output might not be a standard basis of the input."; 1128 "==========================================================="; 992 1129 option(set, opt); 993 1130 if(n1 > 1) { kill I_for_fork; } 994 1131 return(J); 995 1132 } 996 if((variant == 2) || (variant == 3))1133 if((variant == 4) || (variant == 5) || (variant == 6)) 997 1134 { 998 1135 tt = timer; rt = rtimer; … … 1001 1138 if(printlevel >= 10) 1002 1139 { 1003 "CPU-time for last std-computation is "+string(timer - tt)+" seconds."; 1004 "Real-time for last std-computation is "+string(rtimer - rt)+" seconds."; 1005 } 1006 1007 if(size(reduce(K,J)) == 0) 1008 { 1009 "==================================================================="; 1010 "WARNING: Ideal generated by output may be greater than input ideal."; 1011 "==================================================================="; 1012 option(set, opt); 1013 if(n1 > 1) { kill I_for_fork; } 1014 return(J); 1015 } 1016 } 1017 if(variant == 4) 1018 { 1019 tt = timer; rt = rtimer; 1020 K = std(J); 1021 1022 if(printlevel >= 10) 1023 { 1024 "CPU-time for last std-computation is "+string(timer - tt)+" seconds."; 1025 "Real-time for last std-computation is "+string(rtimer - rt)+" seconds."; 1140 "CPU-time for last std-computation is 1141 "+string(timer - tt)+" seconds."; 1142 "Real-time for last std-computation is 1143 "+string(rtimer - rt)+" seconds."; 1026 1144 } 1027 1145 … … 1033 1151 } 1034 1152 } 1035 if(variant == 5) 1036 { 1037 tt = timer; rt = rtimer; 1038 K = std(J); 1039 1040 if(printlevel >= 10) 1041 { 1042 "CPU-time for last std-computation is "+string(timer - tt)+" seconds."; 1043 "Real-time for last std-computation is "+string(rtimer - rt)+" seconds."; 1044 } 1045 1046 if(size(reduce(K,J)) == 0) 1047 { 1048 if(matrix(J) == matrix(I)*trans) 1049 { 1050 option(set, opt); 1051 if(n1 > 1) { kill I_for_fork; } 1052 return(J); 1053 } 1054 } 1055 } 1056 if(pd>2){"pTest o.k. but result wrong";} 1057 } 1058 if(pd>2){"pTest o.k. but result wrong";} 1153 if(pd > 2) { "pTest o.k. but result wrong"; } 1154 } 1155 if(pd > 2) { "pTest o.k. but result wrong"; } 1059 1156 } 1060 1157 … … 1074 1171 { 1075 1172 open(l(i)); 1076 if((variant == 1) || (variant == 3) || (variant == 4)) 1077 { 1078 write(l(i), quote(modpStd(I_for_fork, eval(L[j+i-1]), eval(variant), eval(hi)))); 1173 if((variant == 1) || (variant == 3) || 1174 (variant == 4) || (variant == 6)) 1175 { 1176 write(l(i), quote(modpStd(I_for_fork, eval(L[j+i-1]), 1177 eval(variant), eval(hi)))); 1079 1178 } 1080 1179 if((variant == 2) || (variant == 5)) 1081 1180 { 1082 write(l(i), quote(modpStd(I_for_fork, eval(L[j+i-1]), eval(variant)))); 1181 write(l(i), quote(modpStd(I_for_fork, eval(L[j+i-1]), 1182 eval(variant)))); 1083 1183 } 1084 1184 } … … 1090 1190 example 1091 1191 { "EXAMPLE:"; echo = 2; 1092 ring r= 0,(x,y,z,t),dp;1192 ring R1 = 0,(x,y,z,t),dp; 1093 1193 ideal I = 3x3+x2+1, 11y5+y3+2, 5z4+z2+4; 1094 1194 ideal J = modStd(I); … … 1098 1198 J; 1099 1199 1100 ring s= 0,(x,y,z),ds;1200 ring R2 = 0,(x,y,z),ds; 1101 1201 ideal I = jacob(x5+y6+z7+xyz); 1102 ideal J1 = modStd(I,1, 1);1202 ideal J1 = modStd(I,1,0); 1103 1203 J1; 1104 //requires MP 1105 //ideal J2 = modStd(I,3); 1106 //J2; 1107 //size(reduce(J1,J2)); 1108 //size(reduce(J2,J1)); 1109 1110 ring rr = 0,x(1..4),lp; 1204 1205 ring R3 = 0,x(1..4),lp; 1111 1206 ideal I = cyclic(4); 1112 1207 ideal J1 = modStd(I,1); 1113 ideal J2 = modStd(I,1, 1);1208 ideal J2 = modStd(I,1,0); 1114 1209 size(reduce(J1,J2)); 1115 1210 size(reduce(J2,J1)); 1211 1212 /* 1213 ring R4 = 0,x(1..4),wp(1,-1,-1,1); 1214 ideal I = cyclic(4); 1215 ideal J1 = modStd(I,1,0); 1216 */ 1116 1217 } 1117 1218 … … 1134 1235 list T; 1135 1236 list rl = ringlist(R0); 1136 if((npars(R0)>0) || (rl[1]>0)) { ERROR("characteristic of basering should be zero"); } 1237 if((npars(R0)>0) || (rl[1]>0)) 1238 { 1239 ERROR("Characteristic of basering should be zero."); 1240 } 1137 1241 for(j = 1; j <= size(L); j++) 1138 1242 { … … 1154 1258 kill @r; 1155 1259 } 1156 L = deleteUnluckyPrimes(T,L,homog(I)); // unlucky if and only if the leading ideal is wrong 1260 L = deleteUnluckyPrimes(T,L,homog(I)); 1261 // unlucky if and only if the leading ideal is wrong 1157 1262 J = farey(chinrem(L[1],L[2]),N); 1158 1263 attrib(J,"isSB",1); … … 1340 1445 int c = 4; 1341 1446 int t = 1; 1342 poly f = x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2; 1447 poly f = x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3 1448 +x^(c-2)*y^c*(y2+t*x)^2; 1343 1449 ideal i = jacob(f); 1344 1450 … … 1348 1454 int c = 5; 1349 1455 int t = 1; 1350 poly f = x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3+x^(c-2)*y^c*(y2+t*x)^2; 1456 poly f = x^a+y^b+z^(3*c)+x^(c+2)*y^(c-1)+x^(c-1)*y^(c-1)*z3 1457 +x^(c-2)*y^c*(y2+t*x)^2; 1351 1458 ideal i = jacob(f),f; 1352 1459 … … 1363 1470 int beta = 5; 1364 1471 int t = 1; 1365 poly f = x^a+y^b+z^c+x^alpha*y^(beta-5)+x^(alpha-2)*y^(beta-3)+x^(alpha-3)*y^(beta-4)*z^2+x^(alpha-4)*y^(beta-4)*(y^2+t*x)^2; 1472 poly f = x^a+y^b+z^c+x^alpha*y^(beta-5)+x^(alpha-2)*y^(beta-3) 1473 +x^(alpha-3)*y^(beta-4)*z^2+x^(alpha-4)*y^(beta-4)*(y^2+t*x)^2; 1366 1474 ideal i = jacob(f); 1367 1475 */
Note: See TracChangeset
for help on using the changeset viewer.