Changeset df346ce in git for Singular/LIB
- Timestamp:
- Jan 12, 2001, 8:52:48 PM (23 years ago)
- Branches:
- (u'fieker-DuVal', '117eb8c30fc9e991c4decca4832b1d19036c4c65')(u'spielwiese', 'd08f5f0bb3329b8ca19f23b74cb1473686415c3a')
- Children:
- 4ee700919d4a2c6339cf4c4678715d6669aeb753
- Parents:
- 48b00a5d1e6b037949cfdc671392031e9321de1a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/standard.lib
r48b00a rdf346ce 1 1 ////////////////////////////////////////////////////////////////////////////// 2 version="$Id: standard.lib,v 1.5 2 2000-12-22 14:52:32 greuelExp $";2 version="$Id: standard.lib,v 1.53 2001-01-12 19:52:48 lossen Exp $"; 3 3 category="Miscellaneous"; 4 4 info=" … … 66 66 67 67 proc stdhilb(ideal i,list #) 68 "SYNTAX: stdhilb(ideal_expression);69 stdhilb (ideal_expression, intvec_expression);68 "SYNTAX: stdhilb ( ideal_expression ) 69 stdhilb ( ideal_expression, intvec_expression ) 70 70 TYPE: ideal 71 71 PURPOSE: computes the standard basis of the homogeneous ideal in the basering, … … 127 127 example 128 128 { "EXAMPLE:"; echo = 2; 129 ring r =0,(x,y,z),lp;130 ideal i = y3+x2, x2y+x2, x3-x2,z4-x2-y;131 ideal i1= 129 ring r=0,(x,y,z),lp; 130 ideal i=y3+x2,x2y+x2,x3-x2,z4-x2-y; 131 ideal i1=stdhilb(i); i1; 132 132 // is in this case equivalent to: 133 133 intvec v=1,0,0,-3,0,1,0,3,-1,-1; … … 137 137 138 138 proc groebner(def i, list #) 139 "SYNTAX: groebner(ideal_expression);140 groebner (module_expression);141 groebner (ideal_expression, int_expression);142 groebner (module_expression, int_expression);139 "SYNTAX: groebner ( ideal_expression ) 140 groebner ( module_expression ) 141 groebner ( ideal_expression, int_expression ) 142 groebner ( module_expression, int_expression ) 143 143 TYPE: type of the first argument 144 PURPOSE: computes the standard basis of the first argument i 145 (ideal or module) by a heuristically chosen method: 146 If the ordering of the current ring is a local ordering, or 147 if it is a non-block ordering and the current ring has no 148 parameters, then std(i) is returned. 149 Otherwise, i is mapped into a ring with no parameters and 150 ordering dp, where its Hilbert series is computed. This is 151 followed by a Hilbert-series based std computation in the 152 original ring. 153 NOTE: If a 2nd argument 'wait' is given, then the computation proceeds 154 at most 'wait' seconds. That is, if no result could be computed in 155 'wait' seconds, then the computation is interrupted, 0 is returned, 144 PURPOSE: computes the standard basis of the first argument @code{I} 145 (ideal or module), by a heuristically chosen method: if the 146 ordering of the current ring is a local ordering, or if it is a 147 non-block ordering and the current ring has no parameters, then 148 @code{std(I)} is returned. Otherwise, @code{I} is mapped into a 149 ring with no parameters and ordering dp, where its Hilbert series 150 is computed. This is followed by a Hilbert-series based std 151 computation in the original ring. 152 NOTE: If a 2nd argument @code{wait} is given, then the computation proceeds 153 at most @code{wait} seconds. That is, if no result could be computed in 154 @code{wait} seconds, then the computation is interrupted, 0 is returned, 156 155 a warning message is displayed, and the global variable 157 'groebner_error'is defined.156 @code{groebner_error} is defined. 158 157 SEE ALSO: stdhilb, stdfglm, std 159 158 KEYWORDS: time limit on computations; MP, groebner basis computations … … 408 407 } 409 408 example 410 { "EXAMPLE: "; echo =2;411 ring r = 0, (a,b,c,d),lp;409 { "EXAMPLE: "; echo=2; 410 ring r=0,(a,b,c,d),lp; 412 411 option(prot); 413 ideal i = a+b+c+d, ab+ad+bc+cd, abc+abd+acd+bcd,abcd-1; // cyclic 4412 ideal i=a+b+c+d,ab+ad+bc+cd,abc+abd+acd+bcd,abcd-1; // cyclic 4 414 413 groebner(i); 415 ring rp = (0, a, b),(c,d), lp;416 ideal i = imap(r,i);417 ideal j =groebner(i);414 ring rp=(0,a,b),(c,d), lp; 415 ideal i=imap(r,i); 416 ideal j=groebner(i); 418 417 option(noprot); 419 j; simplify(j, 420 if (system("with", "MP")) {groebner(i,0);}418 j; simplify(j,1); std(i); 419 if (system("with","MP")) {groebner(i,0);} 421 420 defined(groebner_error); 422 421 } … … 446 445 @code{nres} (classical method using syzygies) , see @ref{nres}. 447 446 448 @item @strong{homogen ous ideals and k ==0:}447 @item @strong{homogeneous ideals and k=0:} 449 448 @code{lres} (La'Scala's method), see @ref{lres}. 450 449 451 @item @strong{not minimized resolution, and, homogenous input with k != 0 or local rings:} 450 @item @strong{not minimized resolution and (homogeneous input with k<>0 451 or local rings):} 452 452 @code{sres} (Schreyer's method), see @ref{sres}. 453 453 … … 456 456 @end table 457 457 @item @strong{Note:} 458 Accessing single elements of a resolution may require that some partial computations have to be finished and may therefor take some time. 458 Accessing single elements of a resolution may require that some partial 459 computations have to be finished and may therefore take some time. 459 460 @end table 460 461 @c ref … … 575 576 {"EXAMPLE:"; echo = 2; 576 577 ring r=0,(x,y,z),dp; 577 ideal i=xz,yz,x ^3-y^3;578 def l=res(i,0); // homogen ous ideal: uses lres579 l; // resolution is not yet minimized578 ideal i=xz,yz,x3-y3; 579 def l=res(i,0); // homogeneous ideal: uses lres 580 l; 580 581 print(betti(l), "betti"); // input to betti may be of type resolution 581 582 l[2]; // element access may take some time 582 i=i, 583 l=res(i,0); // inhomogen ous ideal: uses mres584 l; // resolution is not yet minimized583 i=i,x+1; 584 l=res(i,0); // inhomogeneous ideal: uses mres 585 l; 585 586 ring rs=0,(x,y,z),ds; 586 ideal i = imap(r,i);587 ideal i=imap(r,i); 587 588 def l=res(i,0); // local ring not minimized: uses sres 588 l; // resolution is minimized589 l; 589 590 res(i,0,0); // local ring and minimized: uses mres 590 591 } … … 592 593 593 594 proc quot (m1,m2,list #) 594 "SYNTAX: quot(module_expression, module_expression);595 @* quot(module_expression, module_expression, int_expression);596 @* quot(ideal_expression, ideal_expression);597 @* quot(ideal_expression, ideal_expression, int_expression);595 "SYNTAX: @code{quot} ( module_expression, module_expression ) 596 @*@code{quot} ( module_expression, module_expression, int_expression ) 597 @*@code{quot} ( ideal_expression, ideal_expression ) 598 @*@code{quot} ( ideal_expression, ideal_expression, int_expression ) 598 599 TYPE: ideal 599 SYNTAX: quot(module_expression, ideal_expression);600 SYNTAX: @code{quot} ( module_expression, ideal_expression ) 600 601 TYPE: module 601 PURPOSE: computes the quotient of the first and the 2nd argument 602 If a 3rd argum nt 'n' is given the n-th method is used603 ( 1 <= n <=5).602 PURPOSE: computes the quotient of the first and the 2nd argument. 603 If a 3rd argument 'n' is given the n-th method is used 604 (n=1...5). 604 605 SEE ALSO: quotient 605 606 EXAMPLE: example quot; shows an example" … … 636 637 ideal id2=x2+xyz,y2-z3y,z3+y5xz; 637 638 option(prot); 638 ideal id 6=quotient(id1,id2);639 id 6;640 ideal id 7=quot(id1,id2,1);641 id 7;642 ideal id 8=quot(id1,id2,2);643 id 8;639 ideal id3=quotient(id1,id2); 640 id3; 641 ideal id4=quot(id1,id2,1); 642 id4; 643 ideal id5=quot(id1,id2,2); 644 id5; 644 645 } 645 646 … … 847 848 /// 848 849 proc sprintf(string fmt, list #) 849 " USAGE: sprintf(fmt, ...) fmt string850 "SYNTAX: @code{sprintf} ( string_expression [, any_expressions] ) 850 851 RETURN: string 851 PURPOSE: sprintf performs output formatting. The first argument is a format 852 control string. Additional arguments may be required, depending on 853 the contents of the control string. A series of output characters is 854 generated as directed by the control string; these characters are 855 returned as a string. The control string is simply text to be copied, 856 except that the string may contain conversion specifications. Do 857 'help print:' for a listing of valid conversion specifications. 858 As an addition to the conversions of 'print', the '%n' and '%2' 859 conversion specification does not consume an additional argument, 860 but simply generates a newline character. 852 PURPOSE: @code{sprintf(fmt,...);} performs output formatting. The first 853 argument is a format control string. Additional arguments may be 854 required, depending on the content of the control string. A series 855 of output characters is generated as directed by the control string; 856 these characters are returned as a string. @* 857 The control string @code{fmt} is simply text to be copied, 858 except that the string may contain conversion specifications.@* 859 Do @code{help print;} for a listing of valid conversion 860 specifications. As an addition to the conversions of @code{print}, 861 the @code{%n} and @code{%2} conversion specification does not 862 consume an additional argument, but simply generates a newline 863 character. 861 864 NOTE: If one of the additional arguments is a list, then it should be 862 enclosed once more into a list()command, since passing a list865 enclosed once more into a @code{list()} command, since passing a list 863 866 as an argument flattens the list by one level. 864 867 SEE ALSO: fprintf, printf, print, string … … 934 937 935 938 proc printf(string fmt, list #) 936 " USAGE: printf(fmt, ...) fmt string939 "SYNTAX: @code{printf} ( string_expression [, any_expressions] ) 937 940 RETURN: none 938 PURPOSE: printf performs output formatting. The first argument is a format939 control string. Additional arguments may be required, depending on940 the contents of the control string. A series of output characters is941 generated as directed by the control string; these characters are942 displayed (i.e. printed to standard out).943 The control string is simply text to be copied, except that the944 string may contain conversion specifications.945 Do 'help print:' for a listing of valid conversion specifications.946 As an addition to the conversions of 'print', the '%n' and '%2'947 conversion specification does not consume an additional argument,948 but simply generates a newline character.949 941 PURPOSE: @code{printf(fmt,...);} performs output formatting. The first 942 argument is a format control string. Additional arguments may be 943 required, depending on the content of the control string. A series 944 of output characters is generated as directed by the control string; 945 these characters are displayed (i.e., printed to standard out). @* 946 The control string @code{fmt} is simply text to be copied, except 947 that the string may contain conversion specifications. @* 948 Do @code{help print;} for a listing of valid conversion 949 specifications. As an addition to the conversions of @code{print}, 950 the @code{%n} and @code{%2} conversion specification does not 951 consume an additional argument, but simply generates a newline 952 character. 950 953 NOTE: If one of the additional arguments is a list, then it should be 951 enclosed once more into a list() command, since passing a list952 as an argument flattens the list by one level.954 enclosed once more into a @code{list()} command, since passing a 955 list as an argument flattens the list by one level. 953 956 SEE ALSO: sprintf, fprintf, print, string 954 957 EXAMPLE : example printf; shows an example … … 962 965 module m=[1,y],[0,x+z]; 963 966 intmat M=betti(mres(m,0)); 964 list l = r, m,M;965 printf("s:%s, l:%l", 1,2);966 printf("s:%s", 967 printf("s:%s", 968 printf("2l:%2l", 969 printf("%p", 970 printf("%;", 971 printf("%b", 967 list l=r,m,M; 968 printf("s:%s,l:%l",1,2); 969 printf("s:%s",l); 970 printf("s:%s",list(l)); 971 printf("2l:%2l",list(l)); 972 printf("%p",list(l)); 973 printf("%;",list(l)); 974 printf("%b",M); 972 975 } 973 976 974 977 975 978 proc fprintf(link l, string fmt, list #) 976 "USAGE: fprintf(l, fmt, ...) l link; fmt string 979 "SYNTAX: @code{fprintf} ( link_expression, string_expression [, 980 any_expressions] ) 977 981 RETURN: none 978 PURPOSE: fprintf performs output formatting. The second argument is a format 979 control string. Additional arguments may be required, depending on 980 the contents of the control string. A series of output characters is 981 generated as directed by the control string; these characters are 982 PURPOSE: @code{fprintf(l,fmt,...);} performs output formatting. 983 The second argument is a format control string. Additional 984 arguments may be required, depending on the content of the 985 control string. A series of output characters is generated as 986 directed by the control string; these characters are 982 987 written to the link l. 983 The control string is simply text to be copied, except that the984 string may contain conversion specifications.985 Do 'help print:' for a listing of valid conversion specifications.986 As an addition to the conversions of 'print', the '%n' and '%2'987 conversion specification does not consume an additional argument,988 but simply generates a newline character.989 988 The control string @code{fmt} is simply text to be copied, except 989 that the string may contain conversion specifications.@* 990 Do @code{help print;} for a listing of valid conversion 991 specifications. As an addition to the conversions of @code{print}, 992 the @code{%n} and @code{%2} conversion specification does not 993 consume an additional argument, but simply generates a newline 994 character. 990 995 NOTE: If one of the additional arguments is a list, then it should be 991 enclosed once more into a list() command, since passing a list992 a s an argument flattens the list by one level.996 enclosed once more into a @code{list()} command, since passing 997 a list as an argument flattens the list by one level. 993 998 SEE ALSO: sprintf, printf, print, string 994 999 EXAMPLE : example fprintf; shows an example … … 1002 1007 module m=[1,y],[0,x+z]; 1003 1008 intmat M=betti(mres(m,0)); 1004 list l = r, m,M;1005 link li = "";// link to stdout1006 fprintf(li, "s:%s, l:%l", 1,2);1007 fprintf(li, "s:%s",l);1008 fprintf(li, "s:%s",list(l));1009 fprintf(li, "2l:%2l",list(l));1010 fprintf(li, "%p",list(l));1011 fprintf(li, "%;",list(l));1012 fprintf(li, "%b",M);1009 list l=r,m,M; 1010 link li=""; // link to stdout 1011 fprintf(li,"s:%s,l:%l",1,2); 1012 fprintf(li,"s:%s",l); 1013 fprintf(li,"s:%s",list(l)); 1014 fprintf(li,"2l:%2l",list(l)); 1015 fprintf(li,"%p",list(l)); 1016 fprintf(li,"%;",list(l)); 1017 fprintf(li,"%b",M); 1013 1018 } 1014 1019
Note: See TracChangeset
for help on using the changeset viewer.