Changeset 11ddde in git
- Timestamp:
- Feb 23, 2004, 11:19:13 AM (20 years ago)
- Branches:
- (u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
- Children:
- dd8844f86c84ceb5f72e448153ac7a2d0daf5a00
- Parents:
- c229324983bbffba788eee2e34c2f5428261bb0f
- Location:
- Singular/LIB
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/deform.lib
rc22932 r11ddde 1 // $Id: deform.lib,v 1.2 7 2003-11-04 16:43:50Singular Exp $1 // $Id: deform.lib,v 1.28 2004-02-23 10:19:09 Singular Exp $ 2 2 // author: Bernd Martin email: martin@math.tu-cottbus.de 3 3 //(bm, last modified 4/98) 4 4 /////////////////////////////////////////////////////////////////////////////// 5 version="$Id: deform.lib,v 1.2 7 2003-11-04 16:43:50Singular Exp $";5 version="$Id: deform.lib,v 1.28 2004-02-23 10:19:09 Singular Exp $"; 6 6 category="Singularities"; 7 7 info=" … … 26 26 proc versal (ideal Fo,list #) 27 27 "USAGE: versal(Fo[,d,any]); Fo=ideal, d=int, any=list 28 COM UPTE: miniversal deformation of Fo up to degree d (default d=100),28 COMPUTE: miniversal deformation of Fo up to degree d (default d=100), 29 29 CREATE: Rings (exported): 30 30 'my'Px = extending the basering Po by new variables given by … … 104 104 kill Ls; 105 105 t1' = @t1; 106 if( @t1==0) { dbprint(p,"// rigi t!"); return();}106 if( @t1==0) { dbprint(p,"// rigid!"); return();} 107 107 if( @t2==0) { @smooth=1; dbprint(p,"// smooth base space");} 108 108 dbprint(p,"// ready: T_1 and T_2"); … … 117 117 if (defined(@active)) 118 118 { "// matrix of infinitesimal deformations:";print(InfD); 119 "// weights of infinitesimal deformations ( em ty ='not qhomog'):";119 "// weights of infinitesimal deformations ( empty ='not qhomog'):"; 120 120 @degrees; 121 121 matrix dummy; … … 297 297 proc mod_versal(matrix Mo, ideal I, list #) 298 298 "USAGE: mod_versal(Mo,I[,d,any]); I=ideal, M=module, d=int, any =list 299 COM UPTE: miniversal deformation of coker(Mo) over Qo=Po/Io, Po=basering;299 COMPUTE: miniversal deformation of coker(Mo) over Qo=Po/Io, Po=basering; 300 300 CREATE: Ringsr (exported): 301 301 'my'Px = extending the basering by new variables (deformation … … 317 317 (\"my\" prefix-string, \"param\" is a letter (e.g. \"A\") for the name of 318 318 first parameter or (e.g. \"A(\") for index parameter variables, \"ord\" 319 ordering string for ring extension), \"out\" name of output-file).319 ordering string for ring extension), \"out\" name of output-file). 320 320 NOTE: printlevel < 0 no output at all, 321 321 printlevel >=0,1,2,.. informs you, what is going on, … … 325 325 { 326 326 //------- prepare ------------------------------------------------------------- 327 intvec save_opt=option(get); 328 option(cancelunit); 327 329 string str,@param,@order,@my,@out,@degrees; 328 330 int @d,d_max,f0,f1,f2,e1,e1',e2,ok_ann,@smooth,@noObstr,@size,@j; … … 525 527 "// NOTE: rings "+myQx+", "+myOx+", "+mySo+" are still alive!", 526 528 "// (use: 'kill_rings("+@my+");' to remove them)"); 529 option(set,save_opt); 527 530 return(); 528 531 } … … 818 821 ">>Do you want all deformations? (ENTER=yes)"; 819 822 string str = read(""); 820 if ( size(str)>1)821 { ">> Choose column es of the matrix";822 ">> (Enter = all column es)";823 "INPUT (number of column es to use as integer-list 'i_1,i_2,.. ,i_t' ):";823 if ((size(str)>1) and (str<>"yes")) 824 { ">> Choose columns of the matrix"; 825 ">> (Enter = all columns)"; 826 "INPUT (number of columns to use as integer-list 'i_1,i_2,.. ,i_t' ):"; 824 827 string columnes = read(""); 825 if (size(columnes)<2) {columnes=string(col_vec);} 826 t1 = size(columnes)/2; 828 829 // improved: CL 830 // ========================================================== 831 // old: if (size(columnes)<2) {columnes=string(col_vec);} 832 // t1 = size(columnes)/2; 833 // new: 834 if (columnes=="") 835 { 836 intvec vvvv=1..ncols(A); 837 } 838 else 839 { 840 execute("intvec vvvv="+columnes); 841 } 842 t1=size(vvvv); 843 // ========================================================== 844 827 845 int l,l1; 828 846 for (l=1;l<=t1;l=l+1) 829 847 { 830 execute("l1= "+columnes[2*l-1]+";"); 848 // old: execute("l1= "+columnes[2*l-1]+";"); 849 l1=vvvv[l]; 831 850 B[l] = A[l1]; 832 851 if(flag) { C[l]=D[l1];} … … 876 895 } 877 896 setring br; 878 //if(system("with","Namespaces")) { kill Ring::nr; }879 //else { kill nr;}897 if(system("with","Namespaces")) { kill Ring::nr; } 898 kill nr; 880 899 return(degA); 881 900 } … … 883 902 proc homog_test(intvec w_vec, matrix Mo, matrix A) 884 903 " 885 Sub proc: return relative weight string of column es of A with respect904 Sub proc: return relative weight string of columns of A with respect 886 905 to the given w_vec and to Mo, or \"\" if not qh 887 906 NOTE: * means weight is not determined … … 909 928 if (size(tv)>1) 910 929 { k = tv[2]; 911 tv = tv[2..size(tv)]; tv = tv -k; 930 tv = tv[2..size(tv)]; 931 tv = tv -k; 912 932 if (tv==0) { @nv = @nv+string(-k)+",";} 913 933 else {return("");} … … 922 942 " 923 943 Sub-procedure: Computing relative (with respect to flatten(Fo)) weight_vec 924 of column es of A (return zero if Fo or A not qh)944 of columns of A (return zero if Fo or A not qh) 925 945 " 926 946 { … … 937 957 setring br; 938 958 if(system("with","Namespaces")) { kill Ring::nr; } 939 else { kill nr;}959 kill nr; 940 960 return(l); 941 961 } … … 946 966 setring br; 947 967 if(system("with","Namespaces")) { kill Ring::nr; } 948 else { kill nr;}968 kill nr; 949 969 return(dv); 950 970 } -
Singular/LIB/latex.lib
rc22932 r11ddde 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: latex.lib,v 1.2 0 2001-08-27 14:47:53Singular Exp $";2 version="$Id: latex.lib,v 1.21 2004-02-23 10:19:10 Singular Exp $"; 3 3 category="Visualization"; 4 4 info=" … … 30 30 @code{TeXwidth} (int) -1, 0, 1..9, >9: controls breaking of long polynomials 31 31 @code{TeXnofrac} (int) flag: write 1/2 instead of \\frac@{1@}@{2@} 32 @code{TeXbrack} (string) \"@{\", \"(\", \"<\", \"|\", empty string: 32 @code{TeXbrack} (string) \"@{\", \"(\", \"<\", \"|\", empty string: 33 33 controls brackets around ideals and matrices 34 34 @code{TeXproj} (int) flag: write \":\" instead of \",\" in vectors … … 46 46 "USAGE: closetex(fname); fname string 47 47 RETURN: nothing; writes a LaTeX2e closing line into file @code{<fname>}. 48 NOTE: prece eding \">>\" are deleted and suffix \".tex\" (if not given)48 NOTE: preceding \">>\" are deleted and suffix \".tex\" (if not given) 49 49 is added to @code{fname}. 50 50 EXAMPLE: example closetex; shows an example … … 90 90 "USAGE: tex(fname); fname string 91 91 RETURN: nothing; calls latex (LaTeX2e) for compiling the file fname 92 NOTE: prece eding \">>\" are deleted and suffix \".tex\" (if not given)92 NOTE: preceding \">>\" are deleted and suffix \".tex\" (if not given) 93 93 is added to @code{fname}. 94 94 EXAMPLE: example tex; shows an example … … 131 131 texobj("exp001","An ideal ",I); 132 132 closetex("exp001"); 133 tex("exp001"); 133 tex("exp001"); 134 134 echo=0; 135 135 pause("the created files will be deleted after pressing <RETURN>"); … … 141 141 "USAGE: opentex(fname); fname string 142 142 RETURN: nothing; writes a LaTeX2e header into a new file @code{<fname>}. 143 NOTE: prece eding \">>\" are deleted and suffix \".tex\" (if not given)143 NOTE: preceding \">>\" are deleted and suffix \".tex\" (if not given) 144 144 is added to @code{fname}. 145 145 EXAMPLE: example opentex; shows an example … … 284 284 proc texfactorize(string fname, poly f, list #) 285 285 "USAGE: texfactorize(fname,f); fname string, f poly 286 RETURN: if @code{fname=\"\"}: string, f as a product of its irreducible 286 RETURN: if @code{fname=\"\"}: string, f as a product of its irreducible 287 287 factors@* 288 otherwise: append this string to the file @code{<fname>}, and 288 otherwise: append this string to the file @code{<fname>}, and 289 289 return nothing. 290 NOTE: prece eding \">>\" are deleted and suffix \".tex\" (if not given)290 NOTE: preceding \">>\" are deleted and suffix \".tex\" (if not given) 291 291 is added to @code{fname}. 292 292 EXAMPLE: example texfactorize; shows an example … … 369 369 proc texmap(string fname, def m, def @r1, def @r2, list #) 370 370 "USAGE: texmap(fname,m,@r1,@r2); fname string, m string/map, @r1,@r2 rings 371 RETURN: if @code{fname=\"\"}: string, the map m from @r1 to @r2 (prece eded371 RETURN: if @code{fname=\"\"}: string, the map m from @r1 to @r2 (preceded 372 372 by its name if m = string) in TeX-typesetting;@* 373 otherwise: append this string to the file @code{<fname>}, and 373 otherwise: append this string to the file @code{<fname>}, and 374 374 return nothing. 375 NOTE: prece eding \">>\" are deleted in @code{fname}, and suffix \".tex\"375 NOTE: preceding \">>\" are deleted in @code{fname}, and suffix \".tex\" 376 376 (if not given) is added to @code{fname}. 377 377 If m is a string then it has to be the name of an existing map … … 561 561 n = n+5*(i-anf); 562 562 anf =i; // the next text in ( , ) as exponent 563 if (op) 564 { 563 if (op) 564 { 565 565 if (s[i]== ","){anf = anf+1;} 566 566 while(s[i] !=")"){ i++;} … … 580 580 "USAGE: texname(fname,s); fname,s strings 581 581 RETURN: if @code{fname=\"\"}: string, the transformed string s, where the 582 following rules apply: 583 @example 582 following rules apply: 583 @example 584 584 s' + \"~\" --> \"\\tilde@{\"+ s' +\"@}\" 585 \"_\" + int --> \"_@{\" + int +\"@}\" 585 \"_\" + int --> \"_@{\" + int +\"@}\" 586 586 \"[\" + s' + \"]\" --> \"_@{\" + s' + \"@}\" 587 \"A..Z\" + int --> \"A..Z\" + \"^@{\" + int + \"@}\" 587 \"A..Z\" + int --> \"A..Z\" + \"^@{\" + int + \"@}\" 588 588 \"a..z\" + int --> \"a..z\" + \"_@{\" + int + \"@}\" 589 589 \"(\" + int + \",\" + s' + \")\" --> \"_@{\"+ int +\"@}\" + \"^@{\" + s'+\"@}\" 590 590 @end example 591 591 Anyhow, strings which begin with a @code{\"@{\"} are only changed 592 by deleting the first and last character (intended to remove the 592 by deleting the first and last character (intended to remove the 593 593 surrounding curly brackets). 594 594 595 if @code{fname!=\"\"}: append the transformed string s to the file 595 if @code{fname!=\"\"}: append the transformed string s to the file 596 596 @code{<fname>}, and return nothing. 597 NOTE: prece eding \">>\" are deleted in @code{fname}, and suffix \".tex\"597 NOTE: preceding \">>\" are deleted in @code{fname}, and suffix \".tex\" 598 598 (if not given) is added to @code{fname}. 599 599 EXAMPLE: example texname; shows an example … … 603 603 st=manipul(s); 604 604 if (size(fname)) 605 { 605 { 606 606 int i=1; 607 607 while (fname[i]==">"){i++;} 608 608 fname = fname[i,size(fname)-i+1]; 609 609 if (size(fname)>=4) // check if filename is ending with ".tex" 610 { 610 { 611 611 if(fname[size(fname)-3,4]!=".tex") {fname = fname +".tex"; } 612 612 } … … 634 634 635 635 static proc absterm(poly f) 636 { 636 { 637 637 int k; 638 638 for (k=1; k<=nvars(basering); k++) … … 645 645 "USAGE: texobj(fname,l); fname string, l list 646 646 RETURN: if @code{fname=\"\"}: string, the entries of l in LaTeX-typesetting;@* 647 otherwise: append this string to the file @code{<fname>}, and 647 otherwise: append this string to the file @code{<fname>}, and 648 648 return nothing. 649 NOTE: prece eding \">>\" are deleted in @code{fname}, and suffix \".tex\"649 NOTE: preceding \">>\" are deleted in @code{fname}, and suffix \".tex\" 650 650 (if not given) is added to @code{fname}. 651 651 EXAMPLE: example texobj; shows an example … … 687 687 { if (defined(`obj`)) 688 688 { if (typeof(`obj`)=="ideal") 689 { 689 { 690 690 Iname = obj; def e = `obj`; //convert to correct type ideal 691 691 kill obj; def obj = e; kill e; … … 900 900 } 901 901 example 902 { 902 { 903 903 echo=0; 904 904 // -------- prepare for example --------- … … 942 942 "USAGE: texproc(fname,pname); fname,pname strings 943 943 ASSUME: @code{`pname`} is a procedure. 944 RETURN: if @code{fname=\"\"}: string, the proc @code{`pname`} in a verbatim 944 RETURN: if @code{fname=\"\"}: string, the proc @code{`pname`} in a verbatim 945 945 environment in LaTeX-typesetting;@* 946 otherwise: append this string to the file @code{<fname>}, and 946 otherwise: append this string to the file @code{<fname>}, and 947 947 return nothing. 948 NOTE: prece eding \">>\" are deleted in @code{fname}, and suffix \".tex\"948 NOTE: preceding \">>\" are deleted in @code{fname}, and suffix \".tex\" 949 949 (if not given) is added to @code{fname}.@* 950 950 @code{texproc} cannot be applied to itself correctly. … … 1044 1044 "USAGE: texring(fname, r[,L]); fname string, r ring, L list 1045 1045 RETURN: if @code{fname=\"\"}: string, the ring in TeX-typesetting;@* 1046 otherwise: append this string to the file @code{<fname>} and 1046 otherwise: append this string to the file @code{<fname>} and 1047 1047 return nothing. 1048 NOTE: prece eding \">>\" are deleted and suffix \".tex\" (if not given)1048 NOTE: preceding \">>\" are deleted and suffix \".tex\" (if not given) 1049 1049 is added to @code{fname}.@* 1050 1050 The optional list L is assumed to be a list of strings which control, … … 1177 1177 texring("",ralg,"mipo"); 1178 1178 // 1179 ring r49=(49,a),x,dp; // Galois field 1179 ring r49=(49,a),x,dp; // Galois field 1180 1180 texring("",r49); 1181 1181 // … … 1200 1200 proc rmx(string fname) 1201 1201 "USAGE: rmx(fname); fname string 1202 RETURN: nothing; removes the @code{.log} and @code{.aux} files associated to 1202 RETURN: nothing; removes the @code{.log} and @code{.aux} files associated to 1203 1203 the LaTeX file <fname>.@* 1204 NOTE: If @code{fname} ends by @code{\".dvi\"} or @code{\".tex\"}, the 1204 NOTE: If @code{fname} ends by @code{\".dvi\"} or @code{\".tex\"}, the 1205 1205 @code{.dvi} or @code{.tex} file will be deleted, too. 1206 1206 EXAMPLE: example rmx; shows an example … … 1286 1286 { "EXAMPLE:"; echo = 2; 1287 1287 intmat m[3][4] = 9,2,4,5,2,5,-2,4,-6,10,-1,2,7; 1288 opentex("exp001"); 1288 opentex("exp001"); 1289 1289 texobj("exp001","An intmat: ",m); 1290 1290 closetex("exp001"); … … 1300 1300 1301 1301 static proc parsr(string s) // parse real 1302 { 1302 { 1303 1303 string t; 1304 1304 if (s==" Inf") { return("\\infty",3);} … … 1312 1312 else {return(s[1,5]+"*10^"+t,23);} 1313 1313 } 1314 else 1314 else 1315 1315 { 1316 1316 return(s[1,5],12); … … 1319 1319 1320 1320 static proc parsg(string s) // parse Galois field 1321 { 1321 { 1322 1322 int i,j = 1,1; 1323 1323 string t; 1324 1324 if (short) 1325 { 1325 { 1326 1326 t =s[1]; 1327 1327 if(size(s)>1) {return(t+"^{" + s[2,size(s)-1] + "}",3+2*(size(s)-1));} … … 1329 1329 } 1330 1330 else 1331 { 1331 { 1332 1332 return(parselong(s+"!")); 1333 1333 } … … 1338 1338 "USAGE: texpoly(fname,p); fname string, p poly 1339 1339 RETURN: if @code{fname=\"\"}: string, the poly p in LaTeX-typesetting;@* 1340 otherwise: append this string to the file @code{<fname>}, and 1340 otherwise: append this string to the file @code{<fname>}, and 1341 1341 return nothing. 1342 NOTE: prece eding \">>\" are deleted in @code{fname}, and suffix \".tex\"1342 NOTE: preceding \">>\" are deleted in @code{fname}, and suffix \".tex\" 1343 1343 (if not given) is added to @code{fname}. 1344 1344 EXAMPLE: example texpoly; shows an example … … 1847 1847 This document illustrates the functionality of the library."+"\\\\" + nl); 1848 1848 write(fname,"\\begin{tabular}{ll}" + nl + 1849 "LIBRARY: {\\tt latex.lib} & PROCEDURES FOR TYPESETTING SINGULAR" + 1849 "LIBRARY: {\\tt latex.lib} & PROCEDURES FOR TYPESETTING SINGULAR" + 1850 1850 "\\\\" + nl + 1851 1851 " & OBJECTS IN LATEX2E"+ … … 1859 1859 "{\\tt texdemo([n]);} & produces a file explaining the features of this lib"+ 1860 1860 "\\\\" + nl + 1861 "{\\tt texfactorize(fnm,f);} & creates string in \\LaTeX-format for 1861 "{\\tt texfactorize(fnm,f);} & creates string in \\LaTeX-format for 1862 1862 factors of poly f"+ "\\\\" + nl + 1863 1863 "{\\tt texmap(fnm,m,r1,r2);} & creates string in \\LaTeX-format for 1864 1864 map m:r1$\\rightarrow$r2"+ "\\\\" + nl + 1865 "{\\tt texname(fnm,s);} & creates string in \\LaTeX-format for 1865 "{\\tt texname(fnm,s);} & creates string in \\LaTeX-format for 1866 1866 identifier"+ "\\\\" + nl + 1867 1867 "{\\tt texobj(l);} & creates string in \\LaTeX-format for … … 1871 1871 "{\\tt texproc(fnm,p);} & creates string in \\LaTeX-format of 1872 1872 text from proc p"+ "\\\\" + nl + 1873 "{\\tt texring(fnm,r[,l]);} & creates string in \\LaTeX-lformat for 1873 "{\\tt texring(fnm,r[,l]);} & creates string in \\LaTeX-lformat for 1874 1874 ring/qring"+ "\\\\" + nl + 1875 1875 "{\\tt rmx(s);} & removes .aux and .log files of \\LaTeX-files"+ … … 1881 1881 "\\\\" + nl2 + "\\vspace{0.2cm}" + nl2 + 1882 1882 "The global variables {\\tt TeXwidth}, {\\tt TeXnofrac}, {\\tt 1883 TeXbrack}, {\\tt TeXproj}, {\\tt TeXaligned}, {\\tt TeXreplace}, {\\tt 1883 TeXbrack}, {\\tt TeXproj}, {\\tt TeXaligned}, {\\tt TeXreplace}, {\\tt 1884 1884 NoDollars} are used to control the typesetting: " 1885 1885 ); … … 1901 1901 write(fname,"Notice that none of these global variables are defined when 1902 1902 loading \\verb|latex.lib|. A flag variable is set as soon as it is defined."); 1903 1903 1904 1904 1905 1905 //% The procs and … … 1909 1909 write(fname,"\\section{Opening a \\LaTeX\\ file}"); 1910 1910 write(fname,"In order to create a \\LaTeX\\ document and write a standard 1911 header into it, use the following command."+ 1911 header into it, use the following command."+ 1912 1912 bv+ 1913 1913 "> string fname = \"" + fname + "\";" + nl + 1914 "> texopen(fname);" + 1914 "> texopen(fname);" + 1915 1915 ev + nl); 1916 1916 … … 1934 1934 1935 1935 static proc part1(string fname) 1936 { 1936 { 1937 1937 1938 1938 int st = defined(texdemopart); … … 1956 1956 // -1a------ a ring in char 0, short varnames and poly. ordering ---------- 1957 1957 write(fname, 1958 " A ring in characteristic 0 with short names of variables and polynomial 1958 " A ring in characteristic 0 with short names of variables and polynomial 1959 1959 ordering." +nl); 1960 1960 ring r0=0,(x,y,z),dp; … … 1965 1965 "> texring(fname,r0);" + 1966 1966 ev); 1967 texring(fname,r0); 1967 texring(fname,r0); 1968 1968 write(fname,nl2); 1969 1969 write(fname, … … 1972 1972 "> texpoly(fname,g);" +nl + 1973 1973 ev); 1974 texpoly(fname,g); 1974 texpoly(fname,g); 1975 1975 write(fname,"\\\\"+nl2); 1976 1976 … … 1986 1986 ev 1987 1987 ); 1988 texpoly(fname,g/280); 1988 texpoly(fname,g/280); 1989 1989 kill r0; 1990 1990 1991 1991 write(fname,"\\\\"+nl2); 1992 1992 write(fname,"\\Line"); 1993 1993 // -2-------- a ring in char 7, indexed varnames and series ordering ---------- 1994 1994 write(fname, 1995 " A ring in characteristic 7 with indexed names of variables and local 1995 " A ring in characteristic 7 with indexed names of variables and local 1996 1996 ordering." +nl); 1997 1997 ring r1=7,(x1,x2,x3,x4),Ds; 1998 poly g=-2*x1+x4-1; 1999 write(fname, 2000 bv + 2001 "> ring r1=7,(x1,x2,x3,x4),Ds;" +nl + 1998 poly g=-2*x1+x4-1; 1999 write(fname, 2000 bv + 2001 "> ring r1=7,(x1,x2,x3,x4),Ds;" +nl + 2002 2002 "> texring(fname,r1);" +nl + 2003 2003 ev); 2004 texring(fname,r1); 2004 texring(fname,r1); 2005 2005 write(fname,lb); 2006 2006 2007 2007 write(fname, bv + 2008 "> poly g=-2*x1+x4-1; g;" +nl + 2008 "> poly g=-2*x1+x4-1; g;" +nl + 2009 2009 "> texpoly(fname,g);" +nl + 2010 2010 ev); 2011 2011 2012 2012 texpoly(fname,g); 2013 2013 2014 2014 write(fname,lb); 2015 2015 write(fname,"\\Line"); … … 2017 2017 // -3-------- a ring in char 0, indexed varnames and local ordering ---------- 2018 2018 write(fname, 2019 " A ring in characteristic 0 with indexed names of variables and local 2019 " A ring in characteristic 0 with indexed names of variables and local 2020 2020 ordering. 2021 2021 " +nl); … … 2027 2027 "> texring(fname,r2);" +nl + 2028 2028 ev); 2029 texring(fname,r2); 2029 texring(fname,r2); 2030 2030 2031 2031 write(fname, 2032 2032 bv + 2033 2033 "> poly g=-y(1)^3*x(5)+y(1)*x(2); g;" +nl+ 2034 string(g) + nl + 2034 string(g) + nl + 2035 2035 "> texpoly(fname,g);" +nl + 2036 2036 ev 2037 2037 ); 2038 texpoly(fname,g); 2038 texpoly(fname,g); 2039 2039 write(fname,lb); 2040 2040 2041 2041 write(fname,"\\Line"); 2042 2042 … … 2061 2061 ); 2062 2062 texpoly(fname,g); write(fname,lb); 2063 2063 2064 2064 write(fname,"\\Line"); 2065 2065 … … 2099 2099 ev); 2100 2100 texring(fname,r0t); 2101 write(fname, 2101 write(fname, 2102 2102 bv + 2103 2103 "> poly g=8*(-s+2t)/(st+t3)*x+t2*x-1; g;"+nl+ … … 2173 2173 2174 2174 write(fname, 2175 bv + 2175 bv + 2176 2176 "> poly g=-(2a13+a)*x2+a2*x-a+1; g;" +nl+ 2177 2177 string(g) +nl + … … 2198 2198 2199 2199 write(fname, 2200 bv + 2200 bv + 2201 2201 "> poly g=-(i+1)*x+2i2y2+i+x; g;" +nl+ 2202 2202 string(g) +nl + … … 2295 2295 "It is possible to display a ground field different from the 2296 2296 actual one by passing any letter in \\LaTeX \\ notation as additional 2297 argument. Predefined values are \\verb|\"\\\\C\"|, \\verb|\"\\\\R\"|, 2297 argument. Predefined values are \\verb|\"\\\\C\"|, \\verb|\"\\\\R\"|, 2298 2298 \\verb|\"k\"|, \\verb|\"K\"| and \\verb|\"R\"|."+nl+ 2299 2299 "If for example a ground field of characteristic 0 should be written as … … 2311 2311 special role when the ground field is an algebraic extension. In this case 2312 2312 the parameters will be omitted."); 2313 2313 2314 2314 write(fname, 2315 2315 bv + … … 2358 2358 2359 2359 write(fname,nl+ "\\vspace{0.2cm}" + nl2); 2360 2360 2361 2361 write(fname,"The first and the last variable will always be printed. 2362 2362 In order to print only these it is sufficient to give a 1 as third argument."); … … 2389 2389 write(fname,"It is also possible to pass several of the arguments described 2390 2390 above at once (in any order)."); 2391 2391 2392 2392 2393 2393 write(fname, … … 2407 2407 2408 2408 static proc part2(string fname) 2409 { 2409 { 2410 2410 2411 2411 int st = defined(texdemopart); … … 2427 2427 write(fname,"\\subsection{Factorized polynomials}"); 2428 2428 2429 write(fname,"The command \\verb|texfactorize| calls internally the 2430 {\\sc Singular} command \\verb|factorize| and returns the product of the 2431 irreducible factors. Note that, at the moment, it is not possible to pass 2429 write(fname,"The command \\verb|texfactorize| calls internally the 2430 {\\sc Singular} command \\verb|factorize| and returns the product of the 2431 irreducible factors. Note that, at the moment, it is not possible to pass 2432 2432 any optional arguments for \\verb|factorize| through \\verb|texfactorize|."); 2433 2433 … … 2466 2466 // --------------------------------------------- 2467 2467 write(fname,"By setting the global variable \\verb|TeXreplace| it is possible 2468 to define rules for replacing strings or variable names. 2468 to define rules for replacing strings or variable names. 2469 2469 \\verb|TeXreplace| has to be a list of twoelemented lists where the first 2470 2470 entry is the text which should be replaced by the second entry. 2471 This may be applied to replace names of variables, but is also used 2471 This may be applied to replace names of variables, but is also used 2472 2472 when calling \\verb|texname| or \\verb|texmap|. Note that it 2473 2473 is necessary to write a double backslash \\verb|\\\\\| at the beginning of … … 2534 2534 "\\]",nl); 2535 2535 2536 write(fname,"Note that the size of terms is calculated with certain 2536 write(fname,"Note that the size of terms is calculated with certain 2537 2537 multiplicities.",nl); 2538 2538 … … 2550 2550 ev); 2551 2551 2552 setring r0; 2552 setring r0; 2553 2553 poly g=-x2y+2y13z+1; 2554 2554 poly f=g^2; … … 2590 2590 write(fname,nl2,"\\Line"); 2591 2591 2592 write(fname,"There are two possibilities to convert a polynomial into 2592 write(fname,"There are two possibilities to convert a polynomial into 2593 2593 \\LaTeX \\ code: either by using \\verb|texpoly| or by calling \\verb|texobj|. 2594 2594 The difference is that \\verb|texpoly| puts the polynomial in textmode … … 2603 2603 2604 2604 // setring r3; 2605 2605 2606 2606 ring r3=0,(x_1,x_2,x_3),wp(3,2,1); 2607 2607 poly g=-x_1*x_2+2*x_2*x_3+x_1*x_3; … … 2641 2641 write(fname,"If the global variable \\verb|Texaligned| is set then the ideal 2642 2642 is displayed as a row vector."); 2643 2643 2644 2644 write(fname, 2645 2645 bv + … … 2725 2725 2726 2726 static proc part3(string fname) 2727 { 2727 { 2728 2728 int st=defined(texdemopart); 2729 2729 string nl=newline; … … 2734 2734 2735 2735 if (not(st) or st>=3) 2736 { 2736 { 2737 2737 print(" Call part2 first"); 2738 2738 return(); … … 2746 2746 write(fname,"\\section{Typeseting maps between rings}"); 2747 2747 write(fname,"By default, maps are displayed in the following way:"); 2748 2748 2749 2749 write(fname, 2750 2750 bv + … … 2754 2754 "> texmap(fname,phi,r4,r5);" + nl + 2755 2755 ev); 2756 2756 2757 2757 ring @r4_h=0,(x,y,z),dp; 2758 2758 if(system("with","Namespaces")) { exportto(Current, @r4_h); } … … 2767 2767 write(fname,"If the global variable \\verb|TeXaligned| is set, then the 2768 2768 map is displayed in one line."); 2769 2769 2770 2770 write(fname, 2771 2771 bv + … … 2786 2786 the second one contains the parameters for the domain. Note that if only one 2787 2787 list is present then it is applied to both of the rings."); 2788 2788 2789 2789 write(fname, 2790 2790 bv + … … 2802 2802 ev ); 2803 2803 2804 texmap(fname,@phi_h,@r4_h,r5,list(),list("{")); 2804 texmap(fname,@phi_h,@r4_h,r5,list(),list("{")); 2805 2805 2806 2806 write(fname,nl+"\\Line"); … … 2836 2836 write(fname, "Complex data structures such as matrices, vectors or modules 2837 2837 can be displayed by using the procedure \\verb|texobj|."); 2838 2838 2839 2839 write(fname,"\\subsection{Matrices and vectors}"); 2840 2840 //======================================================================= … … 2937 2937 ev ); 2938 2938 2939 setring r; 2939 setring r; 2940 2940 ideal I=3xz5+x2y3-3z,7xz5+y3z+x-z,-xyz2+4yz+2x; 2941 2941 int TeXproj; export TeXproj; 2942 2942 2943 2943 texobj(fname,V); 2944 2944 kill TeXproj; … … 2948 2948 "> kill TeXproj;"+nl+ 2949 2949 ev); 2950 2950 2951 2951 write(fname,"\\subsection{Modules}",nl2); 2952 2952 … … 2984 2984 2985 2985 write(fname,"Integer matrices are displayed in the following way."); 2986 2986 2987 2987 intmat m[3][4]=-1,3,5,2,-2,8,6,0,2,5,8,7; 2988 2988 … … 3065 3065 "// not an isolated singularity"; 3066 3066 } 3067 return(m_nr); 3067 return(m_nr); 3068 3068 } 3069 3069 export(milnor_number); … … 3072 3072 write(fname,"The following procedure allows to include the source code 3073 3073 of procedures into a \\LaTeX document."); 3074 write(fname, 3074 write(fname, 3075 3075 bv + 3076 3076 "> texproc(fname,\"milnor\_number\");" +nl+ 3077 3077 ev); 3078 3078 3079 3079 texproc(fname,"milnor_number"); 3080 3080 3081 3081 kill(milnor_number); 3082 3082 3083 3083 // ------------------------------ closing the tex file ------------------- 3084 3084 write(fname,"\\section{Closing the \\LaTeX\\ file}"); -
Singular/LIB/normal.lib
rc22932 r11ddde 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: normal.lib,v 1.3 7 2001-10-23 10:26:24 pfister Exp $";2 version="$Id: normal.lib,v 1.38 2004-02-23 10:19:11 Singular Exp $"; 3 3 category="Commutative Algebra"; 4 4 info=" … … 7 7 @* G. Pfister, pfister@mathematik.uni-kl.de 8 8 9 PROCEDURES: 10 normal(I[,wd]); computes the normalization of basering/I 11 resp. computes the normalization of basering/I and 12 the delta-invariante 13 HomJJ(L); presentation of End_R(J) as affine ring, L a list 14 genus(I); computes the genus of the projective curve defined 15 by I 9 MAIN PROCEDURES: 10 normal(I[,wd]); computes the normalization of basering/I, 11 resp. computes the normalization of basering/I and 12 the delta invariant 13 HomJJ(L); presentation of End_R(J) as affine ring, L a list 14 genus(I); computes genus of the projective curve defined by I 15 16 AUXILIARY PROCEDURE: 17 deltaLoc(f,S); (sum of) delta invariant(s) at conjugated singular points 16 18 "; 17 19 18 20 LIB "general.lib"; 21 LIB "poly.lib"; 19 22 LIB "sing.lib"; 20 23 LIB "primdec.lib"; … … 184 187 f=mstd(f)[2]; 185 188 ideal ann=quotient(f2,f); 186 int delt a;187 if(isIso&&isEq){delt a=vdim(std(modulo(f,ideal(p))));}189 int delt; 190 if(isIso&&isEq){delt=vdim(std(modulo(f,ideal(p))));} 188 191 189 192 f = p,rf; // generates pJ:J mod(p), i.e. p*Hom(J,J)/p*R as R-module … … 325 328 L = lastRing; 326 329 L = insert(L,0,1); 327 L[3]=delt a;330 L[3]=delt; 328 331 return(L); 329 332 } … … 347 350 348 351 proc normal(ideal id, list #) 349 "USAGE: normal(i [,choose]); i a radical ideal, choose empty, 1 or "wd"352 "USAGE: normal(i [,choose]); i a radical ideal, choose empty, 1 or \"wd\" 350 353 if choose=1 the normalization of the associated primes is computed 351 (which is sometimes more efficient) 352 if choose="wd" the delta-invariant is computed simultaneously353 this may take much more time in the reducible case because the354 factorizing standardbasis algorithm cannot be used.355 ASSUME: The ideal must be radical, for non 354 (which is sometimes more efficient); 355 if @code{choose=\"wd\"} the delta invariant is computed 356 simultaneously; this may take much more time in the reducible case, 357 since the factorizing standard basis algorithm cannot be used. 358 ASSUME: The ideal must be radical, for non-radical ideals the output may 356 359 be wrong (i=radical(i); makes i radical) 357 RETURN: a list of rings, say nor and in case of choose="wd" an integer 358 @format 359 at the end of the list. 360 each ring nor[i] contains two ideals 361 with given names norid and normap such that 362 - the direct sum of the rings nor[i]/norid is 363 the normalization of basering/id; 364 - normap gives the normalization map from basering/id 365 to nor[i]/norid (for each i) 366 @end format 367 NOTE: to use the i-th ring type: def R=nor[i]; setring R;. 368 @* Increasing printlevel displays more comments (default: printlevel=0) 360 RETURN: a list of rings, say nor and in case of @code{choose=\"wd\"} an 361 integer at the end of the list. 362 Each ring @code{nor[i]} contains two ideals with given names 363 @code{norid} and @code{normap} such that@* 364 - the direct sum of the rings @code{nor[i]/norid} is the 365 normalization of basering/id;@* 366 - @code{normap} gives the normalization map from basering/id to 367 @code{nor[i]/norid} (for each i). 368 NOTE: to use the i-th ring type: @code{def R=nor[i]; setring R;}. 369 @* Increasing printlevel displays more comments (default: printlevel=0). 369 370 @* Not implemented for local or mixed orderings. 370 371 @* If the input ideal i is weighted homogeneous a weighted ordering may 371 372 be used (qhweight(i); computes weights). 373 KEYWORDS: normalization; delta invariant. 372 374 EXAMPLE: example normal; shows an example 373 375 " … … 527 529 } 528 530 dbprint(y+1," 529 // 'normal' created a list of "+sr+" ring(s). 530 // nor["+sr+"+1] is the delta-invariant in case of choose=wd. 531 // To see the rings, type (if the name of your list is nor): 531 // 'normal' created a list of "+sr+" ring(s)."); 532 if(withdelta) 533 { 534 dbprint(y+1,"// nor["+sr+"+1] is the delta-invariant."); 535 } 536 dbprint(y+1,"// To see the rings, type (if the name of your list is nor): 532 537 show( nor); 533 538 // To access the 1-st ring and map (similar for the others), type: … … 558 563 559 564 /////////////////////////////////////////////////////////////////////////////// 560 static proc normalizationPrimes(ideal i,ideal ihp,int delt a, list #)565 static proc normalizationPrimes(ideal i,ideal ihp,int delt, list #) 561 566 "USAGE: normalizationPrimes(i,ihp[,si]); i equidimensional ideal, ihp map 562 567 (partial normalization),delta partial delta-invariant, … … 605 610 export normap; 606 611 result=newR7; 607 result[size(result)+1]=delt a;612 result[size(result)+1]=delt; 608 613 setring BAS; 609 614 return(result); … … 633 638 export normap; 634 639 result=newR6; 635 result[size(result)+1]=delt a;640 result[size(result)+1]=delt; 636 641 setring BAS; 637 642 return(result); … … 744 749 export normap; 745 750 result=newR6; 746 result[size(result)+1]=delt a;751 result[size(result)+1]=delt; 747 752 setring BAS; 748 753 return(result); … … 768 773 export normap; 769 774 result=newR5; 770 result[size(result)+1]=delt a;775 result[size(result)+1]=delt; 771 776 setring BAS; 772 777 return(result); … … 794 799 export normap; 795 800 result=newR4; 796 result[size(result)+1]=delt a;801 result[size(result)+1]=delt; 797 802 setring BAS; 798 803 return(result); … … 864 869 export normap; 865 870 result=newR3; 866 result[size(result)+1]=delt a;871 result[size(result)+1]=delt; 867 872 setring BAS; 868 873 return(result); … … 905 910 export normap; 906 911 result=newR6; 907 result[size(result)+1]=delt a;912 result[size(result)+1]=delt; 908 913 setring BAS; 909 914 return(result); … … 941 946 setring newR; 942 947 map psi=BAS,endphi; 943 list tluser=normalizationPrimes(endid,psi(ihp),delt a+RR[3],an);948 list tluser=normalizationPrimes(endid,psi(ihp),delt+RR[3],an); 944 949 setring BAS; 945 950 return(tluser); … … 950 955 ideal norid=fetch(BAS,MB); 951 956 ideal normap=fetch(BAS,ihp); 952 delt a=delta+RR[3];957 delt=delt+RR[3]; 953 958 export norid; 954 959 export normap; 955 960 result=newR7; 956 result[size(result)+1]=delt a;961 result[size(result)+1]=delt; 957 962 setring BAS; 958 963 return(result); … … 992 997 keepresult2=normalizationPrimes(id1,ihp,0); 993 998 994 delt a=delta+mul+keepresult1[size(keepresult1)]999 delt=delt+mul+keepresult1[size(keepresult1)] 995 1000 +keepresult1[size(keepresult1)]; 996 1001 … … 999 1004 keepresult1=insert(keepresult1,keepresult2[lauf]); 1000 1005 } 1001 keepresult1[size(keepresult1)]=delt a;1006 keepresult1[size(keepresult1)]=delt; 1002 1007 return(keepresult1); 1003 1008 } … … 1064 1069 export normap; 1065 1070 result=lastR; 1066 result[size(result)+1]=delt a+RS[3];1071 result[size(result)+1]=delt+RS[3]; 1067 1072 setring BAS; 1068 1073 return(result); … … 1076 1081 map psi=BAS,endphi; 1077 1082 list tluser= 1078 normalizationPrimes(endid,psi(ihp),delt a+RS[3],psi(MJ));1083 normalizationPrimes(endid,psi(ihp),delt+RS[3],psi(MJ)); 1079 1084 setring BAS; 1080 1085 return(tluser); … … 1099 1104 export normap; 1100 1105 result=newR6; 1101 result[size(result)+1]=delt a;1106 result[size(result)+1]=delt; 1102 1107 setring BAS; 1103 1108 return(result); … … 1161 1166 keepresult1=insert(keepresult1,keepresult2[lauf]); 1162 1167 } 1163 keepresult1[size(keepresult1)]=delt a+mul+delta1+delta2;1168 keepresult1[size(keepresult1)]=delt+mul+delta1+delta2; 1164 1169 return(keepresult1); 1165 1170 } … … 1273 1278 ///////////////////////////////////////////////////////////////////////////// 1274 1279 1275 proc genus(ideal K,list #)1280 proc genus(ideal I,list #) 1276 1281 "USAGE: genus(I) or genus(i,1); I a 1-dimensional ideal 1277 1282 RETURN: an integer, the geometric genus p_g = p_a - delta of the projective … … 1288 1293 1289 1294 def R=basering; 1290 K=std(K); 1291 1292 if(nvars(R)==3) 1293 { 1294 if((dim(K)!=2)||(!homog(K))||(size(K)>1)){ERROR("Input is not a curve");} 1295 execute("ring newR=("+charstr(R)+"),(x,y),dp;"); 1296 map kappa=R,x,y,1; 1297 ideal K=kappa(K); 1298 } 1299 if((nvars(R)>3)||(size(K)>1)) 1300 { // hier geeignet projezieren 1301 ERROR("This case is not implemented yet"); 1302 } 1303 if(nvars(R)==2) 1304 { 1305 execute("ring newR=("+charstr(R)+"),(x,y),dp;"); 1306 map kappa=R,x,y; 1307 ideal K=kappa(K); 1295 1296 if(homog(I)) 1297 { 1298 execute("ring newR=("+charstr(R)+"),("+varstr(R)+"),dp;"); 1299 ideal I=imap(R,I); 1300 } 1301 else 1302 { 1303 execute("ring newR=("+charstr(R)+"),("+varstr(R)+",@t),dp;"); 1304 ideal I=imap(R,I); 1305 I=homog(std(I),@t); 1306 } 1307 ideal J=std(I); 1308 if((dim(J)!=2)||((nvars(basering)==2)&&(dim(J)!=1))) 1309 { 1310 ERROR("This is not a curve"); 1311 } 1312 if((nvars(basering)<=3)&&(size(J)>1)) 1313 { 1314 ERROR("This is not equidimensional"); 1308 1315 } 1309 1316 1310 // assume now that R is a ring with two variables 1311 poly p=K[1]; 1312 ideal I; 1313 if(homog(p)) 1317 intvec hp=hilbPoly(J); 1318 int p_a=1-hp[1]; 1319 int d=hp[2]; 1320 1321 if(w>=1) 1322 { 1323 "";"The ideal of the projective curve:";"";J;""; 1324 "The coefficients of the Hilbert polynomial";hp; 1325 "arithmetic genus:";p_a; 1326 "degree:";d;""; 1327 } 1328 1329 intvec v = hilb(J,1); 1330 int o,i; 1331 1332 if(nvars(basering)>3) 1333 { 1334 map phi=newR,maxideal(1); 1335 int de; 1336 ideal K,L; 1337 poly m=var(4); 1338 for(i=5;i<=nvars(basering);i++){m=m*var(i);} 1339 K=eliminate(J,m,v); 1340 if(size(K)==1){de=deg(K[1]);} 1341 m=var(1); 1342 for(i=2;i<=nvars(basering)-3;i++){m=m*var(i);} 1343 i=0; 1344 while(d!=de) 1345 { 1346 o=1; 1347 i++; 1348 K=phi(J); 1349 K=eliminate(K,m,v); 1350 if(size(K)==1){de=deg(K[1]);} 1351 if(i==5) 1352 { 1353 K=reduce(equidimMax(J),J); 1354 if(size(K)!=0){ERROR("This is not equidimensional");} 1355 } 1356 if(i==10){ERROR("did not find a good projection");} 1357 L=sparsetriag(nvars(newR),nvars(newR),80-5*i,i)*transpose(maxideal(1)); 1358 phi=newR,L; 1359 } 1360 J=K; 1361 } 1362 poly p=J[1]; 1363 1364 if(nvars(basering)==2) 1314 1365 { 1315 1366 if(deg(squarefree(p))<deg(p)){ERROR("Curve is not reduced");} 1316 1367 return(-deg(p)+1); 1317 1368 } 1369 1318 1370 execute("ring S=("+charstr(R)+"),(x,y,t),dp;"); 1371 ideal L=maxideal(1); 1319 1372 execute("ring C=("+charstr(R)+"),(x,y),ds;"); 1320 1373 ideal I; … … 1327 1380 1328 1381 setring S; 1329 poly F=imap(newR,p); 1330 F=homog(F,t); 1331 int d=deg(F); 1382 if(o) 1383 { 1384 for(i=1;i<=nvars(newR)-3;i++){L[i]=0;} 1385 L=L,maxideal(1); 1386 } 1387 map sigma=newR,L; 1388 poly F=sigma(p); 1389 if(w>=1){"the projected curve:";"";F;"";} 1390 1391 kill newR; 1392 1332 1393 int genus=(d-1)*(d-2)/2; 1333 1334 // if(w>=1){"test for smoothness";} 1335 // if(dim(std(jacob(F)))==0) //the smooth case 1336 // { 1337 // setring R; 1338 // return(genus); 1339 // } 1394 if(w>=1){"the arithmetic genus of the plane curve:";genus;pause();} 1340 1395 1341 int delt a,deltaloc,deltainf,tau,tauinf,cusps,iloc,iglob,1342 tauloc,tausing,k,rat,nbranchinf,nbranch,nodes ;1396 int delt,deltaloc,deltainf,tau,tauinf,cusps,iloc,iglob,l,nsing, 1397 tauloc,tausing,k,rat,nbranchinf,nbranch,nodes,cuspsinf,nodesinf; 1343 1398 list inv; 1344 1399 1345 if(w>=1){"singularities at oo";} 1400 if(w>=1) 1401 {"";"analyse the singularities at oo";"";"singular locus at (1,x,0):";"";} 1346 1402 setring A; 1347 1403 g=phi(F); … … 1352 1408 { 1353 1409 list qr=minAssGTZ(I); 1410 if(w>=1){qr;"";} 1411 1354 1412 for(k=1;k<=size(qr);k++) 1355 1413 { 1414 if(w>=1){ nsing=nsing+vdim(std(qr[k]));} 1356 1415 inv=deltaLoc(g,qr[k]); 1357 1416 deltainf=deltainf+inv[1]; 1358 1417 tauinf=tauinf+inv[2]; 1418 l=vdim(std(qr[k])); 1419 if(inv[2]==l){nodesinf=nodesinf+l;} 1420 if(inv[2]==2*l){cuspsinf=cuspsinf+l;} 1359 1421 nbranchinf=nbranchinf+inv[3]; 1360 1422 } 1361 1423 } 1424 else 1425 { 1426 if(w>=1){" the curve is smooth at (1,x,0)";"";} 1427 } 1428 if(w>=1){"singular locus at (0,1,0):";"";} 1362 1429 inv=deltaLoc(h,maxideal(1)); 1430 if((w>=1)&&(inv[2]!=0)){ nsing++;} 1363 1431 deltainf=deltainf+inv[1]; 1364 1432 tauinf=tauinf+inv[2]; 1433 if(inv[2]==1){nodesinf=nodeainf++;} 1434 if(inv[2]==2){cuspsinf=cuspsinf++;} 1435 1436 if((w>=1)&&(inv[2]==0)){" the curve is smooth at (0,1,0)";"";} 1365 1437 if(inv[2]>0){nbranchinf=nbranchinf+inv[3];} 1366 1438 1367 1439 if(w>=1) 1368 1440 { 1369 "branches at oo:";nbranchinf; 1370 "tau at oo:";tauinf; 1371 "delta at oo:";deltainf; 1372 "singularities not at oo"; 1373 } 1374 1375 setring newR; //the singularities at the affine part 1441 if(tauinf==0) 1442 { 1443 " the curve is smooth at oo";""; 1444 } 1445 else 1446 { 1447 "number of singularities at oo:";nsing; 1448 "nodes at oo:";nodesinf; 1449 "cusps at oo:";cuspsinf; 1450 "branches at oo:";nbranchinf; 1451 "Tjurina number at oo:";tauinf; 1452 "delta at oo:";deltainf; 1453 "Milnor number at oo:";2*deltainf-nbranchinf+nsing; 1454 pause(); 1455 } 1456 "singularities at (x,y,1):";""; 1457 } 1458 execute("ring newR=("+charstr(R)+"),(x,y),dp;"); 1459 //the singularities at the affine part 1376 1460 map sigma=S,var(1),var(2),1; 1377 I=sigma(F);1378 1379 if( (size(#)!=0)||((char(basering)<181)&&(char(basering)!=0)))1461 ideal I=sigma(F); 1462 1463 if(size(#)!=0) 1380 1464 { //uses the normalization to compute delta 1381 1465 list nor=normal(I,"wd"); 1382 delt a=nor[size(nor)];1383 genus=genus-delt a-deltainf;1466 delt=nor[size(nor)]; 1467 genus=genus-delt-deltainf; 1384 1468 setring R; 1385 1469 return(genus); … … 1388 1472 ideal I1=jacob(I); 1389 1473 matrix Hess[2][2]=jacob(I1); 1390 ideal ID=I+I1+ideal(det(Hess)); 1391 1392 if(w>=1){"the cusps and nodes";} 1474 ideal ID=I+I1+ideal(det(Hess));//singular locus of I+I1 1393 1475 1394 ideal radID=std(radical(ID)); 1395 ideal IDsing=minor(jacob(ID),2)+radID; 1476 ideal radID=std(radical(ID));//the non-nodal locus 1477 if(w>=1){"the non-nodal locus:";"";radID;pause();"";} 1478 if(deg(radID[1])==0) 1479 { 1480 ideal IDsing=1; 1481 } 1482 else 1483 { 1484 ideal IDsing=minor(jacob(ID),2)+radID;//singular locus of ID 1485 } 1486 1396 1487 iglob=vdim(std(IDsing)); 1397 1488 1398 if(iglob!=0) 1489 if(iglob!=0)//computation of the radical of IDsing 1399 1490 { 1400 1491 ideal radIDsing=reduce(IDsing,radID); … … 1409 1500 } 1410 1501 iglob=vdim(radIDsing); 1411 } 1412 cusps=vdim(radID)-iglob; 1413 1414 if(w>=1){"the other singularities";} 1415 1416 if(iglob==0) //only cusps and double points 1417 { 1502 if((w>=1)&&(iglob)) 1503 {"the non-nodal-cuspidal locus:";radIDsing;pause();"";} 1504 } 1505 cusps=vdim(radID)-iglob; 1506 nsing=nsing+cusps; 1507 1508 if(iglob==0) 1509 { 1510 if(w>=1){" there are only cusps and nodes";"";} 1418 1511 tau=vdim(std(I+jacob(I))); 1512 tauinf=tauinf+tau; 1419 1513 nodes=tau-2*cusps; 1420 delta=nodes+cusps; 1421 nbranch=2*tau-3*cusps; 1514 delt=nodes+cusps; 1515 nbranch=2*tau-3*cusps; 1516 nsing=nsing+nodes; 1422 1517 } 1423 1518 else 1424 1519 { 1520 if(w>=1){"the non-nodal-cuspidal singularities";"";} 1425 1521 setring C; 1426 1522 ideal I1=imap(newR,IDsing); 1427 1523 iloc=vdim(std(I1)); 1428 if(iglob==iloc) // only cusps and nodes outside 01524 if(iglob==iloc) 1429 1525 { 1526 if(w>=1){"only cusps and nodes outside (0,0,1)";} 1430 1527 setring newR; 1431 1528 tau=vdim(std(I+jacob(I))); 1529 tauinf=tauinf+tau; 1432 1530 inv=deltaLoc(I[1],maxideal(1)); 1433 delt a=inv[1];1531 delt=inv[1]; 1434 1532 tauloc=inv[2]; 1435 1533 nodes=tau-tauloc-2*cusps; 1436 nbranch=inv[3]+ 2*nodes+cusps; 1437 delta=delta+nodes+cusps; 1534 nsing=nsing+nodes; 1535 nbranch=inv[3]+ 2*nodes+cusps; 1536 delt=delt+nodes+cusps; 1537 if((w>=1)&&(inv[2]==0)){"smooth at (0,0,1)";} 1438 1538 } 1439 1539 else 1440 1540 { 1441 1541 setring newR; 1442 list pr=minAssGTZ(IDsing); 1542 list pr=minAssGTZ(IDsing); 1543 if(w>=1){pr;} 1544 1443 1545 for(k=1;k<=size(pr);k++) 1444 1546 { 1547 if(w>=1){nsing=nsing+vdim(std(pr[k]));} 1445 1548 inv=deltaLoc(I[1],pr[k]); 1446 delt a=delta+inv[1];1549 delt=delt+inv[1]; 1447 1550 tausing=tausing+inv[2]; 1448 1551 nbranch=nbranch+inv[3]; 1449 1552 } 1450 1553 tau=vdim(std(I+jacob(I))); 1451 1554 tauinf=tauinf+tau; 1452 1555 nodes=tau-tausing-2*cusps; 1453 delta=delta+nodes+cusps; 1556 nsing=nsing+nodes; 1557 delt=delt+nodes+cusps; 1454 1558 nbranch=nbranch+2*nodes+cusps; 1455 1559 } 1456 1560 } 1457 1561 genus=genus-delt-deltainf; 1458 1562 if(w>=1) 1459 1563 { 1460 "branches :";nbranch; 1461 "nodes:"; nodes; 1462 "cusps:";cusps; 1463 "tau :";tau; 1464 "delta:";delta; 1465 } 1466 genus=genus-delta-deltainf; 1564 "The projected plane curve has locally:";""; 1565 "singularities:";nsing; 1566 "branches:";nbranch+nbranchinf; 1567 "nodes:"; nodes+nodesinf; 1568 "cusps:";cusps+cuspsinf; 1569 "Tjurina number:";tauinf; 1570 "Milnor number:";2*(delt+deltainf)-nbranch-nbranchinf+nsing; 1571 "delta of the projected curve:";delt+deltainf; 1572 "delta of the curve:";p_a-genus; 1573 "genus:";genus; 1574 "===================================================="; 1575 ""; 1576 } 1467 1577 setring R; 1468 1578 return(genus); … … 1474 1584 genus(i); 1475 1585 } 1476 /////////////////////////////////////////////////////////////////////////// 1586 1587 /////////////////////////////////////////////////////////////////////////////// 1477 1588 proc deltaLoc(poly f,ideal singL) 1589 "USAGE: deltaLoc(f,J); f poly, J ideal 1590 ASSUME: f is reduced bivariate polynomial; basering has exactly two variables; 1591 J is irreducible prime component of the singular locus of f (e.g., one 1592 entry of the output of @code{minAssGTZ(I);}, I = <f,jacob(f)>). 1593 RETURN: list L: 1594 @texinfo 1595 @table @asis 1596 @item @code{L[1]}; int: 1597 the sum of (local) delta invariants of f at the (conjugated) singular 1598 points given by J. 1599 @item @code{L[2]}; int: 1600 the sum of (local) Tjurina numbers of f at the (conjugated) singular 1601 points given by J. 1602 @item @code{L[3]}; int: 1603 the sum of (local) number of branches of f at the (conjugated) 1604 singular points given by J. 1605 @end table 1606 @end texinfo 1607 NOTE: procedure makes use of @code{execute}; increasing printlevel displays 1608 more comments (default: printlevel=0). 1609 SEE ALSO: delta, tjurina 1610 KEYWORDS: delta invariant; Tjurina number 1611 EXAMPLE: example deltaLoc; shows an example 1612 " 1478 1613 { 1614 option(redSB); 1479 1615 def R=basering; 1480 1616 execute("ring S=("+charstr(R)+"),(x,y),lp;"); … … 1485 1621 poly f=phi(f); 1486 1622 int i; 1487 1623 int w = printlevel-voice+2; // w=printlevel (default: w=0) 1488 1624 if(d==1) 1489 1625 { 1490 1626 map alpha=S,var(1)-singL[2][2],var(2)-singL[1][2]; 1491 1627 f=alpha(f); 1628 1492 1629 execute("ring C=("+charstr(S)+"),("+varstr(S)+"),ds;"); 1493 1630 poly f=imap(S,f); 1631 ideal singL=imap(S,singL); 1632 if((w>=1)&&(ord(f)>=2)) 1633 { 1634 "local analysis of the singularities";""; 1635 basering; 1636 singL; 1637 f; 1638 pause(); 1639 } 1494 1640 } 1495 1641 else … … 1498 1644 poly c; 1499 1645 map psi; 1500 while((deg(singL[1])>1)&&(deg(singL[2])>1)) 1646 number co; 1647 1648 while((deg(lead(singL[1]))>1)&&(deg(lead(singL[2]))>1)) 1501 1649 { 1502 1650 psi=S,x,y+random(-100,100)*x; 1503 1651 singL=psi(singL); 1504 1652 singL=std(singL); 1505 } 1506 if(deg(singL[2])==1){p=singL[1];c=singL[2][2];} 1507 if(deg(singL[1])==1) 1653 f=psi(f); 1654 } 1655 1656 if(deg(lead(singL[2]))==1) 1657 { 1658 p=singL[1]; 1659 c=singL[2]-lead(singL[2]); 1660 co=leadcoef(singL[2]); 1661 } 1662 if(deg(lead(singL[1]))==1) 1508 1663 { 1509 1664 psi=S,y,x; … … 1511 1666 singL=psi(singL); 1512 1667 p=singL[2]; 1513 c=singL[1][2]; 1514 } 1668 c=singL[1]-lead(singL[1]);; 1669 co=leadcoef(singL[1]); 1670 } 1671 1515 1672 execute("ring B=("+charstr(S)+"),a,dp;"); 1516 1673 map beta=S,a,a; 1517 1674 poly p=beta(p); 1675 1518 1676 execute("ring C=("+charstr(S)+",a),("+varstr(S)+"),ds;"); 1519 1677 number p=number(imap(B,p)); 1678 1520 1679 minpoly=p; 1521 number c=number(imap(S,c)); 1522 map alpha=S,x-c,y+a; 1523 1680 //number c=number(imap(S,c)); 1681 map iota=S,a,a; 1682 number c=number(iota(c)); 1683 number co=iota(co); 1684 1685 map alpha=S,x-c/co,y+a; 1524 1686 poly f=alpha(f); 1525 1687 f=cleardenom(f); 1526 } 1688 if((w>=1)&&(ord(f)>=2)) 1689 { 1690 "local analysis of the singularities";""; 1691 basering; 1692 alpha; 1693 f; 1694 pause(); 1695 ""; 1696 } 1697 } 1698 option(noredSB); 1527 1699 ideal fstd=std(ideal(f)+jacob(f)); 1528 1700 poly hc=highcorner(fstd); 1529 1701 int tau=vdim(fstd); 1530 1702 int o=ord(f); 1531 int delt a,nb;1532 1703 int delt,nb; 1704 1533 1705 if(tau==0) //smooth case 1534 1706 { … … 1540 1712 if(o==2) //A_k-singularity 1541 1713 { 1714 if(w>=1){"A_k-singularity";"";} 1542 1715 setring R; 1543 delt a=(tau+1)/2;1544 return(list(d*delt a,d*tau,d*(2*delta-tau+1)));1716 delt=(tau+1)/2; 1717 return(list(d*delt,d*tau,d*(2*delt-tau+1))); 1545 1718 } 1546 1719 if((lead(f)==var(1)*var(2)^2)||(lead(f)==var(1)^2*var(2))) 1547 {//D_k- singularity 1720 { 1721 if(w>=1){"D_k- singularity";"";} 1722 1548 1723 setring R; 1549 delt a=(tau+2)/2;1550 return(list(d*delt a,d*tau,d*(2*delta-tau+1)));1724 delt=(tau+2)/2; 1725 return(list(d*delt,d*tau,d*(2*delt-tau+1))); 1551 1726 } 1552 1727 1553 1728 int mu=vdim(std(jacob(f))); 1554 poly g=f+var(1)^mu+var(2)^mu; //to obtain a conv inient Newton-polygon1729 poly g=f+var(1)^mu+var(2)^mu; //to obtain a convenient Newton-polygon 1555 1730 1556 list NP=newton (g);1557 1731 list NP=newtonpoly(g); 1732 if(w>=1){"Newton-Polygon:";NP;"";} 1558 1733 int s=size(NP); 1559 int nN=-NP[1][2]-NP[s][1]+1; // computation of the Newton-number 1560 intmat m[2][2]; 1561 for(i=1;i<=s-1;i++) 1562 { 1563 m=NP[i+1],NP[i]; 1564 nN=nN+det(m); 1565 } 1566 1567 if(mu==nN) // the Newton-polygon is non-degenerate 1568 { // compute nb, the number of branches 1734 1735 if(is_NND(f,mu,NP)) 1736 { // the Newton-polygon is non-degenerate 1737 // compute nb, the number of branches 1569 1738 for(i=1;i<=s-1;i++) 1570 1739 { 1571 1740 nb=nb+gcd(NP[i][2]-NP[i+1][2],NP[i][1]-NP[i+1][1]); 1572 1741 } 1742 if(w>=1){"Newton-Polygon is non-degenerated";"";} 1573 1743 return(list(d*(mu+nb-1)/2,d*tau,d*nb)); 1574 1744 } 1575 1745 1576 //da reddevelop nur benutzt wird, um die Anzahl der Zweige zu bestimmen1577 //kann man das sicher schneller machen: 1578 //die Aufblasung durchfuehren und stets testen, ob das Newton-polyeder1579 //nicht ausgeartet ist.1580 1746 if(w>=1){"Newton-Polygon is degenerated";"";} 1747 1748 // the following can certainly be made more efficient when replacing 1749 // 'reddevelop' (used only for computing number of branches) by 1750 // successive blowing-up + test if Newton polygon degenerate: 1581 1751 if(s>2) // splitting of f 1582 1752 { 1753 if(w>=1){"Newton polygon can be used for splitting";"";} 1583 1754 intvec v=NP[1][2]-NP[2][2],NP[2][1]; 1584 1755 int de=w_deg(g,v); … … 1605 1776 1606 1777 f=jet(f,deg(hc)+2); 1778 if(w>=1){"now we have to use Hamburger-Noether (Puiseux) expansion";} 1607 1779 list hne=reddevelop(f); 1608 1780 nb=size(hne); … … 1614 1786 { 1615 1787 f=jet(f,deg(hc)+2); 1616 list hne=reddevelop(f); 1617 nb=size(hne); 1618 if(nb==1) 1619 { 1620 delta=invariants(hne[1])[5]/2; 1621 setring R; 1622 kill HNEring; 1623 return(list(d*delta,d*tau,d)); 1624 } 1625 setring R; 1626 kill HNEring; 1627 //delta direkt aus reddevelop zurueckgeben 1628 ERROR("the case of small characteristic is not fully implemented yet"); 1788 if(w>=1){"now we have to use Hamburger-Noether (Puiseux) expansion";} 1789 delt=delta(f); 1790 return(list(d*delt,d*tau,d)); 1629 1791 } 1630 1792 } 1631 1632 proc w_deg(poly p, intvec v) 1793 example 1794 { "EXAMPLE:"; echo = 2; 1795 ring r=0,(x,y),dp; 1796 poly f=(x2+y^2-1)^3 +27x2y2; 1797 ideal I=f,jacob(f); 1798 I=std(I); 1799 list qr=minAssGTZ(I); 1800 size(qr); 1801 // each component of the singular locus either describes a cusp or a pair 1802 // of conjugated nodes: 1803 deltaLoc(f,qr[1]); 1804 deltaLoc(f,qr[2]); 1805 deltaLoc(f,qr[3]); 1806 deltaLoc(f,qr[4]); 1807 deltaLoc(f,qr[5]); 1808 deltaLoc(f,qr[6]); 1809 } 1810 /////////////////////////////////////////////////////////////////////////////// 1811 // compute the weighted degree of p 1812 static proc w_deg(poly p, intvec v) 1633 1813 { 1634 1814 if(p==0){return(-1);} … … 1639 1819 } 1640 1820 1641 proc newton (poly f) 1642 { 1643 def R1=basering; 1644 execute("ring R2=("+charstr(R1)+"),("+varstr(R1)+"),ls;"); 1645 poly f=imap(R1,f); 1646 intvec A=(0,ord(subst(f,var(1),0))); 1647 intvec B=(ord(subst(f,var(2),0)),0); 1648 intvec C,H; list L; 1649 int abbruch,i; 1650 poly hilf; 1651 L[1]=A; 1652 f=jet(f,A[2]*B[1]-1,intvec(A[2],B[1])); 1653 map xytausch=R2,var(2),var(1); 1654 for (i=2; f!=0; i++) 1655 { 1656 abbruch=0; 1657 while (abbruch==0) 1658 { 1659 C=leadexp(f); 1660 if(jet(f,A[2]*C[1]-A[1]*C[2]-1,intvec(A[2]-C[2],C[1]-A[1]))==0) 1661 { 1662 abbruch=1; 1663 } 1664 else 1665 { 1666 f=jet(f,-C[1]-1,intvec(-1,0)); 1667 } 1668 } 1669 hilf=jet(f,A[2]*C[1]-A[1]*C[2],intvec(A[2]-C[2],C[1]-A[1])); 1670 H=leadexp(xytausch(hilf)); 1671 A=H[2],H[1]; 1672 L[i]=A; 1673 f=jet(f,A[2]*B[1]-1,intvec(A[2],B[1]-A[1])); 1674 } 1675 L[i]=B; 1676 setring R1; 1677 return(L); 1678 } 1821 //proc hilbPoly(ideal J) 1822 //{ 1823 // poly hp; 1824 // int i; 1825 // if(!attrib(J,"isSB")){J=std(J);} 1826 // intvec v = hilb(J,2); 1827 // for(i=1; i<=size(v); i++){ hp=hp+v[i]*(var(1)-i+2);} 1828 // return(hp); 1829 //} 1679 1830 1680 1831 /////////////////////////////////////////////////////////////////////////// … … 1901 2052 1902 2053 1903 ring r=0,(x,y),dp; // genus s1 with 5 cusps1904 ideal i=57y5+516x4y-320x4+66y4-340x2y3+73y3+128x2-84x2y2-96x2y; ;2054 ring r=0,(x,y),dp; // genus 1 with 5 cusps 2055 ideal i=57y5+516x4y-320x4+66y4-340x2y3+73y3+128x2-84x2y2-96x2y; 1905 2056 1906 2057 //Mark van Hoeij … … 1917 2068 ideal i=((x2+y3)^2+xy6)*((x3+y2)^2+x10y); 1918 2069 2070 ring r=0,(y,z,w,u),dp; //genus -5 2071 ideal i=y2+z2+w2+u2,w4-u4; 2072 2073 ring r=0,(x,y,t),dp; //genus -5 2074 ideal i=x8+8x7y+32x6y2+80x5y3+136x4y4+160x3y5+128x2y6+64xy7+16y8+4x6t2+24x5yt2+72x4y2t2+128x3y3t2+144x2y4t2+96xy5t2+32y6t2+14x4t4+56x3yt4+112x2y2t4+112xy3t4+40y4t4+20x2t6+40xyt6+8y2t6+9t8; 2075 2076 ring r=0,(y,z,w,u),dp; //genus 9 2077 ideal i=y2+z2+w2+u2,z4+w4+u4; 2078 2079 ring r=0,(x,y,t),dp; 2080 ideal i= 2081 25x8+200x7y+720x6y2+1520x5y3+2064x4y4+1856x3y5+1088x2y6+384xy7+64y8-12x6t2-72x5yt2-184x4y2t2-256x3y3t2-192x2y4t2-64xy5t2-2x4t4-8x3yt4+16xy3t4+16y4t4+4x2t6+8xyt6+8y2t6+t8; 2082 2083 ring r=0,(x,y,t),dp; 2084 ideal i= 2085 32761x8+786264x7y+8314416x6y2+50590224x5y3+193727376x4y4+478146240x3y5+742996800x2y6+664848000xy7+262440000y8+524176x7t+11007696x6yt+99772992x5y2t+505902240x4y3t+1549819008x3y4t+2868877440x2y5t+2971987200xy6t+1329696000y7t+3674308x6t2+66137544x5yt2+499561128x4y2t2+2026480896x3y3t2+4656222144x2y4t2+5746386240xy5t2+2976652800y6t2+14737840x5t3+221067600x4yt3+1335875904x3y2t3+4064449536x2y3t3+6226336512xy4t3+3842432640y5t3+36997422x4t4+443969064x3yt4+2012198112x2y2t4+4081745520xy3t4+3126751632y4t4+59524208x3t5+535717872x2yt5+1618766208xy2t5+1641991392y3t5+59938996x2t6+359633976xyt6+543382632y2t6+34539344xt7+103618032yt7+8720497t8; 2086 2087 ring r=32003,(x,y,z,w,u),dp; 2088 ideal i=x2+y2+z2+w2+u2,x3+y3+z3,z4+w4+u4; 2089 1919 2090 */ 1920 2091 -
Singular/LIB/poly.lib
rc22932 r11ddde 1 1 /////////////////////////////////////////////////////////////////////////////// 2 version="$Id: poly.lib,v 1.3 3 2001-01-16 13:48:36Singular Exp $";2 version="$Id: poly.lib,v 1.34 2004-02-23 10:19:13 Singular Exp $"; 3 3 category="General purpose"; 4 4 info=" … … 13 13 is_zero(poly/...); int, =1 resp. =0 if coker(input) is 0 resp. not 14 14 lcm(ideal); lcm of given generators of ideal 15 maxcoef(poly/...); maximal length of coefficient occur ing in poly/...15 maxcoef(poly/...); maximal length of coefficient occurring in poly/... 16 16 maxdeg(poly/...); int/intmat = degree/s of terms of maximal order 17 17 maxdeg1(poly/...); int = [weighted] maximal degree of input … … 25 25 mod2id(M,iv); conversion of a module M to an ideal 26 26 id2mod(i,iv); conversion inverse to mod2id 27 substitute(I,...) substitute in I variables by polynomials 27 28 subrInterred(i1,i2,iv);interred w.r.t. a subset of variables 29 hilbPoly( I) Hilbert polynomial of basering/I 28 30 (parameters in square brackets [] are optional) 29 31 "; … … 32 34 LIB "ring.lib"; 33 35 /////////////////////////////////////////////////////////////////////////////// 34 36 static proc bino(int a, int b) 37 { 38 //computes binomial var(1)+a over b 39 int i; 40 if(b==0){return(1);} 41 poly p=(var(1)+a)/b; 42 for(i=1;i<=b-1;i++) 43 { 44 p=p*(var(1)+a-i)/i; 45 } 46 return(p); 47 } 48 49 proc hilbPoly(ideal I) 50 "USAGE: hilbPoly(I) I a homogeneous ideal 51 RETURN: the Hilbert polynomial of basering/I as an intvec v=v_0,...,v_r 52 such that the Hilbert polynomial is (v_0+v_1*t+...v_r*t^r)/r! 53 EXAMPLE: example hilbPoly; shows an example 54 " 55 { 56 def R=basering; 57 if(!attrib(I,"isSB")){I=std(I);} 58 intvec v=hilb(I,2); 59 int s=dim(I); 60 intvec hp; 61 if(s==0){return(hp);} 62 int d=size(v)-2; 63 ring S=0,t,dp; 64 poly p=v[1+d]*bino(s-1-d,s-1); 65 int i; 66 for(i=1;i<=d;i++) 67 { 68 p=p+v[d-i+1]*bino(s-1-d+i,s-1); 69 } 70 int n=1; 71 for(i=2;i<=s-1;i++){n=n*i;} 72 p=n*p; 73 for(i=1;i<=s;i++) 74 { 75 hp[i]=int(leadcoef(p[s-i+1])); 76 } 77 setring R; 78 return(hp); 79 } 80 example 81 { "EXAMPLE:"; echo = 2; 82 ring r = 0,(b,c,t,h),dp; 83 ideal I= 84 bct-t2h+2th2+h3, 85 bt3-ct3-t4+b2th+c2th-2bt2h+2ct2h+2t3h-bch2-2bth2+2cth2+2th3, 86 b2c2+bt2h-ct2h-t3h+b2h2+2bch2+c2h2-2bth2+2cth2+t2h2-2bh3+2ch3+2th3+3h4, 87 c2t3+ct4-c3th-2c2t2h-2ct3h-t4h+bc2h2-2c2th2-bt2h2+4t3h2+2bth3-2cth3-t2h3 88 +bh4-6th4-2h5; 89 hilbPoly(I); 90 } 91 92 /////////////////////////////////////////////////////////////////////////////// 93 proc substitute (I,list #) 94 "USAGE: - case 1: typeof(#[1])==poly: 95 substitute (I,v,f[,v1,f1,v2,f2,...]); I object of basering which 96 can be mapped, v,v1,v2,.. ring variables, f,f1,f2,... poly 97 @* - case 2: typeof(#[1])==ideal: 98 substitute1 (I,v,f); I object of basering which can be mapped, 99 v ideal of ring variables, f ideal 100 RETURN: object of same type as I, 101 @* - case 1: ring variable v,v1,v2,... substituted by polynomials 102 f,f1,f2,..., in this order 103 @* - case 2: ring variables in v substituted by polynomials in f: 104 v[i] is substituted by f[i], i=1,...,i=min(size(v),ncols(f)) 105 NOTE: this procedure extends the built-in command subst which substitutes 106 ring variables only by monomials 107 EXAMPLE: example substitute; shows an example 108 " 109 110 { 111 def bas = basering; 112 ideal m = maxideal(1); 113 int i,ii; 114 if(typeof(#[1])=="poly") 115 { 116 poly v = #[1]; 117 poly f = #[2]; 118 map phi = bas,m; 119 def J = I; 120 for (ii=1; ii<=size(#) - 1; ii=ii+2) 121 { 122 m = maxideal(1); 123 i=rvar(#[ii]); 124 m[i] = #[ii+1]; 125 phi = bas,m; 126 J = phi(J); 127 } 128 return(J); 129 } 130 if(typeof(#[1])=="ideal") 131 { 132 ideal v = #[1]; 133 ideal f = #[2]; 134 int mi = size(v); 135 if(ncols(f)<mi) 136 { 137 mi = ncols(f); 138 } 139 m[rvar(v[1])]=f[1]; 140 map phi = bas,m; 141 def J = phi(I); 142 for (ii=2; ii<=mi; ii++) 143 { 144 m = maxideal(1); 145 m[rvar(v[ii])]=f[ii]; 146 phi = bas,m; 147 J = phi(J); 148 } 149 return(J); 150 } 151 } 152 example 153 { "EXAMPLE:"; echo = 2; 154 ring r = 0,(b,c,t),dp; 155 ideal I = -bc+4b2c2t,bc2t-5b2c; 156 substitute(I,c,b+c,t,0,b,b-1); 157 ideal v = c,t,b; 158 ideal f = b+c,0,b-1; 159 substitute(I,v,f); 160 } 161 /////////////////////////////////////////////////////////////////////////////// 35 162 proc cyclic (int n) 36 163 "USAGE: cyclic(n); n integer … … 278 405 (maxdeg of each var is 1). 279 406 Of type int if id is of type poly, of type intmat else 280 NOTE: proc maxdeg1 returns 1 integer, the absolut maximum; moreover, it has407 NOTE: proc maxdeg1 returns 1 integer, the absolute maximum; moreover, it has 281 408 an option for computing weighted degrees 282 409 EXAMPLE: example maxdeg; shows examples … … 317 444 example 318 445 { "EXAMPLE:"; echo = 2; 319 ring r = 0,(x,y,z),wp( -1,-2,-3);446 ring r = 0,(x,y,z),wp(1,2,3); 320 447 poly f = x+y2+z3; 321 448 deg(f); //deg; returns weighted degree (in case of 1 block)! … … 397 524 example 398 525 { "EXAMPLE:"; echo = 2; 399 ring r = 0,(x,y,z),wp( -1,-2,-3);526 ring r = 0,(x,y,z),wp(1,2,3); 400 527 poly f = x+y2+z3; 401 528 deg(f); //deg returns weighted degree (in case of 1 block)! … … 404 531 maxdeg1(f,v); //weighted maximal degree 405 532 matrix m[2][2]=f+x10,1,0,f^2; 406 maxdeg1(m,v); //absolut weighted maximal degree533 maxdeg1(m,v); //absolute weighted maximal degree 407 534 } 408 535 /////////////////////////////////////////////////////////////////////////////// … … 413 540 (mindeg of each variable is 1) of type int if id of type poly, else 414 541 of type intmat. 415 NOTE: proc mindeg1 returns one integer, the absolut minimum; moreover it542 NOTE: proc mindeg1 returns one integer, the absolute minimum; moreover it 416 543 has an option for computing weighted degrees. 417 544 EXAMPLE: example mindeg; shows examples … … 539 666 mindeg1(f,v); // computes minimal weighted degree 540 667 matrix m[2][2]=x10,1,0,f^2; 541 mindeg1(m,1..3); // computes absolut minimum of weighted degrees668 mindeg1(m,1..3); // computes absolute minimum of weighted degrees 542 669 } 543 670 /////////////////////////////////////////////////////////////////////////////// … … 611 738 612 739 proc lcm (id, list #) 613 "USAGE: lcm(p[,q]); p int/intve q a list of integers or740 "USAGE: lcm(p[,q]); p int/intvec q a list of integers or 614 741 p poly/ideal q a list of polynomials 615 742 RETURN: the least common multiple of the common entries of p and q: … … 897 1024 l[2]=their coefficients after interreduction 898 1025 l[3]=l[1]*l[2] 899 PU POSE: Do interred only w.r.t. a subset of variables.1026 PURPOSE: Do interred only w.r.t. a subset of variables. 900 1027 The procedure returns an interreduced system of generators of 901 1028 sm considered as a k[t_1,..,t_s]-submodule of the free module
Note: See TracChangeset
for help on using the changeset viewer.