Changeset bd7468 in git
- Timestamp:
- Feb 24, 2007, 4:09:51 PM (16 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- 101775c32e4f8f7cd743c23b9822bc53abca1792
- Parents:
- 2abb041913e22b03ba7227d2705d03a49a7de82a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/standard.lib
r2abb041 rbd7468 1 1 ////////////////////////////////////////////////////////////////////////////// 2 2 //major revision Jan/Feb. 2007, GMG 3 //groebner mit Optionen versehen 3 4 ////////////////////////////////////////////////////////////////////////////// 4 version="$Id: standard.lib,v 1.8 7 2007-02-04 11:37:35Singular Exp $";5 version="$Id: standard.lib,v 1.88 2007-02-24 15:09:51 Singular Exp $"; 5 6 category="Miscellaneous"; 6 7 info=" … … 17 18 weightKB(stc,dd,vl) degree dd part of a kbase wrt. some weigths 18 19 "; 19 20 // quotientList(L,...) a list, say L, s.t. ring(L) creates a correct qring20 // qslimgb(i) computes a standard basis with slimgb in a qring 21 // hilbRing([i]) create a ring containing the homogenized i 21 22 // par2varRing([i]) create a ring with pars to vars together with i 22 // hilbRing([i]) create a ring containing the homogenized i23 // qslimgb(i) computes a standard basis with slimgb in a qring 23 // quotientList(L,...) a list, say QL, s.t. ring(QL) creates a correct qring 24 24 25 ////////////////////////////////////////////////////////////////////////////// 25 26 26 proc stdfglm (i deal i, list #)27 proc stdfglm (i, list #) 27 28 "SYNTAX: @code{stdfglm (} ideal_expression @code{)} @* 28 29 @code{stdfglm (} ideal_expression@code{,} string_expression @code{)} 29 30 TYPE: ideal 30 31 PURPOSE: computes the standard basis of the ideal in the basering 31 via @code{fglm} (from the ordering given as the second argument 32 to the ordering of the basering).@* 33 If no second argument is given, \"dp\" is used. 34 SEE ALSO: fglm, groebner, std, stdhilb 32 via @code{fglm} from the ordering given as the second argument 33 to the ordering of the basering. If no second argument is given, 34 \"dp\" is used. The standard basis for the given ordering (resp. for 35 \"dp\") is computed via the command groebner except if a further 36 argument \"std\" or \"slimgb\" is given in which case std resp. 37 slimgb is used. 38 SEE ALSO: fglm, groebner, std, slimgb, stdhilb 35 39 KEYWORDS: fglm 36 40 EXAMPLE: example stdfglm; shows an example" 37 41 { 38 //### ev. erweitern: Gewichte von aussen setzen 39 string os; 40 int s = size(#); 41 def P= basering; 42 if( s==0 or (typeof(#[1]) != "string") ) 43 { 44 os = "dp(" + string( nvars(P) ) + ")"; 45 if ( (find( ordstr(P), os ) != 0) and (find( ordstr(P), "a") == 0) ) 46 { 47 os= "Dp"; 48 } 49 else 50 { 51 os= "dp"; 52 } 53 } 54 else { os = #[1]; } 55 56 list BRlist = ringlist(P); 57 int nvarP = nvars(P); 58 intvec w; //for ringweights of basering P 59 int k; 60 for(k=1; k<=nvarP; k++) 61 { 62 w[k]=deg(var(k)); 63 } 64 65 BRlist[3] = list(); 66 if( s==0 ) 67 { 68 if( w==1 ) 69 { 70 BRlist[3][1]=list("dp",w); 42 if (nrows(i) > 1) 43 { 44 ERROR("first argument of 'stdfglm' must be an ideal"); 45 } 46 string os; 47 int s = size(#); 48 def P= basering; 49 string algorithm; 50 int ii; 51 for( ii=1; ii<=s; ii++) 52 { 53 if ( typeof(#[ii])== "string" ) 54 { 55 if ( #[ii]=="std" || #[ii]=="slimgb" ) 56 { 57 algorithm = #[ii]; 58 # = delete(#,ii); 59 s = s-1; 60 ii--; 61 } 62 } 63 } 64 65 if( s > 0 && (typeof(#[1]) == "string") ) 66 { 67 os = #[1]; 68 ideal Qideal = ideal(P); 69 int sQ = size(Qideal); 70 int sM = size(minpoly); 71 if ( sM!=0 ) 72 { 73 string mpoly = string(minpoly); 74 } 75 if (sQ!=0 ) 76 { 77 execute("ring Rfglm=("+charstr(P)+"),("+varstr(P)+"),"+os+";"); 78 ideal Qideal = fetch(P,Qideal); 79 qring Pfglm = groebner(Qideal,"std","slimgb"); 71 80 } 72 81 else 73 82 { 74 BRlist[3][1]=list("wp",w); 75 } 76 BRlist[3][2]=list("C",intvec(0)); 77 def Pfglm = ring(quotientList(BRlist)); 78 setring Pfglm; 83 execute("ring Pfglm=("+charstr(P)+"),("+varstr(P)+"),"+os+";"); 84 } 85 if ( sM!=0 ) 86 { 87 execute("minpoly="+mpoly+";"); 88 } 79 89 } 80 90 else 81 91 { 82 ideal Qideal = ideal(P); 83 int sQ = size(Qideal); 84 int sM = size(minpoly); 85 if ( sM!=0 ) 86 { 87 string mpoly = string(minpoly); 88 } 89 if (sQ!=0 ) 90 { 91 execute("ring Rfglm=("+charstr(P)+"),("+varstr(P)+"),"+os+";"); 92 ideal Qideal = fetch(P,Qideal); 93 qring Pfglm = groebner(Qideal,"std","slimgb"); 94 } 95 else 96 { 97 execute("ring Pfglm=("+charstr(P)+"),("+varstr(P)+"),"+os+";"); 98 } 99 if ( sM!=0 ) 100 { 101 execute("minpoly="+mpoly+";"); 102 } 103 } 104 ideal i= fetch(P,i); 105 106 //save options: 107 int p_opt; 108 string s_opt = option(); 109 if (find(s_opt, "prot")) { p_opt = 1; } 110 intvec opt= option(get); 111 92 list BRlist = ringlist(P); 93 int nvarP = nvars(P); 94 intvec w; //for ringweights of basering P 95 int k; 96 for(k=1; k <= nvarP; k++) 97 { 98 w[k]=deg(var(k)); 99 } 100 101 BRlist[3] = list(); 102 if( s==0 or (typeof(#[1]) != "string") ) 103 { 104 if( w==1 ) 105 { 106 BRlist[3][1]=list("dp",w); 107 } 108 else 109 { 110 BRlist[3][1]=list("wp",w); 111 } 112 BRlist[3][2]=list("C",intvec(0)); 113 def Pfglm = ring(quotientList(BRlist)); 114 setring Pfglm; 115 } 116 } 117 ideal i = fetch(P,i); 118 119 intvec opt = option(get); //save options 112 120 option(redSB); 113 //if(p_opt){"groebner in "+string(Pfglm);} 114 i = groebner(i,"std","slimgb"); 121 if (size(algorithm) > 0) 122 { 123 i = groebner(i,algorithm); 124 } 125 else 126 { 127 i = groebner(i); 128 } 115 129 option(set,opt); 116 130 setring P; … … 119 133 example 120 134 { "EXAMPLE:"; echo = 2; 121 ring r =0,(x,y,z),lp;122 ideal i =y3+x2,x2y+x2,x3-x2,z4-x2-y;123 stdfglm(i); //uses fglm from "dp"to "lp"124 125 ring s = (0,x),(y,z,u,v),lp; 126 // qring qs = std(y2-z3); ### Bug in fglm mit qring 135 ring r = 0,(x,y,z),lp; 136 ideal i = y3+x2,x2y+x2,x3-x2,z4-x2-y; 137 stdfglm(i); //uses fglm from "dp" (with groebner) to "lp" 138 stdfglm(i,"std"); //uses fglm from "dp" (with std) to "lp" 139 140 ring s = (0,x),(y,z,u,v),lp; 127 141 minpoly = x2+1; 128 ideal i = y3+x2,u2y+u2,u3-u2,z4-u2-y,v; 129 stdfglm(i,"Dp"); //uses fglm from "Dp" to "lp" 142 ideal i = u5-v4,zv-u2,zu3-v3,z2u-v2,z3-uv,yv-zu,yu-z2,yz-v,y2-u,u-xy2; 143 weight(i); 144 stdfglm(i,"(a(2,3,4,5),dp)"); //uses fglm from "(a(2,3,4,5),dp)" to "lp" 130 145 } 131 146 132 147 ///////////////////////////////////////////////////////////////////////////// 133 148 134 proc stdhilb(i deal i,list #)149 proc stdhilb(i,list #) 135 150 "SYNTAX: @code{stdhilb (} ideal_expression @code{)} @* 151 @code{stdhilb (} module_expression @code{)} @* 136 152 @code{stdhilb (} ideal_expression@code{,} intvec_expression @code{)} 137 153 @code{stdhilb (} ideal_expression@code{,} list of string_expressions 138 154 and intvec_expressin @code{)} @* 139 TYPE: ideal140 PURPOSE: Compute a Groebner basis of the ideal in the basering by using the141 Hilbert driven Groebner basis algorithm.155 TYPE: type of the first argument 156 PURPOSE: Compute a Groebner basis of the ideal/module in the basering by 157 using the Hilbert driven Groebner basis algorithm. 142 158 If an argument of type string @code{\"std\"} resp. @code{\"slimgb\"} 143 159 is given, the standard basis computation uses @code{std} or … … 151 167 driven algorithm. 152 168 NOTE: 'homogeneous' means weighted homogeneous with respect to the weights 153 w[i] of the variables var(i) of the basering. 154 ASSUME: The argument of type intvec is the 1st Hilbert series as computed 155 by @code{hilb} using an intvector w with w[i]=deg(var(i)). 169 w[i] of the variables var(i) of the basering. Parameters are not 170 converted to variables. 171 ASSUME: The argument of type intvec is the 1st Hilbert series, computed 172 by @code{hilb} using an intvector w, w[i]=deg(var(i)), as third 173 argument 156 174 SEE ALSO: stdfglm, std, slimgb, groebner 157 175 KEYWORDS: Hilbert function … … 161 179 //--------------------- save data from basering -------------------------- 162 180 def P=basering; 181 int nr = nrows(i); //nr=1 iff i is an ideal 163 182 ideal Qideal = ideal(P); //defining the quotient ideal if P is a qring 164 183 int was_qring; //remembers if basering was a qring … … 192 211 //--------------------- check the given method --------------------------- 193 212 string method; 194 list Method;195 213 for (k=1; k<=size(#); k++) 196 214 { … … 202 220 { 203 221 method = method + "," + #[k]; 204 Method = Method + list(#[k]);205 222 } 206 223 } … … 225 242 return( std(i,hi,w) ); 226 243 } 227 if (p_opt){" stdhilb not implemented, use std in basering";}228 //if ( neg ) // std can handle local and mixed orderings244 if (p_opt){"//--stdhilb not implemented, use std in basering";} 245 //if ( neg ) 229 246 //{ 230 247 // "//*** WARNING: non-positive ring weights, computation may not finish"; … … 235 252 //------------------------ change to hilbRing ---------------------------- 236 253 237 list hiRi = hilbRing(i); 238 intvec W = hiRi[2]; 239 def Philb = hiRi[1]; // note:Philb is no qring and the predefined240 setring Philb; //ideal Id(1) in Philb is homogeneous241 254 list hiRi = hilbRing(i); //The ground field of P and Philb coincide 255 intvec W = hiRi[2]; //Philb has an extra variable @ or @(k) 256 def Philb = hiRi[1]; //Philb is no qring and the predefined 257 setring Philb; //ideal/module Id(1) in Philb is homogeneous 258 //Parameters of P are not converted in Philb 242 259 //-------- compute Hilbert function of homogenized ideal in Philb --------- 243 260 //Philb has only 1 block. There are three cases … … 266 283 if ( algorithm=="slimgb" || ( algorithm=="stdorslimgb" && char(P)==0 ) ) 267 284 { 268 intvec hi = hilb(qslimgb(Id(1)),1,W);285 intvec hi = hilb(qslimgb(Id(1)),1,W); 269 286 } 270 287 271 //------------- case where we need another intermediate ring ------------- 272 //we add extra blocks for homogenizing variable @hilbRing@ 273 //and for converted parameters 288 //-------------- we need another intermediate ring Phelp ---------------- 289 //In Phelp we change the ordering from Philb, otherwise it coincides with 290 //Philb, that is, it has in addition to P an extra homogenizing variable 291 //with name @, resp. @(i) if @ and @(1), ..., @(i-1) are defined. 292 //Phelp has the same ordering as P on common variables. In Phelp 293 //a quotient ideal from P is added to the input 274 294 275 295 list BRlist = ringlist(Philb); … … 297 317 def Phelp = ring(quotientList(BRlist)); 298 318 setring Phelp; 299 ideali = imap(Philb, Id(1));319 def i = imap(Philb, Id(1)); 300 320 kill Philb; 301 321 302 322 // compute std with Hilbert series 303 if (w ==1 323 if (w ==1) 304 324 { 305 325 if (p_opt){ "std with hilb in " + string(Phelp);} … … 320 340 "dehomogenization"; 321 341 } 322 i = subst(i, @hilbRing@, 1);342 i = subst(i, var(nvars(basering)), 1); 323 343 324 344 if (p_opt) … … 335 355 i = imap(Phelp,i); 336 356 kill Phelp; 357 if( was_qring) 358 { 359 i = NF(i,std(0)); 360 } 337 361 i = simplify(i,34); 338 362 339 // compute reduce sSB363 // compute reduced SB 340 364 if (find(s_opt, "redSB") > 0) 341 365 { 342 366 if (p_opt) 343 367 { 344 " interreduction";368 "//interreduction"; 345 369 } 346 370 i=interred(i); … … 392 416 } 393 417 } 394 ideal Qideal = RL[4]; //##Achtung, nichtkommuatativem Fall behandeln 395 if( size(Qideal) <= 1) 418 ideal Qideal = RL[4]; //##Achtung: falls basering Nullteiler hat, kann 419 //die SB eines Elements mehrere Elemente enthalten 420 if( size(Qideal) <= 0) 396 421 { 397 422 return (RL); … … 427 452 /////////////////////////////////////////////////////////////////////////////// 428 453 proc par2varRing (list #) 429 "USAGE: par2varRing([l]); l list of ideals [default:l=empty list]454 "USAGE: par2varRing([l]); l list of ideals/modules [default:l=empty list] 430 455 RETURN: list, say L, with L[1] a ring where the parameters of the 431 456 basering have been converted to an additional last block of 432 variables all of weight 1 and ordering dp. 433 If a list l with l[i] an ideal is given, then l[i]+minpoly is 434 mapped to an ideal in L[1] with name Id(i) 457 variables, all of weight 1, and ordering dp. 458 If a list l with l[i] an ideal/module is given, then 459 l[i] + minpoly*freemodule(nrows(l[i])) is mapped to an ideal/module 460 in L[1] with name Id(i). 435 461 If the basering has no parameters then L[1] is the basering. 436 462 EXAMPLE: example par2varRing; shows an example" … … 445 471 for( ii = 1; ii <= s; ii++) 446 472 { 447 idealId(ii) = #[ii];473 def Id(ii) = #[ii]; 448 474 export (Id(ii)); 449 475 } … … 455 481 rlist[1] = parlist[1]; 456 482 poly Minpoly = minpoly; //check for minpoly: 483 int sm = size(Minpoly); 457 484 458 485 //now create new ring 459 if ( size(Minpoly) == 0 ) 460 { 461 for( ii = 1; ii <= s; ii++) 462 { 463 ideal Id(ii) = #[ii]; 464 } 465 } 466 else 467 { 468 if( find(option(),"prot") ){"add minpoly to input";} 469 for( ii = 1; ii <= s; ii++) 470 { 471 ideal Id(ii) = #[ii]; 472 Id(ii)[ncols(Id(ii))+1]=Minpoly; 473 } 486 for( ii = 1; ii <= s; ii++) 487 { 488 def Id(ii) = #[ii]; 474 489 } 475 490 int nvar = size(rlist[2]); … … 500 515 def Ppar2var = ring(quotientList(rlist)); 501 516 setring Ppar2var; 502 for( ii = 1; ii <= s; ii++) 503 { 504 def Id(ii) = imap(P,Id(ii)); 505 export (Id(ii)); 517 if ( sm == 0 ) 518 { 519 for( ii = 1; ii <= s; ii++) 520 { 521 def Id(ii) = imap(P,Id(ii)); 522 export (Id(ii)); 523 } 524 } 525 else 526 { 527 if( find(option(),"prot") ){"//add minpoly to input";} 528 poly Minpoly = imap(P,Minpoly); 529 for( ii = 1; ii <= s; ii++) 530 { 531 def Id(ii) = imap(P,Id(ii)); 532 Id(ii) = Id(ii),Minpoly*freemodule(nrows(Id(ii))); 533 export (Id(ii)); 534 } 506 535 } 507 536 list Lpar2var = Ppar2var; … … 516 545 setring(P); 517 546 Id(1); 547 548 setring R; 549 module m = x3*[1,1,1], (xyzuv-1)*[1,0,1]; 550 def Q = par2varRing(m)[1]; Q; 551 setring(Q); 552 print(Id(1)); 518 553 } 519 554 520 555 ////////////////////////////////////////////////////////////////////////////// 521 556 proc hilbRing ( list # ) 522 "USAGE: hilbRing([l]); l list of ideals [default:l=empty list]557 "USAGE: hilbRing([l]); l list of ideals/modules [default:l=empty list] 523 558 RETURN: list, say L: L[1] is a ring and L[2] an intvec 524 L[1] is a ring whith an extra homogenizing variable 525 @hilbRing@. The monomial ordering of L[1] is 1 block dp if the 559 L[1] is a ring whith an extra homogenizing variable with name @, 560 resp. @(i) if @ and @(1), ..., @(i-1) are defined. 561 The monomial ordering of L[1] is 1 block dp if the 526 562 weights of the variables of the basering, say R, are all 1, resp. 527 563 wp(w,1) wehre w is the intvec of weights of the variables of R. 528 If the basering is a quotient ring P/Q, then L[1] is not a quotient529 ring but contains the ideal @Qidealhilb@, the homogenized ideal530 Q of P.564 If R is a quotient ring P/Q, then L[1] is not a quotient ring but 565 contains the ideal @Qidealhilb@, the homogenized ideal Q of P. 566 (Parameters of R are not touched). 531 567 If a list l is given with l[i] an ideal, then l[i] is 532 568 mapped to the homogenized ideal Id(i) in L[1]. … … 538 574 { 539 575 def P = basering; 540 number Minpoly = minpoly;541 //##kann entfallen, wenn minpoly richtig gemapt wird542 543 if( size(Minpoly) > 0 ) //remember minpoly //##544 {545 int is_minpoly =1;546 }547 548 576 ideal Qideal = ideal(P); //defining the quotient ideal if P is a qring 549 577 if( size(Qideal) != 0 ) … … 565 593 for(k = 1; k <= s; k++) 566 594 { 567 ideal Id(k) = #[k]; 568 } 569 570 // a homogenizing variable is added 571 BRlist[2][nvarP+1] = "@hilbRing@"; 595 def Id(k) = #[k]; 596 int nr(k) = nrows(Id(k)); 597 } 598 599 // a homogenizing variable is added: 600 // call it @, resp. @(k) if @(1),...,@(k-1) are defined 601 string homvar; 602 if ( defined(@)==0 ) 603 { 604 homvar = "@"; 605 } 606 else 607 { 608 k=1; 609 while( defined(@(k)) != 0 ) 610 { 611 k++; 612 } 613 homvar = "@("+string(k)+")"; 614 } 615 BRlist[2][nvarP+1] = homvar; 572 616 w[nvarP +1]=1; 573 617 … … 588 632 589 633 //change ring and get ideal from previous ring 590 //(imap converts parameters of P automatically to variables in Phelp)591 if( defined(is_minpoly) ) //##592 {593 BRlist[1][4] = ideal(0);594 }595 596 634 def Philb = ring(quotientList(BRlist)); 597 635 kill BRlist; 598 636 setring Philb; 599 if( defined(is_minpoly) ) //##600 {601 minpoly = imap(P,Minpoly);602 }603 637 if( defined(is_qring) ) 604 638 { 605 ideal @Qidealhilb@ = homog( imap(P,Qideal), @hilbRing@);639 ideal @Qidealhilb@ = homog( imap(P,Qideal), `homvar` ); 606 640 export(@Qidealhilb@); 607 641 … … 609 643 for(k = 1; k <= s; k++) 610 644 { //homogenize 611 ideal Id(k) = homog( imap(P,Id(k)), @hilbRing@ ), @Qidealhilb@ ; 645 def Id(k) = homog( imap(P,Id(k)), `homvar` ); 646 Id(k) = Id(k),@Qidealhilb@*freemodule(nr(k)) ; 612 647 export(Id(k)); 613 648 } … … 617 652 for(k = 1; k <= s; k++) 618 653 { //homogenize 619 ideal Id(k) = homog( imap(P,Id(k)), @hilbRing@);654 def Id(k) = homog( imap(P,Id(k)), `homvar` ); 620 655 export(Id(k)); 621 656 } 622 657 } 623 624 658 list Lhilb = Philb,w; 625 659 return(Lhilb); … … 637 671 qring T = std(x+y2+z3); 638 672 ideal i = xy+xv+yz+zu+uv,xyzuv-v5; 639 def Q = hilbRing(i)[1]; Q; 673 module m = i*[0,1,1] + (xyzuv-v5)*[1,1,0]; 674 def Q = hilbRing(m)[1]; Q; 640 675 setring Q; 641 Id(1);676 print(Id(1)); 642 677 } 643 678 644 679 ////////////////////////////////////////////////////////////////////////////// 645 680 proc qslimgb (i) 646 "USAGE: qslimgb(i); i ideal 647 RETURN: ideal, a standard basis of i computed with slimgb681 "USAGE: qslimgb(i); i ideal or module 682 RETURN: same type as input, a standard basis of i computed with slimgb 648 683 NOTE: As long as slimgb does not know qrings qslimgb should be used in case 649 684 the basering is (possibly) a quotient ring. The quotient ideal is 650 685 added to the input and slimgb is applied. 651 ** not yet implemented for modules652 686 EXAMPLE: example qslimgb; shows an example" 653 687 { … … 676 710 kill BRlist; 677 711 setring Phelp; 678 ideal iq = imap(P,i), imap(P,Qideal); 712 // module case: 713 def iq = imap(P,i); 714 iq = iq, imap(P,Qideal)*freemodule(nrows(iq)); 679 715 if (p_opt) 680 716 { … … 687 723 if (p_opt) 688 724 { 689 " imap to original ring";725 "//imap to original ring"; 690 726 } 691 727 i = imap(Phelp,iq); … … 696 732 if (p_opt) 697 733 { 698 " interreduction";734 "//interreduction"; 699 735 } 700 736 i=interred(i); … … 708 744 qring Q = std(x2-y3); 709 745 ideal i = x+y2,xy+yz+zu+u*v,xyzu*v-1; 710 ideal j = qslimgb(i); 746 ideal j = qslimgb(i); j; 747 748 module m = [x+y2,1,0], [1,1,x2+y2+xyz]; 749 print(qslimgb(m)); 711 750 } 712 751 … … 732 771 a Groebner basis is first computed with an \"easy\" ordering 733 772 and then converted to the ordering of the basering by the 734 Hilbert driven Groebner basis computation .773 Hilbert driven Groebner basis computation or by linear algebra. 735 774 The actual computation of the Groebner basis can be 736 775 specified by @code{\"std\"} or by @code{\"slimgb\"} … … 762 801 //--------------------------------- 763 802 //0. Immer Aufruf von std unabhaengig von der Vorgabe: 764 // gemischte Ordnungen, extra Gewichtsvektor, Matrix Ordnungen , Moduln803 // gemischte Ordnungen, extra Gewichtsvektor, Matrix Ordnungen 765 804 766 805 //1. Keine Vorgabe: es wirkt die aktuelle Heuristk: … … 776 815 // gewaehlt (da slimgb keine Hilbertfunktion kennt, wird std verwendet). 777 816 // Bei slimgb im qring, wird das Quotientenideal zum Ideal addiert. 778 // Bei Angabe von std zusammen mit slimgb (ae uquivalent zur Angabe von817 // Bei Angabe von std zusammen mit slimgb (aequivalent zur Angabe von 779 818 // keinem von beidem) wirkt obige Heuristik. 780 819 … … 795 834 else {ideal i=i_par; } 796 835 kill i_par; 836 797 837 //----------------------- save the given method --------------------------- 798 838 string method; … … 803 843 if (typeof(#[k]) == "int") 804 844 { 805 if (defined(wait) != voice) 806 { 807 int wait = #[k]; 808 } 845 int wait = #[k]; 809 846 } 810 847 if (typeof(#[k]) == "string") … … 821 858 { 822 859 int j = 10; 823 824 860 string bs = nameof(basering); 825 861 link l_fork = "MPtcp:fork"; … … 827 863 write(l_fork, quote(system("pid"))); 828 864 int pid = read(l_fork); 829 write(l_fork, quote(groebner(eval(i))));830 //### write(l_fork, quote(groebner(eval(i),Method)));831 // Fehlermeldung:865 // write(l_fork, quote(groebner(eval(i)))); 866 write(l_fork, quote(groebner(eval(i),eval(Method)))); 867 //###Fehlermeldung: 832 868 // ***dError: undef. ringorder used 833 869 // occured at: … … 935 971 || ( find(ordstr_P,"M") > 0 ) 936 972 || ( find(ordstr_P,"a") > 0 ) 937 || ( nrows(i)>1 ) //module case, not yet handled by slimgb 938 || ( neg>0 ) ) //***fuer Moduln slimgb zulassen, wenn implementiert 973 || ( neg>0 ) ) 939 974 { 940 975 if (p_opt) { "std in basering"; } 941 //if ( neg > 0 ) // std can handle local and mixed orderings 942 //{ 943 // "*** WARNING: some weights are negative, computation may not finish"; 944 //} 945 i = std(i); 946 return(i); 976 return(std(i)); 947 977 } 948 978 949 979 //now we have: 950 //ideal , global ordering, no matrix ordering, no extra weight vector980 //ideal or module, global ordering, no matrix ordering, no extra weight vector 951 981 //The interesting cases start now. 952 982 … … 1012 1042 //define direct: 1013 1043 if ( (order=="simple" && (size(method)==0 )) || 1014 (order=="simple" && (method==",par2var" && npars_P==0 )) ||1044 (order=="simple" && (method==",par2var" && npars_P==0 )) || 1015 1045 (conversion=="no" && partovar=="no" && 1016 1046 (algorithm=="std" || algorithm=="slimgb" || … … 1040 1070 if ( algorithm=="std" || (algorithm=="stdorslimgb" && char(P)>0) ) 1041 1071 { 1042 if (p_opt) { "std in " + string(P); } 1043 return(std(i)); 1072 if (p_opt) { "std in " + string(P); } 1073 i = std(i); 1074 return(i); 1044 1075 } 1045 1076 if ( algorithm=="slimgb" || (algorithm=="stdorslimgb" && char(P)==0) ) 1046 1077 { 1047 return(qslimgb(i)); 1078 i = qslimgb(i); 1079 return(i); 1048 1080 } 1049 1081 } … … 1056 1088 //Note thar "par2var" is not a default strategy, it must be explicitely 1057 1089 //given in order to be performed. 1058 //## TODO: fglm has still to be implemented1059 1090 1060 1091 //------------ case where no parameters are made to variables ------------- … … 1067 1098 if ( conversion=="fglm" ) 1068 1099 { 1069 return (stdfglm(i)); 1100 if ( algorithm=="std" || (algorithm=="stdorslimgb" && char(P)>0) ) 1101 { 1102 return (stdfglm(i,"std")); 1103 } 1104 if ( algorithm=="slimgb" || (algorithm=="stdorslimgb" && char(P)==0) ) 1105 { 1106 return (stdfglm(i,"slimgb")); 1107 } 1070 1108 } 1071 if ( algorithm=="std" || (algorithm=="stdorslimgb" && char(P)>0) ) 1072 { 1073 return (stdhilb(i,"std")); 1074 } 1075 if ( algorithm=="slimgb" || (algorithm=="stdorslimgb" && char(P)==0) ) 1076 { 1077 return (stdhilb(i,"slimgb")); 1109 else 1110 { 1111 if ( algorithm=="std" || (algorithm=="stdorslimgb" && char(P)>0) ) 1112 { 1113 return (stdhilb(i,"std")); 1114 } 1115 if ( algorithm=="slimgb" || (algorithm=="stdorslimgb" && char(P)==0) ) 1116 { 1117 return (stdhilb(i,"slimgb")); 1118 } 1078 1119 } 1079 1120 } … … 1086 1127 // reset options 1087 1128 option(none); 1088 // turn on options prot, mem, intStrategy if previously set1129 // turn on options prot, mem, redSB, intStrategy if previously set 1089 1130 if ( find(s_opt, "prot") ) 1090 1131 { option(prot); } 1091 1132 if ( find(s_opt, "mem") ) 1092 1133 { option(mem); } 1134 if ( find(s_opt, "redSB") ) 1135 { option(redSB); } 1093 1136 if ( find(s_opt, "intStrategy") ) 1094 1137 { option(intStrategy); } … … 1105 1148 def Phelp = par2varRing(i)[1]; //minpoly is mapped with i 1106 1149 setring Phelp; 1107 ideali = Id(1);1150 def i = Id(1); 1108 1151 is_homog = homog(i); 1109 1152 … … 1134 1177 if (p_opt) 1135 1178 { 1136 " simplification";1179 "//simplification"; 1137 1180 } 1138 1181 … … 1144 1187 } 1145 1188 1146 idealLi = lead(i);1189 def Li = lead(i); 1147 1190 setring P; 1148 idealLi = imap(Phelp,Li);1191 def Li = imap(Phelp,Li); 1149 1192 Li = simplify(Li,32); 1150 1193 intvec vi; … … 1167 1210 if (p_opt) 1168 1211 { 1169 " imap to original ring";1212 "//imap to original ring"; 1170 1213 } 1171 1214 i = imap(Phelp,i); … … 1179 1222 if (p_opt) 1180 1223 { 1181 " interreduction";1224 "//interreduction"; 1182 1225 } 1183 1226 i=interred(i); … … 1205 1248 groebner(i,"fglm"); //computes a reduced standard basis 1206 1249 1207 if (system("with","MP")) {groebner(i, 0);}1250 if (system("with","MP")) {groebner(i,10,"std");} 1208 1251 defined(Standard::groebner_error); 1209 1252 option(set,opt); … … 2035 2078 2036 2079 /* 2080 Versuche: 2037 2081 /////////////////////////////////////////////////////////////////////////////// 2038 2082 proc downsizeSB (I, list #) … … 2066 2110 else 2067 2111 { 2068 ERROR(" 2nd argument must be an intvec");2112 ERROR("// 2nd argument must be an intvec"); 2069 2113 } 2070 2114 } … … 2301 2345 2302 2346 */ 2347
Note: See TracChangeset
for help on using the changeset viewer.