Changeset a19255 in git
- Timestamp:
- Jan 15, 2009, 11:57:51 AM (14 years ago)
- Branches:
- (u'spielwiese', '0d6b7fcd9813a1ca1ed4220cfa2b104b97a0a003')
- Children:
- a3bd0b4110d9421ff0cc3528479db22659011909
- Parents:
- 81733986448f9a0d2629201f6509a9ea8f70fb38
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/elim.lib
r817339 ra19255 1 // $Id: elim.lib,v 1.26 2009-01-14 16:07:04 Singular Exp $ 2 /////////////////////////////////////////////////////////////////////////////// 3 version="$Id: elim.lib,v 1.26 2009-01-14 16:07:04 Singular Exp $"; 1 // $Id: elim.lib,v 1.27 2009-01-15 10:57:51 Singular Exp $ 2 // (GMG, modified 22.06.96) 3 // GMG, last modified 30.10.08: new procedure elimRing; 4 // elim changes now to ring with elimination ordering (extra weight vector 5 // a(...)), works now in qring, new examples have been added; 6 // syntax of elim, nselect, select and select1 changed: instead of two 7 // integers an intvec can be given. Bug in nselect fixed which occured 8 // in connectin with type conversion from matrix to module. 9 // GMG, last modified 5.01.09: elim uses now stdhilb(id,@w) instead of std(id) 10 // and can now choose as method slimgb or std. 11 /////////////////////////////////////////////////////////////////////////////// 12 version="$Id: elim.lib,v 1.27 2009-01-15 10:57:51 Singular Exp $"; 4 13 category="Commutative Algebra"; 5 14 info=" … … 10 19 elimRing(p); create ring with block ordering for elimating vars in p 11 20 elim(id,..); variables .. eliminated from id (ideal/module) 12 elim1(id,p); p=product of vars to be eliminated from id13 elim2(id,..); variables .. eliminated from id ( ideal/module)21 elim1(id,p); variables .. eliminated from id (different algorithm) 22 elim2(id,..); variables .. eliminated from id (different algorithm) 14 23 nselect(id,v); select generators not containing variables given by v 15 24 sat(id,j); saturated quotient of ideal/module id by ideal j … … 22 31 LIB "general.lib"; 23 32 LIB "poly.lib"; 24 33 LIB "ring.lib"; 25 34 /////////////////////////////////////////////////////////////////////////////// 26 35 … … 108 117 //---- change l[3]: 109 118 l[3][s+1] = l[3][s]; // save the module ordering of the basering 110 intvec w; 111 w[k]=0; w=w+1; 119 intvec w=1:k; 112 120 intvec v; // containing the weights for the varibale 113 121 if( homog(C) ) … … 184 192 //Note that the different affine charts are {y(i)=1} 185 193 } 186 /////////////////////////////////////////////////////////////////////////////// 194 195 ////////////////////////////////////////////////////////////////////////////// 187 196 proc elimRing ( poly vars, list #) 188 "USAGE: elimRing(vars [,w]); vars = product of variables to be eliminated 189 (type poly), w = intvec (specifying weights for all variables) 190 RETURN: a ring, say R, s.t. the monomial ordering of R has 2 blocks. 191 The first block corresponds to the (given) variables to be eliminated 192 and has ordering dp if these variables have weight all 1; if w is 193 given or if not all variables in vars have weight 1 the ordering is 194 wp(w1) where w1 is the intvec of weights of the variables to be 195 eliminated. 196 The second block corresponds to variables not to be eliminated. 197 @* If the first variable not to be eliminated is global (i.e. > 1), 198 resp. local (i.e. < 1), the second block has ordering dp, resp. ds, 199 (or wp(w2), resp. ws(w2), where w2 is the intvec of weights of the 200 variables not to be eliminated). 201 @* If the basering is a quotient ring P/Q, then R a quotient ring 197 "USAGE: elimRing(vars [,w,str]); vars = product of variables to be eliminated 198 (type poly), w = intvec (specifying weights for all variables), 199 str = string either \"a\" or \"b\" (default: w=ringweights, str=\"a\") 200 RETURN: a list, say L, with R:=L[1] a ring and L[2] an intvec. 201 The ordering in R is an elimination ordering for the variables 202 appearing in vars depending on \"a\" resp. \"b\". Let w1 (resp. w2) 203 be the intvec of weights of the variables to be eliminated (resp. not 204 to be eliminated). 205 The monomial ordering of R has always 2 blocks, the first 206 block corresponds to the (given) variables to be eliminated. 207 @* If str = \"a\" the first block is a(w1,0..0) and the second block is 208 wp(w) resp. ws(w) if the first variable not to be eliminated is local. 209 @* If str = \"b\" the 1st block has ordering wp(w1) and the 2nd block 210 is wp(w2) resp. ws(w2) if the first variable not to be eliminated is 211 local. 212 @* If the basering is a quotient ring P/Q, then R is also a quotient ring 202 213 with Q replaced by a standard basis of Q w.r.t. the new ordering 203 214 (parameters are not touched). 204 NOTE: The ordering in R is an elimination ordering for the variables 205 appearing in vars.215 @* The intvec L[2] is the intvec of variable weights (or the given w) 216 with weights <= 0 replaced by 1. 206 217 PURPOSE: Prepare a ring for eliminating vars from an ideal/moduel by 207 218 computing a standard basis in R with a fast monomial ordering. … … 213 224 int nvarBR = nvars(BR); 214 225 list BRlist = ringlist(BR); 215 intvec @w; //to store weights of all variables 226 //------------------ set resp. compute ring weights ---------------------- 227 int ii; 228 intvec @w; //to store weights of all variables 216 229 @w[nvarBR] = 0; 217 @w = @w + 1; //initialize @w as 1..1 230 @w = @w + 1; //initialize @w as 1..1 231 string str = "a"; //default for specifying elimination ordering 232 if (size(#) == 0) //default values 233 { 234 @w = ringweights(BR); //compute the ring weights (proc from ring.lib) 235 } 236 218 237 if (size(#) == 1) 219 238 { … … 222 241 @w = #[1]; //take the given weights 223 242 } 224 } 225 else 226 { 227 @w = ringweights(BR); //compute the ring weights (proc from ring.lib) 228 } 229 230 //--- get variables to be eliminated and ringweights: 243 if ( typeof(#[1]) == "string" ) 244 { 245 str = #[1]; //string for specifying elimination ordering 246 } 247 } 248 249 if (size(#) >= 2) 250 { 251 if ( typeof(#[1]) == "intvec" and typeof(#[2]) == "string" ) 252 { 253 @w = #[1]; //take the given weights 254 str = #[2]; //string for specifying elimination ordering 255 256 } 257 if ( typeof(#[1]) == "string" and typeof(#[2]) == "intvec" ) 258 { 259 str = #[1]; //string for specifying elimination ordering 260 @w = #[2]; //take the given weights 261 } 262 } 263 264 for ( ii=1; ii<=size(@w); ii++ ) 265 { 266 if ( @w[ii] <= 0 ) 267 { 268 @w[ii] = 1; //replace non-positive weights by 1 269 } 270 } 271 272 //------ get variables to be eliminated together with their weights ------- 231 273 intvec w1,w2; //for ringweights of first (w1) and second (w2) block 232 274 list v1,v2; //for variables of first (to be liminated) and second block 233 275 234 int ii;235 276 for( ii=1; ii<=nvarBR; ii++ ) 236 277 { … … 251 292 } 252 293 253 int l1, l2 = size(w1), size(w2); 254 if ( l1 <= 1 ) 255 { 256 ERROR("no elimination ?"); 257 //return(BR); 258 } 259 if ( l2 <= 1 ) 294 if ( size(w1) <= 1 ) 295 { 296 return(BR); 297 } 298 if ( size(w2) <= 1 ) 260 299 { 261 300 ERROR("## elimination of all variables is not possible"); … … 264 303 w1 = w1[2..size(w1)]; 265 304 w2 = w2[2..size(w2)]; 266 267 //--- put variables to be eliminated in front: 268 BRlist[2] = v1 + v2; 269 270 //--- create a block ordering with two blocks and weights: 271 int nblock = size(BRlist[3]); //number of blocks 272 list BR3 = BRlist[3]; //save ordering 273 BRlist[3] = list(); 274 list B3; 275 276 if( w1==1 ) 277 { 278 B3[1] = list("dp", w1); 279 } 305 BRlist[2] = v1 + v2; //put variables to be eliminated in front 306 307 //-------- create elimination ordering with two blocks and weights --------- 308 //Assume that the first r of the n variables are to be eliminated. 309 //Then, in case of an a-ordering (default), the new ring ordering will be 310 //of the form (a(1..1,0..0),dp) with r 1's and n-r 0's or (a(w1,0..0),wp(@w)) 311 //if there are varaible weights which are not 1. 312 //In the case of a b-ordering the ordering will be a block ordering with two 313 //blocks of the form (dp(r),dp(n-r)) resp. (wp(w1),dp(w2)) 314 315 list B3; //this will become the list for new ordering 316 317 //----- b-ordering case: 318 if ( str == "b" ) 319 { 320 if( w1==1 ) //weights for vars to be eliminated are all 1 321 { 322 B3[1] = list("dp", w1); 323 } 324 else 325 { 326 B3[1] = list("wp", w1); 327 } 328 329 if( w2==1 ) //weights for vars not to be eliminated are all 1 330 { 331 if ( local==1 ) 332 { 333 B3[2] = list("ds", w2); 334 } 335 else 336 { 337 B3[2] = list("dp", w2); 338 } 339 } 340 else 341 { 342 if ( local==1 ) 343 { 344 B3[2] = list("ws", w2); 345 } 346 else 347 { 348 B3[2] = list("wp", w2); 349 } 350 } 351 } 352 353 //----- a-ordering case: 280 354 else 281 355 { 282 B3[1] = list("wp", w1); 283 } 284 285 if( w2==1 ) 286 { 287 if ( local==1 ) 288 { 289 B3[2] = list("ds", w2); 290 } 291 else 292 { 293 B3[2] = list("dp", w2); 294 } 295 } 296 else 297 { 298 if ( local==1 ) 299 { 300 B3[2] = list("ws", w2); 301 } 302 else 303 { 304 B3[2] = list("wp", w2); 305 } 306 } 307 356 //define first the second block 357 if( @w==1 ) //weights for all vars are 1 358 { 359 if ( local==1 ) 360 { 361 B3[2] = list("ls", @w); 362 } 363 else 364 { 365 B3[2] = list("dp", @w); 366 } 367 } 368 else 369 { 370 if ( local==1 ) 371 { 372 B3[2] = list("ws", @w); 373 } 374 else 375 { 376 B3[2] = list("wp", @w); 377 } 378 } 379 380 //define now the first a-block of the form a(w1,0..0) 381 intvec @v; 382 @v[nvarBR] = 0; 383 @v = @v+w1; 384 B3[1] = list("a", @v); 385 } 308 386 BRlist[3] = B3; 309 387 310 //Module ordering stays in front resp. at the end: 311 if( BR3[nblock][1] =="c" || BR3[nblock][1] =="C" ) 312 { 313 BRlist[3] = insert(BRlist[3],BR3[nblock],size(B3)); 314 } 315 else 316 { 317 BRlist[3] = insert(BRlist[3],BR3[1]); 318 } 388 //----------- put module ordering always at the end and return ------------- 389 390 BRlist[3] = insert(BRlist[3],list("C",intvec(0)),size(B3)); 319 391 320 392 def eRing = ring(quotientList(BRlist)); 321 return (eRing); 393 list result = eRing, @w; 394 return (result); 322 395 } 323 396 example … … 331 404 minpoly = a2+1; 332 405 qring T = std(ideal(x+y2+v3,(x+v)^2)); 333 def Q = elimRing(yv) ;406 def Q = elimRing(yv)[1]; 334 407 setring Q; Q; 335 408 } … … 337 410 338 411 proc elim (id, list #) 339 "USAGE: elim(id,arg[,\"withWeights\"]); id ideal/module, arg can be either 340 an intvec vor a product p of variables (type poly) 412 "USAGE: elim(id,arg[,s]); id ideal/module, arg can be either an intvec v or 413 a product p of variables (type poly), s a string determining the 414 method which can be \"slimgb\" or \"std\" or, additionally, 415 \"withWeigts\". 341 416 RETURN: ideal/module obtained from id by eliminating either the variables 342 417 with indices appearing in v or the variables appearing in p. 343 418 Works also in a qring. 344 METHOD: elim uses elimRing to create a ring with block ordering with two 345 blocks where the first block contains the variables to be eliminated 346 and then uses groebner. If the variables in the basering have weights 347 these weights are used in elimRing. 348 @* If a string \"withWeigts\" as second, optional argument is given, 419 METHOD: elim uses elimRing to create a ring with an elimination ordering for 420 the variables to be eliminated and then applies std if \"std\" 421 is given, or slimgb if \"slimgb\" is given, or a heuristically choosen 422 method. 423 @* If the variables in the basering have weights these weights are used 424 in elimRing. If a string \"withWeigts\" as (optional) argument is given 349 425 Singular computes weights for the variables to make the input as 350 426 homogeneous as possible. 351 427 @* The method is different from that used by eliminate and elim1; 352 in some examples elim can be significantlyfaster.428 depending on the example, any of these commands can be faster. 353 429 NOTE: No special monomial ordering is required, i.e. the ordering can be 354 430 local or mixed. The result is a SB with respect to the ordering of … … 367 443 int pr = printlevel - voice + 2; //for ring display if printlevel > 0 368 444 def BR = basering; 445 list lER; //for list returned by elimRing 369 446 //-------------------------------- check input ------------------------------- 370 447 poly vars; 448 int ne; //for number of vars to be eliminated 371 449 int ii; 372 450 if (size(#) > 0) … … 375 453 { 376 454 vars = #[1]; 377 } 378 if ( typeof(#[1]) == "intvec") 379 { 455 for( ii=1; ii<=nvars(BR); ii++ ) 456 { 457 if ( vars/var(ii) != 0) 458 { ne++; } 459 } 460 } 461 if ( typeof(#[1]) == "intvec" or typeof(#[1]) == "int") 462 { 463 ne = size(#[1]); 380 464 vars=1; 381 for( ii=1; ii<= size(#[1]); ii++ )465 for( ii=1; ii<=ne; ii++ ) 382 466 { 383 467 vars=vars*var(#[1][ii]); … … 385 469 } 386 470 } 387 if (size(#) == 2) 471 472 string method; //for "std" or "slimgb" or "withWeights" 473 if (size(#) >= 2) 388 474 { 389 475 if ( typeof(#[2]) == "string" ) … … 391 477 if ( #[2] == "withWeights" ) 392 478 { 393 intvec @w = weight(id); 479 intvec @w = weight(id); //computation of weights 394 480 } 481 if ( #[2] == "std" ) { method = "std"; } 482 if ( #[2] == "slimgb" ) { method = "slimgb"; } 483 } 484 if (size(#) == 3) 485 { 486 if ( typeof(#[3]) == "string" ) 487 { 488 if ( #[3] == "withWeights" ) 489 { 490 intvec @w = weight(id); //computation of weights 491 } 492 if ( #[3] == "std" ) { method = "std"; } 493 if ( #[3] == "slimgb" ) { method = "slimgb"; } 494 } 395 495 } 396 496 } 397 497 398 498 //-------------- create new ring and map objects to new ring ------------------ 399 if ( defined(@w) ) 400 { 401 def ER = elimRing(vars,@w); 402 } 403 else 404 { 405 def ER = elimRing(vars); 406 } 407 setring ER; 408 def id = imap(BR,id); 409 poly vars = imap(BR,vars); 499 if ( defined(@w) ) 500 { 501 lER = elimRing(vars,@w); //in this case lER[2] = @w 502 } 503 else 504 { 505 lER = elimRing(vars); 506 intvec @w = lER[2]; //in this case w is the intvec of 507 //variable weights as computed in elimRing 508 } 509 def ER = lER[1]; 510 setring ER; 511 def id = imap(BR,id); 512 poly vars = imap(BR,vars); 513 410 514 //---------- now eliminate in new ring and map back to old ring --------------- 411 id = groebner(id); 412 id = nselect(id,1..size(ringlist(ER)[3][1][2])); 413 if ( pr > 0 ) 414 { 515 //if possible apply std(id,hi,w) where hi is the first hilbert function 516 //of id with respect to the weights w. If w is not defined (i.e. good weights 517 //@w are computed then id is only approximately @w-homogeneous and 518 //the hilbert driven std cannot be used directly; however, stdhilb 519 //homogenizes first and applies the hilbert driven std to the homogenization 520 521 option(redThrough); 522 if (typeof(id)=="matrix") 523 { 524 id = matrix(stdhilb(module(id),method,@w)); 525 } 526 else 527 { 528 id = stdhilb(id,method,@w); 529 } 530 531 //### Todo: hier sollte id = groebner(id, "hilb"); verwendet werden. 532 //da z.Zt. (Jan 09) groebener bei extra Gewichtsvektor a(...) aber stets std 533 //aufruft und ausserdem "withWeigts" nicht kennt, ist groebner(id, "hilb") 534 //zunaechst nicht aktiviert. Ev. nach Ueberarbeitung von groebner aktivieren 535 536 id = nselect(id,1..ne); 537 if ( pr > 0 ) 538 { 415 539 "// result is a SB in the following ring:"; 416 ER;417 }418 setring BR;419 return(imap(ER,id));540 ER; 541 } 542 setring BR; 543 return(imap(ER,id)); 420 544 } 421 545 example … … 427 551 int p = printlevel; 428 552 printlevel = 2; 429 elim(i,uv,"withWeights" );553 elim(i,uv,"withWeights","slimgb"); 430 554 printlevel = p; 431 555 … … 477 601 m=elim2(m,3..4);show(m); 478 602 } 479 /////////////////////////////////////////////////////////////////////////////// 480 proc elim1 (id, poly vars) 481 "USAGE: elim1(id,p); id ideal/module, p product of vars to be eliminated 482 RETURN: ideal/module obtained from id by eliminating vars occuring in poly 603 604 /////////////////////////////////////////////////////////////////////////////// 605 proc elim1 (id, list #) 606 "USAGE: elim1(id,arg); id ideal/module, arg can be either an intvec v or a 607 product p of variables (type poly) 608 RETURN: ideal/module obtained from id by eliminating either the variables 609 with indices appearing in v or the variables appearing in p 483 610 METHOD: elim1 calls eliminate but in a ring with ordering dp (resp. ls) 484 611 if the first var not to be eliminated belongs to a -p (resp. -s) … … 493 620 if ( size(ideal(br)) != 0 ) 494 621 { 495 ERROR ("cannot eliminate in a qring"); 496 } 622 ERROR ("elim1 cannot eliminate in a qring"); 623 } 624 //------------- create product vars of variables to be eliminated ------------- 625 poly vars; 626 int ii; 627 if (size(#) > 0) 628 { 629 if ( typeof(#[1]) == "poly" ) { vars = #[1]; } 630 if ( typeof(#[1]) == "intvec" or typeof(#[1]) == "int") 631 { 632 vars=1; 633 for( ii=1; ii<=size(#[1]); ii++ ) 634 { 635 vars=vars*var(#[1][ii]); 636 } 637 } 638 } 497 639 //---- get variables to be eliminated and create string for new ordering ------ 498 int ii;499 640 for( ii=1; ii<=nvars(basering); ii++ ) 500 641 { … … 519 660 elim1(i,ts); 520 661 module m=i*gen(1)+i*gen(2); 521 m=elim1(m,st); show(m); 522 } 523 /////////////////////////////////////////////////////////////////////////////// 662 m=elim1(m,3..4); show(m); 663 } 664 /////////////////////////////////////////////////////////////////////////////// 665 524 666 proc nselect (id, intvec v) 525 667 "USAGE: nselect(id,v); id = ideal, module or matrix, v = intvec … … 528 670 SEE ALSO: select, select1 529 671 EXAMPLE: example nselect; shows examples 530 "{ 531 if (typeof(id)!="ideal") 532 { 533 if (typeof(id)=="module" || typeof(id)=="matrix") 534 { 535 module id1 = module(id); 536 } 537 else 538 { 539 ERROR("// *** input must be of type ideal or module or matrix"); 540 } 672 " 673 { 674 if (typeof(id) != "ideal") 675 { 676 if (typeof(id)=="module" || typeof(id)=="matrix") 677 { 678 module id1 = module(id); 679 } 680 else 681 { 682 ERROR("// *** input must be of type ideal or module or matrix"); 683 } 541 684 } 542 685 else … … 556 699 } 557 700 } 558 id1=simplify(id1,2);559 701 if(typeof(id)=="matrix") 560 702 { 561 return(matrix( id1));562 } 563 return( id1);703 return(matrix(simplify(id1,2))); 704 } 705 return(simplify(id1,2)); 564 706 } 565 707 example … … 614 756 } 615 757 /////////////////////////////////////////////////////////////////////////////// 758 616 759 proc select (id, intvec v) 617 760 "USAGE: select(id,n[,m]); id = ideal/module/matrix, v = intvec … … 622 765 SEE ALSO: select1, nselect 623 766 EXAMPLE: example select; shows examples 624 "{ 625 if (typeof(id)!="ideal") 626 { 627 if (typeof(id)=="module" || typeof(id)=="matrix") 628 { 629 module id1 = module(id); 630 } 631 else 632 { 633 ERROR("// *** input must be of type ideal or module or matrix"); 634 } 767 " 768 { 769 if (typeof(id) != "ideal") 770 { 771 if (typeof(id)=="module" || typeof(id)=="matrix") 772 { 773 module id1 = module(id); 774 } 775 else 776 { 777 ERROR("// *** input must be of type ideal or module or matrix"); 778 } 635 779 } 636 780 else 637 781 { 638 ideal id1 = id;782 ideal id1 = id; 639 783 } 640 784 int j,k; … … 677 821 SEE ALSO: select, nselect 678 822 EXAMPLE: example select1; shows examples 679 "{ 680 if (typeof(id)!="ideal") 681 { 682 if (typeof(id)=="module" || typeof(id)=="matrix") 683 { 684 module id1 = module(id); 685 module I; 686 } 687 else 688 { 689 ERROR("// *** input must be of type ideal or module or matrix"); 690 } 823 " 824 { 825 if (typeof(id) != "ideal") 826 { 827 if (typeof(id)=="module" || typeof(id)=="matrix") 828 { 829 module id1 = module(id); 830 module I; 831 } 832 else 833 { 834 ERROR("// *** input must be of type ideal or module or matrix"); 835 } 691 836 } 692 837 else 693 838 { 694 ideal id1 = id;695 ideal I;839 ideal id1 = id; 840 ideal I; 696 841 } 697 842 int j,k; … … 706 851 } 707 852 } 708 I=simplify(I,2);709 853 if(typeof(id)=="matrix") 710 854 { 711 return(matrix( I));712 } 713 return( I);855 return(matrix(simplify(I,2))); 856 } 857 return(simplify(I,2)); 714 858 } 715 859 example … … 722 866 select1(matrix(m),1..2); 723 867 } 724 /////////////////////////////////////////////////////////////////////////////// 868 /* 869 /////////////////////////////////////////////////////////////////////////////// 870 // EXAMPLEs 871 /////////////////////////////////////////////////////////////////////////////// 872 // Siehe auch file 'tst-elim' mit grossem Beispiel; 873 example blowup0; 874 example elimRing; 875 example elim; 876 example elim1; 877 example nselect; 878 example sat; 879 example select; 880 example select1; 881 //=========================================================================== 882 // Rationale Normalkurve vom Grad d im P^d bzw. im A^d: 883 //homogen s:t -> (t^d:t^(d-1)s: ...: s^d), inhomogen t ->(t^d:t^(d-1): ...:t) 884 885 //------------------- 1. Homogen: 886 //Varianten der Methode 887 int d = 5; 888 ring R = 0,(s,t,x(0..d)),dp; 889 ideal I; 890 for( int ii=0; ii<=d; ii++) {I = I,ideal(x(ii)-t^(d-ii)*s^ii); } 891 892 int tt = timer; 893 ideal eI = elim(I,1..2,"std"); 894 ideal eI = elim(I,1..2,"slimgb"); 895 ideal eI = elim(I,st,"withWeights"); 896 ideal eI = elim(I,st,"std","withWeights"); 897 //komplizierter 898 int d = 50; 899 ring R = 0,(s,t,x(0..d)),dp; 900 ideal I; 901 for( int ii=0; ii<=d; ii++) {I = I,ideal(x(ii)-t^(d-ii)*s^ii); } 902 int tt = timer; 903 ideal eI = elim(I,1..2); //56(44)sec (slimgb 22(17),hilb 33(26)) 904 timer-tt; tt = timer; 905 ideal eI = elim1(I,1..2); //71(53)sec 906 timer-tt; tt = timer; 907 ideal eI = eliminate(I,st); //70(51)sec (wie elim1) 908 timer-tt; 909 timer-tt; tt = timer; 910 ideal eI = elim(I,1..2,"withWeights"); //190(138)sec 911 //(weights73(49), slimgb43(33), hilb71(53) 912 timer-tt; 913 //------------------- 2. Inhomogen 914 int d = 50; 915 ring r = 0,(t,x(0..d)),dp; 916 ideal I; 917 for( int ii=0; ii<=d; ii++) {I = I+ideal(x(ii)-t^(d-ii)); } 918 int tt = timer; 919 ideal eI = elim(I,1,); //20(15)sec (slimgb13(10), hilb6(5)) 920 ideal eI = elim(I,1,"std"); //17sec (std 11, hilb 6) 921 timer-tt; tt = timer; 922 ideal eI = elim1(I,t); //8(6)sec 923 timer-tt; tt = timer; 924 ideal eI = eliminate(I,t); //7(6)sec 925 timer-tt; 926 timer-tt; tt = timer; 927 ideal eI = elim(I,1..1,"withWeights"); //189(47)sec 928 //(weights73(42), slimgb43(1), hilb70(2) 929 timer-tt; 930 931 //=========================================================================== 932 // Zufaellige Beispiele, homogen 933 system("random",37); 934 ring R = 0,x(1..6),lp; 935 ideal I = sparseid(4,3); 936 937 int tt = timer; 938 ideal eI = elim(I,1); //108(85)sec (slimgb 29(23), hilb79(61) 939 timer-tt; tt = timer; 940 ideal eI = elim(I,1,"std"); //(139)sec (std 77, hilb 61) 941 timer-tt; tt = timer; 942 ideal eI = elim1(I,1); //(nach 45 min abgebrochen) 943 timer-tt; tt = timer; 944 ideal eI = eliminate(I,x(1)); //(nach 45 min abgebrochen) 945 timer-tt; tt = timer; 946 947 // Zufaellige Beispiele, inhomogen 948 system("random",37); 949 ring R = 32003,x(1..5),dp; 950 ideal I = sparseid(4,2,3); 951 option(prot,redThrough); 952 953 intvec w = 1,1,1,1,1,1; 954 int tt = timer; 955 ideal eI = elim(I,1,w); //(nach 5min abgebr.) hilb schlaegt nicht zu 956 timer-tt; tt = timer; //BUG!!!!!! 957 958 int tt = timer; 959 ideal eI = elim(I,1); //(nach 5min abgebr.) hilb schlaegt nicht zu 960 timer-tt; tt = timer; //BUG!!!!!! 961 ideal eI = elim1(I,1); //8(7.8)sec 962 timer-tt; tt = timer; 963 ideal eI = eliminate(I,x(1)); //8(7.8)sec 964 timer-tt; tt = timer; 965 966 BUG!!!! 967 // Zufaellige Beispiele, inhomogen, lokal 968 system("random",37); 969 ring R = 32003,x(1..6),ds; 970 ideal I = sparseid(4,1,2); 971 option(prot,redThrough); 972 int tt = timer; 973 ideal eI = elim(I,1); //(haengt sich auf) 974 timer-tt; tt = timer; 975 ideal eI = elim1(I,1); //(0)sec !!!!!! 976 timer-tt; tt = timer; 977 ideal eI = eliminate(I,x(1)); //(ewig mit ...., abgebrochen) 978 timer-tt; tt = timer; 979 980 ring R1 =(32003),(x(1),x(2),x(3),x(4),x(5),x(6)),(a(1,0,0,0,0,0),ds,C); 981 ideal I = imap(R,I); 982 I = std(I); //(haengt sich auf) !!!!!!! 983 984 ideal eI = elim(I,1..1,"withWeights"); //(47)sec (weights42, slimgb1, hilb2) 985 timer-tt; 986 987 ring R1 =(32003),(x(1),x(2),x(3),x(4),x(5),x(6)),(a(1,0,0,0,0,0),ds,C); 988 ideal I = imap(R,I); 989 I = std(I); //(haengt sich auf) !!!!!!! 990 991 ideal eI = elim(I,1..1,"withWeights"); //(47)sec (weights42, slimgb1, hilb2) 992 timer-tt; 993 */
Note: See TracChangeset
for help on using the changeset viewer.