Changeset 7161aca in git
- Timestamp:
- Aug 12, 2019, 11:10:44 AM (4 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', '0604212ebb110535022efecad887940825b97c3f')
- Children:
- 8307d2d92aa305b1a9b4e0c9353dfc467f913461
- Parents:
- d4cec6ab781a81162945ff680935242fcccc952ab258e2adb78434353acc85388a6c40c626c4b5ee
- Files:
-
- 6 added
- 14 deleted
- 74 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/JMBTest.lib
rd4cec6a r7161aca 107 107 int aJ=deg(f.h); 108 108 // minimal degree of polynomials in G 109 //print(aJ);110 109 list V=list(); 111 110 V[1]=Terns(G,1); … … 227 226 //Compare degrees; 228 227 d=-1; 229 //print("Per Grado");230 228 } 231 229 if(deg(P.h)==deg(Q.h)) … … 237 235 //head=tail 238 236 d=0; 239 //print("Uguali");240 237 } 241 238 } … … 495 492 } 496 493 I=M[1..size(M)]; 497 //print("IdealOfV");498 494 //I=std(I); 499 495 } … … 538 534 EXAMPLE: example NewWeight; shows an example" 539 535 { 540 //multiply and reduce, degree by degree 541 intvec u=NewWeight(nvars(r)+1); 542 list L=ringlist(r); 543 L[2]=insert(L[2],"t",size(L[2])); 544 //print(L[2]); 545 list ordlist="a",u; 546 L[3]=insert(L[3],ordlist,0); 547 def H=ring(L); 548 //print(V1); 549 //print(G1); 550 list M=list(); 551 jmp p; 552 list N; 553 poly q; 554 poly s; 555 int i; 556 int j; 557 for(i=1; i<=size(G1); i++) 558 { 559 N=list(); 560 for(j=1; j<=size(G1[i]); j++) 561 { 562 p=G1[i][j]; 563 q=p.h; 564 s=p.t; 565 N[j]=list(q,s); 566 } 567 M[i]=N; 568 } 569 p.h=poly(0); 570 p.t=poly(0); 571 setring H; 572 list R=list(); 573 list S=list(); 574 //print("anello definito"); 575 def V=imap(r,V1); 576 //def G=imap(r,G1); 577 //print(V); 578 def MM=imap(r,M); 579 list G=list(); 580 list N=list(); 581 for(i=1; i<=size(MM); i++) 582 { 583 for(j=1; j<=size(MM[i]); j++) 584 { 585 p.h=MM[i][j][1]; 586 p.t=MM[i][j][2]; 587 N[j]=p; 588 } 589 G[i]=N; 590 } 591 ideal I=0; 592 jmp LL; 593 jmp UU; 594 for(i=1; i<=size(V);i++) 595 { 596 R[i]=list(); 597 S[i]=list(); 598 I=0; 599 for(j=1;j<=size(V[i]); j++) 600 { 601 LL=Multiply(V[i][j],G); 602 LL.t=reduce(t*LL.t,I); 603 //I only reduce the tail 604 LL.t=subst(LL.t,t,1); 605 S[i]=insert(S[i],LL,size(S[i])); 606 LL.h=t*LL.h; 607 R[i]=insert(R[i],LL,size(R[i])); 608 UU=R[i][j]; 609 I=I+ideal(UU.h+UU.t); 610 attrib(I,"isSB",1); 611 } 612 } 613 list M=list(); 614 poly q; 615 poly s; 616 for(i=1; i<=size(S); i++) 617 { 618 N=list(); 619 for(j=1; j<=size(S[i]); j++) 620 { 621 p=S[i][j]; 622 q=p.h; 623 s=p.t; 624 N[j]=list(q,s); 625 } 626 M[i]=N; 627 } 628 p.h=poly(0); 629 p.t=poly(0); 630 setring r; 631 def MM=imap(H,M); 632 list MMM=list(); 633 for(i=1; i<=size(MM); i++) 634 { 635 N=list(); 636 for(j=1; j<=size(MM[i]); j++) 637 { 638 p.h=MM[i][j][1]; 639 p.t=MM[i][j][2]; 640 N[j]=p; 641 } 642 MMM[i]=N; 643 } 644 return(MMM); 645 } 646 example 647 { "EXAMPLE:"; echo = 2; 648 ring r=0, (x,y,z), rp; 649 jmp r1; 650 r1.h=z^3; 651 r1.t=poly(0); 652 jmp r2; 653 r2.h=z^2*y; 654 r2.t=poly(0); 655 jmp r3; 656 r3.h=z*y^2 ; 657 r3.t=-x^2*y; 658 jmp r4; 659 r4.h=y^5; 660 r4.t=poly(0); 661 list G2F=list(list(r1,r2,r3),list(r4)); 536 //multiply and reduce, degree by degree 537 intvec u=NewWeight(nvars(r)+1); 538 list L=ringlist(r); 539 L[2]=insert(L[2],"t",size(L[2])); 540 list ordlist="a",u; 541 L[3]=insert(L[3],ordlist,0); 542 def H=ring(L); 543 list M=list(); 544 jmp p; 545 list N; 546 poly q; 547 poly s; 548 int i; 549 int j; 550 for(i=1; i<=size(G1); i++) 551 { 552 N=list(); 553 for(j=1; j<=size(G1[i]); j++) 554 { 555 p=G1[i][j]; 556 q=p.h; 557 s=p.t; 558 N[j]=list(q,s); 559 } 560 M[i]=N; 561 } 562 p.h=poly(0); 563 p.t=poly(0); 564 setring H; 565 list R=list(); 566 list S=list(); 567 //print("anello definito"); 568 def V=imap(r,V1); 569 //def G=imap(r,G1); 570 //print(V); 571 def MM=imap(r,M); 572 list G=list(); 573 list N=list(); 574 for(i=1; i<=size(MM); i++) 575 { 576 for(j=1; j<=size(MM[i]); j++) 577 { 578 p.h=MM[i][j][1]; 579 p.t=MM[i][j][2]; 580 N[j]=p; 581 } 582 G[i]=N; 583 } 584 ideal I=0; 585 jmp LL; 586 jmp UU; 587 for(i=1; i<=size(V);i++) 588 { 589 R[i]=list(); 590 S[i]=list(); 591 I=0; 592 for(j=1;j<=size(V[i]); j++) 593 { 594 LL=Multiply(V[i][j],G); 595 LL.t=reduce(t*LL.t,I); 596 //I only reduce the tail 597 LL.t=subst(LL.t,t,1); 598 S[i]=insert(S[i],LL,size(S[i])); 599 LL.h=t*LL.h; 600 R[i]=insert(R[i],LL,size(R[i])); 601 UU=R[i][j]; 602 I=I+ideal(UU.h+UU.t); 603 attrib(I,"isSB",1); 604 } 605 } 606 list M=list(); 607 poly q; 608 poly s; 609 for(i=1; i<=size(S); i++) 610 { 611 N=list(); 612 for(j=1; j<=size(S[i]); j++) 613 { 614 p=S[i][j]; 615 q=p.h; 616 s=p.t; 617 N[j]=list(q,s); 618 } 619 M[i]=N; 620 } 621 p.h=poly(0); 622 p.t=poly(0); 623 setring r; 624 def MM=imap(H,M); 625 list MMM=list(); 626 for(i=1; i<=size(MM); i++) 627 { 628 N=list(); 629 for(j=1; j<=size(MM[i]); j++) 630 { 631 p.h=MM[i][j][1]; 632 p.t=MM[i][j][2]; 633 N[j]=p; 634 } 635 MMM[i]=N; 636 } 637 return(MMM); 638 } 639 example 640 { "EXAMPLE:"; echo = 2; 641 ring r=0, (x,y,z), rp; 642 jmp r1; 643 r1.h=z^3; 644 r1.t=poly(0); 645 jmp r2; 646 r2.h=z^2*y; 647 r2.t=poly(0); 648 jmp r3; 649 r3.h=z*y^2 ; 650 r3.t=-x^2*y; 651 jmp r4; 652 r4.h=y^5; 653 r4.t=poly(0); 654 list G2F=list(list(r1,r2,r3),list(r4)); 662 655 FinalVm(VConst(G2F,6,r) , G2F, r); 663 656 } … … 671 664 list V=list(); 672 665 V= VConst(G,c); 673 //print("VConst");674 666 //V non ordered 675 667 list L=list(); … … 719 711 //L will contain results 720 712 poly h=Minimus(variables(A.h)); 721 //print(h);722 713 int l=findvars(h,1)[2][1]; 723 714 if(l!=nvars(basering)) 724 715 { 725 //print("vero");726 //print(l);727 716 for(int j=l+1;j<=nvars(basering); j++) 728 717 { 729 //print("entrata");730 //print(var(j));731 718 E=var(j)*A.h/B.h; 732 719 //Candidate for * product 733 //print(E);734 720 if(E!=0) 735 721 { … … 789 775 //Loop on polynomials 790 776 C=EKCouples(G[i][j], G[k][l]); 791 //print("coppia");792 777 if(C[2]!=0) 793 778 { … … 865 850 True=1/False=0 866 851 EXAMPLE: example TestJMark; shows an example" 867 {int flag=1; 868 if(size(G1)==1 && size(G1[1])==1) 869 { 870 //Hypersurface 871 print("Only One Polynomial"); 872 flag=1; 873 } 874 else 875 { 876 int d=0; 877 list EK,D=EKPolys(G1); 878 //print("PolysEK"); 879 //I found EK couples 880 int massimo=Max(D); 881 list V1=ConstructorMain(G1,massimo,r); 882 //print("Costruttore"); 883 //print(V1); 884 jmp mi=V1[1][1]; 885 int minimo=Min(deg(mi.h)); 886 intvec u=NewWeight(nvars(r)+1); 887 list L=ringlist(r); 888 L[2]=insert(L[2],"t",size(L[2])); 889 //print(L[2]); 890 list ordlist="a",u; 891 L[3]=insert(L[3],ordlist,0); 892 def H=ring(L); 893 list JJ=list(); 894 jmp pp; 895 jmp qq; 896 int i; 897 int j; 898 list NN; 899 for(i=size(V1);i>0;i--) 900 { 901 NN=list(); 902 for(j=size(V1[i]);j>0;j--) 903 { 904 //print(j); 905 pp=V1[i][j]; 906 NN[j]=list(pp.h,pp.t); 907 } 908 //print(NN); 909 JJ[i]=NN; 910 //print(JJ[i]); 911 //print(i); 912 } 913 //print(JJ); 914 list KK=list(); 915 list UU=list(); 916 //jmp qq; 917 for(i=size(G1);i>0;i--) 918 { 919 for(j=size(G1[i]);j>0;j--) 920 { 921 //print(j); 922 qq=G1[i][j]; 923 UU[j]=list(qq.h,qq.t); 924 } 925 //print(UU); 926 KK[i]=UU; 927 } 928 setring H; 929 //I defined the new ring with the weighted 930 //variable t 931 poly p; 932 //print("anello definito"); 933 def JJJ=imap(r,JJ); 934 def EK=imap(r,EK); 935 //print(flag); 936 //imap(r,D); 937 list V=list(); 938 jmp fp; 939 //int i; 940 //int j; 941 list N; 942 for(i=size(JJJ); i>0; i--) 943 { 944 N=list(); 945 for(j=size(JJJ[i]); j>0; j--) 946 { 947 fp.h=JJJ[i][j][1]; 948 fp.t=JJJ[i][j][2]; 949 N[j]=fp; 950 } 951 V[i]=N; 952 } 953 //print(V); 954 def KKJ=imap(r,KK); 955 list G=list(); 956 list U=list(); 957 for(i=1; i<=size(KKJ); i++) 958 { 959 for(j=1; j<=size(KKJ[i]); j++) 960 { 961 fp.h=KKJ[i][j][1]; 962 fp.t=KKJ[i][j][2]; 963 U[j]=fp; 964 } 965 G[i]=U; 966 } 967 // print(V); 968 //print(G); 969 //I imported in H everithing I need 970 poly q; 971 ideal I; 972 for(j=1; j<=size(EK);j++) 852 { 853 int flag=1; 854 if(size(G1)==1 && size(G1[1])==1) 855 { 856 //Hypersurface 857 print("Only One Polynomial"); 858 flag=1; 859 } 860 else 861 { 862 int d=0; 863 list EK,D=EKPolys(G1); 864 //I found EK couples 865 int massimo=Max(D); 866 list V1=ConstructorMain(G1,massimo,r); 867 jmp mi=V1[1][1]; 868 int minimo=Min(deg(mi.h)); 869 intvec u=NewWeight(nvars(r)+1); 870 list L=ringlist(r); 871 L[2]=insert(L[2],"t",size(L[2])); 872 list ordlist="a",u; 873 L[3]=insert(L[3],ordlist,0); 874 def H=ring(L); 875 list JJ=list(); 876 jmp pp; 877 jmp qq; 878 int i; 879 int j; 880 list NN; 881 for(i=size(V1);i>0;i--) 882 { 883 NN=list(); 884 for(j=size(V1[i]);j>0;j--) 973 885 { 974 d=D[j]; 975 p=EKPolynomials(EK[j],G); 976 //print("arrivo"); 977 I=IdealOfV(V[d-minimo+1]); 978 attrib(I,"isSB",1); 979 //print(I); 980 q=reduce(t*p,I); 981 //print(I[1]); 982 //print(t*p); 983 q=subst(q,t,1); 984 //I reduce all the EK polynomials 985 // q=RiduzPoly(V[d-minimo+1], p); 986 if(q!=0) 987 { 988 //check whether reduction is 0 989 print("NOT A BASIS"); 990 flag=0; 991 break; 992 } 993 } 994 } 995 //print(flag); 996 setring r; 997 //typeof(flag); 998 return(flag); 999 } 1000 example 1001 { "EXAMPLE:"; echo = 2; 1002 ring r=0, (x,y,z), rp; 1003 jmp r1; 1004 r1.h=z^3; 1005 r1.t=poly(0); 1006 jmp r2; 1007 r2.h=z^2*y; 1008 r2.t=poly(0); 1009 jmp r3; 1010 r3.h=z*y^2 ; 1011 r3.t=-x^2*y; 1012 jmp r4; 1013 r4.h=y^5; 1014 r4.t=poly(0); 1015 list G2F=list(list(r1,r2,r3),list(r4)); 1016 TestJMark(G2F,r); 1017 } 886 pp=V1[i][j]; 887 NN[j]=list(pp.h,pp.t); 888 } 889 JJ[i]=NN; 890 } 891 list KK=list(); 892 list UU=list(); 893 //jmp qq; 894 for(i=size(G1);i>0;i--) 895 { 896 for(j=size(G1[i]);j>0;j--) 897 { 898 qq=G1[i][j]; 899 UU[j]=list(qq.h,qq.t); 900 } 901 KK[i]=UU; 902 } 903 setring H; 904 //I defined the new ring with the weighted 905 //variable t 906 poly p; 907 //print("anello definito"); 908 def JJJ=imap(r,JJ); 909 def EK=imap(r,EK); 910 list V=list(); 911 jmp fp; 912 //int i; 913 //int j; 914 list N; 915 for(i=size(JJJ); i>0; i--) 916 { 917 N=list(); 918 for(j=size(JJJ[i]); j>0; j--) 919 { 920 fp.h=JJJ[i][j][1]; 921 fp.t=JJJ[i][j][2]; 922 N[j]=fp; 923 } 924 V[i]=N; 925 } 926 def KKJ=imap(r,KK); 927 list G=list(); 928 list U=list(); 929 for(i=1; i<=size(KKJ); i++) 930 { 931 for(j=1; j<=size(KKJ[i]); j++) 932 { 933 fp.h=KKJ[i][j][1]; 934 fp.t=KKJ[i][j][2]; 935 U[j]=fp; 936 } 937 G[i]=U; 938 } 939 //I imported in H everithing I need 940 poly q; 941 ideal I; 942 for(j=1; j<=size(EK);j++) 943 { 944 d=D[j]; 945 p=EKPolynomials(EK[j],G); 946 I=IdealOfV(V[d-minimo+1]); 947 attrib(I,"isSB",1); 948 q=reduce(t*p,I); 949 q=subst(q,t,1); 950 //I reduce all the EK polynomials 951 // q=RiduzPoly(V[d-minimo+1], p); 952 if(q!=0) 953 { 954 //check whether reduction is 0 955 print("NOT A BASIS"); 956 flag=0; 957 break; 958 } 959 } 960 } 961 setring r; 962 //typeof(flag); 963 return(flag); 964 } 965 example 966 { "EXAMPLE:"; echo = 2; 967 ring r=0, (x,y,z), rp; 968 jmp r1; 969 r1.h=z^3; 970 r1.t=poly(0); 971 jmp r2; 972 r2.h=z^2*y; 973 r2.t=poly(0); 974 jmp r3; 975 r3.h=z*y^2 ; 976 r3.t=-x^2*y; 977 jmp r4; 978 r4.h=y^5; 979 r4.t=poly(0); 980 list G2F=list(list(r1,r2,r3),list(r4)); 981 TestJMark(G2F,r); 982 } -
Singular/LIB/JMSConst.lib
rd4cec6a r7161aca 176 176 int minimo=deg(m.h); 177 177 int massimo=deg(M.h); 178 //print(minimo);179 //print(massimo);180 178 int i=2; 181 179 jmp qi; 182 180 while(i<=size(Q)) 183 181 { 184 //print("entro nel ciclo");185 //print(i);186 182 qi=Q[i][1]; 187 183 if(deg(qi.h)!=minimo+1) 188 184 { 189 //print("qui riempire");190 //print(i);191 185 Q=insert(Q,list(),i-1);//Insert empty list for all intermediate degree between the minimum and the maximum, not having polynomials. 192 //print(Q);193 186 } 194 187 minimo=minimo+1; 195 188 i=i+1; 196 //print("ora ho");197 //print(minimo);198 //print(i);199 189 } 200 190 return(Q); … … 250 240 Q[i][j]=pp; 251 241 s=s+M[2]; 252 //print(s);253 242 } 254 243 } … … 324 313 int aJ=deg(f.h); 325 314 // minimal degree of polynomials in G 326 //print(aJ);327 315 list V=list(); 328 316 V[1]=Terns(G,1); … … 353 341 { 354 342 p=G[V[m-1][j][2]][V[m-1][j][3]]; 355 //print(p.h);356 //print(p.t);357 //print(var(i));358 //print(Minimus(V[m-1][j][1]*p.h));359 343 if(var(i)<=Minimus(variables(V[m-1][j][1]*p.h))) 360 344 { 361 345 //Can I multiply by the current variable? 362 //print("minoremin");363 //print("fin qui ci sono");364 //print(V[m-1][j][1]);365 346 OO=list(var(i)*V[m-1][j][1],V[m-1][j][2],V[m-1][j][3]); 366 347 V[m]=insert(V[m], OO ,size(V[m])); … … 754 735 EXAMPLE: example FinalVm; shows an example" 755 736 { 756 //multiply and reduce, degree by degree 757 intvec u=NewWeight(nvars(r)+1); 758 list L=ringlist(r); 759 L[2]=insert(L[2],"t",size(L[2])); 760 //print(L[2]); 761 list ordlist="a",u; 762 L[3]=insert(L[3],ordlist,0); 763 def H=ring(L); 764 //print(V1); 765 //print(G1); 766 list M=list(); 767 jmp p; 768 list N; 769 poly q; 770 poly s; 771 int i; 772 int j; 773 for(i=1; i<=size(G1); i++) 774 { 775 N=list(); 776 for(j=1; j<=size(G1[i]); j++) 777 { 778 p=G1[i][j]; 779 q=p.h; 780 s=p.t; 781 N[j]=list(q,s); 782 } 783 M[i]=N; 784 } 785 //print("M is"); 786 //print(M); 787 p.h=poly(0); 788 p.t=poly(0); 789 setring H; 790 list R=list(); 791 list S=list(); 792 //print("anello definito"); 793 list V=imap(r,V1); 794 //def G=imap(r,G1); 795 //print(V); 796 list MM=imap(r,M); 797 list G=list(); 798 list N=list(); 799 for(i=1; i<=size(MM); i++) 800 { 801 for(j=1; j<=size(MM[i]); j++) 802 { 803 p.h=MM[i][j][1]; 804 p.t=MM[i][j][2]; 805 N[j]=p; 806 } 807 G[i]=N; 808 } 809 ideal I=0; 810 jmp LL; 811 jmp UU; 812 //print("pronta x ridurre"); 813 for(i=1; i<=size(V);i++) 814 { 815 //print("sono a V di"); 816 //print(i); 817 R[i]=list(); 818 S[i]=list(); 819 I=0; 820 attrib(I,"isSB",1); 821 for(j=1;j<=size(V[i]); j++) 822 { 823 //print(j); 824 //print("esimo elem"); 825 LL=MultiplyJmP(V[i][j],G); 826 LL.t=reduce(t*LL.t,I); 827 //I only reduce the tail 828 //print(LL.t); 829 LL.t=subst(LL.t,t,1); 830 S[i]=insert(S[i],LL,size(S[i])); 831 LL.h=t*LL.h; 832 R[i]=insert(R[i],LL,size(R[i])); 833 UU=R[i][j]; 834 I=I+ideal(UU.h+UU.t); 835 attrib(I,"isSB",1); 836 } 837 } 838 //print("ho ridotto"); 839 list M=list(); 840 poly q; 841 poly s; 842 for(i=1; i<=size(S); i++) 843 { 844 N=list(); 845 for(j=1; j<=size(S[i]); j++) 846 { 847 p=S[i][j]; 848 q=p.h; 849 s=p.t; 850 N[j]=list(q,s); 851 } 852 M[i]=N; 853 } 854 p.h=poly(0); 855 p.t=poly(0); 856 setring r; 857 def MM=imap(H,M); 858 list MMM=list(); 859 for(i=1; i<=size(MM); i++) 860 { 861 N=list(); 862 for(j=1; j<=size(MM[i]); j++) 863 { 864 p.h=MM[i][j][1]; 865 p.t=MM[i][j][2]; 866 N[j]=p; 867 } 868 MMM[i]=N; 869 } 870 return(MMM); 737 //multiply and reduce, degree by degree 738 intvec u=NewWeight(nvars(r)+1); 739 list L=ringlist(r); 740 L[2]=insert(L[2],"t",size(L[2])); 741 list ordlist="a",u; 742 L[3]=insert(L[3],ordlist,0); 743 def H=ring(L); 744 list M=list(); 745 jmp p; 746 list N; 747 poly q; 748 poly s; 749 int i; 750 int j; 751 for(i=1; i<=size(G1); i++) 752 { 753 N=list(); 754 for(j=1; j<=size(G1[i]); j++) 755 { 756 p=G1[i][j]; 757 q=p.h; 758 s=p.t; 759 N[j]=list(q,s); 760 } 761 M[i]=N; 762 } 763 p.h=poly(0); 764 p.t=poly(0); 765 setring H; 766 list R=list(); 767 list S=list(); 768 //print("anello definito"); 769 list V=imap(r,V1); 770 list MM=imap(r,M); 771 list G=list(); 772 list N=list(); 773 for(i=1; i<=size(MM); i++) 774 { 775 for(j=1; j<=size(MM[i]); j++) 776 { 777 p.h=MM[i][j][1]; 778 p.t=MM[i][j][2]; 779 N[j]=p; 780 } 781 G[i]=N; 782 } 783 ideal I=0; 784 jmp LL; 785 jmp UU; 786 //print("pronta x ridurre"); 787 for(i=1; i<=size(V);i++) 788 { 789 //print("sono a V di"); 790 //print(i); 791 R[i]=list(); 792 S[i]=list(); 793 I=0; 794 attrib(I,"isSB",1); 795 for(j=1;j<=size(V[i]); j++) 796 { 797 //print(j); 798 //print("esimo elem"); 799 LL=MultiplyJmP(V[i][j],G); 800 LL.t=reduce(t*LL.t,I); 801 //I only reduce the tail 802 //print(LL.t); 803 LL.t=subst(LL.t,t,1); 804 S[i]=insert(S[i],LL,size(S[i])); 805 LL.h=t*LL.h; 806 R[i]=insert(R[i],LL,size(R[i])); 807 UU=R[i][j]; 808 I=I+ideal(UU.h+UU.t); 809 attrib(I,"isSB",1); 810 } 811 } 812 //print("ho ridotto"); 813 list M=list(); 814 poly q; 815 poly s; 816 for(i=1; i<=size(S); i++) 817 { 818 N=list(); 819 for(j=1; j<=size(S[i]); j++) 820 { 821 p=S[i][j]; 822 q=p.h; 823 s=p.t; 824 N[j]=list(q,s); 825 } 826 M[i]=N; 827 } 828 p.h=poly(0); 829 p.t=poly(0); 830 setring r; 831 def MM=imap(H,M); 832 list MMM=list(); 833 for(i=1; i<=size(MM); i++) 834 { 835 N=list(); 836 for(j=1; j<=size(MM[i]); j++) 837 { 838 p.h=MM[i][j][1]; 839 p.t=MM[i][j][2]; 840 N[j]=p; 841 } 842 MMM[i]=N; 843 } 844 return(MMM); 871 845 } 872 846 example 873 847 { "EXAMPLE:"; echo = 2; 874 848 ring r=0, (x,y,z), rp; 875 jmp r1;876 r1.h=z^3;877 r1.t=poly(0);878 jmp r2;879 r2.h=z^2*y;880 r2.t=poly(0);881 jmp r3;882 r3.h=z*y^2 ;883 r3.t=-x^2*y;884 jmp r4;885 r4.h=y^5;886 r4.t=poly(0);887 list G2F=list(list(r1,r2,r3),list(r4));849 jmp r1; 850 r1.h=z^3; 851 r1.t=poly(0); 852 jmp r2; 853 r2.h=z^2*y; 854 r2.t=poly(0); 855 jmp r3; 856 r3.h=z*y^2 ; 857 r3.t=-x^2*y; 858 jmp r4; 859 r4.h=y^5; 860 r4.t=poly(0); 861 list G2F=list(list(r1,r2,r3),list(r4)); 888 862 FinalVm(VConst(G2F,6,r) , G2F, r); 889 863 } … … 1093 1067 EXAMPLE: example SchemeEq; shows an example" 1094 1068 { 1095 list Jms=list(); 1096 //ideal I; 1097 list M=list(); 1098 jmp mini; 1099 mini=W[1][1]; 1100 int minimo=deg(mini.h); 1101 //multiply variables 1102 poly pd=poly(1); 1103 for(int i=1;i<=nvars(r);i++) 1104 {pd=pd*var(i);} 1105 //CHANGE RING 1106 intvec u=NewWeight(nvars(r)+1); 1107 list L=ringlist(r); 1108 L[2]=insert(L[2],"t",size(L[2])); 1109 //print(L[2]); 1110 list ordlist="a",u; 1111 L[3]=insert(L[3],ordlist,0); 1112 def H=ring(L); 1113 //list 1114 M=list(); 1115 jmp pu; 1116 list N; 1117 poly q; 1118 poly s; 1119 i=0; 1120 int j; 1121 for(i=1; i<=size(Q); i++) 1122 { 1123 N=list(); 1124 for(j=1; j<=size(Q[i]); j++) 1125 { 1126 pu=Q[i][j]; 1127 q=pu.h; 1128 s=pu.t; 1129 N[j]=list(q,s); 1130 } 1131 M[i]=N; 1132 } 1133 list O; 1134 pu.h=poly(0); 1135 pu.t=poly(0); 1136 for(i=1; i<=size(W); i++) 1137 { 1138 N=list(); 1139 for(j=1; j<=size(W[i]); j++) 1140 { 1141 pu=W[i][j]; 1142 q=pu.h; 1143 s=pu.t; 1144 N[j]=list(q,s); 1145 } 1146 O[i]=N; 1147 } 1148 pu.h=poly(0); 1149 pu.t=poly(0); 1150 setring H; 1151 list R=list(); 1152 list S=list(); 1153 //print("anello definito"); 1154 def EK=imap(r,EK); 1155 def MM=imap(r,M); 1156 def OO=imap(r,O); 1157 def pd=imap(r,pd); 1158 list G=list(); 1159 list N=list(); 1160 for(i=1; i<=size(MM); i++) 1161 { 1162 for(j=1; j<=size(MM[i]); j++) 1163 { 1164 pu.h=MM[i][j][1]; 1165 pu.t=MM[i][j][2]; 1166 N[j]=pu; 1167 } 1168 G[i]=N; 1169 } 1170 list V; 1171 for(i=1; i<=size(OO); i++) 1172 { 1173 for(j=1; j<=size(OO[i]); j++) 1174 { 1175 pu.h=OO[i][j][1]; 1176 pu.t=OO[i][j][2]; 1177 N[j]=pu; 1178 } 1179 V[i]=N; 1180 } 1181 //print(V); 1182 //print(G); 1183 matrix C; 1184 list COEFF; 1185 poly p=0; 1186 poly q=0; 1187 ideal I; 1188 list M; 1189 i=0; 1190 jmp g; 1191 int k; 1192 for(j=1; j<=size(EK);j++) 1069 list Jms=list(); 1070 //ideal I; 1071 list M=list(); 1072 jmp mini; 1073 mini=W[1][1]; 1074 int minimo=deg(mini.h); 1075 //multiply variables 1076 poly pd=poly(1); 1077 for(int i=1;i<=nvars(r);i++) 1078 { pd=pd*var(i);} 1079 //CHANGE RING 1080 intvec u=NewWeight(nvars(r)+1); 1081 list L=ringlist(r); 1082 L[2]=insert(L[2],"t",size(L[2])); 1083 //print(L[2]); 1084 list ordlist="a",u; 1085 L[3]=insert(L[3],ordlist,0); 1086 def H=ring(L); 1087 //list 1088 M=list(); 1089 jmp pu; 1090 list N; 1091 poly q; 1092 poly s; 1093 i=0; 1094 int j; 1095 for(i=1; i<=size(Q); i++) 1096 { 1097 N=list(); 1098 for(j=1; j<=size(Q[i]); j++) 1099 { 1100 pu=Q[i][j]; 1101 q=pu.h; 1102 s=pu.t; 1103 N[j]=list(q,s); 1104 } 1105 M[i]=N; 1106 } 1107 list O; 1108 pu.h=poly(0); 1109 pu.t=poly(0); 1110 for(i=1; i<=size(W); i++) 1111 { 1112 N=list(); 1113 for(j=1; j<=size(W[i]); j++) 1114 { 1115 pu=W[i][j]; 1116 q=pu.h; 1117 s=pu.t; 1118 N[j]=list(q,s); 1119 } 1120 O[i]=N; 1121 } 1122 pu.h=poly(0); 1123 pu.t=poly(0); 1124 setring H; 1125 list R=list(); 1126 list S=list(); 1127 //print("anello definito"); 1128 def EK=imap(r,EK); 1129 def MM=imap(r,M); 1130 def OO=imap(r,O); 1131 def pd=imap(r,pd); 1132 list G=list(); 1133 list N=list(); 1134 for(i=1; i<=size(MM); i++) 1135 { 1136 for(j=1; j<=size(MM[i]); j++) 1137 { 1138 pu.h=MM[i][j][1]; 1139 pu.t=MM[i][j][2]; 1140 N[j]=pu; 1141 } 1142 G[i]=N; 1143 } 1144 list V; 1145 for(i=1; i<=size(OO); i++) 1146 { 1147 for(j=1; j<=size(OO[i]); j++) 1148 { 1149 pu.h=OO[i][j][1]; 1150 pu.t=OO[i][j][2]; 1151 N[j]=pu; 1152 } 1153 V[i]=N; 1154 } 1155 //print(V); 1156 //print(G); 1157 matrix C; 1158 list COEFF; 1159 poly p=0; 1160 poly q=0; 1161 ideal I; 1162 list M; 1163 i=0; 1164 jmp g; 1165 int k; 1166 for(j=1; j<=size(EK);j++) 1167 { 1168 //print("arrivo"); 1169 //print(j); 1170 p=MultEKPolys(EK[j],G); 1171 //ideal 1172 I=0; 1173 if (size(V[D[j]-minimo+1])!=0) 1174 { 1175 M=list(); 1176 // jmp g; 1177 for(i=1; i<= size(V[D[j]-minimo+1]); i++) 1193 1178 { 1194 //print("arrivo"); 1195 //print(j); 1196 p=MultEKPolys(EK[j],G); 1197 //ideal 1198 I=0; 1199 if (size(V[D[j]-minimo+1])!=0) 1200 { 1201 M=list(); 1202 // jmp g; 1203 for(i=1; i<= size(V[D[j]-minimo+1]); i++) 1204 { 1205 g=V[D[j]-minimo+1][i]; 1206 g.h=(g.h)*t; 1207 M[i]=g.h+g.t; 1208 } 1179 g=V[D[j]-minimo+1][i]; 1180 g.h=(g.h)*t; 1181 M[i]=g.h+g.t; 1182 } 1209 1183 I=M[1..size(M)]; 1210 attrib(I,"isSB",1);1211 //print(I);1212 }1213 //print(I);1214 q=reduce(t*p,I);1215 q=subst(q,t,1);1216 1217 1218 1219 1220 1221 1222 1223 1224 setring r;1225 def Jms=imap(H,Jms);1226 return(Jms);1184 attrib(I,"isSB",1); 1185 //print(I); 1186 } 1187 //print(I); 1188 q=reduce(t*p,I); 1189 q=subst(q,t,1); 1190 C=coef(q,pd); 1191 COEFF=C[2,1..ncols(C)]; 1192 for(k=1;k<=size(COEFF);k++) 1193 { 1194 if(COEFF[k]!=0) 1195 { Jms=insert(Jms,COEFF[k],size(Jms));} 1196 } 1197 } 1198 setring r; 1199 def Jms=imap(H,Jms); 1200 return(Jms); 1227 1201 } 1228 1202 example … … 1230 1204 ring r=0, (x,y,z),rp; 1231 1205 ideal Borid=y^2*z,y*z^2,z^3,y^5; 1232 attrib(Borid,"isSB",1); 1233 list B=ArrangeBorel(Borid); 1234 list NumN; 1235 list N; 1236 int i; 1237 int d; 1238 for(i=1;i<=size(B);i++) 1239 { 1240 d=deg(B[i][1]); 1241 N[i]=kbase(Borid,d); 1242 NumN[i]=size(N[i]); 1243 } 1244 int qc=NumNewVar(B, NumN); 1245 //Now I must define the NEW RING, 1246 //putting the c parameters inside. 1247 list L=ringlist(r); 1248 list L2; 1249 L2[1]=L[1]; 1250 L2[2]=list(); 1251 for(i=qc;i>=1;i--) 1252 { 1253 L2[2][i]="c("+string(i)+")"; 1254 } 1255 L2[3]=list(list("rp",qc)); 1256 L2[4]=L[4]; 1257 L[1]=L2; 1258 if(defined(K)){kill K;} 1259 def K=ring(L); 1260 export K; 1261 setring(K); 1262 def Borid=imap(r,Borid); 1263 def N=imap(r,N); 1264 def B=imap(r,B); 1265 //NumN contains only scalars so I do not imap it 1266 int j; 1267 list Q; 1268 int s; 1269 list M; 1270 jmp pp; 1271 for(i=1;i<=size(B);i++) 1272 { 1273 Q[i]=list(); 1274 for(j=1;j<=size(B[i]);j++) 1275 { 1276 M=NewTails(N[i],s); 1277 pp.h=B[i][j]; 1278 pp.t=M[1]; 1279 Q[i][j]=pp; 1280 s=s+M[2]; 1281 //print(s); 1282 } 1283 } 1284 list P=ArrangeTails(Q); 1285 list EK,D= EKPolynomials(P); 1286 int massimo=Max(D); 1287 //list V=VConst(P, massimo); 1288 //pause(); 1289 list V=VmConstructor(P,massimo,r); 1290 list W=FinalVm(V,P,K); 1291 //print("I V ridotti in ordine sono"); 1292 //print(W); 1293 list Jms=SchemeEq(W,EK,D,P,K); 1294 Jms;} 1206 attrib(Borid,"isSB",1); 1207 list B=ArrangeBorel(Borid); 1208 list NumN; 1209 list N; 1210 int i; 1211 int d; 1212 for(i=1;i<=size(B);i++) 1213 { 1214 d=deg(B[i][1]); 1215 N[i]=kbase(Borid,d); 1216 NumN[i]=size(N[i]); 1217 } 1218 int qc=NumNewVar(B, NumN); 1219 //Now I must define the NEW RING, 1220 //putting the c parameters inside. 1221 list L=ringlist(r); 1222 list L2; 1223 L2[1]=L[1]; 1224 L2[2]=list(); 1225 for(i=qc;i>=1;i--) 1226 { 1227 L2[2][i]="c("+string(i)+")"; 1228 } 1229 L2[3]=list(list("rp",qc)); 1230 L2[4]=L[4]; 1231 L[1]=L2; 1232 if(defined(K)){kill K;} 1233 def K=ring(L); 1234 export K; 1235 setring(K); 1236 def Borid=imap(r,Borid); 1237 def N=imap(r,N); 1238 def B=imap(r,B); 1239 //NumN contains only scalars so I do not imap it 1240 int j; 1241 list Q; 1242 int s; 1243 list M; 1244 jmp pp; 1245 for(i=1;i<=size(B);i++) 1246 { 1247 Q[i]=list(); 1248 for(j=1;j<=size(B[i]);j++) 1249 { 1250 M=NewTails(N[i],s); 1251 pp.h=B[i][j]; 1252 pp.t=M[1]; 1253 Q[i][j]=pp; 1254 s=s+M[2]; 1255 //print(s); 1256 } 1257 } 1258 list P=ArrangeTails(Q); 1259 list EK,D= EKPolynomials(P); 1260 int massimo=Max(D); 1261 //list V=VConst(P, massimo); 1262 //pause(); 1263 list V=VmConstructor(P,massimo,r); 1264 list W=FinalVm(V,P,K); 1265 //print("I V ridotti in ordine sono"); 1266 //print(W); 1267 list Jms=SchemeEq(W,EK,D,P,K); 1268 Jms; 1269 } 1295 1270 1296 1271 ////////////////////////////////////////////////////////////////////// … … 1303 1278 EXAMPLE: example JMarkedScheme; shows an example" 1304 1279 { 1305 list Jms;1306 if(BorelCheck(Borid,r))1307 { 1308 if(size(Borid)==1)1309 { Jms=list();}1310 else{1311 //print("Input is OK");1312 attrib(Borid,"isSB",1);1313 list B=ArrangeBorel(Borid);1314 list NumN;1315 list N;1316 int i;1317 int d;1318 for(i=1;i<=size(B);i++)1319 1280 list Jms; 1281 if(BorelCheck(Borid,r)) 1282 { 1283 if(size(Borid)==1) { Jms=list();} 1284 else 1285 { 1286 //print("Input is OK"); 1287 attrib(Borid,"isSB",1); 1288 list B=ArrangeBorel(Borid); 1289 list NumN; 1290 list N; 1291 int i; 1292 int d; 1293 for(i=1;i<=size(B);i++) 1294 { 1320 1295 d=deg(B[i][1]); 1321 1296 N[i]=kbase(Borid,d); 1322 1297 NumN[i]=size(N[i]); 1323 } 1324 int qc=NumNewVar(B, NumN); 1325 if(qc==0) 1326 {Jms=list(0);} 1327 else 1328 { 1329 //Now I must define the NEW RING, 1330 //putting the c parameters inside. 1331 list L=ringlist(r); 1332 list L2; 1333 L2[1]=L[1]; 1334 L2[2]=list(); 1335 for(i=qc;i>=1;i--) 1336 { 1337 L2[2][i]="c("+string(i)+")"; 1338 } 1339 L2[3]=list(list("rp",qc)); 1340 L2[4]=L[4]; 1341 L[1]=L2; 1342 if(defined(K)){kill K;} 1343 def K=ring(L); 1344 export K; 1345 setring(K); 1346 def Borid=imap(r,Borid); 1347 def N=imap(r,N); 1348 def B=imap(r,B); 1349 //NumN contains only scalars so I do not imap it 1350 int j; 1351 list Q; 1352 int s; 1353 list M; 1354 jmp pp; 1355 for(i=1;i<=size(B);i++) 1356 { 1357 Q[i]=list(); 1358 for(j=1;j<=size(B[i]);j++) 1298 } 1299 int qc=NumNewVar(B, NumN); 1300 if(qc==0) {Jms=list(0);} 1301 else 1302 { 1303 //Now I must define the NEW RING, 1304 //putting the c parameters inside. 1305 list L=ringlist(r); 1306 list L2; 1307 L2[1]=L[1]; 1308 L2[2]=list(); 1309 for(i=qc;i>=1;i--) 1359 1310 { 1360 M=NewTails(N[i],s); 1361 pp.h=B[i][j]; 1362 pp.t=M[1]; 1363 Q[i][j]=pp; 1364 s=s+M[2]; 1365 //print(s); 1311 L2[2][i]="c("+string(i)+")"; 1366 1312 } 1367 } 1368 list P=ArrangeTails(Q); 1369 list EK,D= EKPolynomials(P); 1370 int massimo=Max(D); 1371 //list V=VConst(P, massimo); 1372 //pause(); 1373 list V=VmConstructor(P,massimo,r); 1374 list W=FinalVm(V,P,K); 1375 //print("I V ridotti in ordine sono"); 1376 //print(W); 1377 //list 1378 Jms=SchemeEq(W,EK,D,P,K); 1379 keepring K;} 1380 } 1381 } 1382 else 1383 { 1313 L2[3]=list(list("rp",qc)); 1314 L2[4]=L[4]; 1315 L[1]=L2; 1316 if(defined(K)){kill K;} 1317 def K=ring(L); 1318 export K; 1319 setring(K); 1320 def Borid=imap(r,Borid); 1321 def N=imap(r,N); 1322 def B=imap(r,B); 1323 //NumN contains only scalars so I do not imap it 1324 int j; 1325 list Q; 1326 int s; 1327 list M; 1328 jmp pp; 1329 for(i=1;i<=size(B);i++) 1330 { 1331 Q[i]=list(); 1332 for(j=1;j<=size(B[i]);j++) 1333 { 1334 M=NewTails(N[i],s); 1335 pp.h=B[i][j]; 1336 pp.t=M[1]; 1337 Q[i][j]=pp; 1338 s=s+M[2]; 1339 //print(s); 1340 } 1341 } 1342 list P=ArrangeTails(Q); 1343 list EK,D= EKPolynomials(P); 1344 int massimo=Max(D); 1345 //list V=VConst(P, massimo); 1346 //pause(); 1347 list V=VmConstructor(P,massimo,r); 1348 list W=FinalVm(V,P,K); 1349 //print("I V ridotti in ordine sono"); 1350 //print(W); 1351 //list 1352 Jms=SchemeEq(W,EK,D,P,K); 1353 keepring K; 1354 } 1355 } 1356 } 1357 else 1358 { 1384 1359 print("WRONG IDEAL IN INPUT"); 1385 1360 print("It is NOT BOREL"); 1386 1387 return(Jms);1361 } 1362 return(Jms); 1388 1363 } 1389 1364 example … … 1391 1366 ring r=0, (x,y,z),rp; 1392 1367 ideal Borid=y^2*z,y*z^2,z^3,y^5; 1393 JMarkedScheme(Borid,r);1394 } 1395 //////////////////////////////////////////////////////////////////// 1368 JMarkedScheme(Borid,r); 1369 } 1370 //////////////////////////////////////////////////////////////////// -
Singular/LIB/algebra.lib
rd4cec6a r7161aca 1032 1032 } 1033 1033 // --------------------- change of variable names ------------------------- 1034 execute("ring @bsr = ("+charstr(bsr)+"),y(1..m),("+os+");"); 1034 list l2; 1035 for (int ii = 1; ii <= m; ii++) 1036 { 1037 l2[ii] = "y("+string(ii)+")"; 1038 } 1039 ring @bsr = create_ring(ringlist(bsr)[1], l2, "("+os+")", "no_minpoly"); 1035 1040 ideal J = fetch(bsr,J); 1036 1041 ideal PHI = fetch(bsr,PHI); -
Singular/LIB/assprimeszerodim.lib
rd4cec6a r7161aca 284 284 { 285 285 def R = basering; 286 execute("ring QT = ("+charstr(R)+"), "+varstr(R, nvars(R))+", dp;");286 ring QT = create_ring(ringlist(R)[1], varstr(R, nvars(R)), "dp", "no_minpoly"); 287 287 setring(R); 288 288 map phi = QT, f; … … 349 349 M[1..d, j] = coeffs(reduce(f*basis[j], J), basis, vars); 350 350 } 351 execute("ring QT = ("+charstr(R)+"), "+varstr(R, nvars(R))+", dp;");351 ring QT = create_ring(ringlist(R)[1], varstr(R, nvars(R)), "dp", "no_minpoly"); 352 352 matrix M = imap(R, M); 353 353 ideal F = det(M-var(1)*freemodule(d)); … … 364 364 //=== mapping T to p and test if d=deg(F) 365 365 def R = basering; 366 execute("ring Rhelp = ("+charstr(R)+"), T, dp;");366 ring Rhelp = create_ring(ringlist(R)[1], "T", "dp", "no_minpoly"); 367 367 setring R; 368 368 map phi = Rhelp,p; -
Singular/LIB/chern.lib
rd4cec6a r7161aca 3305 3305 int n=nvars(basering); 3306 3306 def br@=basering; // remember the base ring 3307 execute("ring r@=("+ charstr(basering) +"),("+varstr(basering)+",homvar@), dp;");3307 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+",homvar@)", "dp", "no_minpoly"); 3308 3308 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 3309 3309 ideal I=F(I); -
Singular/LIB/classify.lib
rd4cec6a r7161aca 256 256 PhiG = MapReduce(PhiG); 257 257 258 execute("ring RingB="+charstr(basering)+",("+A_Z("x",corank)+"),(c,ds);");258 ring RingB = create_ring(ringlist(basering)[1], "("+A_Z("x",corank)+")", "(c,ds)", "no_minpoly"); 259 259 export RingB; 260 260 setring ring_rest; -
Singular/LIB/ellipticcovers.lib
rd4cec6a r7161aca 67 67 68 68 69 proc mod_init() 70 { 71 newstruct("graph","list vertices, list edges"); 72 newstruct("Net","list rows"); 73 74 system("install","graph","print",printGraph,1); 75 system("install","Net","print",printNet,1); 76 system("install","Net","+",catNet,2); 77 78 } 79 69 static proc mod_init() 70 { 71 newstruct("graph","list vertices, list edges"); 72 newstruct("Net","list rows"); 73 74 system("install","graph","print",printGraph,1); 75 system("install","Net","print",printNet,1); 76 system("install","Net","+",catNet,2); 77 } 80 78 81 79 static proc catNet(Net N, Net M) 82 80 { 83 list L;84 list LN=N.rows;85 list LM=M.rows;86 int widthN=size(LN[1]);87 int widthM=size(LM[1]);88 int nm=max(size(LN),size(LM));89 for (int j=1; j<=nm; j++)90 {81 list L; 82 list LN=N.rows; 83 list LM=M.rows; 84 int widthN=size(LN[1]); 85 int widthM=size(LM[1]); 86 int nm=max(size(LN),size(LM)); 87 for (int j=1; j<=nm; j++) 88 { 91 89 if (j>size(LN)){LN[j]=emptyString(widthN);} 92 90 if (j>size(LM)){LM[j]=emptyString(widthM);} 93 91 L[j]=LN[j]+LM[j]; 94 } 95 Net NM; 96 NM.rows=L; 97 return(NM);} 92 } 93 Net NM; 94 NM.rows=L; 95 return(NM); 96 } 98 97 99 98 … … 111 110 static proc printNet(Net N) 112 111 { 113 list L = N.rows; 114 for (int j=1; j<=size(L); j++) 115 { 116 print(L[j]); 117 } 118 } 119 120 static proc net(def M){ 121 if (typeof(M)=="list"){ 112 list L = N.rows; 113 for (int j=1; j<=size(L); j++) 114 { 115 print(L[j]); 116 } 117 } 118 119 static proc net(def M) 120 { 121 if (typeof(M)=="list") 122 { 122 123 return(netList(M)); 123 124 } … … 126 127 L[1]=string(M); 127 128 N.rows=L; 128 return(N);} 129 return(N); 130 } 129 131 130 132 … … 147 149 G; 148 150 } 149 150 151 151 152 152 proc makeGraph(list v, list e) … … 170 170 G; 171 171 } 172 173 172 174 173 proc propagator(def xy, def d) … … 195 194 " 196 195 { 197 if ((typeof(xy)=="list")||(typeof(d)=="int")) { 196 if ((typeof(xy)=="list")||(typeof(d)=="int")) 197 { 198 198 number x = xy[1]; 199 199 number y = xy[2]; … … 201 201 if (d==0) {return(x^2*y^2/(x^2-y^2)^2);} 202 202 number p=0; 203 for (int j=1; j<=d; j++){ 203 for (int j=1; j<=d; j++) 204 { 204 205 if (d%j==0){p=p+(j*x^(4*j)+j*y^(4*j))/(x*y)^(2*j);} 205 206 } 206 207 return(p); 207 208 } 208 if ((typeof(xy)=="graph")||(typeof(d)=="list")) { 209 if ((typeof(xy)=="graph")||(typeof(d)=="list")) 210 { 209 211 list xl = ringlist(basering)[1][2]; 210 212 list ed = xy.edges; 211 213 number f=1; 212 for (int j=1; j<=size(ed); j++){ 214 for (int j=1; j<=size(ed); j++) 215 { 213 216 execute("number xx1 = "+xl[ed[j][1]]); 214 217 execute("number xx2 = "+xl[ed[j][2]]); … … 219 222 return(f); 220 223 } 221 if ((typeof(xy)=="graph")||(typeof(d)=="int")) { 222 } 223 ERROR("wrong input type");} 224 if ((typeof(xy)=="graph")||(typeof(d)=="int")) 225 { 226 } 227 ERROR("wrong input type"); 228 } 224 229 example 225 230 { "EXAMPLE:"; echo=2; … … 230 235 propagator(G,list(1,1,1,0,0,0)); 231 236 } 232 233 234 235 236 237 237 238 proc computeConstant(number f,number xx) … … 240 241 RETURN: number, the constant coefficient of the Laurent series of f in the variable x. 241 242 THEORY: Computes the constant coefficient of the Laurent series by iterative differentiation. 242 243 243 KEYWORDS: Laurent series 244 244 EXAMPLE: example computeConstant; shows an example … … 250 250 int j; 251 251 poly de; 252 while (tst==0){ 253 ff=f*xx^k; 254 for (j=1; j<=k; j++){ 255 ff=diff(ff,xx)/j; 256 } 257 de = subst(denominator(ff),xx,0); 258 if (de!=0){ 259 poly nu = subst(numerator(ff),xx,0); 260 return(number(nu/de)); 261 } 262 k=k+1; 263 } 264 ERROR("error in computeConstant");} 252 while (tst==0) 253 { 254 ff=f*xx^k; 255 for (j=1; j<=k; j++) 256 { 257 ff=diff(ff,xx)/j; 258 } 259 de = subst(denominator(ff),xx,0); 260 if (de!=0) 261 { 262 poly nu = subst(numerator(ff),xx,0); 263 return(number(nu/de)); 264 } 265 k++; 266 } 267 ERROR("error in computeConstant"); 268 } 265 269 example 266 270 { "EXAMPLE:"; echo=2; … … 270 274 computeConstant(P,x2); 271 275 } 272 273 274 275 276 276 277 proc evaluateIntegral(number P, list xL) … … 289 290 { 290 291 number p = P; 291 for(int j=1; j<=size(xL); j++){ 292 for(int j=1; j<=size(xL); j++) 293 { 292 294 p=computeConstant(p,xL[j]); 293 295 } 294 return(p);} 296 return(p); 297 } 295 298 example 296 299 { "EXAMPLE:"; echo=2; … … 300 303 evaluateIntegral(p,list(x1,x3,x4,x2)); 301 304 } 302 303 305 304 306 proc permute (list N) … … 314 316 " 315 317 { 316 int i,j,k; 317 list L,L1; 318 if (size(N)==1){ 319 return(list(N)); 320 } else { 321 k=1; 322 for (i=1; i<=size(N); i++){ 323 L=permute(delete(N,i)); 324 for (j=1; j<=size(L); j++){ 325 L1[k]=L[j]+list(N[i]); 326 k=k+1; 327 } 328 } 329 } 330 return(L1);} 318 int i,j,k; 319 list L,L1; 320 if (size(N)==1) 321 { 322 return(list(N)); 323 } 324 else 325 { 326 k=1; 327 for (i=1; i<=size(N); i++) 328 { 329 L=permute(delete(N,i)); 330 for (j=1; j<=size(L); j++) 331 { 332 L1[k]=L[j]+list(N[i]); 333 k=k+1; 334 } 335 } 336 } 337 return(L1); 338 } 331 339 example 332 340 { "EXAMPLE:"; echo=2; … … 349 357 " 350 358 { 351 ring R = 2,(x(1..n)),dp; 352 ideal I = maxideal(a); 353 list L; 354 for (int j=1;j<=size(I);j++){ 355 L[j]=leadexp(I[j]); 356 } 357 return(L);} 359 ring R = 2,(x(1..n)),dp; 360 ideal I = maxideal(a); 361 list L; 362 for (int j=1;j<=size(I);j++) 363 { 364 L[j]=leadexp(I[j]); 365 } 366 return(L); 367 } 358 368 example 359 369 { "EXAMPLE:"; echo=2; 360 370 partitions(3,7); 361 371 } 362 363 364 372 365 373 proc gromovWitten(def P,list #) … … 385 393 " 386 394 { 387 if (typeof(P)=="number") { 388 list xl = ringlist(basering)[1][2]; 389 int j; 390 for(j=1; j<=size(xl); j++){ 391 execute("number n= "+xl[j]); 392 xl[j]=n; 393 kill n; 394 } 395 list pxl = permute(xl); 396 number p = 0; 397 for(j=1; j<=size(pxl); j++){ 398 p=p+evaluateIntegral(P,pxl[j]); 399 } 400 return(p); 401 } 402 if (typeof(P)=="graph"){ 403 if (size(#)>1){ 404 return(gromovWitten(propagator(P,#))); 405 } else { 395 if (typeof(P)=="number") 396 { 397 list xl = ringlist(basering)[1][2]; 398 int j; 399 for(j=1; j<=size(xl); j++) 400 { 401 execute("number n= "+xl[j]); 402 xl[j]=n; 403 kill n; 404 } 405 list pxl = permute(xl); 406 number p = 0; 407 for(j=1; j<=size(pxl); j++) 408 { 409 p=p+evaluateIntegral(P,pxl[j]); 410 } 411 return(p); 412 } 413 if (typeof(P)=="graph") 414 { 415 if (size(#)>1) 416 { 417 return(gromovWitten(propagator(P,#))); 418 } 419 else 420 { 406 421 int d =#[1]; 407 422 list pa = partitions(size(P.edges),d); 408 423 list re; 409 424 int ti; 410 for (int j=1; j<=size(pa); j++) { 411 ti=timer; 412 re[j]=gromovWitten(propagator(P,pa[j])); 413 ti=timer-ti; 414 //print(string(j)+" / "+string(size(pa))+" "+string(pa[j])+" "+string(re[j])+" "+string(sum(re))+" "+string(ti)); 425 for (int j=1; j<=size(pa); j++) 426 { 427 ti=timer; 428 re[j]=gromovWitten(propagator(P,pa[j])); 429 ti=timer-ti; 430 //print(string(j)+" / "+string(size(pa))+" "+string(pa[j])+" "+string(re[j])+" "+string(sum(re))+" "+string(ti)); 415 431 } 416 return(lsum(re));417 432 return(lsum(re)); 433 } 418 434 } 419 435 } … … 427 443 gromovWitten(G,2); 428 444 } 429 430 431 445 432 446 proc computeGromovWitten(graph P,int d, int st, int en, list #) … … 443 457 " 444 458 { 445 number s =0; 446 list pararg; 447 list re; 448 list pa = partitions(size(P.edges),d); 449 int vb=0; 450 if (size(#)>0){vb=#[1];} 451 int ti; 452 if (vb>0){print(size(pa));} 453 for (int j=1; j<=size(pa); j++) { 454 if ((j>=st)&(j<=en)){ 455 ti=timer; 456 //pararg[j]=list(propagator(G,pa[j])); 457 re[j]=gromovWitten(propagator(P,pa[j])); 458 ti=timer-ti; 459 if (vb>0){print(string(j)+" / "+string(size(pa))+" "+string(pa[j])+" "+string(re[j])+" "+string(lsum(re))+" "+string(ti));} 460 } else {re[j]=s;} 461 } 462 //list re = parallelWaitAll("gromovWitten", pararg, list(list(list(2)))); 463 return(re); 459 number s =0; 460 list pararg; 461 list re; 462 list pa = partitions(size(P.edges),d); 463 int vb=0; 464 if (size(#)>0){vb=#[1];} 465 int ti; 466 if (vb>0){print(size(pa));} 467 for (int j=1; j<=size(pa); j++) 468 { 469 if ((j>=st)&(j<=en)) 470 { 471 ti=timer; 472 //pararg[j]=list(propagator(G,pa[j])); 473 re[j]=gromovWitten(propagator(P,pa[j])); 474 ti=timer-ti; 475 if (vb>0){print(string(j)+" / "+string(size(pa))+" "+string(pa[j])+" "+string(re[j])+" "+string(lsum(re))+" "+string(ti));} 476 } 477 else 478 {re[j]=s;} 479 } 480 //list re = parallelWaitAll("gromovWitten", pararg, list(list(list(2)))); 481 return(re); 464 482 } 465 483 example … … 471 489 computeGromovWitten(G,2,3,7,1); 472 490 } 473 474 491 475 492 proc lsum(list L) … … 485 502 { 486 503 execute(typeof(L[1])+" s"); 487 for(int j=1; j<=size(L); j++){ 488 s=s+L[j]; 489 } 490 return(s);} 504 for(int j=1; j<=size(L); j++) 505 { 506 s=s+L[j]; 507 } 508 return(s); 509 } 491 510 example 492 511 { "EXAMPLE:"; echo=2; … … 494 513 lsum(L); 495 514 } 496 497 498 515 499 516 proc generatingFunction(graph G, int d) … … 512 529 int j,jj; 513 530 list pa,L; 514 for (j=1; j<=d; j++){ 531 for (j=1; j<=d; j++) 532 { 515 533 pa = partitions(size(G.edges),j); 516 534 L = computeGromovWitten(G,j,1,size(pa)); 517 for (jj=1; jj<=size(pa); jj++) { 518 s=s+L[jj]*monomial(pa[jj]); 519 } 520 } 521 return(s);} 535 for (jj=1; jj<=size(pa); jj++) 536 { 537 s=s+L[jj]*monomial(pa[jj]); 538 } 539 } 540 return(s); 541 } 522 542 example 523 543 { "EXAMPLE:"; echo=2; -
Singular/LIB/equising.lib
rd4cec6a r7161aca 1399 1399 1400 1400 def old_ring=basering; 1401 execute("ring @myRing=("+charstr(basering)+"),("+varstr(basering)+"),ds;");1401 ring @myRing = create_ring(ringlist(basering)[1], "("+varstr(basering)+")", "ds", "no_minpoly"); 1402 1402 poly f=imap(old_ring,f); 1403 1403 -
Singular/LIB/finvar.lib
rd4cec6a r7161aca 1390 1390 poly A(1)=M[1,2]; // denominator of Molien series (for now) 1391 1391 string mp=string(minpoly); 1392 execute("ring R=("+charstr(br)+"),("+varstr(br)+"),ds;");1392 ring R = create_ring(ringlist(br)[1], "("+varstr(br)+")", "ds", "no_minpoly"); 1393 1393 if (mp!="0") 1394 1394 { -
Singular/LIB/fpaprops.lib
rb258e2a r7161aca 877 877 } 878 878 879 proc lpGkDim (ideal G)879 proc lpGkDim_lib(ideal G) 880 880 "USAGE: lpGkDim(G); G an ideal in a letterplace ring 881 881 RETURN: int -
Singular/LIB/gmssing.lib
rd4cec6a r7161aca 196 196 } 197 197 198 execute("ring G="+string(charstr(@R))+",("+s+","+varstr(@R)+"),(ws("+ 199 string(deg(highcorner(g))+2*gmsmaxdeg)+"),"+os+",c);"); 198 ring G = create_ring(string(charstr(@R)), "("+s+","+varstr(@R)+")", "(ws("+string(deg(highcorner(g))+2*gmsmaxdeg)+"),"+os+",c)"); 200 199 201 200 poly gmspoly=imap(@R,t); -
Singular/LIB/goettsche.lib
rd4cec6a r7161aca 81 81 def br@=basering; // remember the base ring 82 82 // add additional variables z@, t@ to the base ring 83 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");83 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 84 84 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 85 85 // compute the generating function by the Goettsche's formula up to degree n in t@ … … 144 144 def br@=basering; // remember the base ring 145 145 // add additional variables z@, t@ to the base ring 146 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");146 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 147 147 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 148 148 // compute the generating function by the Goettsche's formula up to degree n in t@ … … 208 208 def br@=basering; // remember the base ring 209 209 // add additional variables z@, t@ to the base ring 210 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");210 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 211 211 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 212 212 poly rez=1; … … 267 267 def br@=basering; // remember the base ring 268 268 // add additional variables z@, t@ to the base ring 269 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");269 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 270 270 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 271 271 // compute the generating function by the Nakajima-Yoshioka formula up to degree n in t@ … … 322 322 def br@=basering; // remember the base ring 323 323 // add additional variables z@, t@ to the base ring 324 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");324 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 325 325 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 326 326 // compute the generating function by the Nakajima-Yoshioka formula up to degree n in t@ … … 377 377 def br@=basering; // remember the base ring 378 378 // add additional variables z@, t@ to the base ring 379 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");379 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 380 380 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 381 381 poly rez=1; … … 434 434 def br@=basering; // remember the base ring 435 435 // add additional variables z@, t@ to the base ring 436 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");436 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 437 437 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 438 438 poly rez=1; … … 485 485 def br@=basering; // remember the base ring 486 486 // add additional variables z@, t@ to the base ring 487 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");487 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 488 488 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 489 489 poly rez=1; … … 536 536 def br@=basering; // remember the base ring 537 537 // add additional variables z@, t@ to the base ring 538 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", z@, t@), dp;");538 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", z@, t@)", "dp", "no_minpoly"); 539 539 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 540 540 poly rez=1; … … 594 594 def br@=basering; // remember the base ring 595 595 // add additional variable t@ to the base ring 596 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", t@), dp;");596 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", t@)", "dp", "no_minpoly"); 597 597 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 598 598 poly rez=(1-t@^2)*PPolyW(q, m, n, t@, d); … … 637 637 def br@=basering; // remember the base ring 638 638 // add additional variable t@ to the base ring 639 execute("ring r@= (" + charstr(basering) + "),("+varstr(basering)+", t@), dp;");639 ring r@ = create_ring(ringlist(basering)[1], "("+varstr(basering)+", t@)", "dp", "no_minpoly"); 640 640 execute( "map F= br@,"+varstr(br@)+";" ); // define the corresponding inclusion of rings 641 641 poly rez=(1-t@^2)*PPolyW(q, m, n, t@, d); -
Singular/LIB/graal.lib
rd4cec6a r7161aca 210 210 { 211 211 def origin = basering; 212 execute("ring ringForGeneralPosition = ("+charstr(basering)+"),("+varstr(basering)+"),lp;");212 ring ringForGeneralPosition = create_ring(ringlist(basering)[1], "("+varstr(basering)+")", "lp", "no_minpoly"); 213 213 ideal m = fetch(origin,m); 214 214 newRing = 1; … … 358 358 else 359 359 { string pars; string vars = varstr(basering); } 360 execute("ring Q0 = ("+charstr(basering)+pars+"),("+vars+"),dp;");360 ring Q0 = create_ring("("+charstr(basering)+pars+")", "("+vars+")", "dp"); 361 361 ideal J0 = imap(Q,J); 362 362 Gr.Q0 = Q0; -
Singular/LIB/mprimdec.lib
rd4cec6a r7161aca 224 224 { 225 225 def BAS=basering; 226 execute("ring Rloc=("+charstr(basering)+","+varstr(basering)+"),dummy,(C,dp);");226 ring Rloc = create_ring("("+charstr(basering)+","+varstr(basering)+")", "dummy", "(C,dp)"); 227 227 module @N=imap(BAS, @N); 228 228 poly @q=prepareSat(@N); … … 634 634 if(size(ann)==0) 635 635 { 636 execute("ring Rloc=("+charstr(basering)+","+varstr(basering)+"),dummy,(C,dp);");636 ring Rloc = create_ring("("+charstr(basering)+","+varstr(basering)+")", "dummy", "(C,dp)"); 637 637 module @N=imap(BAS, @N); 638 638 poly @q=prepareSat(@N); … … 1424 1424 if(size(ann)==0) //check, whether ann=0 1425 1425 { 1426 execute("ring Rloc=("+charstr(basering)+","+varstr(basering)+"),dummy,(C,dp);");1426 ring Rloc = create_ring("("+charstr(basering)+","+varstr(basering)+")", "dummy", "(C,dp)"); 1427 1427 module @N=clrSBmod(imap(BAS, @N)); 1428 1428 module @M=freemodule(nrows(@N)); … … 1553 1553 ring RAU = create_ring(ringlist(basering)[1], "("+indep[@k1][@k2][1]+","+indep[@k1][@k2][2]+")", indep[@k1][@k2][3], "no_minpoly"); 1554 1554 module @N=std(imap(BAS,@N)); // the standard basis in (R[U])[A] 1555 execute("ring Rloc=("+charstr(basering)+","+indep[@k1][@k2][2]+"),("+indep[@k1][@k2][1]+"),(C,dp);");1555 ring Rloc = create_ring("("+charstr(basering)+","+indep[@k1][@k2][2]+")", "("+indep[@k1][@k2][1]+")", "(C,dp)"); 1556 1556 module @N=imap(RAU,@N); //std in lokalisierung 1557 1557 @N=clrSBmod(@N); -
Singular/LIB/numerAlg.lib
rd4cec6a r7161aca 230 230 setring W1; 231 231 number j1=jj; 232 execute("ring q=(real,0),("+varstr(S)+"),dp;");232 ring q = create_ring("(real,0)", "("+varstr(S)+")", "dp"); 233 233 ideal I=imap(W1,I); 234 234 ideal J=imap(W1,J); 235 execute("ring qq=0,("+varstr(S)+"),dp;");235 ring qq = create_ring(0, "("+varstr(S)+")", "dp"); 236 236 ideal I=imap(S,I); 237 237 ideal J=imap(S,J); … … 315 315 if((u^2)==0) 316 316 { 317 execute("ring A=(real,e-1),("+varstr(S)+",I),ds;");317 ring A = create_ring("(real,e-1)", "("+varstr(S)+",I)", "ds"); 318 318 ideal II=imap(S,J); 319 319 list rw=imap(S,rw); … … 332 332 { 333 333 int d=dim(std(J)); 334 execute("ring R=(complex,e-1,I),("+varstr(S)+"),ds;");334 ring R = create_ring("(complex,e-1,I)", "("+varstr(S)+")", "ds"); 335 335 list w=imap(S,w); 336 336 ideal II=imap(S,J); … … 355 355 if(tt==d) 356 356 { 357 execute("ring A=(complex,e,I),("+varstr(S)+"),dp;");357 ring A = create_ring("(complex,e,I)", "("+varstr(S)+")", "dp"); 358 358 t=tt; 359 359 } 360 360 else 361 361 { 362 execute("ring RR=(real,e-2),("+varstr(S)+",I),dp;");362 ring RR = create_ring("(real,e-2)", "("+varstr(S)+",I)", "dp"); 363 363 ideal II=imap(S,J); 364 364 list rw=imap(S,rw); … … 398 398 setring M; 399 399 sz1=size(SOL); 400 execute("ring RRRQ=(real,e-1),("+varstr(S)+",I),dp;");400 ring RRRQ = create_ring("(real,e-1)", "("+varstr(S)+",I)", "dp"); 401 401 ideal HH=imap(RR,HH); 402 402 if(dim(std(HH))==0) … … 413 413 if(sz1==sz2) 414 414 { 415 execute("ring A=(complex,e,I),("+varstr(S)+"),dp;");415 ring A = create_ring("(complex,e,I)", "("+varstr(S)+")", "dp"); 416 416 t=d; 417 417 } 418 418 else 419 419 { 420 execute("ring RQ=(real,e-1),("+varstr(S)+"),dp;");420 ring RQ = create_ring("(real,e-1)", "("+varstr(S)+")", "dp"); 421 421 ideal II=imap(S,J); 422 422 def RW=WitSet(II); … … 448 448 if((ni+nr)<1/10^(2*e-3)) 449 449 { 450 execute("ring A=(complex,e,I),("+varstr(S)+"),dp;");450 ring A = create_ring("(complex,e,I)", "("+varstr(S)+")", "dp"); 451 451 list W(ii)=imap(RW,W(ii)); 452 452 t=0; … … 459 459 { 460 460 def SS=Singular2bertini(W(ii)); 461 execute("ring D=(complex,e,I),("+varstr(S)+",s,gamma),dp;");461 ring D = create_ring("(complex,e,I)", "("+varstr(S)+",s,gamma)", "dp"); 462 462 string nonsin; 463 463 ideal H,L; … … 504 504 if(tr<=1/10^(2*e-3)) 505 505 { 506 execute("ring A=(complex,e,I),("+varstr(S)+"),dp;");506 ring A = create_ring("(complex,e,I)", "("+varstr(S)+")", "dp"); 507 507 t=ii; 508 508 ii=d+1; -
Singular/LIB/numerDecom.lib
rd4cec6a r7161aca 349 349 if((n-rn)!=dd) 350 350 { 351 execute("ring R=0,("+varstr(S)+",z(1..dd)),dp;"); 351 list l2 = ringlist(S)[2]; 352 for (int ii = 1; ii <= dd; ii++) 353 { 354 l2[size(l2)+1] = "z("+string(ii)+")"; 355 } 356 ring R = create_ring(0, l2, "dp"); 352 357 ideal I=imap(rs,I); 353 358 ideal H(0..n),L,LL,L(1..dd),LL(1..dd),h(1..dd),N(0..dd); … … 483 488 { 484 489 int w(q-1)=0; 485 execute("ring D(q)=(0,s,gamma),("+varstr(S)+",z(1..q)),dp;"); 490 list l2 = ringlist(S)[2]; 491 for (int ii = 1; ii <= q; ii++) 492 { 493 l2[size(l2)+1] = "z("+string(ii)+")"; 494 } 495 ring D(q) = create_ring("(0,s,gamma)", l2, "dp"); 486 496 string nonsin(q),stnonsin(q); 487 497 ideal H(1..q); … … 579 589 for(qq=q-1;qq>=1;qq--) 580 590 { 581 execute("ring T(qq)=(complex,16,I),("+varstr(S)+",z(1..qq)),dp;"); 591 list l2 = ringlist(S)[2]; 592 for (int ii = 1; ii <= qq; ii++) 593 { 594 l2[size(l2)+1] = "z("+string(ii)+")"; 595 } 596 ring T(qq) = create_ring("(complex,16,I)", l2, "dp"); 582 597 list W(qq-1)=var(1); 583 598 } … … 591 606 { 592 607 int w(qq-1); 593 execute("ring T(qq)=(complex,16,I),("+varstr(S)+",z(1..qq)),dp;"); 608 list l2 = ringlist(S)[2]; 609 for (int ii = 1; ii <= qq; ii++) 610 { 611 l2[size(l2)+1] = "z("+string(ii)+")"; 612 } 613 ring T(qq) = create_ring("(complex,16,I)", l2, "dp"); 594 614 list W(qq-1)=var(1); 595 615 } … … 600 620 for(qq=q;qq>=1;qq--) 601 621 { 602 execute("ring T(qq)=(complex,16,I),("+varstr(S)+",z(1..qq)),dp;"); 622 list l2 = ringlist(S)[2]; 623 for (int ii = 1; ii <= qq; ii++) 624 { 625 l2[size(l2)+1] = "z("+string(ii)+")"; 626 } 627 ring T(qq) = create_ring("(complex,16,I)", l2, "dp"); 603 628 list W(qq-1)=var(1); 604 629 } … … 1951 1976 export(J(i)); 1952 1977 } 1953 execute("ring RR=0,(x(1..n),"+varstr(S)+"),dp;"); 1978 list l2; 1979 for (int ii = 1; ii <= n; ii++) 1980 { 1981 l2[ii] = "x("+string(ii)+")"; 1982 } 1983 l2 = l2+ringlist(S)[2]; 1984 ring RR = create_ring(0, l2, "dp"); 1954 1985 for(i=1;i<=d;i++) 1955 1986 { … … 1995 2026 int zc=size(D(d)); 1996 2027 export(zc); 1997 execute("ring DR=0,("+varstr(S)+",x(1..zc)),dp;"); 2028 list l2 = ringlist(S)[2]; 2029 for (int ii = 1; ii <= zc; ii++) 2030 { 2031 l2[size(l2)+1] = "x("+string(ii)+")"; 2032 } 2033 ring DR = create_ring(0, l2, "dp"); 1998 2034 matrix TT(d)=imap(R,TT(d)); 1999 2035 ideal I=imap(S,I); -
Singular/LIB/paraplanecurves.lib
rd4cec6a r7161aca 1616 1616 poly p=beta(p); 1617 1617 1618 execute("ring C=("+charstr(S)+",a),("+varstr(S)+"),ds;");1618 ring C = create_ring("("+charstr(S)+",a)", "("+varstr(S)+")", "ds"); 1619 1619 number p=number(imap(B,p)); 1620 1620 minpoly=p; -
Singular/LIB/polymake.lib
rd4cec6a r7161aca 135 135 LIB "customstd.so"; 136 136 LIB "gfanlib.so"; 137 LIB "polymake.so";137 load("polymake.so","try"); 138 138 option(set,save); 139 139 } -
Singular/LIB/primitiv.lib
rd4cec6a r7161aca 341 341 342 342 //---------------- Minimalpolynom in ein Polynom umwandeln: ----------------- 343 execute("ring splt2="+charakt+","+algname+",dp;");343 ring splt2 = create_ring(charakt, algname, "dp"); 344 344 execute("poly mipol="+minp+";"); 345 345 // f ist Polynom in algname und einer weiteren Variablen -> mache f bivariat: 346 execute("ring splt3="+charakt+",("+algname+","+varnames+"),dp;");346 ring splt3 = create_ring(charakt, "("+algname+","+varnames+")", "dp"); 347 347 poly f=imap(altring,f); 348 348 349 349 //-------------- Vorbereitung des Aufrufes von primitive: ------------------- 350 execute("ring splt1="+charakt+",(x,y),dp;");350 ring splt1 = create_ring(charakt, "(x,y)", "dp"); 351 351 ideal abbnach=x; 352 352 for (i=1; i<=anzvar; i++) { abbnach=abbnach,y; } … … 364 364 if (printlevel > -1) { "// new minimal polynomial:",minp; } 365 365 //--------------------- definiere den neuen Ring: --------------------------- 366 execute("ring neuring = ("+charakt+","+algname+"),("+varnames+"),(" 367 +ordstr(altring)+");"); 366 ring neuring = create_ring("("+charakt+","+algname+")", "("+varnames+")", "("+ordstr(altring)+")"); 368 367 execute("minpoly="+minp+";"); 369 368 -
Singular/LIB/resolve.lib
rd4cec6a r7161aca 396 396 laM=subst(laM,var(templist[4][j]),0); 397 397 } 398 execute("ring Rnew=("+charstr(basering)+"),("+string(templist[1])+"),dp;");398 ring Rnew = create_ring(ringlist(basering)[1], "("+string(templist[1])+")", "dp", "no_minpoly"); 399 399 ideal Jnew=imap(R,Jsub); 400 400 ideal eD=imap(R,Esub); … … 639 639 v=N[4]; 640 640 for(j=1;j<=size(v);j++){BO[5]=subst(BO[5],var(v[j]),0);} 641 execute("ring R1=("+charstr(R0)+"),("+newvar+"),dp;");641 ring R1 = create_ring(ringlist(R0)[1], "("+newvar+")", "dp", "no_minpoly"); 642 642 list BO=imap(R0,BO); 643 643 ideal C=imap(R0,C); … … 1115 1115 laM=subst(laM,var(v[j]),0); 1116 1116 } 1117 execute("ring R2=("+charstr(S)+"),("+newvar+"),dp;");1117 ring R2 = create_ring(ringlist(S)[1], "("+newvar+")", "dp", "no_minpoly"); 1118 1118 list BO=imap(S,B); 1119 1119 ideal laM=imap(S,laM); … … 2984 2984 //--- hypersurface is V(@f) 2985 2985 @f=Jb[fvec[i]]; 2986 execute("ring R1=("+charstr(R)+"),(@y,"+varstr(R)+"),dp;");2986 ring R1 = create_ring(ringlist(R)[1], "(@y,"+varstr(R)+")", "dp", "no_minpoly"); 2987 2987 poly p=imap(R,@p); 2988 2988 poly f=imap(R,@f); … … 4233 4233 kill tr,L; 4234 4234 } 4235 execute("ring R1=("+charstr(S)+"),(@z,"+varstr(S)+"),dp;");4235 ring R1 = create_ring(ringlist(S)[1], "(@z,"+varstr(S)+")", "dp", "no_minpoly"); 4236 4236 poly p=imap(S,@p); 4237 4237 list BO=imap(S,BO); … … 4800 4800 { 4801 4801 string newvar=string(N[1]); 4802 execute("ring R1=("+charstr(R)+"),("+newvar+"),dp;");4802 ring R1 = create_ring(ringlist(R)[1], "("+newvar+")", "dp", "no_minpoly"); 4803 4803 list BO=imap(R,BO); 4804 4804 ideal cent=imap(R,cent); -
Singular/LIB/rinvar.lib
rd4cec6a r7161aca 658 658 minPoly = string(minpoly); 659 659 } 660 execute("ring RA1=0,(" + varstr(basering) + "," + parName + "), lp;");660 ring RA1 = create_ring(0, "(" + varstr(basering) + "," + parName + ")", "lp"); 661 661 if (minPoly!="0") { execute("ideal mpoly = std(" + minPoly + ");"); } 662 662 ideal I = imap(RIRR,invarsGens); … … 962 962 minPoly = string(minpoly); 963 963 } 964 execute("ring RA1=0,(" + varstr(basering) + "," + parName + "), lp;");964 ring RA1 = create_ring(0, "(" + varstr(basering) + "," + parName + ")", "lp"); 965 965 if (minPoly!="0") { execute("ideal mpoly = std(" + minPoly + ");"); } 966 966 ideal Grp = imap(ROBR,Grp); -
Singular/LIB/rwalk.lib
rd4cec6a r7161aca 209 209 int printout=0; 210 210 def xR = basering; 211 execute("ring ostR = "+charstr(xR)+",("+varstr(xR)+"),"+ord_str+";");211 ring ostR = create_ring(ringlist(xR)[1], "("+varstr(xR)+")", ord_str, "no_minpoly"); 212 212 def old_ring = basering; 213 213 … … 261 261 int printout=0; 262 262 def xR = basering; 263 execute("ring ostR = ("+charstr(xR)+"),("+varstr(xR)+"),"+ord_str+";");263 ring ostR = create_ring(ringlist(xR)[1], "("+varstr(xR)+")", ord_str, "no_minpoly"); 264 264 def old_ring = basering; 265 265 … … 310 310 def xR = basering; 311 311 312 execute("ring ostR = ("+charstr(xR)+"),("+varstr(xR)+"),"+ord_str+";");312 ring ostR = create_ring(ringlist(xR)[1], "("+varstr(xR)+")", ord_str, "no_minpoly"); 313 313 def old_ring = basering; 314 314 //print("//** help ring = " + string(basering)); -
Singular/LIB/sing.lib
rd4cec6a r7161aca 1076 1076 int ii; 1077 1077 def bas = basering; 1078 execute("ring @r_locstd 1079 =("+charstr(bas)+"),(@t@,"+varstr(bas)+"),(dp(1),dp);"); 1078 ring @r_locstd = create_ring(ringlist(bas)[1], "(@t@,"+varstr(bas)+")", "(dp(1),dp)", "no_minpoly"); 1080 1079 ideal @id = imap(bas,id); 1081 1080 ideal @hid = homog(@id,@t@); -
Singular/LIB/solve.lib
rd4cec6a r7161aca 700 700 if (oldr!=1) 701 701 { 702 execute("ring rinC =(complex,"+string(outprec)+ 703 "),("+varstr(basering)+"),lp;"); 702 ring rinC = create_ring("(complex,"+string(outprec)+")", "("+varstr(basering)+")", "lp"); 704 703 list SOL; 705 704 if (mu==0){SOL[1] = zerolist(nv);} … … 771 770 if (oldr!=1) 772 771 { 773 execute("ring rinC =(complex,"+string(outprec)+"),("+varstr(basering)+"),lp;");772 ring rinC = create_ring("(complex,"+string(outprec)+")", "("+varstr(basering)+")", "lp"); 774 773 list SOL; 775 774 for (ii=1; ii<=size(L); ii++ ) { execute("SOL[ii]=number("+L[ii]+");"); } … … 800 799 else 801 800 { 802 execute("ring internC=(complex,"+string(prec)+"),("+varstr(basering)+"),lp;");801 ring internC = create_ring("(complex,"+string(prec)+")", "("+varstr(basering)+")", "lp"); 803 802 ideal H = imap(hr,H); 804 803 list sp = splittolist(splitsqrfree(H[1],var(1))); … … 812 811 if (oldr!=1) 813 812 { 814 execute("ring rinC =(complex,"+string(outprec)+"),("+varstr(basering)+"),lp;");813 ring rinC = create_ring("(complex,"+string(outprec)+")", "("+varstr(basering)+")", "lp"); 815 814 list SOL; 816 815 list sp=imap(internC,sp); … … 878 877 if (outprec<prec) 879 878 { 880 execute("ring internC=(complex,"+string(prec)+"),("+varstr(hr)+"),lp;");879 ring internC = create_ring("(complex,"+string(prec)+")", "("+varstr(hr)+")", "lp"); 881 880 } 882 881 else 883 882 { 884 execute("ring rinC =(complex,"+string(outprec)+"),("+varstr(basering)+"),lp;");883 ring rinC = create_ring("(complex,"+string(outprec)+")", "("+varstr(basering)+")", "lp"); 885 884 } 886 885 list triC = imap(hr,sp); … … 941 940 if (oldr!=1) 942 941 { 943 execute("ring rinC =(complex,"+string(outprec)+"),("+varstr(basering)+"),lp;");942 ring rinC = create_ring("(complex,"+string(outprec)+")", "("+varstr(basering)+")", "lp"); 944 943 list SOL=imap(internC,ret1); 945 944 export SOL; … … 1436 1435 int ii,jj; 1437 1436 int nv=size(LL[1]); 1438 execute("ring rinC =(complex,"+string(prec)+",I),(" 1439 +varstr(basering)+"),lp;"); 1437 ring rinC = create_ring("(complex,"+string(prec)+",I)", "("+varstr(basering)+")", "lp"); 1440 1438 list SOL,SOLnew; 1441 1439 for (ii=1; ii<=sizeLL; ii++) -
Singular/LIB/standard.lib
rd4cec6a r7161aca 2517 2517 static proc parse_L1(string l1) 2518 2518 { 2519 if (find(l1, "(", 1) == 0) // no parentheses 2520 { 2521 return(int(l1)); 2522 } 2523 list tokens = tuple_to_tokens(l1); 2519 list tokens; 2520 if (l1[1] != "(") 2521 { 2522 tokens[1] = l1; 2523 } 2524 else 2525 { 2526 tokens = tuple_to_tokens(l1); 2527 } 2528 if (tokens[1] == "real") 2529 { 2530 int p1 = 6; 2531 int p2 = 6; 2532 if (size(tokens) > 1) 2533 { 2534 p1 = int(tokens[2]); 2535 p2 = p1; 2536 } 2537 if (size(tokens) > 2) 2538 { 2539 p2 = int(tokens[3]); 2540 } 2541 return(list(0, list(p1, p2))); 2542 } 2543 if (tokens[1] == "complex") 2544 { 2545 int p1 = 6; 2546 int p2 = 6; 2547 string imag_unit = "i"; 2548 if (int(tokens[size(tokens)]) == 0) // not an integer 2549 { 2550 imag_unit = tokens[size(tokens)]; 2551 tokens = delete(tokens, size(tokens)); 2552 } 2553 if (size(tokens) > 1) 2554 { 2555 p1 = int(tokens[2]); 2556 p2 = p1; 2557 } 2558 if (size(tokens) > 2) 2559 { 2560 p2 = int(tokens[3]); 2561 } 2562 return(list(0, list(p1, p2), imag_unit)); 2563 } 2524 2564 if (size(tokens) == 1) 2525 2565 { 2526 2566 return(int(tokens[1])); 2527 2567 } 2528 2568 list L = int(tokens[1]); … … 2537 2577 if (v[1, 4] == "var(" && defined(basering)) 2538 2578 { 2539 2540 2579 int i = int(v[5,size(v)-5]); 2580 v = ringlist(basering)[2][i]; 2541 2581 } 2542 2582 return(v); … … 2550 2590 static proc parse_L2(string l2) 2551 2591 { 2552 if ( find(l2, "(", 1) == 0) // no parentheses2553 { 2554 2592 if (l2[1] != "(") 2593 { 2594 return(list(parse_var(l2))); 2555 2595 } 2556 2596 list V = tuple_to_tokens(l2); 2557 2597 for (int i = size(V); i > 0; i--) 2558 2598 { 2559 2599 V[i] = parse_var(V[i]); 2560 2600 } 2561 2601 return(V); … … 2572 2612 { 2573 2613 string name; 2574 intvec w;2575 2614 int b1 = find(ordering, "(", 1); 2576 2615 if (b1 == 0) // no parentheses … … 2579 2618 if (name == "C" || name == "c") 2580 2619 { 2581 w = intvec(0);2620 intvec w = intvec(0); 2582 2621 } 2583 2622 else 2584 2623 { 2585 w = 1:n_vars;2624 intvec w = 1:n_vars; 2586 2625 } 2587 2626 } … … 2593 2632 if (c == 0) 2594 2633 { 2595 w = 1:int(ordering[b1+1, b2-b1-1]); 2634 if (name == "L") 2635 { 2636 int w = int(ordering[b1+1, b2-b1-1]); 2637 } 2638 if (name == "wp" || name == "Wp" || name == "ws" || name == "Ws" 2639 || name == "a") 2640 { 2641 intvec w = int(ordering[b1+1, b2-b1-1]); 2642 } 2643 if (!defined(w)) // else 2644 { 2645 intvec w = 1:int(ordering[b1+1, b2-b1-1]); 2646 } 2596 2647 } 2597 2648 else 2598 2649 { 2599 2650 list W = tuple_to_tokens(ordering[b1, b2-b1+1]); 2600 w = intvec(int(W[1..size(W)]));2651 intvec w = intvec(int(W[1..size(W)])); 2601 2652 } 2602 2653 } -
Singular/LIB/surfex/Singular/surfex.lib
rd4cec6a r7161aca 298 298 string str_num_mp = "number "+parstr(1)+"="+ 299 299 decstr2ratstr(rootminpoly())+";"; 300 execute("ring Iring = 0,(" 301 // +string(coords)+","+str_para+"),dp;"); 302 +string(coords)+"),dp;"); 300 ring Iring = create_ring(0, "("+string(coords)+")", "dp"); 303 301 basering; 304 302 execute(str_num_mp); … … 320 318 string str_tmp_l = "ideal eqd_tmp = "+string(tmp_l)+";"; 321 319 def cur_ring = basering; 322 execute("ring Iring = (real,30),("+string(coords)+"),("+ordstr(oring)+");");320 ring Iring = create_ring("(real,30)", "("+string(coords)+")", "("+ordstr(oring)+")"); 323 321 // basering; 324 322 execute(str_I); … … 1011 1009 if(minp==1) { 1012 1010 // switch to a ring without minimal polynomial: 1013 execute("ring rr = (real,30,30),("+varstr(base)+"), dp;");1011 ring rr = create_ring("(real,30,30)", "("+varstr(base)+")", "dp"); 1014 1012 // rr; 1015 1013 // "str_I",str_I; … … 1032 1030 if(n-params==3) { 1033 1031 p=cleardenom(p); 1034 execute("ring rr = (real,30,30),("+varstr(base)+","+parstr(base)+"), dp;");1032 ring rr = create_ring("(real,30,30)", "("+varstr(base)+","+parstr(base)+")", "dp"); 1035 1033 rr; 1036 1034 "str_I",str_I; -
Singular/LIB/tropical.lib
rd4cec6a r7161aca 340 340 if (nvars(basering)==2) 341 341 { 342 ring BASERING = create_ring(ringlist(ALTERRING)[1], "(t,x(1))", "("+ordstr(ALTERRING)+")", "no_minpoly");342 execute("ring BASERING=("+charstr(ALTERRING)+"),(t,x(1)),("+ordstr(ALTERRING)+");"); 343 343 } 344 344 else … … 470 470 variablen=variablen+var(j); 471 471 } 472 ring GRUNDRING = create_ring(ringlist(basering)[1], "("+string(variablen)+",t)", "(dp("+string(nvars(basering)-1)+"),lp(1))", "no_minpoly");472 execute("ring GRUNDRING=("+charstr(basering)+"),("+string(variablen)+",t),(dp("+string(nvars(basering)-1)+"),lp(1));"); 473 473 ideal variablen; 474 474 for (j=1;j<=nvars(basering)-1;j++) … … 573 573 // from LIFTRING are present, 574 574 // and where also the variables of CUTDOWNRING live 575 ring REPLACEMENTRING = create_ring(ringlist(LIFTRING)[1], "("+varstr(CUTDOWNRING)+")", "dp", "no_minpoly");575 execute("ring REPLACEMENTRING=("+charstr(LIFTRING)+"),("+varstr(CUTDOWNRING)+"),dp;"); 576 576 list repl=imap(CUTDOWNRING,repl); // get the replacement rules 577 577 // from CUTDOWNRING … … 1069 1069 poly mp=minpoly; 1070 1070 def OLDRING=basering; 1071 ring NEWRING = create_ring(0, "("+varstr(basering)+","+parstr(basering)+")", "ds");1071 execute("ring NEWRING=0,("+varstr(basering)+","+parstr(basering)+"),ds;"); 1072 1072 ideal I=imap(OLDRING,mp),imap(OLDRING,f); 1073 1073 } … … 1717 1717 { 1718 1718 string polynomstring=string(f); 1719 ring drawring = create_ring("(0,"+parstr(basering)+")", "("+varstr(basering)+")", "dp");1719 execute("ring drawring=(0,"+parstr(basering)+"),("+varstr(basering)+"),dp;"); 1720 1720 execute("poly f="+polynomstring+";"); 1721 1721 } … … 2652 2652 } 2653 2653 // we want to homogenise the ideal i .... 2654 ring HOMOGRING = create_ring(ringlist(basering)[1], "(@s,"+string(variablen)+")", "dp", "no_minpoly");2654 execute("ring HOMOGRING=("+charstr(basering)+"),(@s,"+string(variablen)+"),dp;"); 2655 2655 ideal i=homog(std(imap(BASERING,i)),@s); 2656 2656 // ... and compute a standard basis with … … 2667 2667 } 2668 2668 intmat O=weightVectorToOrderMatrix(whomog); 2669 ring WEIGHTRING = create_ring(ringlist(basering)[1], "("+varstr(basering)+")", "(M("+string(O)+"))", "no_minpoly");2669 execute("ring WEIGHTRING=("+charstr(basering)+"),("+varstr(basering)+"),(M("+string(O)+"));"); 2670 2670 // map i to the new ring and compute a GB of i, then dehomogenise i, 2671 2671 // so that we can be sure, that the … … 2674 2674 // compute the w-initial ideal with the help of the procedure tInitialForm; 2675 2675 setring BASERING; 2676 ring COMPINIRING = create_ring(ringlist(basering)[1], "("+string(variablen)+")", "dp", "no_minpoly");2676 execute("ring COMPINIRING=("+charstr(basering)+"),("+string(variablen)+"),dp;"); 2677 2677 ideal i=imap(WEIGHTRING,i); 2678 2678 ideal ini; … … 2711 2711 def BASERING=basering; 2712 2712 intmat O=weightVectorToOrderMatrix(w); 2713 ring INITIALRING = create_ring(ringlist(BASERING)[1], "("+varstr(basering)+")", "M("+string(O)+")", "no_minpoly");2713 execute("ring INITIALRING=("+charstr(BASERING)+"),("+varstr(basering)+"),M("+string(O)+");"); 2714 2714 poly f=imap(BASERING,f); 2715 2715 int GRAD=deg(f); … … 2784 2784 def BASERING=basering; 2785 2785 intmat O=weightVectorToOrderMatrix(w); 2786 ring INITIALRING = create_ring(ringlist(BASERING)[1], "("+varstr(basering)+")", "M("+string(O)+")", "no_minpoly");2786 execute("ring INITIALRING=("+charstr(BASERING)+"),("+varstr(basering)+"),M("+string(O)+");"); 2787 2787 ideal i=imap(BASERING,i); 2788 2788 i=std(i); … … 2834 2834 } 2835 2835 def BASERING=basering; 2836 ring PARAMETERRING = create_ring("("+string(char(basering))+")", "("+parstr(basering)+")", "ds");2836 execute("ring PARAMETERRING=("+string(char(basering))+"),("+parstr(basering)+"),ds;"); 2837 2837 poly den=imap(BASERING,den); 2838 2838 poly num=imap(BASERING,num); … … 3493 3493 { 3494 3494 def BASERING=basering; 3495 ring RADRING = create_ring(ringlist(basering)[1], "(@T,"+varstr(basering)+")", "(dp(1),"+ordstr(basering)+")", "no_minpoly");3495 execute("ring RADRING=("+charstr(basering)+"),(@T,"+varstr(basering)+"),(dp(1),"+ordstr(basering)+");"); 3496 3496 ideal I=ideal(imap(BASERING,i))+ideal(1-@T*imap(BASERING,f)); 3497 3497 if (reduce(1,std(I))==0) … … 4218 4218 // return pideal, the initial and the list ergl which tells us 4219 4219 // which variables we replaced by which form 4220 ring BASERINGLESS1 = create_ring(ringlist(BASERING)[1], "("+string(variablen)+",t)", "(dp("+string(ncols(variablen))+"),lp(1))", "no_minpoly");4220 execute("ring BASERINGLESS1=("+charstr(BASERING)+"),("+string(variablen)+",t),(dp("+string(ncols(variablen))+"),lp(1));"); 4221 4221 ideal i=imap(BASERING,pideal); 4222 4222 ideal ini=imap(BASERING,pini); //ideal ini2=tInitialIdeal(i,wvecp,1); … … 4295 4295 } 4296 4296 setring BASERING; 4297 ring BASERINGLESS2 = create_ring(ringlist(BASERING)[1], "("+string(variablen)+",t)", "(dp("+string(ncols(variablen))+"),lp(1))", "no_minpoly");4297 execute("ring BASERINGLESS2=("+charstr(BASERING)+"),("+string(variablen)+",t),(dp("+string(ncols(variablen))+"),lp(1));"); 4298 4298 // using the 0/1-vector which tells us which variables belong 4299 4299 // to the set of smallest entries of wvec … … 4643 4643 if ((numberdeletedvariables>0) and (anzahlvariablen>1)) // if only t remains, 4644 4644 { // all true variables are gone 4645 ring NEURING = create_ring(ringlist(basering)[1], "("+string(variablen)+")", "(dp("+string(size(variablen)-1)+"),lp(1))", "no_minpoly");4645 execute("ring NEURING=("+charstr(basering)+"),("+string(variablen)+"),(dp("+string(size(variablen)-1)+"),lp(1));"); 4646 4646 ideal i=imap(BASERING,i); 4647 4647 ideal gesamt_m=imap(BASERING,gesamt_m); … … 4659 4659 { 4660 4660 // pass to a ring which has variables which are suitable for gfan 4661 ring GFANRING = create_ring(ringlist(basering)[1], "(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z)", "dp", "no_minpoly");4661 execute("ring GFANRING=("+charstr(basering)+"),(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z),dp;"); 4662 4662 ideal phiideal=b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z; 4663 4663 phiideal[nvars(PREGFANRING)]=a; // map t to a … … 4829 4829 else 4830 4830 { 4831 ring PARARing = create_ring(ringlist(basering)[1], "t", "ls", "no_minpoly");4831 execute("ring PARARing=("+charstr(basering)+"),t,ls;"); 4832 4832 } 4833 4833 ideal PARA; // will contain the parametrisation … … 4917 4917 variablen=variablen+var(j); 4918 4918 } 4919 ring INITIALRING = create_ring(ringlist(basering)[1], "("+string(variablen)+")", "dp", "no_minpoly");4919 execute("ring INITIALRING=("+charstr(basering)+"),("+string(variablen)+"),dp;"); 4920 4920 ideal ini=imap(BASERING,ini); 4921 4921 // compute the associated primes of the initialideal … … 5164 5164 else 5165 5165 { 5166 ring TINRING = create_ring(ringlist(basering)[1], "("+string(variablen)+")", "dp", "no_minpoly");5166 execute("ring TINRING=("+charstr(basering)+"),("+string(variablen)+"),dp;"); 5167 5167 } 5168 5168 ideal tin=imap(BASERING,tin); … … 5543 5543 if (size(#)>0) // noAbs was used 5544 5544 { 5545 ring NOQRing = create_ring("("+string(char(LIFTRing))+")", "("+varstr(basering)+","+parstr(LIFTRing)+")", "dp");5545 execute("ring NOQRing=("+string(char(LIFTRing))+"),("+varstr(basering)+","+parstr(LIFTRing)+"),dp;"); 5546 5546 execute("qring TESTRing=std("+#[1]+");"); 5547 5547 ideal i=imap(BASERING,i); -
Singular/LIB/tropicalNewton.lib
rd4cec6a r7161aca 125 125 number c_denom = denominator(c); 126 126 number c_num = numerator(c); 127 execute("ring r_Val=0,"+string(uniformizingParameter)+",ds");127 ring r_Val = create_ring(0, string(uniformizingParameter), "ds"); 128 128 poly c_denom = imap(origin,c_denom); 129 129 poly c_num = imap(origin,c_num); -
Singular/dyn_modules/freealgebra/freealgebra.cc
rd4cec6a r7161aca 6 6 { 7 7 const short t1[]={2,RING_CMD,INT_CMD}; 8 if (iiCheckTypes(args,t1,1)) 8 const short t2[]={3,RING_CMD,INT_CMD,INT_CMD}; 9 if (iiCheckTypes(args, t2, 0) || iiCheckTypes(args, t1, 1)) 9 10 { 10 11 ring r=(ring)args->Data(); … … 33 34 return TRUE; 34 35 } 35 ring R=freeAlgebra(r,d); 36 int ncGenCount = 0; 37 if (iiCheckTypes(args,t2,0)) 38 ncGenCount = (int)(long) args->next->next->Data(); 39 ring R=freeAlgebra(r,d,ncGenCount); 36 40 res->rtyp=RING_CMD; 37 41 res->data=R; -
Singular/dyn_modules/python/Makefile.am
rd4cec6a r7161aca 51 51 python_moduledir = ${datadir}/singular/LIB 52 52 python_module_DATA = cart.py interpreter.py perf.py symm.py util.py 53 EXTRA_DIST=cart.py interpreter.py perf.py symm.py util.py -
Singular/dyn_modules/systhreads/Makefile.am
rd4cec6a r7161aca 18 18 endif 19 19 20 SOURCES = shared.cc lintree.cc bytebuf.cc thread.cc bytebuf.h lintree.h channel.h syncvar.h threadconf.h 20 SOURCES = shared.cc lintree.cc bytebuf.cc thread.cc bytebuf.h lintree.h channel.h syncvar.h threadconf.h thread.h singthreads.h 21 21 systhreads_la_SOURCES = $(SOURCES) 22 22 systhreads_la_CPPFLAGS = ${MYINCLUDES} ${P_PROCS_CPPFLAGS_COMMON} -
Singular/iparith.cc
rd4cec6a r7161aca 5153 5153 ideal v_id=(ideal)v->Data(); 5154 5154 tHomog hom=testHomog; 5155 #ifdef HAVE_SHIFTBBA 5156 if (rIsLPRing(currRing)) 5157 { 5158 if (currRing->LPncGenCount < IDELEMS(v_id)) 5159 { 5160 Werror("At least %d ncgen variables are needed for this computation.", IDELEMS(v_id)); 5161 return TRUE; 5162 } 5163 } 5164 #endif 5155 5165 if (ww!=NULL) 5156 5166 { -
Singular/ipshell.cc
rd4cec6a r7161aca 2252 2252 // R->cf->ch=0; 2253 2253 // ---------------------------------------- 2254 // 1:2254 // 0, (r1,r2) [, "i" ] 2255 2255 if (L->m[1].rtyp!=LIST_CMD) 2256 2256 { … … 2259 2259 } 2260 2260 lists LL=(lists)L->m[1].data; 2261 if (( (LL->nr!=2)2261 if ((LL->nr!=1) 2262 2262 || (LL->m[0].rtyp!=INT_CMD) 2263 2263 || (LL->m[1].rtyp!=INT_CMD)) 2264 && ((LL->nr!=1) 2265 || (LL->m[0].rtyp!=INT_CMD))) 2266 { 2267 WerrorS("invalid coeff. field description list"); 2264 { 2265 WerrorS("invalid coeff. field description list, expected list(`int`,`int`)"); 2268 2266 return; 2269 2267 } 2270 2268 int r1=(int)(long)LL->m[0].data; 2271 2269 int r2=(int)(long)LL->m[1].data; 2270 r1=si_min(r1,32767); 2271 r2=si_min(r2,32767); 2272 LongComplexInfo par; memset(&par, 0, sizeof(par)); 2273 par.float_len=r1; 2274 par.float_len2=r2; 2272 2275 if (L->nr==2) // complex 2273 R->cf = nInitChar(n_long_C, NULL); 2274 else if ((r1<=SHORT_REAL_LENGTH) 2275 && (r2<=SHORT_REAL_LENGTH)) 2276 R->cf = nInitChar(n_R, NULL); 2277 else 2278 { 2279 LongComplexInfo* p = (LongComplexInfo *)omAlloc0(sizeof(LongComplexInfo)); 2280 p->float_len=r1; 2281 p->float_len2=r2; 2282 R->cf = nInitChar(n_long_R, p); 2283 } 2284 2285 if ((r1<=SHORT_REAL_LENGTH) // should go into nInitChar 2286 && (r2<=SHORT_REAL_LENGTH)) 2287 { 2288 R->cf->float_len=SHORT_REAL_LENGTH/2; 2289 R->cf->float_len2=SHORT_REAL_LENGTH; 2290 } 2291 else 2292 { 2293 R->cf->float_len=si_min(r1,32767); 2294 R->cf->float_len2=si_min(r2,32767); 2295 } 2296 // ---------------------------------------- 2297 // 2: list (par) 2298 if (L->nr==2) 2299 { 2300 //R->cf->extRing->N=1; 2276 { 2301 2277 if (L->m[2].rtyp!=STRING_CMD) 2302 2278 { … … 2304 2280 return; 2305 2281 } 2306 //(rParameter(R))=(char**)omAlloc0(rPar(R)*sizeof(char_ptr)); 2307 rParameter(R)[0]=omStrDup((char *)L->m[2].data); 2308 } 2309 // ---------------------------------------- 2282 par.par_name=(char*)L->m[2].data; 2283 R->cf = nInitChar(n_long_C, &par); 2284 } 2285 else if ((r1<=SHORT_REAL_LENGTH) && (r2<=SHORT_REAL_LENGTH)) /* && L->nr==1*/ 2286 R->cf = nInitChar(n_R, NULL); 2287 else /* && L->nr==1*/ 2288 { 2289 R->cf = nInitChar(n_long_R, &par); 2290 } 2310 2291 } 2311 2292 -
Singular/table.h
rd4cec6a r7161aca 278 278 ,{D(jjSTD), STD_CMD, SMATRIX_CMD, SMATRIX_CMD , ALLOW_NC |ALLOW_RING} 279 279 ,{D(jjDUMMY), STRING_CMD, STRING_CMD, STRING_CMD , ALLOW_NC |ALLOW_RING} 280 ,{D(jjSYZYGY), SYZYGY_CMD, MODUL_CMD, IDEAL_CMD , ALLOW_ PLURAL|ALLOW_RING}281 ,{D(jjSYZYGY), SYZYGY_CMD, MODUL_CMD, MODUL_CMD , ALLOW_ PLURAL|ALLOW_RING}280 ,{D(jjSYZYGY), SYZYGY_CMD, MODUL_CMD, IDEAL_CMD , ALLOW_NC |ALLOW_RING} 281 ,{D(jjSYZYGY), SYZYGY_CMD, MODUL_CMD, MODUL_CMD , ALLOW_NC |ALLOW_RING} 282 282 #ifdef HAVE_PLURAL 283 283 ,{D(jjENVELOPE), ENVELOPE_CMD, RING_CMD, RING_CMD , ALLOW_PLURAL |NO_RING} -
Tst/Letterplace.lst
rb258e2a r7161aca 9 9 Manual/makeLetterplaceRing.tst 10 10 Manual/serreRelations.tst 11 Manual/lpGkDim.tst 11 12 Manual/lpKDim.tst 12 13 Manual/lpMonomialPrinting.tst … … 18 19 Manual/lpSickleDim.tst 19 20 Manual/lpHilbert.tst 21 Manual/lpLmDivisible.tst -
Tst/Manual/letterplace_std.res.gz.uu
rb258e2a r7161aca 1 begin 640 letterplace_std.res.gz 2 M'XL(",KG3EP"`VQE='1E<G!L86-E7W-T9"YR97,`39%=:X,P%(;O_16'L@N- 3 M6HS6?B`&-GIC&;MH=S>DZ$Q%$%<T97&_?B?1-KT0S7N>]SD$3Y_[[`,`*(/W 4 M[`T68A#+MBD7">#7N>D:83N)I=[`&+1<"-Y?V^*;GP=1+3O^NQQ$(:S3K`EG 5 MS:7GO"XGTV,8,>B;KH8>4@@\6WJC]^=X^ZLA5@R:3D#%:^R?RY];5R$;&R!F 6 M.+S`$5.UXK6M>=D7=N_%CH'6#`8N]*JC23?HKGC10H9E7Y+1WY"1C&Y$))$> 7 M8$"DCP\936=[[QRP@Q>VLZ<U.P:'Q#I\T3S5#N/$,,S3,%0RS"*BM7Y(U9%( 8 M5T,:BZ:N6GW'W3OF&VRE;-L@F@(TT%T4S&,-Q'F*T327RK&)J8'7]`E=Y^GX 9 :.,YWH0'3_UO]R]M@4R=YL?X!*I4F?1H"```` 1 begin 644 letterplace_std.res.gz 2 M'XL("(6:P5P"`VQE='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+TA[1-C802D)'X0`0-]@F#N.!RM-`_4E1(-8&_M*ERJ=`GJ] 116 MI:"<\HR^A'T8-"6^0$CP]O;0'[?[RG:M>E=K?=^R!%ILI)`2+L%CMOWA()K# 117 M5R;.YZQJWX?^A_6D?9YI+G3Q]J&%`8(4@<1""'JW/9_;PSD\P(H_@F=3MH`, 118 MI_Y8(&7?&/2]C(`-2EGD9^MJLU6^+&AFNS*6@G;@+=,7RN9[^>#!B3TZSQ*# 119 M?09[AKM$]]!%\*VK11I\=6.%9]@E>%N]KFH_76S'2YX!SM5GN<OKXALDI:PF 120 M%^'AV6%:DGG'6D<T</)PRY<P1"R+R+EO<I[6D9HZT$;\ZH#AG=+W[<X,UGM0 121 MC?.(>JM\*'L=D.Y;Q$L\V;2P%S4\(O>4I(Z]3$)R$AH`RRCKZ-?"CRR=H<;] 122 M&7[R#).5@8V>QK3S09Q=\=SW^;GTFKTEK>$A>5WHC._K^)V0\5TC]8:"M?K6 123 M&+!5[G7[N98<RKF\R@3/VV"6<BXX\SU2K;,<9X8]H(5U4K;/5IPH>J));3MV 124 M:\75JMDGK?U(6[(.(JEY,&^IM]-!Z6B1%ZR75EFL\BG3PY2=V(I'SSN'[1.% 125 M.`+)/*^E['M(>-,W7SP78\;I>S1S[@^KCE!=]_P(`0*5K^X^(I'@VY]*+#%? 126 M/9+R;1!%DIH_UOTK(=E>D3RU#NK7^Y&RU_"ECWV[?V3?5%CUJ:]LV,FK=E9' 127 M?1"X^-M^H\=;S5/7ZBM0OGB!-?>.O[Z7W+8WRE-_L_X;!/_[@K__]BI^^]T_ 128 +?/,_T)H[0:XP```` 10 129 ` 11 130 end -
Tst/Manual/letterplace_std.stat
rb258e2a r7161aca 1 1 >> tst_memory_0 :: 15 48675018:4114, 64 bit:4.1.1:x86_64-Linux:nepomuck:3318562 1 >> tst_memory_1 :: 15 48675018:4114, 64 bit:4.1.1:x86_64-Linux:nepomuck:21501603 1 >> tst_memory_2 :: 15 48675018:4114, 64 bit:4.1.1:x86_64-Linux:nepomuck:21912644 1 >> tst_timer_1 :: 15 48675018:4114, 64 bit:4.1.1:x86_64-Linux:nepomuck:61 1 >> tst_memory_0 :: 1556191877:4120, 64 bit:4.1.2:x86_64-Darwin:Karims-MBP.localdomain:20013576 2 1 >> tst_memory_1 :: 1556191877:4120, 64 bit:4.1.2:x86_64-Darwin:Karims-MBP.localdomain:21011760 3 1 >> tst_memory_2 :: 1556191877:4120, 64 bit:4.1.2:x86_64-Darwin:Karims-MBP.localdomain:21068800 4 1 >> tst_timer_1 :: 1556191877:4120, 64 bit:4.1.2:x86_64-Darwin:Karims-MBP.localdomain:22 -
Tst/Manual/letterplace_std.tst
rb258e2a r7161aca 1 1 LIB "tst.lib"; tst_init(); 2 2 LIB "freegb.lib"; 3 4 // 1 3 5 ring r = 0,(x,y,z),Dp; 4 6 int degree_bound = 5; … … 6 8 setring R; 7 9 ideal I = -x*y-7*y*y+3*x*x, x*y*x-y*x*y; 8 ideal J = std(I); 9 J; 10 std(I); 11 12 kill r; 13 kill R; 14 15 // 2 (c_4_1_7_W) 16 ring r = 0,(x4,x3,x2,x1),Dp; 17 def R = freeAlgebra(r, 7); 18 setring(R); 19 ideal I = x4*x4-25*x4*x2-x1*x4-6*x1*x3-9*x1*x2+x1*x1, 20 x4*x3+13*x4*x2+12*x4*x1-9*x3*x4+4*x3*x2+41*x3*x1-7*x1*x4-x1*x2, 21 x3*x3-9*x3*x2+2*x1*x4+x1*x1, 22 17*x4*x2-5*x2*x2-41*x1*x4, 23 x2*x2-13*x2*x1-4*x1*x3+2*x1*x2-x1*x1, 24 x2*x1+4*x1*x2-3*x1*x1; 25 std(I); 26 10 27 tst_status(1);$ -
Tst/Manual/makeLetterplaceRing.res.gz.uu
rd4cec6a r7161aca 1 1 begin 640 makeLetterplaceRing.res.gz 2 M'XL("$:J*%T"`VUA:V5,971T97)P;&%C95)I;F<N<F5S`*U476O;,!1]]Z\X 3 MA#[88-+::;HN9H:XH5`(@RYCKT..KSU1QS:2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10 M%>._9/3+SH^"$+S%P:13-)]TTG'2RYO]2]XP&E*R+?=BVPE-RY$GFG@R+C0[ 11 MH][E:;U/J7R:XOBH+/X_CZMSY'%]II&-^`%PCX=[%':&!R)YY_T&_C-LQ&<$ 12 "```` 12 13 ` 13 14 end -
Tst/Manual/makeLetterplaceRing.stat
rd4cec6a r7161aca 1 1 >> tst_memory_0 :: 156 2946118:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:2322802 1 >> tst_memory_1 :: 156 2946118:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:21516403 1 >> tst_memory_2 :: 156 2946118:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:21927444 1 >> tst_timer_1 :: 156 2946118:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:71 1 >> tst_memory_0 :: 1565101538:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:232264 2 1 >> tst_memory_1 :: 1565101538:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2151640 3 1 >> tst_memory_2 :: 1565101538:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2192744 4 1 >> tst_timer_1 :: 1565101538:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:6 -
Tst/Short/absfact.res.gz.uu
rd4cec6a r7161aca 1 1 begin 640 absfact.res.gz 2 M'XL(" `O%'%T"`V%B<V9A8W0N<F5S`.V<6V_;.!;'W_,IB&*`D2PI(0]OX@3V3 MP^QB%P,L]J'IVZ`IY-2>&IM-@EC=2/WT> VC9)%W1M]:=+K9*45OFS1+/__QX4 M1)&^>?/7W_Y)"&$3\H_??B6OZF5]>;^8OKJ^N%G GP(1@XKO%PZ).TNL+^TXF5 M$U)-E_/JKKY\F+U<+NNJ=N7YA+AC<=F UNBF\W;(,2JI+\KQX^(.\)F.2T#0G6 M29.W^';_Y,OK"5E^>'RNQX3ZQ')"GA[O6_)D*Q9ZU-P"R0B,FE &[.E*C!E_;7 M 6X&O3*P3A4Y'B6P@:R&]Y:.D*=KT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1IVP^1TV8 52 MCKD5QDHKP&XFM=M)J-KC`SV!0JYX)H65M%5R"1&9&;\1@)GPEX!6TUWYI]6$ 53 MUY:`7I-D5^'4M;C>_3/'0JU`@!<MC!)6-!!TYZ[=0/-3XL"!UK8K363B"^A) 54 M,[5VKK(513?<'JNU[<$>*(OLUP8*`Z7.:G*@,1@!%=_#Y)XE0)$E`3Q9>OW3 55 +Q7\!?:#A?_%,```` 56 56 ` 57 57 end -
Tst/Short/absfact.stat
rd4cec6a r7161aca 1 1 >> tst_memory_0 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:1906322 1 >> tst_memory_1 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:24862723 1 >> tst_memory_2 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:24862724 1 >> tst_timer :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:185 2 >> tst_memory_0 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:1950486 2 >> tst_memory_1 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:27402247 2 >> tst_memory_2 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:27402248 2 >> tst_timer :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:509 3 >> tst_memory_0 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:19504810 3 >> tst_memory_1 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:274022411 3 >> tst_memory_2 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:274022412 3 >> tst_timer :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:113 4 >> tst_memory_0 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:19646414 4 >> tst_memory_1 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:274022415 4 >> tst_memory_2 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:274022416 4 >> tst_timer :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:917 5 >> tst_memory_0 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:19596818 5 >> tst_memory_1 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:274022419 5 >> tst_memory_2 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:274022420 5 >> tst_timer_1 :: 156 2166539:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:831 1 >> tst_memory_0 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:192208 2 1 >> tst_memory_1 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2506752 3 1 >> tst_memory_2 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2506752 4 1 >> tst_timer :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:18 5 2 >> tst_memory_0 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:197648 6 2 >> tst_memory_1 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 7 2 >> tst_memory_2 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 8 2 >> tst_timer :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:50 9 3 >> tst_memory_0 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:197648 10 3 >> tst_memory_1 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 11 3 >> tst_memory_2 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 12 3 >> tst_timer :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2 13 4 >> tst_memory_0 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:202280 14 4 >> tst_memory_1 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 15 4 >> tst_memory_2 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 16 4 >> tst_timer :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:9 17 5 >> tst_memory_0 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:201784 18 5 >> tst_memory_1 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 19 5 >> tst_memory_2 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:2637824 20 5 >> tst_timer_1 :: 1565087159:4122, 64 bit:4.1.2:x86_64-Linux:nepomuck:83 -
Tst/Short/bug_zp.res.gz.uu
rd4cec6a r7161aca 1 1 begin 640 bug_zp.res.gz 2 M'XL(" -%LPED"`V)U9U]Z<"YR97,`E5!-3\)`$+WW5[P0#B6I"[O(AQ#6Q'@A3 M ,5[P1K19RK9.`FTSNX3*KW>KI.K1T[QY;U[FS6Q>'M?/`*3&T_H!/>^\.-"N4 M MXPV5T5I!#*EDGP\6$9MA=;8G8KT4HO2GH7SQG?C8XT.WPH,AS@;+A-0CIKI5 M :$$.OJIP,%Q8Y!4C-YFO^&/1V28"3&4!7DW&T_E,CD8R:9)]_9-IJJ\NNEC$6 M C;J1(5G@[Y&]&PZ*97*>LC_+XJ-I6D*]J;O!/Z>W\G716M(`5C+:JN]6=HEF7 7O\Z>BZ^/M6\YN3A$ZT>?0,1X.V<!````2 M'XL("$.:.5T"`V)U9U]Z<"YR97,`55#+;L(P$+S[*T:(0Y""P>99$$:J>D&J 3 M>H$;:B.3.F$E2"+;B)2OK].BM)QV=V9'L[/;W<OF#8!0>-T\H^.=YR<Z=)9L 4 M>V>D0@`3*LA'O25K*I3"X9(GMXH7YLJ=U[Y='RFT_9AC,,!5VR(&9:@LG0W( 5 MP9<E3MKF!EEID>G4E_9KT<HF'):*''8U&4WG,S$<BKB./ZN_FZ;JKJ*;053+ 6 MO@B7!7R-]*AM8(PEYRE],(O.NFX`^2&?>FPOWA>-)`G-2K"]_!U%ZS'[%V3. 7 3?W[0!+VX*)AUV3<,'@((.0$````` 8 8 ` 9 9 end -
Tst/Short/bug_zp.stat
rd4cec6a r7161aca 1 1 >> tst_memory_0 :: 15 05914065:4103, 64 bit:4.1.0:x86_64-Linux:nepomuck:835922 1 >> tst_memory_1 :: 15 05914065:4103, 64 bit:4.1.0:x86_64-Linux:nepomuck:22159363 1 >> tst_memory_2 :: 15 05914065:4103, 64 bit:4.1.0:x86_64-Linux:nepomuck:22159364 1 >> tst_timer_1 :: 15 05914065:4103, 64 bit:4.1.0:x86_64-Linux:nepomuck:01 1 >> tst_memory_0 :: 1564056131:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:85680 2 1 >> tst_memory_1 :: 1564056131:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:2150192 3 1 >> tst_memory_2 :: 1564056131:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:2191296 4 1 >> tst_timer_1 :: 1564056131:4120, 64 bit:4.1.2:x86_64-Linux:nepomuck:5 -
doc/NEWS.texi
rd4cec6a r7161aca 21 21 22 22 @heading News for version @value{VERSION} 23 24 Changes in the kernel/build system: 25 @itemize 26 @item improved gcd and multiplication via FLINT 27 @end itemize 28 29 @heading News for version 4-1-2 23 30 New libraries: 24 31 @itemize -
emacs/Makefile.am
rd4cec6a r7161aca 4 4 5 5 EMACS = \ 6 ChangeLog \7 6 COPYING \ 8 NEWS \9 7 singular.el \ 10 8 singular.xpm .emacs-general .emacs-singular \ -
factory/FLINTconvert.cc
rd4cec6a r7161aca 24 24 #include "singext.h" 25 25 #include "cf_algorithm.h" 26 27 #ifdef HAVE_OMALLOC 28 #define Alloc(L) omAlloc(L) 29 #define Free(A,L) omFreeSize(A,L) 30 #else 31 #define Alloc(L) malloc(L) 32 #define Free(A,L) free(A) 33 #endif 26 34 27 35 #ifdef HAVE_FLINT … … 53 61 #include <flint/fq_nmod_mat.h> 54 62 #endif 63 #if ( __FLINT_RELEASE >= 20503) 64 #include <flint/fmpq_mpoly.h> 65 #endif 55 66 #ifdef __cplusplus 56 67 } … … 152 163 if (f.isImm ()) 153 164 { 154 fmpz_set_si (fmpq_numref (result), f.num().intval()); 155 fmpz_set_si (fmpq_denref (result), f.den().intval()); 156 } 157 else 165 fmpq_set_si (result, f.intval(), 1); 166 } 167 else if(f.inQ()) 158 168 { 159 169 mpz_t gmp_val; … … 165 175 mpz_clear (gmp_val); 166 176 } 177 else if(f.inZ()) 178 { 179 mpz_t gmp_val; 180 f.mpzval(gmp_val); 181 fmpz_set_mpz (fmpq_numref (result), gmp_val); 182 mpz_clear (gmp_val); 183 fmpz_one(fmpq_denref(result)); 184 } 185 else 186 { 187 printf("wrong type\n"); 188 } 167 189 } 168 190 … … 181 203 182 204 CanonicalForm result; 183 if (mpz_is_imm (nnum) && mpz_is_imm (nden)) 184 { 185 num= CanonicalForm (mpz_get_si(nnum)); 186 den= CanonicalForm (mpz_get_si(nden)); 187 mpz_clear (nnum); 188 mpz_clear (nden); 189 result= num/den; 190 if (!isRat) 191 Off (SW_RATIONAL); 192 return result; 205 if (mpz_is_imm (nden)) 206 { 207 if (mpz_is_imm(nnum)) 208 { 209 num= CanonicalForm (mpz_get_si(nnum)); 210 den= CanonicalForm (mpz_get_si(nden)); 211 mpz_clear (nnum); 212 mpz_clear (nden); 213 result= num/den; 214 } 215 else if (mpz_cmp_si(nden,1)==0) 216 { 217 result= CanonicalForm( CFFactory::basic(nnum)); 218 mpz_clear (nden); 219 } 220 else 221 result= CanonicalForm( CFFactory::rational( nnum, nden, false)); 193 222 } 194 223 else 195 224 { 196 result= make_cf (nnum, nden, false);197 if (!isRat)198 Off (SW_RATIONAL);199 return result;200 }225 result= CanonicalForm( CFFactory::rational( nnum, nden, false)); 226 } 227 if (!isRat) 228 Off (SW_RATIONAL); 229 return result; 201 230 } 202 231 … … 528 557 } 529 558 #endif 530 531 #endif 532 533 559 #if __FLINT_RELEASE >= 20503 560 static void convFlint_RecPP ( const CanonicalForm & f, ulong * exp, nmod_mpoly_t result, nmod_mpoly_ctx_t ctx, int N ) 561 { 562 // assume f!=0 563 if ( ! f.inCoeffDomain() ) 564 { 565 int l = f.level(); 566 for ( CFIterator i = f; i.hasTerms(); i++ ) 567 { 568 exp[N-l] = i.exp(); 569 convFlint_RecPP( i.coeff(), exp, result, ctx, N ); 570 } 571 exp[N-l] = 0; 572 } 573 else 574 { 575 int c=f.intval(); // with Off(SW_SYMMETRIC_FF): 0<=c<p 576 nmod_mpoly_push_term_ui_ui(result,c,exp,ctx); 577 } 578 } 579 580 static void convFlint_RecPP ( const CanonicalForm & f, ulong * exp, fmpq_mpoly_t result, fmpq_mpoly_ctx_t ctx, int N ) 581 { 582 // assume f!=0 583 if ( ! f.inBaseDomain() ) 584 { 585 int l = f.level(); 586 for ( CFIterator i = f; i.hasTerms(); i++ ) 587 { 588 exp[N-l] = i.exp(); 589 convFlint_RecPP( i.coeff(), exp, result, ctx, N ); 590 } 591 exp[N-l] = 0; 592 } 593 else 594 { 595 fmpq_t c; 596 fmpq_init(c); 597 convertCF2Fmpq(c,f); 598 fmpq_mpoly_push_term_fmpq_ui(result,c,exp,ctx); 599 fmpq_clear(c); 600 } 601 } 602 603 void convFactoryPFlintMP ( const CanonicalForm & f, nmod_mpoly_t res, nmod_mpoly_ctx_t ctx, int N ) 604 { 605 if (f.isZero()) return; 606 ulong * exp = (ulong*)Alloc(N*sizeof(ulong)); 607 memset(exp,0,N*sizeof(ulong)); 608 bool save_sym_ff= isOn (SW_SYMMETRIC_FF); 609 if (save_sym_ff) Off (SW_SYMMETRIC_FF); 610 convFlint_RecPP( f, exp, res, ctx, N ); 611 if (save_sym_ff) On(SW_SYMMETRIC_FF); 612 Free(exp,N*sizeof(ulong)); 613 } 614 615 void convFactoryPFlintMP ( const CanonicalForm & f, fmpq_mpoly_t res, fmpq_mpoly_ctx_t ctx, int N ) 616 { 617 if (f.isZero()) return; 618 ulong * exp = (ulong*)Alloc(N*sizeof(ulong)); 619 memset(exp,0,N*sizeof(ulong)); 620 convFlint_RecPP( f, exp, res, ctx, N ); 621 fmpq_mpoly_reduce(res,ctx); 622 Free(exp,N*sizeof(ulong)); 623 } 624 625 CanonicalForm convFlintMPFactoryP(nmod_mpoly_t f, nmod_mpoly_ctx_t ctx, int N) 626 { 627 CanonicalForm result; 628 int d=nmod_mpoly_length(f,ctx)-1; 629 ulong* exp=(ulong*)Alloc(N*sizeof(ulong)); 630 for(int i=d; i>=0; i--) 631 { 632 ulong c=nmod_mpoly_get_term_coeff_ui(f,i,ctx); 633 nmod_mpoly_get_term_exp_ui(exp,f,i,ctx); 634 CanonicalForm term=(int)c; 635 for ( int i = 0; i <N; i++ ) 636 { 637 if (exp[i]!=0) term*=CanonicalForm( Variable( N-i ), exp[i] ); 638 } 639 result+=term; 640 } 641 Free(exp,N*sizeof(ulong)); 642 return result; 643 } 644 645 CanonicalForm convFlintMPFactoryP(fmpq_mpoly_t f, fmpq_mpoly_ctx_t ctx, int N) 646 { 647 CanonicalForm result; 648 int d=fmpq_mpoly_length(f,ctx)-1; 649 ulong* exp=(ulong*)Alloc(N*sizeof(ulong)); 650 fmpq_t c; 651 fmpq_init(c); 652 for(int i=d; i>=0; i--) 653 { 654 fmpq_mpoly_get_term_coeff_fmpq(c,f,i,ctx); 655 fmpq_mpoly_get_term_exp_ui(exp,f,i,ctx); 656 CanonicalForm term=convertFmpq_t2CF(c); 657 for ( int i = 0; i <N; i++ ) 658 { 659 if (exp[i]!=0) term*=CanonicalForm( Variable( N-i ), exp[i] ); 660 } 661 result+=term; 662 } 663 fmpq_clear(c); 664 Free(exp,N*sizeof(ulong)); 665 return result; 666 } 667 668 // stolen from: 669 // https://graphics.stanford.edu/~seander/bithacks.html#IntegerLog 670 static inline int SI_LOG2(int v) 671 { 672 const unsigned int b[] = {0x2, 0xC, 0xF0, 0xFF00, 0xFFFF0000}; 673 const unsigned int S[] = {1, 2, 4, 8, 16}; 674 675 unsigned int r = 0; // result of log2(v) will go here 676 if (v & b[4]) { v >>= S[4]; r |= S[4]; } 677 if (v & b[3]) { v >>= S[3]; r |= S[3]; } 678 if (v & b[2]) { v >>= S[2]; r |= S[2]; } 679 if (v & b[1]) { v >>= S[1]; r |= S[1]; } 680 if (v & b[0]) { v >>= S[0]; r |= S[0]; } 681 return (int)r; 682 } 683 684 CanonicalForm mulFlintMP_Zp(const CanonicalForm& F,int lF, const CanonicalForm& G, int lG,int m) 685 { 686 int bits=SI_LOG2(m)+1; 687 int N=F.level(); 688 nmod_mpoly_ctx_t ctx; 689 nmod_mpoly_ctx_init(ctx,N,ORD_LEX,getCharacteristic()); 690 nmod_mpoly_t f,g,res; 691 nmod_mpoly_init3(f,lF,bits,ctx); 692 nmod_mpoly_init3(g,lG,bits,ctx); 693 convFactoryPFlintMP(F,f,ctx,N); 694 convFactoryPFlintMP(G,g,ctx,N); 695 nmod_mpoly_init(res,ctx); 696 nmod_mpoly_mul(res,f,g,ctx); 697 nmod_mpoly_clear(g,ctx); 698 nmod_mpoly_clear(f,ctx); 699 CanonicalForm RES=convFlintMPFactoryP(res,ctx,N); 700 nmod_mpoly_clear(res,ctx); 701 nmod_mpoly_ctx_clear(ctx); 702 return RES; 703 } 704 705 CanonicalForm mulFlintMP_QQ(const CanonicalForm& F,int lF, const CanonicalForm& G, int lG, int m) 706 { 707 int bits=SI_LOG2(m)+1; 708 int N=F.level(); 709 fmpq_mpoly_ctx_t ctx; 710 fmpq_mpoly_ctx_init(ctx,N,ORD_LEX); 711 fmpq_mpoly_t f,g,res; 712 fmpq_mpoly_init3(f,lF,bits,ctx); 713 fmpq_mpoly_init3(g,lG,bits,ctx); 714 convFactoryPFlintMP(F,f,ctx,N); 715 convFactoryPFlintMP(G,g,ctx,N); 716 fmpq_mpoly_init(res,ctx); 717 fmpq_mpoly_mul(res,f,g,ctx); 718 fmpq_mpoly_clear(g,ctx); 719 fmpq_mpoly_clear(f,ctx); 720 CanonicalForm RES=convFlintMPFactoryP(res,ctx,N); 721 fmpq_mpoly_clear(res,ctx); 722 fmpq_mpoly_ctx_clear(ctx); 723 return RES; 724 } 725 726 CanonicalForm gcdFlintMP_Zp(const CanonicalForm& F, const CanonicalForm& G) 727 { 728 int N=F.level(); 729 int lf,lg,m=1<<MPOLY_MIN_BITS; 730 lf=size_maxexp(F,m); 731 lg=size_maxexp(G,m); 732 int bits=SI_LOG2(m)+1; 733 nmod_mpoly_ctx_t ctx; 734 nmod_mpoly_ctx_init(ctx,N,ORD_LEX,getCharacteristic()); 735 nmod_mpoly_t f,g,res; 736 nmod_mpoly_init3(f,lf,bits,ctx); 737 nmod_mpoly_init3(g,lg,bits,ctx); 738 convFactoryPFlintMP(F,f,ctx,N); 739 convFactoryPFlintMP(G,g,ctx,N); 740 nmod_mpoly_init(res,ctx); 741 int ok=nmod_mpoly_gcd(res,f,g,ctx); 742 nmod_mpoly_clear(g,ctx); 743 nmod_mpoly_clear(f,ctx); 744 CanonicalForm RES=1; 745 if (ok) 746 { 747 RES=convFlintMPFactoryP(res,ctx,N); 748 } 749 nmod_mpoly_clear(res,ctx); 750 nmod_mpoly_ctx_clear(ctx); 751 return RES; 752 } 753 754 static CanonicalForm b_content ( const CanonicalForm & f ) 755 { 756 if ( f.inCoeffDomain() ) 757 return f; 758 else 759 { 760 CanonicalForm result = 0; 761 CFIterator i; 762 for ( i = f; i.hasTerms() && (!result.isOne()); i++ ) 763 result=bgcd( b_content(i.coeff()) , result ); 764 return result; 765 } 766 } 767 768 769 CanonicalForm gcdFlintMP_QQ(const CanonicalForm& F, const CanonicalForm& G) 770 { 771 int N=F.level(); 772 fmpq_mpoly_ctx_t ctx; 773 fmpq_mpoly_ctx_init(ctx,N,ORD_LEX); 774 fmpq_mpoly_t f,g,res; 775 fmpq_mpoly_init(f,ctx); 776 fmpq_mpoly_init(g,ctx); 777 convFactoryPFlintMP(F,f,ctx,N); 778 convFactoryPFlintMP(G,g,ctx,N); 779 fmpq_mpoly_init(res,ctx); 780 int ok=fmpq_mpoly_gcd(res,f,g,ctx); 781 fmpq_mpoly_clear(g,ctx); 782 fmpq_mpoly_clear(f,ctx); 783 CanonicalForm RES=1; 784 if (ok) 785 { 786 // Flint normalizes the gcd to be monic. 787 // Singular wants a gcd defined over ZZ that is primitive and has a positive leading coeff. 788 if (!fmpq_mpoly_is_zero(res, ctx)) 789 { 790 fmpq_t content; 791 fmpq_init(content); 792 fmpq_mpoly_content(content, res, ctx); 793 fmpq_mpoly_scalar_div_fmpq(res, res, content, ctx); 794 fmpq_clear(content); 795 } 796 RES=convFlintMPFactoryP(res,ctx,N); 797 // gcd(2x,4x) should be 2x, so RES should also have the gcd(lc(F),lc(G)) 798 RES*=bgcd(b_content(F),b_content(G)); 799 } 800 fmpq_mpoly_clear(res,ctx); 801 fmpq_mpoly_ctx_clear(ctx); 802 return RES; 803 } 804 805 #endif 806 807 #endif 808 809 -
factory/FLINTconvert.h
rd4cec6a r7161aca 250 250 251 251 252 #endif 253 #endif 252 #if __FLINT_RELEASE >= 20503 253 CanonicalForm mulFlintMP_Zp(const CanonicalForm& F,int lF, const CanonicalForm& Gi, int lG, int m); 254 CanonicalForm mulFlintMP_QQ(const CanonicalForm& F,int lF, const CanonicalForm& Gi, int lG, int m); 255 CanonicalForm gcdFlintMP_Zp(const CanonicalForm& F, const CanonicalForm& G); 256 CanonicalForm gcdFlintMP_QQ(const CanonicalForm& F, const CanonicalForm& G); 257 #endif 258 #endif 259 #endif -
factory/Makefile.am
rd4cec6a r7161aca 173 173 libfactory_includedir = ${includedir}/factory 174 174 175 nodist_libfactory_include_HEADERS = factory.h factoryconf.h globaldefs.h 175 nodist_libfactory_include_HEADERS = factory.h factoryconf.h 176 libfactory_include_HEADERS = globaldefs.h 176 177 177 178 -
factory/NTLconvert.cc
rd4cec6a r7161aca 33 33 #include "NTLconvert.h" 34 34 35 #ifdef HAVE_OMALLOC 36 #define Alloc(L) omAlloc(L) 37 #define Free(A,L) omFreeSize(A,L) 38 #else 35 39 #define Alloc(L) malloc(L) 36 40 #define Free(A,L) free(A) 41 #endif 37 42 38 43 void out_cf(const char *s1,const CanonicalForm &f,const char *s2); -
factory/canonicalform.cc
rd4cec6a r7161aca 17 17 #include "gfops.h" 18 18 #include "facMul.h" 19 #include "facAlgFuncUtil.h" 19 20 #include "FLINTconvert.h" 20 21 … … 707 708 else if ( value->level() == cf.value->level() ) { 708 709 #if (HAVE_NTL && HAVE_FLINT && __FLINT_RELEASE >= 20400) 710 #if (__FLINT_RELEASE >= 20503) 711 int l_this,l_cf,m=1; 712 if ((getCharacteristic()>0) 713 && (CFFactory::gettype() != GaloisFieldDomain) 714 &&(!hasAlgVar(*this)) 715 &&(!hasAlgVar(cf)) 716 &&((l_cf=size_maxexp(cf,m))>10) 717 &&((l_this=size_maxexp(*this,m))>10) 718 ) 719 { 720 *this=mulFlintMP_Zp(*this,l_this,cf,l_cf,m); 721 } 722 else 723 /*-----------------------------------------------------*/ 724 if ((getCharacteristic()==0) 725 &&(!hasAlgVar(*this)) 726 &&(!hasAlgVar(cf)) 727 &&((l_cf=size_maxexp(cf,m))>10) 728 &&((l_this=size_maxexp(*this,m))>10) 729 ) 730 { 731 *this=mulFlintMP_QQ(*this,l_this,cf,l_cf,m); 732 } 733 else 734 #endif 735 709 736 if (value->levelcoeff() == cf.value->levelcoeff() && cf.isUnivariate() && (*this).isUnivariate()) 710 737 { -
factory/cf_char.cc
rd4cec6a r7161aca 33 33 theDegree = 1; 34 34 CFFactory::settype( FiniteFieldDomain ); 35 ff_big = c > cf_getSmallPrime( cf_getNumSmallPrimes()-1 ); 36 if (c!=theCharacteristic) 37 { 38 if (c > 536870909) factoryError("characteristic is too large(max is 2^29)"); 39 ff_setprime( c ); 40 } 35 41 theCharacteristic = c; 36 ff_big = c > cf_getSmallPrime( cf_getNumSmallPrimes()-1 );37 if (c > 536870909) factoryError("characteristic is too large(max is 2^29)");38 ff_setprime( c );39 42 } 40 43 } -
factory/cf_gcd.cc
rd4cec6a r7161aca 26 26 #include "cfSubResGcd.h" 27 27 #include "cfModGcd.h" 28 #include "FLINTconvert.h" 28 29 #include "facAlgFuncUtil.h" 29 30 … … 100 101 if ( getCharacteristic() != 0 ) 101 102 { 103 #if defined(HAVE_FLINT) && ( __FLINT_RELEASE >= 20503) 104 if ( isOn( SW_USE_FL_GCD_P) 105 && (CFFactory::gettype() != GaloisFieldDomain) 106 && (getCharacteristic()>10) 107 &&(!hasAlgVar(fc)) && (!hasAlgVar(gc))) 108 { 109 return gcdFlintMP_Zp(fc,gc); 110 } 111 #endif 102 112 #ifdef HAVE_NTL 103 113 if ((!fc_and_gc_Univariate) && (isOn( SW_USE_EZGCD_P ))) … … 119 129 fc = subResGCD_p( fc, gc ); 120 130 } 121 else if (!fc_and_gc_Univariate) 131 else if (!fc_and_gc_Univariate) /* && char==0*/ 122 132 { 133 #if defined(HAVE_FLINT) && ( __FLINT_RELEASE >= 20503) 134 if (( isOn( SW_USE_FL_GCD_0) ) 135 &&(!hasAlgVar(fc)) && (!hasAlgVar(gc))) 136 { 137 return gcdFlintMP_QQ(fc,gc); 138 } 139 else 140 #endif 123 141 if ( isOn( SW_USE_EZGCD ) ) 124 142 fc= ezgcd (fc, gc); 125 #ifdef HAVE_NTL143 #ifdef HAVE_NTL 126 144 else if (isOn(SW_USE_CHINREM_GCD)) 127 145 fc = modGCDZ( fc, gc); 128 #endif146 #endif 129 147 else 130 148 { … … 311 329 CanonicalForm cdF = bCommonDen( f ); 312 330 CanonicalForm cdG = bCommonDen( g ); 331 CanonicalForm F = f * cdF, G = g * cdG; 313 332 Off( SW_RATIONAL ); 314 CanonicalForm l = lcm( cdF, cdG ); 315 On( SW_RATIONAL ); 316 CanonicalForm F = f * l, G = g * l; 317 Off( SW_RATIONAL ); 318 l = gcd_poly( F, G ); 333 CanonicalForm l = gcd_poly( F, G ); 319 334 On( SW_RATIONAL ); 320 335 return abs( l ); -
factory/cf_inline.cc
rd4cec6a r7161aca 143 143 CF_INLINE 144 144 CanonicalForm::CanonicalForm ( const int i ) 145 : value( CFFactory::basic( ( constlong)i ) )145 : value( CFFactory::basic( (long)i ) ) 146 146 { 147 147 } -
factory/cf_switches.cc
rd4cec6a r7161aca 32 32 #ifdef HAVE_NTL 33 33 On(SW_USE_CHINREM_GCD); 34 //Off(SW_USE_NTL_SORT); 34 On(SW_USE_NTL_SORT); 35 #endif 36 #ifdef HAVE_FLINT 35 37 On(SW_USE_FL_GCD_P); 36 //On(SW_USE_FL_GCD_0);38 On(SW_USE_FL_GCD_0); 37 39 #endif 38 40 On(SW_USE_EZGCD); -
factory/facFqBivar.cc
rd4cec6a r7161aca 6883 6883 #ifdef HAVE_FLINT 6884 6884 nmod_mat_t FLINTN; 6885 #else 6885 #endif 6886 6886 6887 if (fac_NTL_char != getCharacteristic()) 6887 6888 { … … 6890 6891 } 6891 6892 mat_zz_p NTLN; 6892 #endif6893 6893 6894 6894 if (alpha.level() != 1) … … 6898 6898 } 6899 6899 mat_zz_pE NTLNe; 6900 6900 6901 if (alpha.level() == 1) 6901 6902 { -
factory/imm.h
rd4cec6a r7161aca 165 165 { 166 166 if ( is_imm( op ) == FFMARK ) 167 { 167 168 if ( cf_glob_switches.isOn( SW_SYMMETRIC_FF ) ) 168 169 return ff_symmetric( imm2int( op ) ); 169 170 else 170 171 return imm2int( op ); 171 else if ( is_imm( op ) == GFMARK ) { 172 } 173 else if ( is_imm( op ) == GFMARK ) 174 { 172 175 ASSERT( gf_isff( imm2int( op ) ), "invalid conversion" ); 173 176 if ( cf_glob_switches.isOn( SW_SYMMETRIC_FF ) ) … … 176 179 return gf_gf2ff( imm2int( op ) ); 177 180 } 178 else181 /*else*/ 179 182 return imm2int( op ); 180 183 } -
kernel/GBEngine/kstd1.cc
rd4cec6a r7161aca 38 38 #include "kernel/GBEngine/kInline.h" 39 39 40 #ifdef HAVE_SHIFTBBA 41 #include "polys/shiftop.h" 42 #endif 40 43 41 44 /* the list of all options which give a warning by test */ … … 2343 2346 2344 2347 #ifdef HAVE_SHIFTBBA 2345 if(rIsLPRing(currRing)) return freegb(F, Q);2348 if(rIsLPRing(currRing)) return kStdShift(F, Q, h, w, hilb, syzComp, newIdeal, vw, FALSE); 2346 2349 #endif 2347 2350 … … 2820 2823 int newIdeal, intvec *vw, BOOLEAN rightGB) 2821 2824 { 2825 assume(rIsLPRing(currRing)); 2826 assume(idIsInV(F)); 2822 2827 ideal r; 2823 2828 BOOLEAN b=currRing->pLexOrder,toReset=FALSE; … … 2913 2918 delete(strat); 2914 2919 if ((delete_w)&&(w!=NULL)&&(*w!=NULL)) delete *w; 2920 assume(idIsInV(r)); 2915 2921 return r; 2916 2922 } -
kernel/GBEngine/kstd1.h
rd4cec6a r7161aca 42 42 int syzComp=0, int newIdeal=0, intvec *vw=NULL, BOOLEAN rightGB=FALSE); 43 43 44 ideal freegb(ideal F, ideal Q);45 44 ideal rightgb(ideal F, ideal Q); 46 45 -
kernel/GBEngine/kstd2.cc
rd4cec6a r7161aca 4520 4520 } 4521 4521 4522 4523 ideal freegb(ideal F, ideal Q) 4524 { 4525 assume(rIsLPRing(currRing)); 4526 assume(idIsInV(F)); 4527 ideal RS = kStdShift(F, Q, testHomog, NULL); 4528 idSkipZeroes(RS); // is this even necessary? 4529 assume(idIsInV(RS)); 4530 return(RS); 4531 } 4532 4522 #ifdef HAVE_SHIFTBBA 4533 4523 ideal rightgb(ideal F, ideal Q) 4534 4524 { … … 4540 4530 return(RS); 4541 4531 } 4532 #endif 4542 4533 4543 4534 /*2 -
kernel/ideals.cc
rd4cec6a r7161aca 617 617 p = h2->m[j]; 618 618 q = pOne(); 619 #ifdef HAVE_SHIFTBBA 620 // non multiplicative variable 621 if (rIsLPRing(currRing)) 622 { 623 pSetExp(q, currRing->isLPring - currRing->LPncGenCount + j + 1, 1); 624 p_Setm(q, currRing); 625 } 626 #endif 619 627 pSetComp(q,syzcomp+1+j); 620 628 pSetmComp(q); 621 629 if (p!=NULL) 622 630 { 623 while (pNext(p)) pIter(p); 624 p->next = q; 631 #ifdef HAVE_SHIFTBBA 632 if (rIsLPRing(currRing)) 633 { 634 h2->m[j] = pAdd(p, q); 635 } 636 else 637 #endif 638 { 639 while (pNext(p)) pIter(p); 640 p->next = q; 641 } 625 642 } 626 643 else … … 630 647 idTest(h2); 631 648 649 #ifdef HAVE_SHIFTBBA 650 if (rIsLPRing(currRing)) alg = GbStd; 651 #endif 632 652 ideal h3=NULL; 633 653 if (alg==GbDefault) alg=GbStd; -
kernel/mod2.h
rd4cec6a r7161aca 77 77 #endif 78 78 79 #define SINGULAR_PATCHLEVEL 079 #define SINGULAR_PATCHLEVEL 2 80 80 #define SINGULAR_VERSION ((SINGULAR_MAJOR_VERSION*1000 + SINGULAR_MINOR_VERSION*100 + SINGULAR_SUB_VERSION*10)+SINGULAR_PATCHLEVEL) 81 81 -
kernel/preimage.cc
rd4cec6a r7161aca 88 88 } 89 89 90 assume(n_SetMap(theImageRing->cf, dst_r->cf) == ndCopyMap);91 92 90 if (theImageRing->cf != dst_r->cf) 93 91 { -
libpolys/coeffs/Makefile.am
rd4cec6a r7161aca 44 44 test_LDADD = libcoeffs.la $(libcoeffs_la_LIBADD) 45 45 46 EXTRA_DIST = rintegers2.cc rinteger 3.cc46 EXTRA_DIST = rintegers2.cc rintegers3.cc -
libpolys/coeffs/rintegers2.cc
rd4cec6a r7161aca 515 515 } 516 516 517 static void nrzMPZ(mpz_t res, number &a, const coeffs) 518 { 519 mpz_init_set(res, (mpz_ptr) a); 520 } 521 517 522 static number nrzFarey(number r, number N, const coeffs R) 518 523 { … … 621 626 r->cfInit = nrzInit; 622 627 r->cfInitMPZ = nrzInitMPZ; 628 r->cfMPZ = nrzMPZ; 623 629 r->cfSize = nrzSize; 624 630 r->cfInt = nrzInt; -
libpolys/polys/clapconv.cc
rd4cec6a r7161aca 87 87 p1=p; 88 88 l=l/2; 89 while(l> 0) { p=pNext(p); l--; }89 while(l>1) { p=pNext(p); l--; } 90 90 p2=pNext(p); 91 91 pNext(p)=NULL; … … 101 101 102 102 #define MIN_CONV_LEN 7 103 CanonicalForm convSingPFactoryP( poly p,const ring r )103 static CanonicalForm convSingPFactoryP_intern( poly p, int l, BOOLEAN & setChar,const ring r ) 104 104 { 105 105 CanonicalForm result = 0; 106 106 int e, n = rVar(r); 107 BOOLEAN setChar=TRUE; 108 109 int l; 110 if ((l=pLength(p))>MIN_CONV_LEN) 107 assume(l==pLength(p)); 108 109 if (l>MIN_CONV_LEN) 111 110 { 112 111 poly p1,p2; 113 112 convPhalf(p,l,p1,p2); 114 CanonicalForm P=convSingPFactoryP (p1,r);115 P+=convSingPFactoryP (p2,r);113 CanonicalForm P=convSingPFactoryP_intern(p1,l/2,setChar,r); 114 P+=convSingPFactoryP_intern(p2,l-l/2,setChar,r); 116 115 convPunhalf(p1,p2); 117 116 return P; 118 117 } 118 BOOLEAN setChar_loc=setChar; 119 setChar=FALSE; 119 120 while ( p!=NULL ) 120 121 { 121 CanonicalForm term=r->cf->convSingNFactoryN(pGetCoeff( p ),setChar , r->cf);122 CanonicalForm term=r->cf->convSingNFactoryN(pGetCoeff( p ),setChar_loc, r->cf); 122 123 if (errorreported) break; 123 setChar =FALSE;124 setChar_loc=FALSE; 124 125 for ( int i = 1; i <=n; i++ ) 125 126 { … … 131 132 } 132 133 return result; 134 } 135 136 CanonicalForm convSingPFactoryP( poly p, const ring r ) 137 { 138 BOOLEAN setChar=TRUE; 139 return convSingPFactoryP_intern(p,pLength(p),setChar,r); 133 140 } 134 141 -
libpolys/polys/clapsing.cc
rd4cec6a r7161aca 59 59 #ifdef HAVE_FLINT 60 60 #if __FLINT_RELEASE >= 20503 61 if (rField_is_Zp(r) && (r->cf->ch> 500))61 if (rField_is_Zp(r) && (r->cf->ch>10)) 62 62 { 63 63 nmod_mpoly_ctx_t ctx; -
libpolys/polys/flint_mpoly.cc
rd4cec6a r7161aca 65 65 #if 1 66 66 // memory allocation is not thread safe; singular polynomials must be constructed in serial 67 68 /* 69 We agree the that result of a singular -> fmpq_mpoly conversion is 70 readonly. This restricts the usage of the result in flint functions to 71 const arguments. However, the real readonly conversion is currently only 72 implemented in the threaded conversion below since it requires a scan of 73 all coefficients anyways. The _fmpq_mpoly_clear_readonly_sing needs to 74 be provided for a consistent interface in the polynomial operations. 75 */ 76 static void _fmpq_mpoly_clear_readonly_sing(fmpq_mpoly_t a, fmpq_mpoly_ctx_t ctx) 77 { 78 fmpq_mpoly_clear(a, ctx); 79 } 67 80 68 81 void convSingPFlintMP(fmpq_mpoly_t res, fmpq_mpoly_ctx_t ctx, poly p, int lp, const ring r) … … 186 199 } 187 200 201 202 /* 203 In order that flint may sometimes borrow the large integer coeffs of 204 polynomials over QQ (borrow means: simply point to the same GMP structs 205 that singular has already allocated), we define the result of a 206 singular -> fmpq_mpoly conversion to be readonly. This means we agree 207 that 208 - it can only be used as an const argument to a flint function 209 - singular must not mutate the original coeffs while the readonly object is in use 210 */ 211 212 static void _fmpq_mpoly_clear_readonly_sing(fmpq_mpoly_t a, fmpq_mpoly_ctx_t ctx) 213 { 214 if (fmpq_is_one(a->content)) 215 { 216 if (a->zpoly->alloc > 0) 217 { 218 flint_free(a->zpoly->coeffs); 219 flint_free(a->zpoly->exps); 220 } 221 222 fmpq_clear(a->content); 223 } 224 else 225 { 226 fmpq_mpoly_clear(a, ctx); 227 } 228 } 229 188 230 /* singular -> fmpq_mpoly conversion */ 189 231 … … 197 239 std::vector<poly> markers; 198 240 ring r; 199 200 convert_sing_to_fmpq_mpoly_base(slong num_threads_, fmpq_mpoly_struct * res_, 201 const fmpq_mpoly_ctx_struct * ctx_, const ring r_, poly p) 202 : num_threads(num_threads_), 241 fmpq_t content; 242 243 convert_sing_to_fmpq_mpoly_base(fmpq_mpoly_struct * res_, 244 const fmpq_mpoly_ctx_struct * ctx_, const ring r_, poly p) 245 : num_threads(0), 203 246 res(res_), 204 247 ctx(ctx_), 205 248 r(r_) 206 249 { 250 fmpq_t c; 251 fmpq_init(c); 252 fmpq_init(content); 253 fmpq_zero(content); 254 207 255 length = 0; 208 256 while (1) 209 257 { 210 258 if ((length % 4096) == 0) 259 { 260 my_convSingNFlintN_QQ(c, number(pGetCoeff(p))); 261 fmpq_gcd(content, content, c); 211 262 markers.push_back(p); 263 } 212 264 if (p == NULL) 213 265 return; … … 215 267 pIter(p); 216 268 } 269 270 fmpq_clear(c); 271 } 272 273 ~convert_sing_to_fmpq_mpoly_base() 274 { 275 fmpq_clear(content); 217 276 } 218 277 }; … … 248 307 249 308 flint_bitcnt_t required_bits = MPOLY_MIN_BITS; 250 fmpq_ zero(arg->content);309 fmpq_set(arg->content, base->content); 251 310 252 311 while (idx < arg->end_idx) 253 312 { 254 my_convSingNFlintN_QQ(c, number(pGetCoeff(p))); 255 fmpq_gcd(arg->content, arg->content, c); 313 number n = number(pGetCoeff(p)); 314 315 if (fmpq_is_one(arg->content) && (SR_HDL(n)&SR_INT || n->s >= 3)) 316 { 317 /* content is 1 and n is an integer, nothing to do */ 318 } 319 else 320 { 321 my_convSingNFlintN_QQ(c, n); 322 fmpq_gcd(arg->content, arg->content, c); 323 } 256 324 257 325 #if SIZEOF_LONG==8 … … 293 361 } 294 362 363 slong N = mpoly_words_per_exp(base->res->zpoly->bits, base->ctx->zctx->minfo); 364 fmpz * res_coeffs = base->res->zpoly->coeffs; 365 ulong * res_exps = base->res->zpoly->exps; 366 flint_bitcnt_t res_bits = base->res->zpoly->bits; 367 295 368 while (idx < arg->end_idx) 296 369 { 297 my_convSingNFlintN_QQ(c, number(pGetCoeff(p))); 298 FLINT_ASSERT(!fmpq_is_zero(base->res->content)); 299 fmpq_div(t, c, base->res->content); 300 FLINT_ASSERT(fmpz_is_one(fmpq_denref(t))); 301 302 slong N = mpoly_words_per_exp(base->res->zpoly->bits, base->ctx->zctx->minfo); 303 fmpz_swap(base->res->zpoly->coeffs + idx, fmpq_numref(t)); 370 if (fmpq_is_one(base->res->content)) 371 { 372 // borrowing singular integers 373 // the entry res_coeffs[idx] is junk, we should just overwrite it 374 375 number n = number(pGetCoeff(p)); 376 377 if (SR_HDL(n)&SR_INT) 378 { 379 // n is a singular-small integer 380 res_coeffs[idx] = SR_TO_INT(n); 381 } 382 else if (n->s<3) 383 { 384 // n is an element of QQ \ ZZ, should not happen 385 assume(false); 386 } 387 else 388 { 389 // n is a singular-large integer, n may be flint-small 390 res_coeffs[idx] = PTR_TO_COEFF(n->z); 391 if (fmpz_fits_si(res_coeffs + idx)) 392 { 393 slong val = fmpz_get_si(res_coeffs + idx); 394 if (val >= COEFF_MIN && val <= COEFF_MAX) 395 res_coeffs[idx] = val; 396 } 397 } 398 } 399 else 400 { 401 my_convSingNFlintN_QQ(c, number(pGetCoeff(p))); 402 FLINT_ASSERT(!fmpq_is_zero(base->res->content)); 403 fmpq_div(t, c, base->res->content); 404 FLINT_ASSERT(fmpz_is_one(fmpq_denref(t))); 405 fmpz_swap(res_coeffs + idx, fmpq_numref(t)); 406 } 407 304 408 #if SIZEOF_LONG==8 305 409 p_GetExpVL(p, (int64*)exp, base->r); 306 mpoly_set_monomial_ui( base->res->zpoly->exps + N*idx, exp, base->res->zpoly->bits, base->ctx->zctx->minfo);410 mpoly_set_monomial_ui(res_exps + N*idx, exp, res_bits, base->ctx->zctx->minfo); 307 411 #else 308 412 p_GetExpV(p, (int*)exp, base->r); 309 mpoly_set_monomial_ui( base->res->zpoly->exps + N*idx, &(exp[1]), base->res->zpoly->bits, base->ctx->minfo);413 mpoly_set_monomial_ui(res_exps + N*idx, &(exp[1]), res_bits, base->ctx->minfo); 310 414 #endif 311 415 … … 324 428 thread_pool_handle * handles; 325 429 slong num_handles; 326 slong thread_limit = 1000; 327 328 /* get workers */ 430 slong thread_limit = 1000; // TODO: should be paramter to this function 431 432 /* the constructor works out the length of p and sets some markers */ 433 convert_sing_to_fmpq_mpoly_base base(res, ctx, r, p); 434 435 /* sensibly limit thread count and get workers */ 436 thread_limit = FLINT_MIN(thread_limit, base.length/1024); 329 437 handles = NULL; 330 438 num_handles = 0; … … 340 448 } 341 449 342 convert_sing_to_fmpq_mpoly_base base(num_handles + 1, res, ctx, r, p);343 344 450 /* fill in thread division points */ 451 base.num_threads = 1 + num_handles; 345 452 convert_sing_to_fmpq_mpoly_arg * args = new convert_sing_to_fmpq_mpoly_arg[base.num_threads]; 346 453 slong cur_idx = 0; … … 348 455 { 349 456 slong next_idx = i + 1 < base.num_threads ? (i + 1)*base.length/base.num_threads : base.length; 457 FLINT_ASSERT(cur_idx <= base.length); 350 458 next_idx = FLINT_MAX(next_idx, cur_idx); 351 459 next_idx = FLINT_MIN(next_idx, base.length); … … 367 475 required_bits = FLINT_MAX(required_bits, args[i].required_bits); 368 476 369 /* initialize res with optimal bits */370 fmpq_mpoly_init3(res, base.length, mpoly_fix_bits(required_bits, ctx->zctx->minfo), ctx);371 372 477 /* sign of content should match sign of first coeff */ 373 fmpq_zero(base.res->content); 478 fmpq_t content; 479 fmpq_init(content); 480 fmpq_zero(content); 374 481 for (slong i = 0; i < base.num_threads; i++) 375 fmpq_gcd( base.res->content, base.res->content, args[i].content);482 fmpq_gcd(content, content, args[i].content); 376 483 if (p != NULL) 377 484 { … … 380 487 my_convSingNFlintN_QQ(c, number(pGetCoeff(p))); 381 488 if (fmpq_sgn(c) < 0) 382 fmpq_neg( base.res->content, base.res->content);489 fmpq_neg(content, content); 383 490 fmpq_clear(c); 384 491 } 492 493 /* initialize res with optimal bits */ 494 required_bits = mpoly_fix_bits(required_bits, ctx->zctx->minfo); 495 if (fmpq_is_one(content)) 496 { 497 /* initialize borrowed coeffs */ 498 slong N = mpoly_words_per_exp(required_bits, ctx->zctx->minfo); 499 slong alloc = base.length; 500 if (alloc != 0) 501 { 502 res->zpoly->coeffs = (fmpz *) flint_malloc(alloc*sizeof(fmpz)); 503 res->zpoly->exps = (ulong *) flint_malloc(alloc*N*sizeof(ulong)); 504 } 505 else 506 { 507 res->zpoly->coeffs = NULL; 508 res->zpoly->exps = NULL; 509 } 510 res->zpoly->alloc = alloc; 511 res->zpoly->length = 0; 512 res->zpoly->bits = required_bits; 513 514 fmpq_init(res->content); 515 fmpq_one(res->content); 516 } 517 else 518 { 519 /* initialize coeffs that will be created and destroyed */ 520 fmpq_mpoly_init3(res, base.length, required_bits, ctx); 521 fmpq_swap(res->content, content); 522 } 523 524 fmpq_clear(content); 385 525 386 526 /* fill in res->zpoly */ … … 468 608 thread_pool_handle * handles; 469 609 slong num_handles; 470 slong thread_limit = 1000; 471 472 /* get workers */ 610 slong thread_limit = 1000;// TODO: should be paramter to this function 611 612 /* sensibly limit threads and get workers */ 613 thread_limit = FLINT_MIN(thread_limit, f->zpoly->length/1024); 473 614 handles = NULL; 474 615 num_handles = 0; … … 485 626 486 627 convert_fmpq_mpoly_to_sing_base base(num_handles + 1, f, ctx, r); 487 488 628 convert_fmpq_mpoly_to_sing_arg * args = new convert_fmpq_mpoly_to_sing_arg[base.num_threads]; 489 629 slong cur_idx = 0; … … 492 632 slong next_idx = i + 1 < base.num_threads ? (i + 1)*base.f->zpoly->length/base.num_threads 493 633 : base.f->zpoly->length; 634 FLINT_ASSERT(cur_idx <= base.f->zpoly->length); 494 635 next_idx = FLINT_MAX(next_idx, cur_idx); 495 636 next_idx = FLINT_MIN(next_idx, base.f->zpoly->length); … … 542 683 ring r; 543 684 544 convert_sing_to_nmod_mpoly_base( slong num_threads_,nmod_mpoly_struct * res_,545 546 : num_threads( num_threads_),685 convert_sing_to_nmod_mpoly_base(nmod_mpoly_struct * res_, 686 const nmod_mpoly_ctx_struct * ctx_, const ring r_, poly p) 687 : num_threads(0), 547 688 res(res_), 548 689 ctx(ctx_), … … 624 765 } 625 766 767 slong N = mpoly_words_per_exp(base->res->bits, base->ctx->minfo); 768 ulong * res_coeffs = base->res->coeffs; 769 ulong * res_exps = base->res->exps; 770 flint_bitcnt_t res_bits = base->res->bits; 771 626 772 while (idx < arg->end_idx) 627 773 { 628 slong N = mpoly_words_per_exp(base->res->bits, base->ctx->minfo);629 774 #if SIZEOF_LONG==8 630 775 p_GetExpVL(p, (int64*)exp, base->r); 631 mpoly_set_monomial_ui( base->res->exps + N*idx, exp, base->res->bits, base->ctx->minfo);776 mpoly_set_monomial_ui(res_exps + N*idx, exp, res_bits, base->ctx->minfo); 632 777 #else 633 778 p_GetExpV(p, (int*)exp, base->r); 634 mpoly_set_monomial_ui( base->res->exps + N*idx, &(exp[1]), base->res->bits, base->ctx->minfo);779 mpoly_set_monomial_ui(res_exps + N*idx, &(exp[1]), res_bits, base->ctx->minfo); 635 780 #endif 636 781 637 base->res->coeffs[idx] = (ulong)(number(pGetCoeff(p)));782 res_coeffs[idx] = (ulong)(number(pGetCoeff(p))); 638 783 639 784 pIter(p); … … 649 794 thread_pool_handle * handles; 650 795 slong num_handles; 651 slong thread_limit = 1000; 652 653 /* get workers */ 796 slong thread_limit = 1000; // TODO: should be paramter to this function 797 798 /* the constructor works out the length of p and sets some markers */ 799 convert_sing_to_nmod_mpoly_base base(res, ctx, r, p); 800 801 /* sensibly limit thread count and get workers */ 802 thread_limit = FLINT_MIN(thread_limit, base.length/1024); 654 803 handles = NULL; 655 804 num_handles = 0; … … 665 814 } 666 815 667 convert_sing_to_nmod_mpoly_base base(num_handles + 1, res, ctx, r, p);668 669 816 /* fill in thread division points */ 817 base.num_threads = 1 + num_handles; 670 818 convert_sing_to_nmod_mpoly_arg * args = new convert_sing_to_nmod_mpoly_arg[base.num_threads]; 671 819 slong cur_idx = 0; … … 674 822 slong next_idx = i + 1 < base.num_threads ? (i + 1)*base.length/base.num_threads 675 823 : base.length; 824 FLINT_ASSERT(cur_idx <= base.length); 676 825 next_idx = FLINT_MAX(next_idx, cur_idx); 677 826 next_idx = FLINT_MIN(next_idx, base.length); … … 777 926 thread_pool_handle * handles; 778 927 slong num_handles; 779 slong thread_limit = 1000; 780 781 /* get workers */ 928 slong thread_limit = 1000; // TODO: should be paramter to this function 929 930 /* sensibly limit threads and get workers */ 931 thread_limit = FLINT_MIN(thread_limit, f->length/1024); 782 932 handles = NULL; 783 933 num_handles = 0; … … 794 944 795 945 convert_nmod_mpoly_to_sing_base base(num_handles + 1, f, ctx, r); 796 797 946 convert_nmod_mpoly_to_sing_arg * args = new convert_nmod_mpoly_to_sing_arg[base.num_threads]; 798 947 slong cur_idx = 0; … … 801 950 slong next_idx = i + 1 < base.num_threads ? (i + 1)*base.f->length/base.num_threads 802 951 : base.f->length; 952 FLINT_ASSERT(cur_idx <= base.f->length); 803 953 next_idx = FLINT_MAX(next_idx, cur_idx); 804 954 next_idx = FLINT_MIN(next_idx, base.f->length); … … 845 995 { 846 996 fmpq_mpoly_t pp,qq,res; 847 convSingPFlintMP(pp,ctx,p,lp,r); 848 convSingPFlintMP(qq,ctx,q,lq,r); 997 convSingPFlintMP(pp,ctx,p,lp,r); // pp read only 998 convSingPFlintMP(qq,ctx,q,lq,r); // qq read only 849 999 fmpq_mpoly_init(res,ctx); 850 1000 fmpq_mpoly_mul(res,pp,qq,ctx); 851 1001 poly pres=convFlintMPSingP(res,ctx,r); 852 1002 fmpq_mpoly_clear(res,ctx); 853 fmpq_mpoly_clear(pp,ctx);854 fmpq_mpoly_clear(qq,ctx);1003 _fmpq_mpoly_clear_readonly_sing(pp,ctx); 1004 _fmpq_mpoly_clear_readonly_sing(qq,ctx); 855 1005 fmpq_mpoly_ctx_clear(ctx); 856 1006 p_Test(pres,r); … … 878 1028 { 879 1029 fmpq_mpoly_t pp,qq,res; 880 convSingPFlintMP(pp,ctx,p,lp,r); 881 convSingPFlintMP(qq,ctx,q,lq,r); 1030 convSingPFlintMP(pp,ctx,p,lp,r); // pp read only 1031 convSingPFlintMP(qq,ctx,q,lq,r); // qq read only 882 1032 fmpq_mpoly_init(res,ctx); 883 1033 fmpq_mpoly_divides(res,pp,qq,ctx); 884 1034 poly pres = convFlintMPSingP(res,ctx,r); 885 1035 fmpq_mpoly_clear(res,ctx); 886 fmpq_mpoly_clear(pp,ctx);887 fmpq_mpoly_clear(qq,ctx);1036 _fmpq_mpoly_clear_readonly_sing(pp,ctx); 1037 _fmpq_mpoly_clear_readonly_sing(qq,ctx); 888 1038 fmpq_mpoly_ctx_clear(ctx); 889 1039 p_Test(pres,r); … … 934 1084 { 935 1085 fmpq_mpoly_t pp,qq,res; 936 convSingPFlintMP(pp,ctx,p,lp,r); 937 convSingPFlintMP(qq,ctx,q,lq,r); 1086 convSingPFlintMP(pp,ctx,p,lp,r); // pp read only 1087 convSingPFlintMP(qq,ctx,q,lq,r); // qq read only 938 1088 fmpq_mpoly_init(res,ctx); 939 1089 int ok=fmpq_mpoly_gcd(res,pp,qq,ctx); … … 959 1109 } 960 1110 fmpq_mpoly_clear(res,ctx); 961 fmpq_mpoly_clear(pp,ctx);962 fmpq_mpoly_clear(qq,ctx);1111 _fmpq_mpoly_clear_readonly_sing(pp,ctx); 1112 _fmpq_mpoly_clear_readonly_sing(qq,ctx); 963 1113 fmpq_mpoly_ctx_clear(ctx); 964 1114 return pres; -
libpolys/polys/monomials/ring.cc
rd4cec6a r7161aca 432 432 if (rIsLPRing(r)) 433 433 { 434 Print("\n// letterplace ring (block size %d )",r->isLPring);434 Print("\n// letterplace ring (block size %d, ncgen count %d)",r->isLPring, r->LPncGenCount); 435 435 } 436 436 #endif … … 1393 1393 #ifdef HAVE_SHIFTBBA 1394 1394 res->isLPring=r->isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */ 1395 res->LPncGenCount=r->LPncGenCount; 1395 1396 #endif 1396 1397 … … 1522 1523 #ifdef HAVE_SHIFTBBA 1523 1524 res->isLPring=r->isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */ 1525 res->LPncGenCount=r->LPncGenCount; 1524 1526 #endif 1525 1527 … … 1667 1669 #ifdef HAVE_SHIFTBBA 1668 1670 if (r1->isLPring!=r2->isLPring) return FALSE; 1671 if (r1->LPncGenCount!=r2->LPncGenCount) return FALSE; 1669 1672 #endif 1670 1673 -
libpolys/polys/monomials/ring.h
rd4cec6a r7161aca 312 312 #ifdef HAVE_SHIFTBBA 313 313 short isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */ 314 short LPncGenCount; 314 315 #endif 315 316 -
libpolys/polys/operations/p_Mult_q.cc
rd4cec6a r7161aca 67 67 } 68 68 69 static void pqLengthApprox(poly p, poly q, int &lp, int &lq, const int min) 70 { 71 int l = 0; 72 73 do 74 { 75 if (p == NULL) 76 { 77 lp=l; 78 lq=l+(q!=NULL); 79 return; 80 } 81 if (q == NULL) /* && p!=NULL */ 82 { 83 lp=l+1; 84 lq=l; 85 return; 86 } 87 if (l>min) /* && p,q!=NULL */ 88 { 89 lp=l; lq=l; 90 return; 91 } 92 pIter(p); 93 pIter(q); 94 l++; 95 } 96 while (1); 97 } 98 69 99 70 100 static poly _p_Mult_q_Bucket(poly p, const int lp, … … 290 320 poly pt; 291 321 292 pqLength(p, q, lp, lq, MIN_LENGTH_FACTORY); 322 // MIN_LENGTH_FACTORY must be >= MIN_LENGTH_FACTORY_QQ, MIN_FLINT_QQ, MIN_FLINT_Zp 20 323 pqLengthApprox(p, q, lp, lq, MIN_LENGTH_FACTORY); 293 324 294 325 if (lp < lq) … … 309 340 if (pure_polys && rField_is_Q(r) && !convSingRFlintR(ctx,r)) 310 341 { 311 lp=pLength(p); 312 //printf("mul in flint\n"); 313 poly res=Flint_Mult_MP(p,lp,q,lq,ctx,r); 342 // lq is a lower bound for the length of p and q 343 poly res=Flint_Mult_MP(p,lq,q,lq,ctx,r); 314 344 if (!copy) 315 345 { … … 325 355 if (pure_polys && rField_is_Zp(r) && !convSingRFlintR(ctx,r)) 326 356 { 327 lp=pLength(p); 328 //printf("mul in flint\n"); 329 poly res=Flint_Mult_MP(p,lp,q,lq,ctx,r); 357 // lq is a lower bound for the length of p and q 358 poly res=Flint_Mult_MP(p,lq,q,lq,ctx,r); 330 359 if (!copy) 331 360 { … … 357 386 { 358 387 lp=pLength(p); 359 assume(lq == pLength(q));388 lq=pLength(q); 360 389 return _p_Mult_q_Bucket(p, lp, q, lq, copy, r); 361 390 } -
libpolys/polys/shiftop.cc
rd4cec6a r7161aca 529 529 PrintLn(); WriteLPExpV(m1ExpV, ri); 530 530 #endif 531 assume(_p_mLPNCGenValid(m1ExpV, ri)); 531 532 } 532 533 … … 564 565 PrintLn(); WriteLPExpV(m1ExpV, ri); 565 566 #endif 567 assume(_p_mLPNCGenValid(m1ExpV, ri)); 566 568 } 567 569 … … 608 610 assume(p_FirstVblock(m1,r) <= 1); 609 611 assume(p_FirstVblock(m2,r) <= 1); 612 } 613 614 BOOLEAN _p_mLPNCGenValid(int *mExpV, const ring r) 615 { 616 BOOLEAN hasNCGen = FALSE; 617 int lV = r->isLPring; 618 int degbound = r->N/lV; 619 int ncGenCount = r->LPncGenCount; 620 for (int i = 1; i <= degbound; i++) 621 { 622 for (int j = i*lV; j > (i*lV - ncGenCount); j--) 623 { 624 if (mExpV[j]) 625 { 626 if (hasNCGen) 627 { 628 return FALSE; 629 } 630 hasNCGen = TRUE; 631 } 632 } 633 } 634 return TRUE; 610 635 } 611 636 … … 673 698 if (B[j]!=0) break; 674 699 } 675 /* do not need e anymore */ 700 701 if (j==0) 702 { 703 omFreeSize((ADDRESS) e, (r->N+1)*sizeof(int)); 704 omFreeSize((ADDRESS) B, (b+1)*sizeof(int)); 705 return 1; 706 } 707 708 if (!_p_mLPNCGenValid(e, r)) 709 { 710 omFreeSize((ADDRESS) e, (r->N+1)*sizeof(int)); 711 omFreeSize((ADDRESS) B, (b+1)*sizeof(int)); 712 return 0; 713 } 714 676 715 omFreeSize((ADDRESS) e, (r->N+1)*sizeof(int)); 677 716 678 if (j==0) goto ret_true;679 717 // { 680 718 // /* it is a zero exp vector, which is in V */ … … 688 726 { 689 727 omFreeSize((ADDRESS) B, (b+1)*sizeof(int)); 690 return (0);691 } 692 } 693 ret_true: 728 return 0; 729 } 730 } 731 694 732 omFreeSize((ADDRESS) B, (b+1)*sizeof(int)); 695 return (1);733 return 1; 696 734 } 697 735 … … 776 814 } 777 815 778 ring freeAlgebra(ring r, int d) 779 { 816 ring freeAlgebra(ring r, int d, int ncGenCount) 817 { 818 if (ncGenCount) r = rCopy0(r); 819 for (int i = 1; i <= ncGenCount; i++) 820 { 821 char *varname=(char *)omAlloc(256); 822 sprintf(varname, "ncgen(%d)", i); 823 ring save = r; 824 r = rPlusVar(r, varname, 0); 825 omFreeSize(varname, 256); 826 rDelete(save); 827 } 780 828 ring R=rCopy0(r); 781 829 int p; … … 788 836 R->N=r->N*d; 789 837 R->isLPring=r->N; 838 R->LPncGenCount=ncGenCount; 790 839 // create R->order 791 840 BOOLEAN has_order_a=FALSE; … … 876 925 R->names=names; 877 926 927 if (ncGenCount) rDelete(r); 878 928 rComplete(R,TRUE); 879 929 return R; -
libpolys/polys/shiftop.h
rd4cec6a r7161aca 55 55 BOOLEAN _p_LPLmDivisibleByNoComp(poly a, poly b, const ring r); 56 56 57 BOOLEAN _p_mLPNCGenValid(int *mExpV, const ring r); 58 57 59 poly p_LPVarAt(poly p, int pos, const ring r); 58 60 59 61 /// create the letterplace ring corresponding to r up to degree d 60 ring freeAlgebra(ring r, int d );62 ring freeAlgebra(ring r, int d, int LPncGenCount = 0); 61 63 #endif 62 64 #endif
Note: See TracChangeset
for help on using the changeset viewer.