Changeset d2b2a7 in git for Singular/LIB/presolve.lib
- Timestamp:
- May 5, 1998, 1:55:40 PM (26 years ago)
- Branches:
- (u'spielwiese', '873fc1222e995d7cb33f79d8f1792ce418c8c72c')
- Children:
- 97f92aa6d280f6022eaae47195ccc02503ccb984
- Parents:
- 4996f5286c7671191ad22e654499fd8b752fe4f0
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/presolve.lib
r4996f52 rd2b2a7 1 // $Id: presolve.lib,v 1. 3 1998-04-03 22:47:10krueger Exp $1 // $Id: presolve.lib,v 1.4 1998-05-05 11:55:34 krueger Exp $ 2 2 //system("random",787422842); 3 3 //(GMG), last modified 97/10/07 by GMG 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: presolve.lib,v 1. 3 1998-04-03 22:47:10krueger Exp $";6 version="$Id: presolve.lib,v 1.4 1998-05-05 11:55:34 krueger Exp $"; 7 7 info=" 8 8 LIBRARY: presolve.lib PROCEDURES FOR PRE-SOLVING POLYNOMIAL EQUATIONS … … 32 32 33 33 proc degreepart (id,int d1,int d2,list #) 34 USAGE: degreepart(id,d1,d2[,v]); id=ideal/module, d1,d1=integers, v=intvec34 "USAGE: degreepart(id,d1,d2[,v]); id=ideal/module, d1,d1=integers, v=intvec 35 35 RETURN: generators of id of [v-weighted] total degree >= d1 and <= d2 36 36 (default: v = 1,...,1) 37 37 EXAMPLE: example degreepart; shows an example 38 " 38 39 { 39 40 def dpart = id; … … 67 68 68 69 proc elimlinearpart (ideal i,list #) 69 USAGE: elimlinearpart(i[,n]); i=ideal, n=integer70 "USAGE: elimlinearpart(i[,n]); i=ideal, n=integer 70 71 RETURN: list of of 5 objects: 71 72 [1]: (interreduced) ideal obtained from i by eliminating (sbstituting) … … 82 83 // bei ** spaeter eventuell verbessern 83 84 EXAMPLE: example elimlinearpart; shows an example 85 " 84 86 { 85 87 int ii,n,fi,k; … … 171 173 172 174 proc elimpart (ideal i,list #) 173 USAGE: elimpart(i[,n,e]); i=ideal, n,e=integers175 "USAGE: elimpart(i[,n,e]); i=ideal, n,e=integers 174 176 consider 1-st n vars for elimination (better: substitution), 175 177 e =0: substitute from linear part of i (same as elimlinearpart) … … 191 193 since it avoids internal ring change and mapping 192 194 EXAMPLE: example elimpart; shows an example 195 " 193 196 { 194 197 def P = basering; … … 315 318 316 319 proc elimpartanyr (ideal i, list #) 317 USAGE: elimpartanyr(i[,p,e]); i=ideal, p=product of vars to be eliminated,320 "USAGE: elimpartanyr(i[,p,e]); i=ideal, p=product of vars to be eliminated, 318 321 e=int (default: p=product of all vars, e=1) 319 322 RETURN: list of of 6 objects: … … 334 337 placed correctly and then applies 'elimpart'; 335 338 EXAMPLE: example elimpartanyr; shows an example 339 " 336 340 { 337 341 def P = basering; … … 367 371 368 372 proc fastelim (ideal i, poly p, list #) 369 USAGE: fastelim(i,p[h,o,a,b,e,m]); i=ideal, p=product of variables to be373 "USAGE: fastelim(i,p[h,o,a,b,e,m]); i=ideal, p=product of variables to be 370 374 eliminated; h,o,a,b,e integers 371 375 (options for Hilbert-std, 'valvars', elimpart, minimizing) … … 380 384 RETURN: ideal obtained from i by eliminating those variables which occur in p 381 385 EXAMPLE: example fastelim; shows an example. 386 " 382 387 { 383 388 def P = basering; … … 455 460 456 461 proc faststd (@id,string @s1,string @s2, list #) 457 USAGE: faststd(id,s1,s2[,"hilb","sort","dec",o,"blocks"]);462 "USAGE: faststd(id,s1,s2[,\"hilb\",\"sort\",\"dec\",o,\"blocks\"]); 458 463 id=ideal/module, s1,s2=strings (names for new ring and maped id) 459 o = string (allowed ordstring: "lp","dp","Dp","ls","ds","Ds")460 "hilb","sort","dec","block" options for Hilbert-std, sortandmap461 COMPUTE: create a new ring (with "best" ordering of vars) and compute a464 o = string (allowed ordstring:\"lp\",\"dp\",\"Dp\",\"ls\",\"ds\",\"Ds\") 465 \"hilb\",\"sort\",\"dec\",\"block\" options for Hilbert-std, sortandmap 466 COMPUTE: create a new ring (with \"best\" ordering of vars) and compute a 462 467 std-basis of id (hopefully faster) 463 - If say, s1= "R" and s2="j", the new basering has name R and the468 - If say, s1=\"R\" and s2=\"j\", the new basering has name R and the 464 469 std-basis of the image of id in R has name j 465 - "hilb" : use Hilbert-series driven std-basis computation466 - "sort" : use 'sortandmap' for a best ordering of vars467 - "dec" : order vars w.r.t. decreasing complexity (with "sort")468 - "block" : create blockordering, each block having ordstr=o, s.t.469 vars of same complexity are in one block (with "sort")470 - \"hilb\" : use Hilbert-series driven std-basis computation 471 - \"sort\" : use 'sortandmap' for a best ordering of vars 472 - \"dec\" : order vars w.r.t. decreasing complexity (with \"sort\") 473 - \"block\" : create blockordering, each block having ordstr=o, s.t. 474 vars of same complexity are in one block (with \"sort\") 470 475 - o : defines the basic ordering of the resulting ring 471 476 default: o = ordering of 1-st block of basering - if it is allowed, 472 else o= "dp",473 "sort", if none of the optional parameters is given477 else o=\"dp\", 478 \"sort\", if none of the optional parameters is given 474 479 RETURN: nothing 475 480 NOTE: This proc is only useful for hard problems where other methods fail. 476 "hilb" is useful for hard orderings (as "lp") or for characteristic 0,477 it is correct for "lp","dp","Dp" (and for blockorderings combining481 \"hilb\" is useful for hard orderings (as \"lp\") or for characteristic 0, 482 it is correct for \"lp\",\"dp\",\"Dp\" (and for blockorderings combining 478 483 these) but not for s-orderings or if the vars have different weights. 479 There seem to be only few cases in which "dec" is fast484 There seem to be only few cases in which \"dec\" is fast 480 485 EXAMPLE: example faststd; shows an example. 486 " 481 487 { 482 488 def @P = basering; … … 624 630 625 631 proc findvars(id, list #) 626 USAGE: findvars(id[,any]); id poly/ideal/vector/module/matrix, any=any type632 "USAGE: findvars(id[,any]); id poly/ideal/vector/module/matrix, any=any type 627 633 RETURN: ideal of variables occuring in id, if no second argument is present 628 634 list of 4 objects, if a second argument is given (of any type) … … 632 638 -[4]: intvec of variables not occuring in id 633 639 EXAMPLE: example findvars; shows an example 640 " 634 641 { 635 642 int ii,n; … … 670 677 671 678 proc hilbvec (@id, list #) 672 USAGE: hilbvec(id[,c,o]); id poly/ideal/vector/module/matrix, c,o=strings673 c=char, o=ord in which hilb is computed (default: c= "32003", o="dp")679 "USAGE: hilbvec(id[,c,o]); id poly/ideal/vector/module/matrix, c,o=strings 680 c=char, o=ord in which hilb is computed (default: c=\"32003\", o=\"dp\") 674 681 RETURN: intvec of 1-st Hilbert-series of id, computed in char c and ordering o 675 682 bei ** aendern falls ringmaps vollstaendig ? 676 683 NOTE: id must be homogeneous (all vars having weight 1) 677 684 EXAMPLE: example hilbvec; shows an example 685 " 678 686 { 679 687 def @P = basering; … … 701 709 702 710 proc linearpart (id) 703 USAGE: linearpart(id); id=ideal/module711 "USAGE: linearpart(id); id=ideal/module 704 712 RETURN: generators of id of total degree <= 1 705 713 EXAMPLE: example linearpart; shows an example 714 " 706 715 { 707 716 return(degreepart(id,0,1)); … … 718 727 719 728 proc tolessvars (id ,list #) 720 USAGE: tolessvars(id,[s1,s2]); id poly/ideal/vector/module/matrix,729 "USAGE: tolessvars(id,[s1,s2]); id poly/ideal/vector/module/matrix, 721 730 s1,s2=strings (names of: new ring, new ordering) 722 731 CREATE: nothing, if id contains all vars of the basering. Else, create … … 725 734 new ring, which will be the basering after the proc has finished. 726 735 The name of the new ring is by default R(n), where n is the number of 727 variables in the new ring. If, say, s1 = "newR" then the new ring has736 variables in the new ring. If, say, s1 = \"newR\" then the new ring has 728 737 name newR. In s2 a different ordering for the new ring may be given 729 as an allowed ordstring (default is "dp" resp. "ds", depending whether738 as an allowed ordstring (default is \"dp\" resp. \"ds\", depending whether 730 739 the first block of the old ordering is a p- resp. an s-ordering). 731 740 DISPLAY: If printlevel >=0, display ideal of vars which have been ommitted from … … 739 748 occurs in the old ring, for the same reason. 740 749 EXAMPLE: example tolessvars; shows an example 750 " 741 751 { 742 752 //---------------- initialisation and check occurence of vars ----------------- … … 796 806 797 807 proc solvelinearpart (id,list #) 798 USAGE: solvelinearpart(id[,n]); id=ideal/module, n=integer808 "USAGE: solvelinearpart(id[,n]); id=ideal/module, n=integer 799 809 RETURN: (interreduced) generators of id of degree <=1 in reduced triangular 800 810 form (default) or if n=0 [non-reduced triangular form if n!=0] … … 805 815 char 0 instead! 806 816 EXAMPLE: example solvelinearpart; shows an example 817 " 807 818 { 808 819 intvec getoption = option(get); … … 855 866 856 867 proc sortandmap (@id,string @s1,string @s2, list #) 857 USAGE: sortandmap(id,s1,s2[,n1,p1,n2,p2...,o1,m1,o2,m2...]);868 "USAGE: sortandmap(id,s1,s2[,n1,p1,n2,p2...,o1,m1,o2,m2...]); 858 869 id=poly/ideal/vector/module 859 870 s1,s2=strings (names for new ring and maped id) 860 871 p1,p2,...= product of vars, n1,n2,...=integers 861 872 o1,o2,...= allowed ordstrings, m1,m2,...=integers 862 (default: p1=product of all vars, n1=0, o1= "dp",m1=0)873 (default: p1=product of all vars, n1=0, o1=\"dp\",m1=0) 863 874 the last pi (containing the remaining vars) may be omitted 864 875 CREATE: a new ring and map id into it, the new ring has same char as basering … … 867 878 id, ni controls the sorting in i-th block (= vars occuring in pi): 868 879 ni=0 (resp.!=0) means that less (resp. more) complex vars come first 869 - If say, s1= "R" and s2="j", the new basering has name R and the image880 - If say, s1=\"R\" and s2=\"j\", the new basering has name R and the image 870 881 of id in R has name j 871 882 - oi and mi define the monomial ordering of the i-th block: … … 874 885 each subblock having ordstr=oi, such that vars of same complexity 875 886 are in one block 876 default: oi= "dp", mi=0877 - only simple ordstrings oi are allowed: "lp","dp","Dp","ls","ds","Ds"887 default: oi=\"dp\", mi=0 888 - only simple ordstrings oi are allowed:\"lp\",\"dp\",\"Dp\",\"ls\",\"ds\",\"Ds\" 878 889 RETURN: nothing 879 890 NOTE: We define a variable x to be more complex than y (with respect to id) … … 884 895 # of monomials in coefficient of next smaller power of x,...) 885 896 EXAMPLE: example sortandmap; shows an example 897 " 886 898 { 887 899 def @P = basering; … … 948 960 949 961 proc sortvars (id, list #) 950 USAGE: sortvars(id[,n1,p1,n2,p2,...]); id=poly/ideal/vector/module,962 "USAGE: sortvars(id[,n1,p1,n2,p2,...]); id=poly/ideal/vector/module, 951 963 p1,p2,...= product of vars, n1,n2,...=integers 952 964 (default: p1=product of all vars, n1=0) … … 972 984 # of monomials in coefficient of next smaller power of x,...) 973 985 EXAMPLE: example sortvars; shows an example 986 " 974 987 { 975 988 int ii,jj,n,s; … … 1009 1022 1010 1023 proc valvars (id, list #) 1011 USAGE: valvars(id[,n1,p1,n2,p2,...]); id=poly/ideal/vector/module,1024 "USAGE: valvars(id[,n1,p1,n2,p2,...]); id=poly/ideal/vector/module, 1012 1025 p1,p2,...= product of vars, n1,n2,...=integers 1013 1026 ni controls the ordering of vars occuring in pi: … … 1032 1045 # of monomials in coefficient of next smaller power of x,...) 1033 1046 EXAMPLE: example valvars; shows an example 1047 " 1034 1048 { 1035 1049 //---------------------------- initialization ---------------------------------
Note: See TracChangeset
for help on using the changeset viewer.