Changeset ebc333 in git
- Timestamp:
- May 10, 2019, 4:13:19 PM (4 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- d0ca0b8ae05c9cfcf2578b78e43825144b88299c
- Parents:
- b2fc349e4c2e86a7c7f9cbefef96756f70e8b57f
- Location:
- Singular/LIB
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/ainvar.lib
rb2fc34 rebc333 215 215 //------------- changes the basering bsr to bsr[@(0),...,@(z)] ---------- 216 216 execute("ring s="+charstr(basering)+",("+varstr(basering)+",@(0..z)),dp;"); 217 // Ev hier die Reihenfolge der Vars aendern. Dazu muss unten aber entsprechend218 // geaendert werden:219 // execute("ring s="+charstr(basering)+",(@(0..z),"+varstr(basering)+"),dp;");220 217 221 218 //constructs the leading ideal of dom=(p-@(0),dom[1]-@(1),...,dom[z]-@(z)) -
Singular/LIB/brnoeth.lib
rb2fc34 rebc333 916 916 execute("string sdatum=string("+datum+");"); 917 917 ring auxring=char(basering),(a,b,x,y,t),lp; 918 // execute("poly pdatum="+datum+";");919 918 execute("poly pdatum="+sdatum+";"); 920 919 execute("poly prel=b-("+rel+");"); -
Singular/LIB/deform.lib
rb2fc34 rebc333 845 845 for (l=1;l<=t1;l=l+1) 846 846 { 847 // old: execute("l1= "+columnes[2*l-1]+";");848 847 l1=vvvv[l]; 849 848 B[l] = A[l1]; -
Singular/LIB/dmod.lib
rb2fc34 rebc333 526 526 } 527 527 528 // JM+VL: output ring restructured into "normal" 529 530 // proc Sannfslog (poly F, list #) 531 // "USAGE: Sannfslog(f [,eng]); f a poly, eng an optional int 532 // RETURN: ring 533 // PURPOSE: compute the D-module structure of basering[1/f]*f^s 534 // NOTE: activate the output ring with the @code{setring} command. 535 // @* In the output ring D[s], the ideal LD1 is generated by the elements 536 // @* in Ann F^s in D[s], coming from logarithmic derivations. 537 // @* If eng <>0, @code{std} is used for Groebner basis computations, 538 // @* otherwise, and by default @code{slimgb} is used. 539 // DISPLAY: If @code{printlevel}=1, progress debug messages will be printed, 540 // @* if @code{printlevel}>=2, all the debug messages will be printed. 541 // EXAMPLE: example Sannfslog; shows examples 542 // " 543 // { 544 // int eng = 0; 545 // if ( size(#)>0 ) 546 // { 547 // if ( typeof(#[1]) == "int" ) 548 // { 549 // eng = int(#[1]); 550 // } 551 // } 552 // int ppl = printlevel-voice+2; 553 // def save = basering; 554 // int N = nvars(basering); 555 // int Nnew = 2*N+1; 556 // int i; 557 // string s; 558 // list RL = ringlist(basering); 559 // list L, Lord; 560 // list tmp; 561 // intvec iv; 562 // L[1] = RL[1]; // char 563 // L[4] = RL[4]; // char, minpoly 564 // // check whether vars have admissible names 565 // list Name = RL[2]; 566 // for (i=1; i<=N; i++) 567 // { 568 // if (Name[i] == "s") 569 // { 570 // ERROR("Variable names should not include s"); 571 // } 572 // } 573 // // the ideal I 574 // ideal I = -F, jacob(F); 575 // dbprint(ppl,"// -1-1- starting the computation of syz(-F,_Dx(F))"); 576 // dbprint(ppl-1, I); 577 // matrix M = syz(I); 578 // M = transpose(M); // it is more usefull working with columns 579 // dbprint(ppl,"// -1-2- the module syz(-F,_Dx(F)) has been computed"); 580 // dbprint(ppl-1, M); 581 // // ------------ the ring @R ------------ 582 // // _x, _Dx, s; elim.ord for _x,_Dx. 583 // // now, create the names for new vars 584 // list DName; 585 // for (i=1; i<=N; i++) 586 // { 587 // DName[i] = "D"+Name[i]; // concat 588 // } 589 // tmp[1] = "s"; 590 // list NName; 591 // for (i=1; i<=N; i++) 592 // { 593 // NName[2*i-1] = Name[i]; 594 // NName[2*i] = DName[i]; 595 // //NName[2*i-1] = DName[i]; 596 // //NName[2*i] = Name[i]; 597 // } 598 // NName[Nnew] = tmp[1]; 599 // L[2] = NName; 600 // tmp = 0; 601 // // block ord (a(1,1),a(0,0,1,1),...,dp); 602 // //list("a",intvec(1,1)), list("a",intvec(0,0,1,1)), ... 603 // tmp[1] = "a"; // string 604 // for (i=1; i<=N; i++) 605 // { 606 // iv[2*i-1] = 1; 607 // iv[2*i] = 1; 608 // tmp[2] = iv; iv = 0; // intvec 609 // Lord[i] = tmp; 610 // } 611 // //list("dp",intvec(1,1,1,1,1,...)) 612 // s = "iv="; 613 // for (i=1; i<=Nnew; i++) 614 // { 615 // s = s+"1,"; 616 // } 617 // s[size(s)]=";"; 618 // execute(s); 619 // kill s; 620 // tmp[1] = "dp"; // string 621 // tmp[2] = iv; // intvec 622 // Lord[N+1] = tmp; 623 // //list("C",intvec(0)) 624 // tmp[1] = "C"; // string 625 // iv = 0; 626 // tmp[2] = iv; // intvec 627 // Lord[N+2] = tmp; 628 // tmp = 0; 629 // L[3] = Lord; 630 // // we are done with the list. Now add a Plural part 631 // def @R@ = ring(L); 632 // setring @R@; 633 // matrix @D[Nnew][Nnew]; 634 // for (i=1; i<=N; i++) 635 // { 636 // @D[2*i-1,2*i]=1; 637 // //@D[2*i-1,2*i]=-1; 638 // } 639 // def @R = nc_algebra(1,@D); 640 // setring @R; 641 // kill @R@; 642 // dbprint(ppl,"// -2-1- the ring @R(_x,_Dx,s) is ready"); 643 // dbprint(ppl-1, @R); 644 // matrix M = imap(save,M); 645 // // now, create the vector [-s,_Dx] 646 // vector v = [-s]; // now s is a variable 647 // for (i=1; i<=N; i++) 648 // { 649 // v = v + var(2*i)*gen(i+1); 650 // //v = v + var(2*i-1)*gen(i+1); 651 // } 652 // ideal J = ideal(M*v); 653 // // make leadcoeffs positive 654 // for (i=1; i<= ncols(J); i++) 655 // { 656 // if ( leadcoef(J[i])<0 ) 657 // { 658 // J[i] = -J[i]; 659 // } 660 // } 661 // ideal LD1 = J; 662 // kill J; 663 // export LD1; 664 // return(@R); 665 // } 666 // example 667 // { 668 // "EXAMPLE:"; echo = 2; 669 // ring r = 0,(x,y),Dp; 670 // poly F = x^4+y^5+x*y^4; 671 // printlevel = 0; 672 // def A = Sannfslog(F); 673 // setring A; 674 // LD1; 675 // } 528 676 529 677 530 … … 3047 2900 tmp[2] = iv; 3048 2901 Lord[2] = tmp; 3049 // extra block for s3050 // tmp[1] = "dp"; iv = 1;3051 // s[size(s)]= ","; s = s + "1,1,1;"; execute(s); tmp[2] = iv;3052 // Lord[3] = tmp;3053 2902 kill s; 3054 2903 tmp[1] = "C"; iv = 0; tmp[2] = iv; … … 3429 3278 tmp[2] = iv; 3430 3279 Lord[2] = tmp; 3431 // extra block for s3432 // tmp[1] = "dp"; iv = 1;3433 // s[size(s)]= ","; s = s + "1,1,1;"; execute(s); tmp[2] = iv;3434 // Lord[3] = tmp;3435 3280 kill s; 3436 3281 tmp[1] = "C"; iv = 0; tmp[2] = iv; … … 4944 4789 } 4945 4790 4946 // proc annfsgms(poly F, list #) 4947 // "USAGE: annfsgms(f [,eng]); f a poly, eng an optional int 4948 // ASSUME: f has an isolated critical point at 0 4949 // RETURN: ring 4950 // PURPOSE: compute the D-module structure of basering[1/f]*f^s 4951 // NOTE: activate the output ring with the @code{setring} command. In this ring, 4952 // @* - the ideal LD is the needed D-mod structure, 4953 // @* - the ideal BS is the list of roots of a Bernstein polynomial of f. 4954 // @* If eng <>0, @code{std} is used for Groebner basis computations, 4955 // @* otherwise (and by default) @code{slimgb} is used. 4956 // @* If printlevel=1, progress debug messages will be printed, 4957 // @* if printlevel>=2, all the debug messages will be printed. 4958 // EXAMPLE: example annfsgms; shows examples 4959 // " 4960 // { 4961 // LIB "gmssing.lib"; 4962 // int eng = 0; 4963 // if ( size(#)>0 ) 4964 // { 4965 // if ( typeof(#[1]) == "int" ) 4966 // { 4967 // eng = int(#[1]); 4968 // } 4969 // } 4970 // int ppl = printlevel-voice+2; 4971 // // returns a ring with the ideal LD in it 4972 // def save = basering; 4973 // // compute the Bernstein polynomial from gmssing.lib 4974 // list RL = ringlist(basering); 4975 // // in the descr. of the ordering, replace "p" by "s" 4976 // list NL = convloc(RL); 4977 // // create a ring with the ordering, converted to local 4978 // def @LR = ring(NL); 4979 // setring @LR; 4980 // poly F = imap(save, F); 4981 // ideal B = bernstein(F)[1]; 4982 // // since B may not contain (s+1) [following gmssing.lib] 4983 // // add it! 4984 // B = B,-1; 4985 // B = simplify(B,2+4); // erase zero and repeated entries 4986 // // find the minimal integer value 4987 // int S = minIntRoot(B,0); 4988 // dbprint(ppl,"// -0- minimal integer root found"); 4989 // dbprint(ppl-1,S); 4990 // setring save; 4991 // int N = nvars(basering); 4992 // int Nnew = 2*(N+2); 4993 // int i,j; 4994 // string s; 4995 // // list RL = ringlist(basering); 4996 // list L, Lord; 4997 // list tmp; 4998 // intvec iv; 4999 // L[1] = RL[1]; // char 5000 // L[4] = RL[4]; // char, minpoly 5001 // // check whether vars have admissible names 5002 // list Name = RL[2]; 5003 // list RName; 5004 // RName[1] = "u"; 5005 // RName[2] = "v"; 5006 // RName[3] = "t"; 5007 // RName[4] = "Dt"; 5008 // for(i=1;i<=N;i++) 5009 // { 5010 // for(j=1; j<=size(RName);j++) 5011 // { 5012 // if (Name[i] == RName[j]) 5013 // { 5014 // ERROR("Variable names should not include u,v,t,Dt"); 5015 // } 5016 // } 5017 // } 5018 // // now, create the names for new vars 5019 // // tmp[1] = "u"; tmp[2] = "v"; tmp[3] = "t"; tmp[4] = "Dt"; 5020 // list UName = RName; 5021 // list DName; 5022 // for(i=1;i<=N;i++) 5023 // { 5024 // DName[i] = "D"+Name[i]; // concat 5025 // } 5026 // list NName = UName + Name + DName; 5027 // L[2] = NName; 5028 // tmp = 0; 5029 // // Name, Dname will be used further 5030 // kill UName; 5031 // kill NName; 5032 // // block ord (a(1,1),dp); 5033 // tmp[1] = "a"; // string 5034 // iv = 1,1; 5035 // tmp[2] = iv; //intvec 5036 // Lord[1] = tmp; 5037 // // continue with dp 1,1,1,1... 5038 // tmp[1] = "dp"; // string 5039 // s = "iv="; 5040 // for(i=1; i<=Nnew; i++) // need really all vars! 5041 // { 5042 // s = s+"1,"; 5043 // } 5044 // s[size(s)]= ";"; 5045 // execute(s); 5046 // tmp[2] = iv; 5047 // Lord[2] = tmp; 5048 // tmp[1] = "C"; 5049 // iv = 0; 5050 // tmp[2] = iv; 5051 // Lord[3] = tmp; 5052 // tmp = 0; 5053 // L[3] = Lord; 5054 // // we are done with the list 5055 // def @R = ring(L); 5056 // setring @R; 5057 // matrix @D[Nnew][Nnew]; 5058 // @D[3,4] = 1; // t,Dt 5059 // for(i=1; i<=N; i++) 5060 // { 5061 // @D[4+i,4+N+i]=1; 5062 // } 5063 // // L[5] = matrix(UpOneMatrix(Nnew)); 5064 // // L[6] = @D; 5065 // nc_algebra(1,@D); 5066 // dbprint(ppl,"// -1-1- the ring @R is ready"); 5067 // dbprint(ppl-1,@R); 5068 // // create the ideal 5069 // poly F = imap(save,F); 5070 // ideal I = u*F-t,u*v-1; 5071 // poly p; 5072 // for(i=1; i<=N; i++) 5073 // { 5074 // p = u*Dt; // u*Dt 5075 // p = diff(F,var(4+i))*p; 5076 // I = I, var(N+4+i) + p; // Dx, Dy 5077 // } 5078 // // add the relations between t,Dt and s 5079 // // I = I, t*Dt+1+S; 5080 // // -------- the ideal I is ready ---------- 5081 // dbprint(ppl,"// -1-2- starting the elimination of u,v in @R"); 5082 // ideal J = engine(I,eng); 5083 // ideal K = nselect(J,1..2); 5084 // dbprint(ppl,"// -1-3- u,v are eliminated in @R"); 5085 // dbprint(ppl-1,K); // without u,v: not yet our answer 5086 // //----- create a ring with elim.ord for t,Dt ------- 5087 // setring save; 5088 // // ------------ new ring @R2 ------------------ 5089 // // without u,v and with the elim.ord for t,Dt 5090 // // keep: N, i,j,s, tmp, RL 5091 // Nnew = 2*N+2; 5092 // // list RL = ringlist(save); // is defined earlier 5093 // kill Lord,tmp,iv, RName; 5094 // L = 0; 5095 // list Lord, tmp; 5096 // intvec iv; 5097 // L[1] = RL[1]; // char 5098 // L[4] = RL[4]; // char, minpoly 5099 // // check whether vars have admissible names -> done earlier 5100 // // list Name = RL[2]; 5101 // list RName; 5102 // RName[1] = "t"; 5103 // RName[2] = "Dt"; 5104 // // DName is defined earlier 5105 // list NName = RName + Name + DName; 5106 // L[2] = NName; 5107 // tmp = 0; 5108 // // block ord (a(1,1),dp); 5109 // tmp[1] = "a"; // string 5110 // iv = 1,1; 5111 // tmp[2] = iv; //intvec 5112 // Lord[1] = tmp; 5113 // // continue with dp 1,1,1,1... 5114 // tmp[1] = "dp"; // string 5115 // s = "iv="; 5116 // for(i=1;i<=Nnew;i++) 5117 // { 5118 // s = s+"1,"; 5119 // } 5120 // s[size(s)]= ";"; 5121 // execute(s); 5122 // kill s; 5123 // kill NName; 5124 // tmp[2] = iv; 5125 // Lord[2] = tmp; 5126 // tmp[1] = "C"; 5127 // iv = 0; 5128 // tmp[2] = iv; 5129 // Lord[3] = tmp; 5130 // tmp = 0; 5131 // L[3] = Lord; 5132 // // we are done with the list 5133 // // Add: Plural part 5134 // def @R2 = ring(L); 5135 // setring @R2; 5136 // matrix @D[Nnew][Nnew]; 5137 // @D[1,2]=1; 5138 // for(i=1; i<=N; i++) 5139 // { 5140 // @D[2+i,2+N+i]=1; 5141 // } 5142 // nc_algebra(1,@D); 5143 // dbprint(ppl,"// -2-1- the ring @R2 is ready"); 5144 // dbprint(ppl-1,@R2); 5145 // ideal MM = maxideal(1); 5146 // MM = 0,0,MM; 5147 // map R01 = @R, MM; 5148 // ideal K2 = R01(K); 5149 // // add the relations between t,Dt and s 5150 // // K2 = K2, t*Dt+1+S; 5151 // poly G = t*Dt+S+1; 5152 // K2 = NF(K2,std(G)),G; 5153 // dbprint(ppl,"// -2-2- starting elimination for t,Dt in @R2"); 5154 // ideal J = engine(K2,eng); 5155 // ideal K = nselect(J,1..2); 5156 // dbprint(ppl,"// -2-3- t,Dt are eliminated"); 5157 // dbprint(ppl-1,K); 5158 // // "------- produce a final result --------"; 5159 // // ----- create the ordinary Weyl algebra and put 5160 // // ----- the result into it 5161 // // ------ create the ring @R5 5162 // // keep: N, i,j,s, tmp, RL 5163 // setring save; 5164 // Nnew = 2*N; 5165 // // list RL = ringlist(save); // is defined earlier 5166 // kill Lord, tmp, iv; 5167 // // kill L; 5168 // L = 0; 5169 // list Lord, tmp; 5170 // intvec iv; 5171 // L[1] = RL[1]; // char 5172 // L[4] = RL[4]; // char, minpoly 5173 // // check whether vars have admissible names -> done earlier 5174 // // list Name = RL[2]; 5175 // // DName is defined earlier 5176 // list NName = Name + DName; 5177 // L[2] = NName; 5178 // // dp ordering; 5179 // string s = "iv="; 5180 // for(i=1;i<=2*N;i++) 5181 // { 5182 // s = s+"1,"; 5183 // } 5184 // s[size(s)]= ";"; 5185 // execute(s); 5186 // tmp = 0; 5187 // tmp[1] = "dp"; // string 5188 // tmp[2] = iv; //intvec 5189 // Lord[1] = tmp; 5190 // kill s; 5191 // tmp[1] = "C"; 5192 // iv = 0; 5193 // tmp[2] = iv; 5194 // Lord[2] = tmp; 5195 // tmp = 0; 5196 // L[3] = Lord; 5197 // // we are done with the list 5198 // // Add: Plural part 5199 // def @R5 = ring(L); 5200 // setring @R5; 5201 // matrix @D[Nnew][Nnew]; 5202 // for(i=1; i<=N; i++) 5203 // { 5204 // @D[i,N+i]=1; 5205 // } 5206 // nc_algebra(1,@D); 5207 // dbprint(ppl,"// -3-1- the ring @R5 is ready"); 5208 // dbprint(ppl-1,@R5); 5209 // ideal K5 = imap(@R2,K); 5210 // option(redSB); 5211 // dbprint(ppl,"// -3-2- the final cosmetic std"); 5212 // K5 = engine(K5,eng); // std does the job too 5213 // // total cleanup 5214 // kill @R; 5215 // kill @R2; 5216 // ideal LD = K5; 5217 // ideal BS = imap(@LR,B); 5218 // kill @LR; 5219 // export BS; 5220 // export LD; 5221 // return(@R5); 5222 // } 5223 // example 5224 // { 5225 // "EXAMPLE:"; echo = 2; 5226 // ring r = 0,(x,y,z),Dp; 5227 // poly F = x^2+y^3+z^5; 5228 // def A = annfsgms(F); 5229 // setring A; 5230 // LD; 5231 // print(matrix(BS)); 5232 // } 4791 5233 4792 5234 4793 -
Singular/LIB/finvar.lib
rb2fc34 rebc333 1517 1517 def T = br+tmpR; 1518 1518 setring T; 1519 // execute("ring T=("+charstr(br)+"),("+varstr(br)+",p(1..m)),lp;");1520 // p(1..m) are the general coefficients of the general polynomial of degree g1521 1519 ideal vars = fetch(br,vars); 1522 1520 map f; -
Singular/LIB/freegb.lib
rb2fc34 rebc333 3481 3481 int i, j, k, sm, sv; 3482 3482 vector v; 3483 // execute("setring "+lpring);3484 3483 setring lpring; 3485 3484 poly @@p; -
Singular/LIB/involut.lib
rb2fc34 rebc333 821 821 execute("ring @@KK=(0,"+Par+"),("+@ss+"), dp;"); 822 822 } 823 // execute("setring @@KK;");824 823 // basering; 825 824 ideal J = imap(@@K,J); // ideal, considered in @@KK now -
Singular/LIB/maxlike.lib
rb2fc34 rebc333 300 300 } 301 301 302 //execute("ring outR =(complex,"+string(prec)+"),(x(1.."+string(n)+")),dp;");303 302 ring outR=(complex,prec),x(1..n),dp; 304 303 list MPOINTS = imap(R,L2); … … 497 496 } 498 497 499 //execute("ring outR =(complex,"+string(prec)+"),(x(1.."+string(n)+")),dp;");500 498 ring outR=(complex,prec),x(1..n),dp; 501 499 list MPOINTS = imap(R,L2); -
Singular/LIB/normal.lib
rb2fc34 rebc333 2986 2986 } 2987 2987 ker=simplify(interred(ker),15); 2988 //execute ("ring R0="+charstr(R)+",("+varstr(R)+"),("+ordstr(R)+");");2989 2988 // Rlist may be not defined in this new ring, so we define it again. 2990 2989 list Rlist2 = ringlist(R); … … 3302 3301 setring S(k); 3303 3302 3304 //execute ("ring S(k) = "+charstr(R(k))+",("+varstr(R(k))+",3305 // Z(1.."+string(ncols(phi))+")),(dp("+string(nvars(R(k)))3306 // +"),dp("+string(ncols(phi))+"));");3307 3308 3303 ideal phi = imap(R(k),phi); 3309 3304 ideal J = imap (R(k),ker); … … 3337 3332 // mapstr=mapstr+"0,"; 3338 3333 //} 3339 //execute (mapstr+"maxideal(1);");3340 3334 poly p; 3341 3335 } … … 3490 3484 setring S(k); 3491 3485 3492 // execute ("ring S(k) = "+charstr(R(k))+",("+varstr(R(k))+",3493 // Z(1.."+string(ncols(phi))+")),(dp("+string(nvars(R(k)))3494 // +"),dp("+string(ncols(phi))+"));");3495 3496 3486 ideal phi = imap(R(k),phi); 3497 3487 ideal J = imap (R(k),ker); … … 3523 3513 // mapstr=mapstr+"0,"; 3524 3514 //} 3525 //execute (mapstr+"maxideal(1);");3526 3515 3527 3516 poly p; -
Singular/LIB/primdec.lib
rb2fc34 rebc333 1135 1135 else { @qh=groebner(@qh); } 1136 1136 1137 //=============================================================1138 // if(npars(@P)>0)1139 // {1140 // @ri= "ring @Phelp ="1141 // +string(char(@P))+",1142 // ("+varstr(@P)+","+parstr(@P)+",@t),(C,dp);";1143 // }1144 // else1145 // {1146 // @ri= "ring @Phelp ="1147 // +string(char(@P))+",("+varstr(@P)+",@t),(C,dp);";1148 // }1149 // execute(@ri);1150 // ideal @qh=homog(imap(@P,@qht),@t);1151 //1152 // ideal @qh1=std(@qh);1153 // @hilb=hilb(@qh1,1);1154 // @ri= "ring @Phelp1 ="1155 // +string(char(@P))+",("+varstr(@Phelp)+"),(C,lp);";1156 // execute(@ri);1157 // ideal @qh=homog(imap(@P,@qh),@t);1158 // kill @Phelp;1159 // @qh=std(@qh,@hilb);1160 // @qh=subst(@qh,@t,1);1161 // setring @P;1162 // @qh=imap(@Phelp1,@qh);1163 // kill @Phelp1;1164 // @qh=clearSB(@qh);1165 // attrib(@qh,"isSB",1);1166 //=============================================================1167 1168 1137 ser1=phi1(ser); 1169 1138 @lh=zero_decomp (@qh,phi(ser1),@wr); … … 1209 1178 primary=primary+lres0; 1210 1179 1211 //============================================================= 1212 // if(npars(@P)>0) 1213 // { 1214 // @ri= "ring @Phelp =" 1215 // +string(char(@P))+", 1216 // ("+varstr(@P)+","+parstr(@P)+",@t),(C,dp);"; 1217 // } 1218 // else 1219 // { 1220 // @ri= "ring @Phelp =" 1221 // +string(char(@P))+",("+varstr(@P)+",@t),(C,dp);"; 1222 // } 1223 // execute(@ri); 1224 // list @lvec; 1225 // list @lr=imap(@P,lres0); 1226 // ideal @lr1; 1227 // 1228 // if(size(@lr)==2) 1229 // { 1230 // @lr[2]=homog(@lr[2],@t); 1231 // @lr1=std(@lr[2]); 1232 // @lvec[2]=hilb(@lr1,1); 1233 // } 1234 // else 1235 // { 1236 // for(@n=1;@n<=size(@lr) div 2;@n++) 1237 // { 1238 // if(specialIdealsEqual(@lr[2*@n-1],@lr[2*@n])==1) 1239 // { 1240 // @lr[2*@n-1]=homog(@lr[2*@n-1],@t); 1241 // @lr1=std(@lr[2*@n-1]); 1242 // @lvec[2*@n-1]=hilb(@lr1,1); 1243 // @lvec[2*@n]=@lvec[2*@n-1]; 1244 // } 1245 // else 1246 // { 1247 // @lr[2*@n-1]=homog(@lr[2*@n-1],@t); 1248 // @lr1=std(@lr[2*@n-1]); 1249 // @lvec[2*@n-1]=hilb(@lr1,1); 1250 // @lr[2*@n]=homog(@lr[2*@n],@t); 1251 // @lr1=std(@lr[2*@n]); 1252 // @lvec[2*@n]=hilb(@lr1,1); 1253 // 1254 // } 1255 // } 1256 // } 1257 // @ri= "ring @Phelp1 =" 1258 // +string(char(@P))+",("+varstr(@Phelp)+"),(C,lp);"; 1259 // execute(@ri); 1260 // list @lr=imap(@Phelp,@lr); 1261 // 1262 // kill @Phelp; 1263 // if(size(@lr)==2) 1264 // { 1265 // @lr[2]=std(@lr[2],@lvec[2]); 1266 // @lr[2]=subst(@lr[2],@t,1); 1267 // } 1268 // else 1269 // { 1270 // for(@n=1;@n<=size(@lr) div 2;@n++) 1271 // { 1272 // if(specialIdealsEqual(@lr[2*@n-1],@lr[2*@n])==1) 1273 // { 1274 // @lr[2*@n-1]=std(@lr[2*@n-1],@lvec[2*@n-1]); 1275 // @lr[2*@n-1]=subst(@lr[2*@n-1],@t,1); 1276 // @lr[2*@n]=@lr[2*@n-1]; 1277 // attrib(@lr[2*@n],"isSB",1); 1278 // } 1279 // else 1280 // { 1281 // @lr[2*@n-1]=std(@lr[2*@n-1],@lvec[2*@n-1]); 1282 // @lr[2*@n-1]=subst(@lr[2*@n-1],@t,1); 1283 // @lr[2*@n]=std(@lr[2*@n],@lvec[2*@n]); 1284 // @lr[2*@n]=subst(@lr[2*@n],@t,1); 1285 // } 1286 // } 1287 // } 1288 // kill @lvec; 1289 // setring @P; 1290 // lres0=imap(@Phelp1,@lr); 1291 // kill @Phelp1; 1292 // for(@n=1;@n<=size(lres0);@n++) 1293 // { 1294 // lres0[@n]=clearSB(lres0[@n]); 1295 // attrib(lres0[@n],"isSB",1); 1296 // } 1297 // 1298 // primary[2*@k-1]=lres0[1]; 1299 // primary[2*@k]=lres0[2]; 1300 // @s=size(primary) div 2; 1301 // for(@n=1;@n<=size(lres0) div 2-1;@n++) 1302 // { 1303 // primary[2*@s+2*@n-1]=lres0[2*@n+1]; 1304 // primary[2*@s+2*@n]=lres0[2*@n+2]; 1305 // } 1306 // @k--; 1307 //============================================================= 1308 } 1180 } 1309 1181 } 1310 1182 return(primary); … … 2044 1916 option( redSB ); 2045 1917 list @pr=facstd(i); 2046 //if(size(@pr)==1) 2047 // { 2048 // attrib(@pr[1],"isSB",1); 2049 // if((dim(@pr[1])==0)&&(homog(@pr[1])==1)) 2050 // { 2051 // setring @P; 2052 // list @res=maxideal(1); 2053 // return(phi(@res)); 2054 // } 2055 // if(dim(@pr[1])>1) 2056 // { 2057 // setring @P; 2058 // // kill gnir; 2059 // execute ("ring gnir1 = ("+charstr(basering)+"), 2060 // ("+varstr(basering)+"),(C,lp);"); 2061 // ideal i=fetch(@P,i); 2062 // list @pr=facstd(i); 2063 // // ideal ser; 2064 // setring gnir; 2065 // @pr=fetch(gnir1,@pr); 2066 // kill gnir1; 2067 // } 2068 // } 1918 2069 1919 // option( noredSB ); 2070 1920 option( set, op ); … … 9285 9135 else { @qh=groebner(@qh); } 9286 9136 9287 //=============================================================9288 // if(npars(@P)>0)9289 // {9290 // @ri= "ring @Phelp ="9291 // +string(char(@P))+",9292 // ("+varstr(@P)+","+parstr(@P)+",@t),(C,dp);";9293 // }9294 // else9295 // {9296 // @ri= "ring @Phelp ="9297 // +string(char(@P))+",("+varstr(@P)+",@t),(C,dp);";9298 // }9299 // execute(@ri);9300 // ideal @qh=homog(imap(@P,@qht),@t);9301 //9302 // ideal @qh1=std(@qh);9303 // @hilb=hilb(@qh1,1);9304 // @ri= "ring @Phelp1 ="9305 // +string(char(@P))+",("+varstr(@Phelp)+"),(C,lp);";9306 // execute(@ri);9307 // ideal @qh=homog(imap(@P,@qh),@t);9308 // kill @Phelp;9309 // @qh=std(@qh,@hilb);9310 // @qh=subst(@qh,@t,1);9311 // setring @P;9312 // @qh=imap(@Phelp1,@qh);9313 // kill @Phelp1;9314 // @qh=clearSB(@qh);9315 // attrib(@qh,"isSB",1);9316 //=============================================================9317 9318 9137 ser1=phi1(ser); 9319 9138 @lh=newZero_decomp (@qh,phi(ser1),@wr, list("nest", nestLevel + 1)); … … 9369 9188 primary=primary+lres0; 9370 9189 9371 //=============================================================9372 // if(npars(@P)>0)9373 // {9374 // @ri= "ring @Phelp ="9375 // +string(char(@P))+",9376 // ("+varstr(@P)+","+parstr(@P)+",@t),(C,dp);";9377 // }9378 // else9379 // {9380 // @ri= "ring @Phelp ="9381 // +string(char(@P))+",("+varstr(@P)+",@t),(C,dp);";9382 // }9383 // execute(@ri);9384 // list @lvec;9385 // list @lr=imap(@P,lres0);9386 // ideal @lr1;9387 //9388 // if(size(@lr)==2)9389 // {9390 // @lr[2]=homog(@lr[2],@t);9391 // @lr1=std(@lr[2]);9392 // @lvec[2]=hilb(@lr1,1);9393 // }9394 // else9395 // {9396 // for(@n=1;@n<=size(@lr) div 2;@n++)9397 // {9398 // if(specialIdealsEqual(@lr[2*@n-1],@lr[2*@n])==1)9399 // {9400 // @lr[2*@n-1]=homog(@lr[2*@n-1],@t);9401 // @lr1=std(@lr[2*@n-1]);9402 // @lvec[2*@n-1]=hilb(@lr1,1);9403 // @lvec[2*@n]=@lvec[2*@n-1];9404 // }9405 // else9406 // {9407 // @lr[2*@n-1]=homog(@lr[2*@n-1],@t);9408 // @lr1=std(@lr[2*@n-1]);9409 // @lvec[2*@n-1]=hilb(@lr1,1);9410 // @lr[2*@n]=homog(@lr[2*@n],@t);9411 // @lr1=std(@lr[2*@n]);9412 // @lvec[2*@n]=hilb(@lr1,1);9413 //9414 // }9415 // }9416 // }9417 // @ri= "ring @Phelp1 ="9418 // +string(char(@P))+",("+varstr(@Phelp)+"),(C,lp);";9419 // execute(@ri);9420 // list @lr=imap(@Phelp,@lr);9421 //9422 // kill @Phelp;9423 // if(size(@lr)==2)9424 // {9425 // @lr[2]=std(@lr[2],@lvec[2]);9426 // @lr[2]=subst(@lr[2],@t,1);9427 //9428 // }9429 // else9430 // {9431 // for(@n=1;@n<=size(@lr) div 2;@n++)9432 // {9433 // if(specialIdealsEqual(@lr[2*@n-1],@lr[2*@n])==1)9434 // {9435 // @lr[2*@n-1]=std(@lr[2*@n-1],@lvec[2*@n-1]);9436 // @lr[2*@n-1]=subst(@lr[2*@n-1],@t,1);9437 // @lr[2*@n]=@lr[2*@n-1];9438 // attrib(@lr[2*@n],"isSB",1);9439 // }9440 // else9441 // {9442 // @lr[2*@n-1]=std(@lr[2*@n-1],@lvec[2*@n-1]);9443 // @lr[2*@n-1]=subst(@lr[2*@n-1],@t,1);9444 // @lr[2*@n]=std(@lr[2*@n],@lvec[2*@n]);9445 // @lr[2*@n]=subst(@lr[2*@n],@t,1);9446 // }9447 // }9448 // }9449 // kill @lvec;9450 // setring @P;9451 // lres0=imap(@Phelp1,@lr);9452 // kill @Phelp1;9453 // for(@n=1;@n<=size(lres0);@n++)9454 // {9455 // lres0[@n]=clearSB(lres0[@n]);9456 // attrib(lres0[@n],"isSB",1);9457 // }9458 //9459 // primary[2*@k-1]=lres0[1];9460 // primary[2*@k]=lres0[2];9461 // @s=size(primary) div 2;9462 // for(@n=1;@n<=size(lres0) div 2-1;@n++)9463 // {9464 // primary[2*@s+2*@n-1]=lres0[2*@n+1];9465 // primary[2*@s+2*@n]=lres0[2*@n+2];9466 // }9467 // @k--;9468 //=============================================================9469 9190 } 9470 9191 } -
Singular/LIB/sagbi.lib
rb2fc34 rebc333 1112 1112 //------------- change the basering bsr to bsr[@(0),...,@(z)] ---------- 1113 1113 def s=addNvarsTo(basering,z+1,,"@",0); setring s; 1114 // Ev hier die Reihenfolge der Vars aendern. Dazu muss unten aber entsprechend1115 // geaendert werden:1116 // execute("ring s="+charstr(basering)+",(@(0..z),"+varstr(basering)+"),dp;");1117 1114 1118 1115 //constructs the leading ideal of dom=(p-@(0),dom[1]-@(1),...,dom[z]-@(z)) -
Singular/LIB/tropicalNewton.lib
rb2fc34 rebc333 1100 1100 // disabled routines to check characteristic-freeness of tropical points 1101 1101 1102 // proc saturateWithRespectToVariable(ideal I, int k) 1103 // { 1104 // ASSUME(1,k>=1); 1105 // ASSUME(1,k<=nvars(basering)); 1106 1107 // def origin = basering; 1108 // int n = nvars(basering); 1109 // intvec weightVector = ringlist(origin)[3][1][2]; 1110 1111 // string newVars; 1112 // for (int i=1; i<k; i++) 1113 // { 1114 // newVars = newVars+string(var(i))+","; 1115 // } 1116 // for (i=k+1; i<=n; i++) 1117 // { 1118 // newVars = newVars+string(var(i))+","; 1119 // } 1120 // newVars = newVars+string(var(k)); 1121 // execute("ring ringForSaturation = ("+charstr(origin)+"),("+newVars+"),dp;"); 1122 1123 // ideal I = satstd(imap(origin,I)); 1124 // if (I==-1) 1125 // { 1126 // return (-1); 1127 // } 1128 // I = simplify(I,2+4+32); 1129 1130 // setring origin; 1131 // I = imap(ringForSaturation,I); 1132 // return (I); 1133 // } 1102 1134 1103 1135 1104 // proc stepwiseSaturation(ideal I) … … 1158 1127 1159 1128 1160 // proc checkForContainmentInTropicalVariety(ideal I, intvec w, int charInt)1161 // {1162 // def origin = basering;1163 // intvec wOne = oneVector(nvars(origin));1164 // execute("ring rInitialIdeal = ("+string(charInt)+"),("+varstr(origin)+"),(a(wOne),wp(w));");1165 1166 // ideal I = imap(origin,I);1167 // int tinI = timer;1168 // option(redSB);1169 // ideal stdI = satstd(I);1170 // attrib(stdI,"isSB",1);1171 // ideal inI = initial(stdI,w);1172 // tinI = timer-tinI;1173 // dbprint("time used computing initial ideal: "+string(tinI));1174 1175 // int tsat = timer;1176 // ideal satinI = stepwiseSaturation(inI);1177 // tsat = timer-tsat;1178 // dbprint("time used computing saturation: "+string(tsat));1179 1180 1181 // export(I);1182 // export(stdI);1183 // export(inI);1184 // export(satinI);1185 // return (rInitialIdeal);1186 // }
Note: See TracChangeset
for help on using the changeset viewer.