Changeset 917fb5 in git
- Timestamp:
- Jul 6, 1999, 5:33:00 PM (24 years ago)
- Branches:
- (u'jengelh-datetime', 'ceac47cbc86fe4a15902392bdbb9bd2ae0ea02c6')(u'spielwiese', 'a800fe4b3e9d37a38c5a10cc0ae9dfa0c15a4ee6')
- Children:
- 8e7ed6b81b8840e62d72f281eef096b71dc1b37e
- Parents:
- ce7ba606241efb95de4d1ab5581428b7143b3be2
- Location:
- Singular
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
Singular/LIB/all.lib
rce7ba6 r917fb5 1 // $Id: all.lib,v 1.1 7 1999-06-22 10:42:23 obachmanExp $1 // $Id: all.lib,v 1.18 1999-07-06 15:32:45 Singular Exp $ 2 2 /////////////////////////////////////////////////////////////////////////////// 3 3 4 version="$Id: all.lib,v 1.1 7 1999-06-22 10:42:23 obachmanExp $";4 version="$Id: all.lib,v 1.18 1999-07-06 15:32:45 Singular Exp $"; 5 5 info=" 6 6 LIBRARY: all.lib Load all libraries … … 15 15 homolog.lib PROCEDURES FOR HOMOLOGICAL ALGEBRA 16 16 inout.lib PROCEDURES FOR MANIPULATING IN- AND OUTPUT 17 invar.lib PROCEDURES FOR COMPUTING INVARIANTS OF (C,+)-ACTIONS 17 invar.lib PROCEDURES FOR COMPUTING INVARIANTS OF (C,+)-ACTIONS 18 18 latex.lib PROCEDURES FOR TYPESET OF SINGULAROBJECTS IN LATEX2E 19 19 matrix.lib PROCEDURES FOR MATRIX OPERATIONS -
Singular/LIB/deform.lib
rce7ba6 r917fb5 1 // $Id: deform.lib,v 1.1 5 1999-07-06 11:32:46 obachmanExp $1 // $Id: deform.lib,v 1.16 1999-07-06 15:32:46 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.1 5 1999-07-06 11:32:46 obachmanExp $";5 version="$Id: deform.lib,v 1.16 1999-07-06 15:32:46 Singular Exp $"; 6 6 info=" 7 7 LIBRARY: deform.lib PROCEDURES FOR COMPUTING MINIVERSAL DEFORMATION … … 564 564 br = my+"Sx"; 565 565 if (defined(`br`)) { kill `br`} 566 if(system("with","Namespaces")) { 566 if(system("with","Namespaces")) 567 { 567 568 br = my+"Qx"; 568 569 if (defined(Top::`br`)) { kill Top::`br`;} -
Singular/LIB/general.lib
rce7ba6 r917fb5 1 // $Id: general.lib,v 1.1 4 1999-07-06 11:32:54 obachmanExp $1 // $Id: general.lib,v 1.15 1999-07-06 15:32:47 Singular Exp $ 2 2 //system("random",787422842); 3 3 //GMG, last modified 18.6.99 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: general.lib,v 1.1 4 1999-07-06 11:32:54 obachmanExp $";6 version="$Id: general.lib,v 1.15 1999-07-06 15:32:47 Singular Exp $"; 7 7 info=" 8 8 LIBRARY: general.lib PROCEDURES OF GENERAL TYPE … … 243 243 EXAMPLE: example kmemory; shows an example 244 244 " 245 { 245 { 246 246 int n; 247 247 int verb; … … 252 252 { verb=#[2]; } 253 253 } 254 254 255 255 if ( verb != 0) 256 256 { -
Singular/LIB/graphics.lib
rce7ba6 r917fb5 1 // $Id: graphics.lib,v 1. 3 1999-07-06 11:32:55 obachmanExp $1 // $Id: graphics.lib,v 1.4 1999-07-06 15:32:47 Singular Exp $ 2 2 // 3 3 // author : Christian Gorzel email: gorzelc@math.uni-muenster.de 4 4 // 5 5 /////////////////////////////////////////////////////////////////////////////// 6 version="$Id: graphics.lib,v 1. 3 1999-07-06 11:32:55 obachmanExp $";6 version="$Id: graphics.lib,v 1.4 1999-07-06 15:32:47 Singular Exp $"; 7 7 info=" 8 8 LIBRARY: graphics.lib PROCEDURES FOR GRAPHICS WITH MATHEMATICA … … 136 136 137 137 if (i>0) 138 { suffix = filename[i,size(filename)-i+1]; 138 { suffix = filename[i,size(filename)-i+1]; 139 139 name = ">" + filename[1,i-1]+ ".m"; 140 140 } 141 141 else { print("--Error: Suffix of filename incorrect"); return("");} 142 142 // if (suffix ==".m") { cmd = "Display[\" " + filename + "\",% ]";} 143 if (suffix ==".mps") { cmd = "Display[\" " + filename + "\",%] ";} 144 if (suffix ==".ps") { cmd = "Display[\" ! psfix > " + filename + "\", %]";} 145 if (suffix ==".eps") 146 { cmd = "Display[\" ! psfix -epsf > " + filename + "\", %]";} 143 if (suffix ==".mps") { cmd = "Display[\" " + filename + "\",%] ";} 144 if (suffix ==".ps") { cmd = "Display[\" ! psfix > " + filename + "\", %]";} 145 if (suffix ==".eps") 146 { cmd = "Display[\" ! psfix -epsf > " + filename + "\", %]";} 147 147 148 148 } … … 347 347 // active evalutation of the cell with SHIFT RETURN 348 348 349 // Hit RETURN to continue 350 pause; 349 pause("Hit RETURN to continue"); 351 350 // --------- space curves -------------- 352 351 I(1) = x3,-1/10x3+x2,x2; … … 357 356 // active evalutation of the cell with SHIFT RETURN 358 357 359 // Hit RETURN to continue 360 pause; 358 pause("Hit RETURN to continue"); 361 359 // --------- implicit curves ------------ 362 360 ring rr = 0,(x,y),ds; export rr; … … 387 385 // active evalutation of the cell with SHIFT RETURN 388 386 389 // Hit RETURN to continue 390 pause; 387 pause("Hit RETURN to continue"); 391 388 // ----------- surfaces ------------------- 392 389 ideal J(1) = 3xy4 + 2xy2, x5y3 + x + y6,10x2; -
Singular/LIB/hnoether.lib
rce7ba6 r917fb5 1 // $Id: hnoether.lib,v 1.1 1 1999-07-06 11:32:56 obachmanExp $1 // $Id: hnoether.lib,v 1.12 1999-07-06 15:32:48 Singular Exp $ 2 2 // author: Martin Lamm, email: lamm@mathematik.uni-kl.de 3 3 // last change: 09.03.99 … … 5 5 // This library is for Singular 1.2 or newer 6 6 7 version="$Id: hnoether.lib,v 1.1 1 1999-07-06 11:32:56 obachmanExp $";7 version="$Id: hnoether.lib,v 1.12 1999-07-06 15:32:48 Singular Exp $"; 8 8 info=" 9 9 LIBRARY: hnoether.lib PROCEDURES FOR THE HAMBURGER-NOETHER DEVELOPMENT … … 540 540 "The given polynomial is in fact not squarefree."; 541 541 "I'll continue with the radical."; 542 pause ;542 pause("Hit RETURN to continue"); 543 543 f=test_sqr; 544 544 } … … 580 580 {"But if the polynomial contains a factor of the form g^"+string(p)+","; 581 581 "this factor will be lost.";} 582 pause ;582 pause("Hit RETURN to continue"); 583 583 f=test_sqr; 584 584 nm = getnm(f); // N,M haben sich veraendert … … 762 762 // (the missing x in the matrix indicates that this line is not complete. 763 763 // It can only occur in the last line of the HNE, and normally does.) 764 hne[2]; pause; 764 hne[2]; 765 pause("Hit RETURN to continue"); 765 766 param(hne); 766 767 // returns the parametrization x(t)= -t14+O(t21), y(t)= -3t98+O(t105) … … 870 871 list hne_extended1=develop(f,6); 871 872 list hne_extended2=develop(f,10); 872 pause ;873 pause("Hit RETURN to continue"); 873 874 // compare the different matrices ... 874 875 print(hne[1]); … … 1959 1960 list hne=reddevelop(x14-3y2x11-y3x10-y2x9+3y4x8+y5x7+3y4x6+x5*(-y6+y5)-3y6x3-y7x2+y8); 1960 1961 print(hne[1][1]); // finite HNE 1961 print(extdevelop(hne[1],5)[1]); pause; 1962 print(extdevelop(hne[1],5)[1]); 1963 pause("Hit RETURN to continue"); 1962 1964 print(hne[2][1]); // HNE that can be extended 1963 1965 list ehne=extdevelop(hne[2],5); … … 1965 1967 param(hne[2]); 1966 1968 param(ehne); 1967 param(extdevelop(ehne,7)); pause; 1969 param(extdevelop(ehne,7)); 1970 pause("Hit RETURN to continue"); 1968 1971 ////////////////////////// 1969 1972 print(develop(x-y2-2y3-3y4)[1]); … … 2419 2422 displayInvariants(hne); 2420 2423 kill HNEring,r; 2421 pause ;2424 pause("Hit RETURN to continue"); 2422 2425 // a more interesting example: 2423 2426 ring r = 32003,(x,y),dp; … … 3076 3079 if (testpol!=0) { 3077 3080 "factorize not implemented in char (0,a)!"; 3078 "could not factorize:",charPoly(leitf,M,N); pause; 3081 "could not factorize:",charPoly(leitf,M,N); 3082 pause("Hit RETURN to continue"); 3079 3083 } 3080 3084 return(faktoren,(testpol==0)); // Test: faktoren==list() geht leider nicht -
Singular/LIB/inout.lib
rce7ba6 r917fb5 1 // $Id: inout.lib,v 1. 8 1999-07-06 11:32:58 obachmanExp $1 // $Id: inout.lib,v 1.9 1999-07-06 15:32:49 Singular Exp $ 2 2 // system("random",787422842); 3 3 // (GMG/BM, last modified 22.06.96) 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: inout.lib,v 1. 8 1999-07-06 11:32:58 obachmanExp $";6 version="$Id: inout.lib,v 1.9 1999-07-06 15:32:49 Singular Exp $"; 7 7 info=" 8 8 LIBRARY: inout.lib PROCEDURES FOR MANIPULATING IN- AND OUTPUT … … 37 37 int i; 38 38 for( i=1; i<=size(#); i=i+1 ) { print(#[i]); } 39 if( ALLprint==2 ) { pause ; listvar(matrix); }40 if( ALLprint >0 ) { pause ; }39 if( ALLprint==2 ) { pause(); listvar(matrix); } 40 if( ALLprint >0 ) { pause(); } 41 41 } 42 42 return(); … … 403 403 { 404 404 "["+string(@ii)+"]:"; 405 tab(@li@+2),"//",id[@ii]; 405 tab(@li@+2),"//",id[@ii]; 406 406 } 407 407 } -
Singular/LIB/invar.lib
rce7ba6 r917fb5 1 // $Id: invar.lib,v 1. 8 1999-07-06 11:32:59 obachmanExp $1 // $Id: invar.lib,v 1.9 1999-07-06 15:32:50 Singular Exp $ 2 2 /////////////////////////////////////////////////////// 3 3 // invar.lib … … 7 7 ////////////////////////////////////////////////////// 8 8 9 version="$Id: invar.lib,v 1. 8 1999-07-06 11:32:59 obachmanExp $";9 version="$Id: invar.lib,v 1.9 1999-07-06 15:32:50 Singular Exp $"; 10 10 info=" 11 11 LIBRARY: invar.lib PROCEDURES FOR COMPUTING INVARIANTS OF (C,+)-ACTIONS … … 490 490 " "; 491 491 karl; 492 // pause;493 492 " "; 494 493 } … … 529 528 " "; 530 529 karl; 531 // pause;532 530 " "; 533 531 } -
Singular/LIB/jordan.lib
rce7ba6 r917fb5 1 1 /////////////////////////////////////////////////////////////////////////////// 2 2 3 version="$Id: jordan.lib,v 1.1 4 1999-07-06 11:32:59 obachmanExp $";3 version="$Id: jordan.lib,v 1.15 1999-07-06 15:32:51 Singular Exp $"; 4 4 info=" 5 5 LIBRARY: jordan.lib PROCEDURES TO COMPUTE THE JORDAN NORMAL FORM … … 188 188 { 189 189 for(j=ncols(eM0);j>=1;j--) 190 190 { 191 191 if(deg(eM0[j])>1) 192 192 { … … 200 200 { 201 201 for(j=ncols(eM0);j>=1;j--) 202 202 { 203 203 if(deg(eM0[j])>1) 204 204 { … … 396 396 print("//not enough entries in argument list"); 397 397 matrix J[1][0]; 398 return(J); 398 return(J); 399 399 } 400 400 def eJ,bJ=jd[1..2]; … … 403 403 print("//first entry in argument list not an ideal"); 404 404 matrix J[1][0]; 405 return(J); 405 return(J); 406 406 } 407 407 if(typeof(bJ)!="list") … … 409 409 print("//second entry in argument list not a list"); 410 410 matrix J[1][0]; 411 return(J); 411 return(J); 412 412 } 413 413 if(size(eJ)<size(bJ)) -
Singular/LIB/latex.lib
rce7ba6 r917fb5 1 // $Id: latex.lib,v 1. 7 1999-07-06 11:33:00 obachman Exp $1 // $Id: latex.lib,v 1.8 1999-07-06 15:32:52 Singular Exp $ 2 2 // 1998/04/17 3 3 // author : Christian Gorzel email: gorzelc@math.uni-muenster.de 4 // 4 // 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 … … 26 26 xdvi(s); calls xdvi for dvi-file s 27 27 (parameters in square brackets [] are optional) 28 29 GLOBAL VARIABLES: 28 29 GLOBAL VARIABLES: 30 30 TeXwidth, TeXnofrac, TeXbrack, TeXproj, TeXaligned, TeXreplace, NoDollars 31 are used to control the typesetting 31 are used to control the typesetting 32 32 Call example texdemo; to become familiar with the features of latex.lib 33 33 … … 45 45 /////////////////////////////////////////////////////////////////////////////// 46 46 47 proc closetex(string fname, list #) 47 proc closetex(string fname, list #) 48 48 "USAGE: closetex(fname[,style]); fname,style = string 49 49 RETURN: nothing; writes a LaTeX2e closing line into file fname 50 NOTE: style overwrites the default setting latex2e; maybe latex,amstex,tex 51 preceeding >> end ending \".tex\" may miss in fname; 50 NOTE: style overwrites the default setting latex2e; maybe latex,amstex,tex 51 preceeding >> end ending \".tex\" may miss in fname; 52 52 overwriting an existing file is not possible 53 53 EXAMPLE: example closetex; shows an example 54 54 " 55 55 { 56 string default = "latex2e"; 56 string default = "latex2e"; 57 57 string s; 58 58 int i = 1; … … 61 61 if (size(#)) { default = #[1];} 62 62 63 if (default=="latex2e" or default == "latex") 63 if (default=="latex2e" or default == "latex") 64 64 { s = "\\end{document}"; flag = 1;} 65 65 if (default=="amstex") {s = "\\enddocument"; flag = 1;} 66 66 if (default=="tex") {s = "\\bye"; flag = 1;} 67 if (not(flag)) { s = "";} 68 69 if (size(fname)) 67 if (not(flag)) { s = "";} 68 69 if (size(fname)) 70 70 { 71 71 while (fname[i]==">"){i++;} 72 72 fname = fname[i,size(fname)-i+1]; 73 73 74 74 if (size(fname)>=4) // check if filename is ending with ".tex" 75 75 { if(fname[size(fname)-3,4]!=".tex") {fname = fname +".tex"; } … … 77 77 else {fname = fname + ".tex";} 78 78 write(fname, s); 79 write(fname," - Thanks latex.lib and Singular - "); 80 } 81 else {return(s);} 79 write(fname," - Thanks latex.lib and Singular - "); 80 } 81 else {return(s);} 82 82 } 83 83 example … … 92 92 "USAGE: tex(fname[,style]); fname,style = string 93 93 RETURN: nothing; calls latex2e for compiling the file fname 94 NOTE: style overwrites the default setting latex2e; maybe latex,amstex,tex 95 ending ".tex" may miss in fname 94 NOTE: style overwrites the default setting latex2e; maybe latex,amstex,tex 95 ending ".tex" may miss in fname 96 96 EXAMPLE: example tex; shows an example 97 97 " 98 { 98 { 99 99 string default = "latex2e"; 100 int retval; 100 int retval; 101 101 int i=1; 102 102 … … 107 107 while (fname[i]==">"){i++;} 108 108 fname = fname[i,size(fname)-i+1]; 109 109 110 110 if (size(fname)>=4) // check if filename is ending with ".tex" 111 111 { if(fname[size(fname)-3,4]!=".tex") {fname = fname +".tex"; } … … 113 113 else {fname = fname + ".tex";} 114 114 "calling ",default, " for :",fname,newline; 115 115 116 116 retval = system("sh",default + " " + fname); 117 117 } … … 135 135 tex("exp002","tex"); 136 136 echo = 0; 137 print("the created files will be deleted after pressing <RETURN> "); 138 pause; 137 pause("the created files will be deleted after pressing <RETURN>"); 139 138 echo = 2; 140 139 system("sh","rm -i exp00?.*"); … … 142 141 /////////////////////////////////////////////////////////////////////////////// 143 142 144 proc opentex(string fname, list #) 143 proc opentex(string fname, list #) 145 144 "USAGE: opentex(fname[,style]); fname,style = string 146 145 RETURN: nothing; writes as LaTeX2e header into a new file fname 147 146 NOTE: suffix .tex may miss in fname 148 style overwrites the default setting latex2e; may be latex,amstex,tex 147 style overwrites the default setting latex2e; may be latex,amstex,tex 149 148 EXAMPLE: example opentex; shows an example 150 149 " 151 { 150 { 152 151 string default = "latex2e"; 153 152 string s; … … 157 156 if (size(#)) { default = #[1];} 158 157 159 if (default == "latex2e") // the default latex2e header 160 { s = 158 if (default == "latex2e") // the default latex2e header 159 { s = 161 160 "\\documentclass[12pt]{article}" + newline + 162 161 // "\\usepackage{fullpage,amsmath,amscd,amsthm,amssymb,amsxtra,latexsym,epsfig}" + newline + 163 162 "\\usepackage{amsmath,amssymb}" + newline + 164 "\\parindent=0pt" + newline + 165 "\\newcommand{\\C}{{\\Bbb C}}" + newline + 166 "\\newcommand{\\F}{{\\Bbb F}}" + newline + 163 "\\parindent=0pt" + newline + 164 "\\newcommand{\\C}{{\\Bbb C}}" + newline + 165 "\\newcommand{\\F}{{\\Bbb F}}" + newline + 167 166 "\\newcommand{\\N}{{\\Bbb N}}" + newline + 168 167 // "\\newcommand{\\P}{{\\Bbb P}}" + newline + 169 "\\newcommand{\\Q}{{\\Bbb Q}}" + newline + 168 "\\newcommand{\\Q}{{\\Bbb Q}}" + newline + 170 169 "\\newcommand{\\R}{{\\Bbb R}}" + newline + 171 170 "\\newcommand{\\T}{{\\Bbb T}}" + newline + … … 175 174 } 176 175 if (default == "latex") 177 { s = 176 { s = 178 177 "\\documentstyle[12pt,amstex]{article}" + newline + 179 178 "\\parindent=0pt" + newline + 180 "\\newcommand{\\C}{{\\Bbb C}}" + newline + 181 "\\newcommand{\\F}{{\\Bbb F}}" + newline + 179 "\\newcommand{\\C}{{\\Bbb C}}" + newline + 180 "\\newcommand{\\F}{{\\Bbb F}}" + newline + 182 181 "\\newcommand{\\N}{{\\Bbb N}}" + newline + 183 182 // "\\newcommand{\\P}{{\\Bbb P}}" + newline + 184 "\\newcommand{\\Q}{{\\Bbb Q}}" + newline + 183 "\\newcommand{\\Q}{{\\Bbb Q}}" + newline + 185 184 "\\newcommand{\\R}{{\\Bbb R}}" + newline + 186 185 "\\newcommand{\\T}{{\\Bbb T}}" + newline + … … 188 187 "\\begin{document}"; 189 188 flag = 1; 190 } 191 if (default == "amstex") 192 { s = 189 } 190 if (default == "amstex") 191 { s = 193 192 "\\documentstyle{amsppt} " + newline + newline + 194 193 "\\document"; 195 flag = 1; 196 } 197 198 if (default == "tex") 199 { s = 200 ""; 194 flag = 1; 195 } 196 197 if (default == "tex") 198 { s = 199 ""; 201 200 flag = 1; 202 201 } … … 207 206 if (not(flag)) { s = "";} 208 207 209 if (size(fname)) 208 if (size(fname)) 210 209 { 211 210 while (fname[i]==">"){i++;} … … 219 218 write(fname,s); 220 219 } 221 else {return(s);} 220 else {return(s);} 222 221 } 223 222 example … … 229 228 /////////////////////////////////////////////////////////////////////////////// 230 229 231 proc texdemo(list #) 230 proc texdemo(list #) 232 231 "USAGE: texdemo(); 233 232 RETURN: nothing; generates automatically a LaTeX2e file called: texlibdemo.tex 234 233 explaining the features of latex.lib and its gloabl variables 235 NOTE: this proc takes a minutes 234 NOTE: this proc takes a minutes 236 235 EXAMPLE: example texdemo; executes the generation 237 236 " … … 239 238 string fname = "texlibdemo"; 240 239 241 if (size(#)) 242 { if (typeof(#[1])=="int") {TeXdemostart = #[1];} 240 if (size(#)) 241 { if (typeof(#[1])=="int") {TeXdemostart = #[1];} 243 242 } 244 243 system("random",TeXdemostart); 245 244 246 245 if (size(#) ==2) 247 246 { if (typeof(#[2]) == "string") { fname = #[2];} … … 274 273 /////////////////////////////////////////////////////////////////////////////// 275 274 276 proc texfactorize(string fname, poly f, list #) 275 proc texfactorize(string fname, poly f, list #) 277 276 "USAGE: opentex(fname,f); fname = string; f = poly 278 277 RETURN: string, the poly as as product of its irreducible factors 279 278 in TeX-typesetting if fname == empty string; 280 otherwise append this to file fname.tex; return nothing 281 NOTE: preceeding >> end ending \".tex\" may miss in fname 279 otherwise append this to file fname.tex; return nothing 280 NOTE: preceeding >> end ending \".tex\" may miss in fname 282 281 EXAMPLE: example texfactorize; shows an example 283 282 " … … 295 294 else { D = ""; } 296 295 TW = defined(TeXwidth); 297 if (TW) {Tw = TeXwidth; TeXwidth = -1;} 296 if (TW) {Tw = TeXwidth; TeXwidth = -1;} 298 297 else {int TeXwidth = -1; export TeXwidth;} 299 298 … … 312 311 if(size(g)>1 or (size(g)==1 and k>1)) 313 312 { t = "(" + texpoly("",l[1][i]) + ")";} 314 else { t = texpoly("",l[1][i]);} 313 else { t = texpoly("",l[1][i]);} 315 314 if (l[2][i]>1) 316 315 { t = t+"^{" +string(l[2][i]) + "}";} … … 321 320 if (TW) {TeXwidth = Tw;} 322 321 } 323 if(size(fname)) 322 if(size(fname)) 324 323 { i=1; 325 324 while (fname[i]==">"){i++;} … … 342 341 minpoly = a2 +a +3; 343 342 poly f = (a24x5 + x3)*a2x6*(x+1)^2; 344 f; 343 f; 345 344 texfactorize("",f); 346 345 } … … 351 350 RETURN: string, the map m from @r1 to @r2 preeceded by its name if m = string 352 351 in TeX-typesetting if fname == empty string; 353 otherwise append this to file fname.tex; return nothing 354 NOTE: preceeding >> end ending \".tex\" may miss in fname 352 otherwise append this to file fname.tex; return nothing 353 NOTE: preceeding >> end ending \".tex\" may miss in fname 355 354 EXAMPLE: example texmap; shows an example 356 355 " 357 { 356 { 358 357 int saveDollars= defined(NoDollars); 359 358 int TX = defined(TeXwidth); … … 371 370 { int i; 372 371 373 for(i=1;i<=size(TeXreplace);i++) 372 for(i=1;i<=size(TeXreplace);i++) 374 373 { if (TeXreplace[i][1]==s) {s= TeXreplace[i][2]; break;}} 375 374 return(s); 376 375 } 377 376 378 377 // --- store all actual informations 379 378 if(TX) { Tw = TeXwidth; TeXwidth = -1;} … … 429 428 t = t + texpoly("",@J[1]); 430 429 for (i=2;i<=n; i++) 431 {if(defined(TeXaligned)) 430 {if(defined(TeXaligned)) 432 431 { t = t + vrg + texpoly("",@J[i]); } 433 432 else { t = t + "\\\\" + newline + texpoly("",@J[i]);} … … 479 478 else {return(s);} 480 479 } 481 example 480 example 482 481 { "EXAMPLE:"; echo = 2; 483 482 string fname = "tldemo"; … … 494 493 texmap("",phi,r1,r2,"\\C"); 495 494 kill r1,r2,TeXreplace,TeXaligned; 496 } 495 } 497 496 /////////////////////////////////////////////////////////////////////////////// 498 497 499 proc texname(string fname, string s) 498 proc texname(string fname, string s) 500 499 "USAGE: texname(fname,s); fname,s = string 501 500 RETURN: the string s if fname == the empty string 502 otherwise append s to file fname.tex; return nothing 503 NOTE: preceeding >> end ending \".tex\" may miss in fname 501 otherwise append s to file fname.tex; return nothing 502 NOTE: preceeding >> end ending \".tex\" may miss in fname 504 503 EXAMPLE: example texname; shows an example 505 504 " … … 528 527 if (s[i]=="[") { anf = i+1; 529 528 while(s[i]!="]"){i++;} // matrices and vectors 530 st = st + "_{" + s[anf,i-anf] + "}"; n = n+ 5*(i-anf); i++; 529 st = st + "_{" + s[anf,i-anf] + "}"; n = n+ 5*(i-anf); i++; 531 530 // besser: while s[i]<> nwline : scan forward: end, return 532 531 } … … 538 537 n = n+5*(i-anf); 539 538 anf =i; // the next text in ( , ) as exponent 540 if (op) { if (s[i]== ","){anf = anf+1;} 539 if (op) { if (s[i]== ","){anf = anf+1;} 541 540 while(s[i] !=")"){ i++;} 542 541 if (i<>anf){st = st + "^{" + s[anf,i-anf] + "}"; n = n +5*(i-anf);} … … 577 576 "USAGE: texobj(fname,l); fname = string,l = list of Singular dataypes 578 577 RETURN: string, the objects in TeX-typesetting if fname == empty string; 579 otherwise append this to file fname.tex; return nothing 580 NOTE: preceeding ">>" end ending ".tex" may miss in fname; 578 otherwise append this to file fname.tex; return nothing 579 NOTE: preceeding ">>" end ending ".tex" may miss in fname; 581 580 EXAMPLE: example texobj; shows an example 582 581 " … … 591 590 string D,DA,DE = "$","\\begin{equation*}" + newline, 592 591 "\\end{equation*}"+ newline; 593 string OB,CB = "(",")"; 592 string OB,CB = "(",")"; 594 593 if (defined(TeXbrack)) 595 594 {// if (TeXbrack=="(") {OB = "("; CB = ")";} … … 610 609 proc absterm(poly f) 611 610 { int k; 612 611 613 612 for (k=1; k<=nvars(basering); k++) 614 613 { f = subst(f,var(k),0); } … … 618 617 619 618 if (size(#)==1) 620 { if (typeof(#[1])=="int" or typeof(#[1])=="intvec" or typeof(#[1])=="vector" 619 { if (typeof(#[1])=="int" or typeof(#[1])=="intvec" or typeof(#[1])=="vector" 621 620 or typeof(#[1])=="number" or defined(TeXaligned)) { DA = D; DE = D; } } 622 621 … … 625 624 for (k=1; k<=size(#); k++) 626 625 { def obj = #[k]; 627 if (typeof(obj) == "string") 626 if (typeof(obj) == "string") 628 627 { if (defined(`obj`)) 629 { if (typeof(`obj`)=="ideal") 628 { if (typeof(`obj`)=="ideal") 630 629 { Iname = obj; def e = `obj`; 631 630 kill obj; def obj = e; kill e;} … … 635 634 } 636 635 if (typeof(obj) == "int") { s = s + " " + string(obj) + " ";} 637 638 if (typeof(obj) == "intvec") 636 637 if (typeof(obj) == "intvec") 639 638 { s = s + " ("; 640 639 for(j=1; j<size(obj);j++) { s = s + string(obj[j]) + sep;} … … 642 641 } 643 642 644 if (typeof(obj) == "number" ) 643 if (typeof(obj) == "number" ) 645 644 { s = s + texpoly("",obj) + newline; 646 645 } … … 654 653 } 655 654 656 if (typeof(obj) == "vector") 655 if (typeof(obj) == "vector") 657 656 { if (obj==0) { s = s + "0" ;} 658 657 else … … 665 664 } 666 665 667 if (typeof(obj) == "ideal") 666 if (typeof(obj) == "ideal") 668 667 { if (size(Iname)) // verwende hier align 669 668 { if (Tw==0) {TeXwidth = -1;} … … 673 672 // { untereinander } 674 673 // else { hintereinander } 675 // 676 // 677 // s = s + Iname + "=" + texpoly("",obj,","); 674 // 675 // 676 // s = s + Iname + "=" + texpoly("",obj,","); 678 677 // siehe ebenso noch einmal am Ende : ! (TeXwidth <> 0 !? ) 679 678 680 679 s = s + "\\begin{array}{rcl}" + newline; 681 680 for (i=1;i<=size(matrix(obj));i++) 682 { s = s + Iname+ "_{" + string(i) + "} & = & " 681 { s = s + Iname+ "_{" + string(i) + "} & = & " 683 682 + texpoly("",obj[i]); 684 683 if (i<size(matrix(obj))){ s = s + "\\\\" + newline;} … … 689 688 Iname =""; 690 689 } 691 else 692 { 693 if (TeXwidth==0) 690 else 691 { 692 if (TeXwidth==0) 694 693 { TeXwidth = -1; 695 694 obj= simplify(obj,2); … … 711 710 } 712 711 else // linear 713 { s = s + 712 { s = s + 714 713 "\\begin{array}{*{" + string(2*nvars(basering)-1) + "}{c}cr}" + newline; 715 for(j=1; j<=size(obj);j++) 716 { h = absterm(obj[j]); 714 for(j=1; j<=size(obj);j++) 715 { h = absterm(obj[j]); 717 716 ineq = attrib(obj[j],"ineq"); 718 717 if(!(size(ineq))) { ineq = "=" ; } … … 725 724 { if (t[1]!="-" and t[1]!= " " and nc ){sg = "+";} 726 725 if (t[1]=="-") { sg = "-"; nc =1; t=t[2,size(t)-1];} 727 if (t==" ") {sg ="";} 726 if (t==" ") {sg ="";} 728 727 l = l + " & " + sg + " & " + t; 729 728 } … … 744 743 if (defined(TeXaligned)) 745 744 { s = s + texpoly("",obj,","); 746 } 745 } 747 746 else 748 747 { s = s + newline + "\\begin{array}{c}" + newline + 749 texpoly("",obj,", \\\\" + newline) + 748 texpoly("",obj,", \\\\" + newline) + 750 749 newline + "\\end{array}" + newline; 751 750 } 752 751 s = s + "\\right" + CB; 753 } // end TeXwidth <> 0 752 } // end TeXwidth <> 0 754 753 } // not Iname 755 754 // s; 756 755 } 757 756 758 if (typeof(obj) == "module") 757 if (typeof(obj) == "module") 759 758 { M = matrix(obj); 760 759 if (Tw ==0 or Tw > 9) { TeXwidth = -1;} … … 762 761 if (!(defined(TeXaligned))) 763 762 { // Naechste Zeile nicht notwendig ! 764 // s = s + "\\begin{array}{*{"+ string(ncols(M)) + "}{c}}" + newline; 765 for(j=1;j<=ncols(M);j++) 763 // s = s + "\\begin{array}{*{"+ string(ncols(M)) + "}{c}}" + newline; 764 for(j=1;j<=ncols(M);j++) 766 765 { l = "\\left" + OB + newline + "\\begin{array}{c}" + newline; 767 766 l = l + texpoly("",ideal(M[1..nrows(M),j]), " \\\\" + newline) … … 772 771 } 773 772 else // TeXaligned 774 { 775 for(j=1;j<=ncols(M);j++) 773 { 774 for(j=1;j<=ncols(M);j++) 776 775 { s = s + "\\left" + OB + newline + 777 776 texpoly("",ideal(M[1..nrows(M),j]),",") + newline + "\\right" + CB; … … 787 786 l = ""; 788 787 // M = transpose(obj); 789 s = s + "\\left" + OB + newline + 788 s = s + "\\left" + OB + newline + 790 789 "\\begin{array}{*{"+ string(ncols(obj)) + "}{c}" + "}"+ newline; 791 790 for(i=1;i<=nrows(obj);i++) … … 794 793 } 795 794 l = l + newline; 796 s = s + l + "\\end{array}" + newline + 795 s = s + l + "\\end{array}" + newline + 797 796 "\\right" + CB + newline; 798 797 TeXwidth = Tw; 799 798 } 800 799 801 800 if (typeof(obj) == "intmat") 802 801 { nr,nc = nrows(obj),ncols(obj); 803 802 l = ""; 804 l = "\\left" + OB + newline + 803 l = "\\left" + OB + newline + 805 804 "\\begin{array}{*{"+ string(nc) + "}{r}}"+ newline; 806 805 for(i=1;i<=nr;i++) 807 { for(j=1;j<=nc;j++) 806 { for(j=1;j<=nc;j++) 808 807 { l = l + string(obj[i,j]); 809 808 if (j <nc ) { l = l + " & ";} … … 811 810 } 812 811 } 813 l = l + newline + "\\end{array}" + newline + 812 l = l + newline + "\\end{array}" + newline + 814 813 "\\right" + CB + newline; 815 s = s + l; 814 s = s + l; 816 815 } 817 816 … … 854 853 /////////////////////////////////////////////////////////////////////////////// 855 854 856 proc texproc(string fname,string pname) 855 proc texproc(string fname,string pname) 857 856 "USAGE: opentex(fname,pname); fname,pname = string 858 RETURN: string, the proc in a verbatim environment in TeX-typesetting 857 RETURN: string, the proc in a verbatim environment in TeX-typesetting 859 858 if fname == empty string; 860 otherwise append this to file fname.tex; return nothing 861 NOTE: preceeding >> end ending \".tex\" may miss in fname; 862 CAUTION: texproc cannot applied on itself correctly 859 otherwise append this to file fname.tex; return nothing 860 NOTE: preceeding >> end ending \".tex\" may miss in fname; 861 CAUTION: texproc cannot applied on itself correctly 863 862 EXAMPLE: example texproc; shows an example 864 863 " … … 900 899 { if(fname[size(fname)-3,4]!=".tex") {fname = fname +".tex"; } 901 900 } 902 else {fname = fname + ".tex";} 901 else {fname = fname + ".tex";} 903 902 write(fname,s); 904 903 } 905 else{return(s);} 904 else{return(s);} 906 905 } 907 906 example … … 918 917 } 919 918 export exp; 920 texproc("","exp"); 919 texproc("","exp"); 921 920 } 922 921 923 922 /////////////////////////////////////////////////////////////////////////////// 924 923 925 proc texring(string fname, def r, list #) 924 proc texring(string fname, def r, list #) 926 925 "USAGE: texring(fname, r[,l]); fname = string; r = ring; 927 926 l=list of strings : controls the symbol for 928 coefficient field etc. see example texdemo(); 927 coefficient field etc. see example texdemo(); 929 928 RETURN: string, the ring in TeX-typesetting if fname == empty string; 930 otherwise append this to file fname.tex; return nothing 931 NOTE: preceeding >> end ending \".tex\" may miss in fname; 929 otherwise append this to file fname.tex; return nothing 930 NOTE: preceeding >> end ending \".tex\" may miss in fname; 932 931 EXAMPLE: example texring; shows an example 933 932 " 934 { 933 { 935 934 int i,galT,flag,mipo,nopar,Dollars,TB,TA; 936 935 string ob,cb,cf,en,s,t,savebrack; //opening bracket, closing br, coef.field … … 939 938 940 939 proc tvar(intvec v) 941 { 940 { 942 941 int i,j,ldots; 943 942 string s; 944 943 945 944 j = 1; 946 945 s = texpoly("",var(1)); 947 946 948 947 if (nvars(basering)==1) { return(s);} 949 948 if (nvars(basering)==2) { return(s + "," + texpoly("",var(2)));} … … 957 956 ldots =1; 958 957 } 959 if (i== v[j]) 958 if (i== v[j]) 960 959 { s = s + "," + texpoly("",var(i)); 961 960 ldots =0; … … 986 985 if (size(#)) 987 986 { if (typeof(#[1])=="list") { # = #[1];} 988 } 987 } 989 988 for (i=1;i<=size(#);i++) 990 989 { flag =0; … … 1018 1017 s = s + texpoly("",par(npars(r))) + ")"; 1019 1018 } // parameters done 1020 if (!(galT) and mipo and minpoly!=0) 1019 if (!(galT) and mipo and minpoly!=0) 1021 1020 { s = s + "/" + list(parsp(string(minpoly),0))[1];} 1022 1021 s = s + ob; … … 1029 1028 if (typeof(r)=="qring") 1030 1029 { ideal @I = ideal(r); 1031 if (defined(TeXbrack)) 1030 if (defined(TeXbrack)) 1032 1031 { 1033 TB =1; savebrack = TeXbrack; 1032 TB =1; savebrack = TeXbrack; 1034 1033 if (TeXbrack!= "<" and TeXbrack!="(") { TeXbrack = "<";} 1035 1034 } … … 1044 1043 } 1045 1044 1046 if (Dollars) 1045 if (Dollars) 1047 1046 { kill NoDollars; 1048 1047 s = "$" + s + "$"; … … 1060 1059 } 1061 1060 else{return(s);} 1062 } 1061 } 1063 1062 example 1064 1063 { "EXAMPLE:"; echo=2; 1065 1064 ring r0 = 0,(x,y,z),dp; // short varnames polynomial ordering 1066 1065 texring("",r0); 1067 ring r7 =0,(x(0..2)),ds; // char =7, long varnames 1066 ring r7 =0,(x(0..2)),ds; // char =7, long varnames 1068 1067 texring("",r7); 1069 1068 ring r1 = 0,(x1,x2,y1,y2),wp(1,2,3,4); … … 1074 1073 texring("",rr); 1075 1074 ring r; 1076 texring("",r); 1075 texring("",r); 1077 1076 ring rabc =(0,t1,t2,t3),(x,y),dp; // parameters 1078 1077 texring("",rabc); … … 1082 1081 texring("",ralg,"mipo"); 1083 1082 ring r49=(49,a),x,dp; // Galoisfield 1084 texring("",r49); 1083 texring("",r49); 1085 1084 setring r0; 1086 1085 ideal i = x2-z,xy2+1; … … 1094 1093 intvec v = 5,6; 1095 1094 texring("",rxy,v); 1096 texring("",r0,"C","{"); 1095 texring("",r0,"C","{"); 1097 1096 texring("",ralg,"k"); 1098 1097 texring("",r7,"^G"); … … 1110 1109 proc rmx(string fname) 1111 1110 "USAGE: rmx(fname); fname = string 1112 RETURN: nothing; removes .log and .aux files associated to file <fname> 1111 RETURN: nothing; removes .log and .aux files associated to file <fname> 1113 1112 removes tex and xdvi file too, if suffix \".tex\" or \".dvi\" is given 1114 NOTE: if fname ends by .dvi or .tex 1115 fname.dvi or fname.dvi and fname.tex will be deleted, too 1113 NOTE: if fname ends by .dvi or .tex 1114 fname.dvi or fname.dvi and fname.tex will be deleted, too 1116 1115 EXAMPLE: example rmx; shows an example 1117 1116 " 1118 1117 { 1119 1118 int i,suffix= 1,0; 1120 int retval; 1119 int retval; 1121 1120 1122 1121 if (size(fname)) … … 1128 1127 if (fname[size(fname)-3,4]==".dvi") { suffix = 1; } 1129 1128 if (suffix) { fname = fname[1,size(fname)-4]; } 1130 } 1129 } 1131 1130 retval = system("sh","rm " + fname + ".aux"); 1132 1131 retval = system("sh","rm " + fname + ".log"); … … 1137 1136 {" -- Need a filename "; 1138 1137 return(); 1139 } 1138 } 1140 1139 } 1141 1140 example … … 1155 1154 rmx("exp002.tex"); // removes aux, log, dvi and tex file of exp002 1156 1155 echo = 0; 1157 print("remaining files will be deleted after pressing <RETURN> "); 1158 pause; 1156 pause("remaining files will be deleted after pressing <RETURN>"); 1159 1157 echo = 2; 1160 1158 system("sh","rm -i exp00?.*"); … … 1172 1170 int i=1; 1173 1171 int retval; 1174 string default = "xdvi"; 1175 1172 string default = "xdvi"; 1173 1176 1174 if (size(#)) {default = string(#[1]);} 1177 1175 1178 1176 if (size(fname)) 1179 1177 { … … 1183 1181 if (size(fname)>=4) 1184 1182 { if(fname[size(fname)-3,4]==".tex") {fname = fname[1,size(fname)-4];}} 1185 1186 "calling ",default, " for :",fname,newline; 1187 1183 1184 "calling ",default, " for :",fname,newline; 1185 1188 1186 retval = system("sh",default + " " + fname + " &"); 1189 1187 } … … 1203 1201 xdvi("exp001"); 1204 1202 echo = 0; 1205 print("the created files will be deleted after pressing <RETURN> "); 1206 pause; 1203 pause("the created files will be deleted after pressing <RETURN>"); 1207 1204 echo = 2; 1208 system("sh","rm -i exp00?.*"); 1205 system("sh","rm -i exp00?.*"); 1209 1206 } 1210 1207 /////////////////////////////////////////////////////////////////////////////// … … 1213 1210 "USAGE: texpoly(fname,p[,l]); fname = string; p = poly,ideal; l formation str 1214 1211 RETURN: string, the objects in TeX-typesetting if fname == empty string; 1215 otherwise append this to file fname.tex; return nothing 1216 NOTE: preceeding ">>" end ending ".tex" may miss in fname; 1212 otherwise append this to file fname.tex; return nothing 1213 NOTE: preceeding ">>" end ending ".tex" may miss in fname; 1217 1214 EXAMPLE: example texpoly; shows an example 1218 1215 " 1219 { 1216 { 1220 1217 def @r = basering; 1221 1218 … … 1225 1222 string sign,cfmt,pt,s,bg,t,monomt, lnbreak; 1226 1223 string sep = newline; 1227 int i,b,b2,n, msz,linesz, count,k; 1224 int i,b,b2,n, msz,linesz, count,k; 1228 1225 int realT, parT, galT; 1229 1226 int C = 2 + defined(TeXdisplay); … … 1234 1231 if (typeof(p) == "ring" or typeof(p) == "qring") 1235 1232 { " -- Call texring instead "; return();} 1236 if (find(notvalid,typeof(p))) 1233 if (find(notvalid,typeof(p))) 1237 1234 { " -- Call texobj instead "; return();} 1238 1235 if (typeof(p) == "map") … … 1247 1244 1248 1245 proc parsr(string s) // parse real 1249 { string t; 1250 1251 if (s==" Inf") { return("\\infty",3);} 1246 { string t; 1247 1248 if (s==" Inf") { return("\\infty",3);} 1252 1249 if (s==" -Inf") { return("\\-infty",6);} 1253 1250 if (s[7]=="-"){t ="-";} 1254 1251 if (s[8]<>"0"){t = t + s[8];} 1255 1252 if (s[9]<>"0" or s[8]<>"0"){t = t + s[9];} 1256 if (size(t)) 1253 if (size(t)) 1257 1254 { if (t=="1") {return(s[1,5]+"*10",21);} 1258 1255 if (size(t)>1) {return(s[1,5]+"*10^{"+t+"}",21+2*size(t));} … … 1265 1262 { int i,j = 1,1; 1266 1263 string t; 1267 1264 1268 1265 if (short) 1269 { t =s[1]; 1266 { t =s[1]; 1270 1267 if(size(s)>1) {return(t+"^{" + s[2,size(s)-1] + "}",3+2*(size(s)-1));} 1271 else{return(t,5);} 1268 else{return(t,5);} 1272 1269 } 1273 1270 else 1274 1271 { return(parselong(s+"!"));} 1275 1272 } 1276 1273 1277 1274 if (defined(TeXdisplay)) { bg = "& ";} 1278 1275 if (!(defined(TeXwidth))) { int TeXwidth = -1; export TeXwidth;} … … 1280 1277 1281 1278 // -- Type check 1282 1279 1283 1280 if (typeof(p)=="string") 1284 1281 { if(defined(`p`)) 1285 { pt = p + " = "; 1286 p = `p`; 1282 { pt = p + " = "; 1283 p = `p`; 1287 1284 } 1288 1285 } 1289 1286 if (typeof(p)=="poly" or typeof(p)=="number") {I = p;} 1290 1291 if (typeof(p)=="ideal") 1287 1288 if (typeof(p)=="ideal") 1292 1289 { I = p; 1293 1290 if(size(#)){ sep = #[1];} 1294 1291 } 1295 1292 1296 if (I==0) 1293 if (I==0) 1297 1294 { if (!(defined(NoDollars))){return("$0$");} 1298 1295 else {return("0");} 1299 1296 } 1300 1297 1301 // -- Type check ende 1302 1303 //--------------------- 1298 // -- Type check ende 1299 1300 //--------------------- 1304 1301 1305 1302 1306 1303 //------- set flags: -------------------------------------------------------- 1307 1304 1308 1305 if (size(#)) 1309 1306 { if (typeof(#[1])=="int") { linesz = #[1];} … … 1317 1314 { t = charstr(@r)[1,i-1]; 1318 1315 galT = (t <> string(char(@r))); // the char is not the same as the ... 1319 } 1316 } 1320 1317 i = 0; 1321 1318 1322 1319 //------- parse the polynom 1323 1320 pt = bg; 1324 1321 1325 1322 for(k=1;k<=size(matrix(I));k++) 1326 1323 { i = 0; linesz = 0; count =0; 1327 sign =""; 1324 sign =""; 1328 1325 f = I[k]; 1329 1326 if (f==0) { pt = pt + "0";} … … 1332 1329 1333 1330 // ------ tex the coefficient 1334 monom = lead(f); 1335 f = f - monom; 1331 monom = lead(f); 1332 f = f - monom; 1336 1333 cfm = leadcoef(monom); 1337 1334 if (cfm*1 != 0) { monom = monom/cfm;} // the normalized monom 1338 1335 s = string(monom) + "!"; // add a terminating sign 1339 1336 cfmt = ""; 1340 1337 1341 1338 if (defined(TeXreplace)) { short =0;} // this is essential 1342 1339 cfmt = string(cfm); … … 1362 1359 if (b) {b++;} 1363 1360 n = size(cfmt); 1364 if (!(parT) and !(realT) and !(galT)) 1365 { if( !(b2) or defined(TeXnofrac)) 1361 if (!(parT) and !(realT) and !(galT)) 1362 { if( !(b2) or defined(TeXnofrac)) 1366 1363 { monomt = cfmt; msz = 3*size(monomt);} 1367 1364 else … … 1377 1374 // -- now parse the monom 1378 1375 if (monom <> 1) 1379 { i = 1; 1376 { i = 1; 1380 1377 if(short) 1381 1378 { while(s[i]<>"!") 1382 { monomt = monomt + s[i]; i++; 1379 { monomt = monomt + s[i]; i++; 1383 1380 b = i; 1384 1381 msz = msz + 3; // it was a single lettered var … … 1396 1393 } 1397 1394 } 1398 1395 1399 1396 1400 1397 … … 1403 1400 1404 1401 if (TeXwidth > 10 and (linesz + msz > 3*TeXwidth) and linesz) 1405 { pt = pt + lnbreak + bg; 1406 linesz = msz; 1402 { pt = pt + lnbreak + bg; 1403 linesz = msz; 1407 1404 } 1408 else { linesz = linesz + msz; } // 3 for sign 1405 else { linesz = linesz + msz; } // 3 for sign 1409 1406 pt = pt + sign + monomt; 1410 1407 sign = "+"; … … 1430 1427 } 1431 1428 else {return(pt);} 1432 } 1429 } 1433 1430 example 1434 1431 { "EXAMPLE:"; echo =2; … … 1437 1434 texpoly("",f); 1438 1435 texpoly("",2x2y23z); 1439 1436 1440 1437 1441 1438 ring rr= real,(x,y),dp; … … 1448 1445 f; 1449 1446 texpoly("",f); 1450 } 1447 } 1451 1448 1452 1449 static proc parsp(string cfmt, int b) … … 1489 1486 // sec parameter to see if in parsp a fraction follows 1490 1487 { int i,j =1,-1; 1491 int b,k,jj,mz; // begin and end 1488 int b,k,jj,mz; // begin and end 1492 1489 int saveshort=short; 1493 1490 string t,c,vn,nom,denom,sg; … … 1784 1781 if(system("with","Namespaces")) { exportto(Current,splt); } 1785 1782 else { export splt; } 1786 1783 1787 1784 // string fname = "texlibdemo.tex"; 1788 1785 string nl = newline; … … 1811 1808 Singular in \\LaTeX \\ text. 1812 1809 Most of the examples in this document are generated 1813 randomly by Singular itself and passed through the procs from 1814 \\verb|latex.lib|. Consequently, 1810 randomly by Singular itself and passed through the procs from 1811 \\verb|latex.lib|. Consequently, 1815 1812 every document does not show merely how the \\verb|latex.lib| works 1816 1813 but looks differently in large parts."); … … 1843 1840 ev); 1844 1841 1845 write(fname,"A flag means in the following that a variable with the indicated 1842 write(fname,"A flag means in the following that a variable with the indicated 1846 1843 name has to be defined. Usually it is from type \\verb|int|."); 1847 1844 … … 1858 1855 TeXreplace : list, entries twoelemented list for replacing symbols 1859 1856 NoDollars : (int) flag, suppresses surrounding \\$ signs 1860 1857 1861 1858 " + 1862 1859 ev); … … 1913 1910 "> ring r0=0,(x,y,z),dp; texring(fname,r0); 1914 1911 > poly g = -x2y +2y13z +1; g; texpoly(fname,g);" +nl + 1915 string(g) + nl + 1912 string(g) + nl + 1916 1913 "> poly f = randompoly(5,25,25); f; texpoly(fname,f);" +nl + 1917 1914 splt(string(f)) + nl2 + … … 1930 1927 write(fname, 1931 1928 bv + 1932 "> f = f/280; 1929 "> f = f/280; 1933 1930 > texpoly(fname,f);" +nl + 1934 splt(string(f)) + nl2 + 1931 splt(string(f)) + nl2 + 1935 1932 ev 1936 1933 ); … … 1944 1941 if(system("with","Namespaces")) { exportto(Current, r1); } 1945 1942 else { export r1; } 1946 poly g = -2*x1 +x4 -1; 1943 poly g = -2*x1 +x4 -1; 1947 1944 poly f = randompoly(5,25,25); f; export f; 1948 1945 write(fname, … … 1950 1947 "> ring r1=7,(x1,x2,x3,x4),Ds; texring(fname,r1); 1951 1948 > poly g = -2*x1 +x4 -1; g; texpoly(fname,g);" +nl + 1952 string(g) + nl + 1949 string(g) + nl + 1953 1950 "> poly f = randompoly(5,25,25); f; texpoly(fname,f);" +nl + 1954 splt(string(f)) + nl2 + 1951 splt(string(f)) + nl2 + 1955 1952 ev 1956 ); 1953 ); 1957 1954 texring(fname,r1); write(fname,lb); 1958 texpoly(fname,g); write(fname,lb); 1955 texpoly(fname,g); write(fname,lb); 1959 1956 texpoly(fname,f); write(fname,lb); 1960 1957 write(fname,"\\Line"); … … 1965 1962 " +nl); 1966 1963 ring r2=0,(x(1..5),y(1..2)),(ds(5),dp(2)); 1967 poly g = -y(1)*x(5) +y(1)*x(2); g; 1964 poly g = -y(1)*x(5) +y(1)*x(2); g; 1968 1965 poly f = randompoly(5,25,25); f; 1969 1966 write(fname, … … 1971 1968 "> ring r2=0,(x(1..5),y(1..2)),(ds(5),dp(2)); texring(fname,r2); 1972 1969 > poly g = -y(1)*x(5) +y(1)*x(2); g; texpoly(fname,g);" +nl + 1973 string(g) + nl + 1970 string(g) + nl + 1974 1971 "> poly f = randompoly(5,25,25); f; texpoly(fname,f);" +nl + 1975 splt(string(f)) + nl2 + 1976 ev 1977 ); 1972 splt(string(f)) + nl2 + 1973 ev 1974 ); 1978 1975 texring(fname,r2); write(fname,lb); 1979 texpoly(fname,g); write(fname,lb); 1976 texpoly(fname,g); write(fname,lb); 1980 1977 texpoly(fname,f); write(fname,lb); 1981 1978 write(fname,"\\Line"); … … 1988 1985 if(system("with","Namespaces")) { exportto(Current, r3); } 1989 1986 else { export r3; } 1990 poly g = -x_1*x_2 + 2*x_2*x_3 + x_1*x_3; g; 1987 poly g = -x_1*x_2 + 2*x_2*x_3 + x_1*x_3; g; 1991 1988 poly f = randompoly(5,25,25); f; export f; 1992 1989 write(fname, … … 1994 1991 "> ring r3=0,(x_1,x_2,x_3),wp(3,2,1); texring(fname,r3); 1995 1992 > poly g = -x_1*x_2 + 2*x_2*x_3 + x_1*x_3; g; texpoly(fname,g);" +nl + 1996 string(g) + nl + 1993 string(g) + nl + 1997 1994 "> poly f = randompoly(5,25,25); f; texpoly(fname,f);" +nl + 1998 splt(string(f)) + nl2 + 1995 splt(string(f)) + nl2 + 1999 1996 ev 2000 ); 1997 ); 2001 1998 texring(fname,r3); write(fname,lb); 2002 texpoly(fname,g); write(fname,lb); 1999 texpoly(fname,g); write(fname,lb); 2003 2000 texpoly(fname,f); write(fname,lb); 2004 2001 write(fname,"\\Line"); … … 2008 2005 " A ring with real coefficients and matrix ordering. 2009 2006 " +nl); 2010 ring rr =real,(x,y),M(1,2,3,4); 2011 poly g = -1.2e-10*x + y +1; 2007 ring rr =real,(x,y),M(1,2,3,4); 2008 poly g = -1.2e-10*x + y +1; 2012 2009 poly f = randompoly(5,25,25); f; 2013 2010 write(fname, … … 2015 2012 "> ring rr =real,(x,y),M(1,2,3,4); texring(fname,rr); 2016 2013 > poly g = -1.2e-10*x + y +1; g; texpoly(fname,g);" +nl + 2017 string(g) + nl + 2014 string(g) + nl + 2018 2015 "> poly f = randompoly(5,25,25); f; texpoly(fname,f);" +nl + 2019 splt(string(f)) + nl2 + 2016 splt(string(f)) + nl2 + 2020 2017 ev 2021 ); 2018 ); 2022 2019 texring(fname,rr); write(fname,lb); 2023 texpoly(fname,g); write(fname,lb); 2020 texpoly(fname,g); write(fname,lb); 2024 2021 texpoly(fname,f); write(fname,lb); 2025 2022 write(fname,"\\Line"); … … 2029 2026 " A ring in characteristic 0 and indexed parameters. 2030 2027 " +nl); 2031 ring r0t=(0,s,t),(x,y),dp; 2028 ring r0t=(0,s,t),(x,y),dp; 2032 2029 if(system("with","Namespaces")) { exportto(Current, r0t); } 2033 2030 else { export r0t; } 2034 poly g = 8*(-s+2t)/(st+t3)*x + t2*x -1; g; 2031 poly g = 8*(-s+2t)/(st+t3)*x + t2*x -1; g; 2035 2032 poly f = randompoly(5,25,25); f; export f; 2036 2033 write(fname, … … 2038 2035 "> ring r0t=(0,s,t),(x,y),dp; texring(fname,r0t); 2039 2036 > poly g = 8*(-s+2t)/(st+t3)*x + t2*x -1; g; texpoly(fname,g);" +nl + 2040 string(g) + nl + 2037 string(g) + nl + 2041 2038 "> poly f = randompoly(5,25,25); f; texpoly(fname,f);" +nl + 2042 splt(string(f)) + nl2 + 2039 splt(string(f)) + nl2 + 2043 2040 ev 2044 ); 2041 ); 2045 2042 texring(fname,r0t); write(fname,lb); 2046 texpoly(fname,g); write(fname,lb); 2043 texpoly(fname,g); write(fname,lb); 2047 2044 texpoly(fname,f); write(fname,lb); 2048 2045 write(fname,"\\Line"); … … 2053 2050 " A ring in characteristic 11 and indexed parameters. 2054 2051 " +nl); 2055 ring rt=(11003,t1,t2,t3),(X,Y),dp; 2056 poly g = 8*(-t1+t2)/(t1+t3)*X + t2*Y -1; g; 2052 ring rt=(11003,t1,t2,t3),(X,Y),dp; 2053 poly g = 8*(-t1+t2)/(t1+t3)*X + t2*Y -1; g; 2057 2054 poly f = randompoly(5,25,25); f; 2058 2055 write(fname, … … 2060 2057 "> ring rt=(11003,t1,t2,t3),(X,Y),dp; texring(fname,rt); 2061 2058 > poly g = 8*(-t1+t2)/(t1+t3)*X + t2*Y -1; g; texpoly(fname,g);" +nl + 2062 string(g) + nl + 2059 string(g) + nl + 2063 2060 "> poly f = randompoly(5,25,25); f; texpoly(fname,f);" +nl + 2064 splt(string(f)) + nl2 + 2061 splt(string(f)) + nl2 + 2065 2062 ev 2066 ); 2063 ); 2067 2064 texring(fname,rt); write(fname,lb); 2068 texpoly(fname,g); write(fname,lb); 2065 texpoly(fname,g); write(fname,lb); 2069 2066 texpoly(fname,f); write(fname,lb); 2070 2067 write(fname,"\\Line"); … … 2074 2071 " A ring over an algebraic extension in char 7. 2075 2072 " +nl); 2076 ring ralg = (7,a),x,dp; 2077 minpoly = a2-a+3; 2078 poly g = -(2a13 +a)*x2 + a2*x -a +1; g; 2073 ring ralg = (7,a),x,dp; 2074 minpoly = a2-a+3; 2075 poly g = -(2a13 +a)*x2 + a2*x -a +1; g; 2079 2076 poly f = randompoly(5,25,25); f; 2080 2077 write(fname, 2081 2078 bv + 2082 "> ring ralg = (7,a),x,dp; 2079 "> ring ralg = (7,a),x,dp; 2083 2080 > minpoly = a2-a+3; texring(fname,ralg); 2084 2081 > poly g = -(2a13 +a)*x2 + a2*x -a +1; g; texpoly(fname,g);" +nl + 2085 string(g) + nl + 2082 string(g) + nl + 2086 2083 "> poly f = randompoly(5,25,25); f; texpoly(fname,f);" +nl + 2087 splt(string(f)) + nl2 + 2084 splt(string(f)) + nl2 + 2088 2085 ev 2089 ); 2086 ); 2090 2087 texring(fname,ralg); write(fname,lb); 2091 texpoly(fname,g); write(fname,lb); 2088 texpoly(fname,g); write(fname,lb); 2092 2089 texpoly(fname,f); write(fname,lb); 2093 2090 write(fname,"\\Line"); … … 2095 2092 // -8-------- the same ring a in 7 ralg, defined with gftables -- F_49 ------- 2096 2093 write(fname, 2097 " A ring defined with \\verb|gftables|, the same as \\verb|ralg| before, but 2094 " A ring defined with \\verb|gftables|, the same as \\verb|ralg| before, but 2098 2095 with primitive element in the Galoisfield $\\F_{49}$." +nl); 2099 2096 ring r49 =(49,a),x,dp; 2100 2097 if(system("with","Namespaces")) { exportto(Current, r49); } 2101 2098 else { export r49; } 2102 poly g = -(2a13 +a)*x2 + a2*x -a +1; g; export g; 2099 poly g = -(2a13 +a)*x2 + a2*x -a +1; g; export g; 2103 2100 poly f = randompoly(5,25,25); f; 2104 2101 write(fname, … … 2106 2103 "> ring r49 =(49,a),x,dp; texring(fname,r49); 2107 2104 > poly g = -(2a13 +a)*x2 + a2*x -a +1; g; texpoly(fname,g);" +nl + 2108 string(g) + nl + 2105 string(g) + nl + 2109 2106 "> poly f = randompoly(5,25,25); f; texpoly(fname,f);" +nl + 2110 splt(string(f)) + nl2 + 2107 splt(string(f)) + nl2 + 2111 2108 ev 2112 ); 2109 ); 2113 2110 texring(fname,r49); write(fname,lb); 2114 texpoly(fname,g); write(fname,lb); 2111 texpoly(fname,g); write(fname,lb); 2115 2112 texpoly(fname,f); write(fname,lb); 2116 2113 write(fname,"\\Line"); … … 2121 2118 " +nl); 2122 2119 ring ri=(0,i),(x,y,z),ls; 2123 minpoly = i2 +1; 2124 poly g = -(i+1)*x +2i2y2 +i +x; g; 2120 minpoly = i2 +1; 2121 poly g = -(i+1)*x +2i2y2 +i +x; g; 2125 2122 poly f = randompoly(5,25,25); f; 2126 2123 write(fname, … … 2129 2126 > minpoly = i2 +1; texring(fname,ri); 2130 2127 > poly g = -(i+1)*x +2i2y2 +i +x; g; texpoly(fname,g);" +nl + 2131 string(g) + nl + 2128 string(g) + nl + 2132 2129 "> poly f = randompoly(5,25,25); f; texpoly(fname,f);" +nl + 2133 splt(string(f)) + nl2 + 2130 splt(string(f)) + nl2 + 2134 2131 ev 2135 ); 2132 ); 2136 2133 texring(fname,ri); write(fname,lb); 2137 texpoly(fname,g); write(fname,lb); 2134 texpoly(fname,g); write(fname,lb); 2138 2135 texpoly(fname,f); write(fname,lb); 2139 2136 write(fname,"\\Line"); … … 2144 2141 " +nl); 2145 2142 setring r0; 2146 ideal I = x2-y,y+z2, xy; 2143 ideal I = x2-y,y+z2, xy; 2147 2144 I = std(I); 2148 2145 string sI = string(I); … … 2155 2152 > string(I);" + nl + 2156 2153 splt(sI) + nl + 2157 "> qring qr = I; texring(fname,qr);" + 2154 "> qring qr = I; texring(fname,qr);" + 2158 2155 ev 2159 ); 2156 ); 2160 2157 texring(fname,qr); write(fname,lb); 2161 2158 … … 2170 2167 // changing the brackets 2171 2168 2172 write(fname,"If the displayed and defaulted brackets for the ring are not 2169 write(fname,"If the displayed and defaulted brackets for the ring are not 2173 2170 the rigth one, 2174 2171 correct brackets my be passed over to \\verb|texring|",nl, … … 2180 2177 write(fname, 2181 2178 bv + 2182 "> texring(fname,rr,\"{{\");" + nl + 2179 "> texring(fname,rr,\"{{\");" + nl + 2183 2180 ev 2184 ); 2181 ); 2185 2182 2186 2183 texring(fname,rr,"{{"); … … 2188 2185 write(fname, 2189 2186 bv + 2190 "> texring(fname,r2,\"[\");" + nl + 2187 "> texring(fname,r2,\"[\");" + nl + 2191 2188 ev 2192 ); 2189 ); 2193 2190 2194 2191 texring(fname,r2,"["); … … 2196 2193 write(fname,nl2); 2197 2194 2198 write(fname,nl2,"The brackets around the ideal in a quotientring can be 2199 changed with the global variable \\verb|TeXbrack| (see the section 2195 write(fname,nl2,"The brackets around the ideal in a quotientring can be 2196 changed with the global variable \\verb|TeXbrack| (see the section 2200 2197 {\\tt ideal}).",nl); 2201 2198 … … 2204 2201 bv + 2205 2202 "> string TeXbrack = \"<\"; 2206 > texring(fname,qr); 2203 > texring(fname,qr); 2207 2204 > kill TeXbrack;" + nl + 2208 2205 ev 2209 ); 2206 ); 2210 2207 2211 2208 string TeXbrack = "<"; export TeXbrack; … … 2223 2220 write(fname, 2224 2221 bv + 2225 "> texring(fname,r3,\"\\\\C\");" + nl + 2222 "> texring(fname,r3,\"\\\\C\");" + nl + 2226 2223 ev 2227 ); 2224 ); 2228 2225 2229 2226 texring(fname,r3,"\\C"); … … 2232 2229 write(fname,nl2, "naechster abschnitt stimmt nicht"+lb,nl2); 2233 2230 2234 write(fname,"Predefined and accepted values here are 2231 write(fname,"Predefined and accepted values here are 2235 2232 \\verb|\"\\\\C\"|, \\verb|\"\\\\R\"|, 2236 2233 \\verb|\"\\\\C\"|, \\verb|\"k\"|, \\verb|\"K\"|, \\verb|\"R\"|."); 2237 write(fname,"The latter are useful to print a ring whose coefficientfield is 2234 write(fname,"The latter are useful to print a ring whose coefficientfield is 2238 2235 defined by an algebraic extension. Now the parameters will omitted completely. 2239 2236 "); 2240 write(fname,"The user may specify then the field in more detail."+lb,nl2); 2237 write(fname,"The user may specify then the field in more detail."+lb,nl2); 2241 2238 2242 2239 write(fname,"Any correct letter in \\LaTeX \\ notation may be used to describe 2243 the coefficientfield. If the letter is k, K or R it forces \\verb|texring| 2240 the coefficientfield. If the letter is k, K or R it forces \\verb|texring| 2244 2241 not to print the parameters. This will be useful for a ring described by an 2245 2242 algebraic extension",nl2); … … 2247 2244 write(fname, 2248 2245 bv + 2249 "> texring(fname,ralg,\"k\");" + nl + 2246 "> texring(fname,ralg,\"k\");" + nl + 2250 2247 ev 2251 ); 2248 ); 2252 2249 2253 2250 texring(fname, ralg,"k"); 2254 2251 2255 2252 // texobj(fname,"with k = "); 2256 2253 … … 2260 2257 write(fname, 2261 2258 bv + 2262 "> texring(fname,ralg,\"mipo\");" + nl + 2259 "> texring(fname,ralg,\"mipo\");" + nl + 2263 2260 ev 2264 ); 2261 ); 2265 2262 2266 2263 texring(fname, ralg,"mipo"); … … 2278 2275 "> intvec v = 5,6; 2279 2276 > texring(fname,r2,v); 2280 > kill v;" + nl + 2277 > kill v;" + nl + 2281 2278 ev 2282 ); 2279 ); 2283 2280 2284 2281 intvec v = 5,6; … … 2292 2289 write(fname, 2293 2290 bv + 2294 "> texring(fname,r1,1);" + nl + 2291 "> texring(fname,r1,1);" + nl + 2295 2292 ev 2296 ); 2293 ); 2297 2294 texring(fname,r1,1); 2298 2295 … … 2307 2304 write(fname, 2308 2305 bv + 2309 "> texring(fname,r0,\"^G\");" + nl + 2306 "> texring(fname,r0,\"^G\");" + nl + 2310 2307 ev 2311 ); 2308 ); 2312 2309 2313 2310 texring(fname, r0,"^G"); 2314 2315 write(fname,nl2,"All these arguments may be passed over in any order as 2316 optional arguments, but it may give a rather nonsense result if too much of 2311 2312 write(fname,nl2,"All these arguments may be passed over in any order as 2313 optional arguments, but it may give a rather nonsense result if too much of 2317 2314 them are used at the same time",nl); 2318 2315 2319 2316 write(fname, 2320 2317 bv + 2321 "> texring(fname,r3,\"\\\\R\",1,\"{{\",\"^G\");" + nl + 2318 "> texring(fname,r3,\"\\\\R\",1,\"{{\",\"^G\");" + nl + 2322 2319 ev 2323 ); 2320 ); 2324 2321 2325 2322 texring(fname, r3,"\\R",1,"<<","^G"); … … 2344 2341 } 2345 2342 else { texdemopart=2; } 2346 2343 2347 2344 "Continuing Part2 of " + fname + nl; 2348 2345 … … 2352 2349 write(fname,"The command \\verb|texfactorize| calls internally the Singular 2353 2350 command \\verb|factorize| and returns the product of the irreducible factors. 2354 at the present it is not possible to pass the optional arguments of 2351 at the present it is not possible to pass the optional arguments of 2355 2352 \\verb|factorize| through \\verb|texfactorize|."+lb); 2356 2353 … … 2407 2404 // TeXreplace 2408 2405 // --------------------------------------------- 2409 write(fname,"The global variable \\verb|TeXreplace| must be a list 2406 write(fname,"The global variable \\verb|TeXreplace| must be a list 2410 2407 whose entries are twoelemented lists again; wherby the first entry is the 2411 2408 word which should be replaced and second is the replacing word." + 2412 "This is may be applied to replace variablenames, but holds also for texname 2409 "This is may be applied to replace variablenames, but holds also for texname 2413 2410 anmd texmap" + lb + 2414 2411 "It is most useful to write the greece letters correctly. Notice that it 2415 2412 is necesarry to write 2416 a double backslash \\verb|\\\\\ | at the beginning of 2413 a double backslash \\verb|\\\\\ | at the beginning of 2417 2414 a \\TeX \\ symbol." + lb); 2418 2415 … … 2473 2470 2474 2471 write(fname,"If \\verb|TeXreplace| is defined, the translation into \\TeX code 2475 runs significantly slower, because every polynomial will be compiled in the 2472 runs significantly slower, because every polynomial will be compiled in the 2476 2473 \\verb|non short| mode."+ lb ); 2477 2474 … … 2480 2477 //linebreaking TeXwdith 2481 2478 //----------------------------------------------------------------------- 2482 write(fname,"The global variable \\verb|TeXwidth| controls the wrapping of 2479 write(fname,"The global variable \\verb|TeXwidth| controls the wrapping of 2483 2480 polynomials; possible values are:" + lb); 2484 2481 … … 2489 2486 " -1 & \\text{no linebreaking} \\\\ ", 2490 2487 " 0 & \\text{print the polynom as equation} f=0 \\\\ ", 2491 " 1,\\ldots,5 & \\text{ the first n termes followed by the sign of the next 2488 " 1,\\ldots,5 & \\text{ the first n termes followed by the sign of the next 2492 2489 term} \\\\ ", 2493 2490 " > 5 & \\text{wrapping after n letters corresponding x} ", … … 2495 2492 "\\]",nl); 2496 2493 2497 write(fname,"Notice that two letters like x counts as three subscripts or 2494 write(fname,"Notice that two letters like x counts as three subscripts or 2498 2495 exponents",nl); 2499 2496 … … 2503 2500 2504 2501 write(fname,"\\verb|TeXwidth| is the only global variable which will be defined 2505 automatically from Singular. Its default value is -1 2502 automatically from Singular. Its default value is -1 2506 2503 i.e. wrapping is set off."+ lb); 2507 2504 … … 2577 2574 //write(fname,nl2,"\\Line",nl); 2578 2575 2579 write(fname,"As seen there are two possibilities to tex a polynomial. The 2576 write(fname,"As seen there are two possibilities to tex a polynomial. The 2580 2577 command \\verb|texpoly| is the most basic one and sets the polynomials in 2581 2578 textmode. Notice that it counts the length of the terms convenientely." + lb + … … 2588 2585 bv + 2589 2586 "> setring r3; 2590 > texpoly(fname,f/180);" + nl + 2587 > texpoly(fname,f/180);" + nl + 2591 2588 ev); 2592 2589 2593 2590 2594 2591 setring r3; 2595 texpoly(fname,f/180); 2592 texpoly(fname,f/180); 2596 2593 2597 2594 write(fname,nl2, "Now the same again with \\verb|texobj| "+ lb,nl); … … 2608 2605 write(fname,"Some explaination how it works: if \\verb|texobj| is called for 2609 2606 a polynomial, then it defines a global variable \\verb|TeXdisp| which forces 2610 \\verb|texpoly| to count fraction with space corresponding 2607 \\verb|texpoly| to count fraction with space corresponding 2611 2608 the displaymode."+lb,nl2); 2612 2609 … … 2618 2615 2619 2616 2620 ring r; 2617 ring r; 2621 2618 ideal I = 3xz5+x2y3-3z,7xz5+y3z+x-z,-xyz2+4yz+2x; 2622 2619 … … 2672 2669 ideal I = -x(1) + 2*x(3) + x(5),x(2) -x(4) +2*x(5) -1,8*x(1) +x(4) +2; 2673 2670 2674 TeXwidth = 0; 2675 write(fname, 2676 bv + 2677 "> ring r5 = 0,x(1..5),dp ; 2671 TeXwidth = 0; 2672 write(fname, 2673 bv + 2674 "> ring r5 = 0,x(1..5),dp ; 2678 2675 > ideal I = -x(1) + 2*x(3) + x(5),x(2) -x(4) +2*x(5) -1,8*x(1) +x(4) +2; 2679 2676 > string(I);" + nl + 2680 splt(string(I)) + nl2 + 2681 "> TeXwidth = 0; 2677 splt(string(I)) + nl2 + 2678 "> TeXwidth = 0; 2682 2679 > texobj(fname,I);" + 2683 2680 //> TeXwidth = 0;" + 2684 2681 ev 2685 ); 2682 ); 2686 2683 2687 2684 texobj(fname,I); 2688 2685 // TeXwidth = -1; 2689 2686 2690 2687 setring r; 2691 2688 ideal J; … … 2714 2711 write(fname, 2715 2712 bv + 2716 "> texobj(fname,J);" + 2713 "> texobj(fname,J);" + 2717 2714 ev 2718 ); 2719 2715 ); 2716 2720 2717 texobj(fname,J); 2721 2718 //% TeXwidth = 0; TeXbrackets … … 2731 2728 ev); 2732 2729 2733 setring r; 2730 setring r; 2734 2731 ideal I = 3xz5+x2y3-3z,7xz5+y3z+x-z,-xyz2+4yz+2x; 2735 2732 if(system("with","Namespaces")) { exportto(Current, r, I); } … … 2765 2762 // int TeXwidth =-1; 2766 2763 write(fname,bv + 2767 "> ring r1=0,(x,y,z),dp; 2764 "> ring r1=0,(x,y,z),dp; 2768 2765 > ring r2=0,(u,v),dp; 2769 2766 > map phi = r1,u2,uv -v,v2; … … 2786 2783 write(fname,"\\item",nl); 2787 2784 2788 write(fname,"If the map will be called by its name \\verb|texmap| can in 2785 write(fname,"If the map will be called by its name \\verb|texmap| can in 2789 2786 combination with \\verb|TeXreplace| print the name of the map." + lb ,nl); 2790 2787 … … 2792 2789 "> list TeXreplace; 2793 2790 > TeXreplace[1] = list(\"phi\",\"\\\\phi\"); 2794 > texmap(fname,\"phi\",r1,r2);" + nl + 2791 > texmap(fname,\"phi\",r1,r2);" + nl + 2795 2792 ev); 2796 2793 … … 2814 2811 write(fname,"\\item",nl); 2815 2812 2816 write(fname,nl2,"The addtional arguments for \\verb|rings| may be passed over 2813 write(fname,nl2,"The addtional arguments for \\verb|rings| may be passed over 2817 2814 in \\verb|texmap|.",nl); 2818 2815 2819 write(fname,"In the following form the arguments are valid for both 2816 write(fname,"In the following form the arguments are valid for both 2820 2817 \\verb|rings|.",nl); 2821 2818 … … 2867 2864 texobj(fname,H); 2868 2865 2869 // probiere auch V = 0 bei texobj aus 2866 // probiere auch V = 0 bei texobj aus 2870 2867 matrix M = H; 2871 2868 … … 2905 2902 //------------------------------------------------------------------------ 2906 2903 2907 write(fname,"All the features for \\verb|poly| and the features for 2904 write(fname,"All the features for \\verb|poly| and the features for 2908 2905 \\verb|intmat| or \\verb|intvec| hold here, too."); 2909 2906 … … 2912 2909 write(fname,bv + 2913 2910 "> TeXwidth = 1;", 2914 "> texobj(fname,H);", 2911 "> texobj(fname,H);", 2915 2912 "> TeXwidth = -1;", 2916 2913 ev ); 2917 2914 2918 2915 TeXwidth = 1; 2919 texobj(fname,H); 2916 texobj(fname,H); 2920 2917 TeXwidth = -1; 2921 2918 … … 2936 2933 2937 2934 write(fname,bv + 2938 "> int TeXnofrac;", 2935 "> int TeXnofrac;", 2939 2936 "> texobj(fname,M);", 2940 2937 "> kill TeXnofrac;", … … 3002 2999 > v;" + nl + 3003 3000 string(v) + nl + 3004 "> nrows(v);" + nl + 3001 "> nrows(v);" + nl + 3005 3002 string(nrows(v)) + nl + 3006 3003 "texobj(fname,v);" + nl2 + … … 3017 3014 "> intmat m[3][4] = -1,3,5,2,-2,8,6,0,2,5,8,7;" + nl + 3018 3015 "> m;" + nl + 3019 string(m) + nl + 3016 string(m) + nl + 3020 3017 "> texobj(fname,m);" + nl2 + 3021 3018 ev ); … … 3070 3067 "> intmat mat[3][3] = 1,2,3,4,5,6,7,8,9;" + nl + 3071 3068 "> string TeXbrack = \"|\";" + nl + 3072 "> texobj(fname,mat,\"=\",det(mat)); " + nl2 + 3069 "> texobj(fname,mat,\"=\",det(mat)); " + nl2 + 3073 3070 ev ); 3074 3071 … … 3083 3080 3084 3081 3085 //write(fname,"The proc \\verb|texname| is used to write indexed names in a 3082 //write(fname,"The proc \\verb|texname| is used to write indexed names in a 3086 3083 //correct way"+lb,nl); 3087 3084 … … 3112 3109 3113 3110 proc cleantexdemo() 3114 { 3111 { 3115 3112 kill fname,nl,nl2,lb,bv,ev; 3116 3113 return(); -
Singular/LIB/mondromy.lib
rce7ba6 r917fb5 1 1 /////////////////////////////////////////////////////////////////////////////// 2 2 3 version="$Id: mondromy.lib,v 1. 6 1999-07-06 11:33:02 obachmanExp $";3 version="$Id: mondromy.lib,v 1.7 1999-07-06 15:32:53 Singular Exp $"; 4 4 info=" 5 5 LIBRARY: mondromy.lib PROCEDURES TO COMPUTE THE MONODROMY OF A SINGULARITY … … 110 110 } 111 111 } 112 return(m); 112 return(m); 113 113 } 114 114 /////////////////////////////////////////////////////////////////////////////// … … 189 189 If U is not a sqaure matrix, the list is empty. 190 190 If U is a sqaure matrix, then the first entry is the determinant of U. 191 If U is a square matrix and the determinant of U not zero, 191 If U is a square matrix and the determinant of U not zero, 192 192 then the second entry is the adjoint matrix of U. 193 193 DISPLAY: The procedure displays comments if printlevel>=1. … … 246 246 proc jacoblift(poly f) 247 247 "USAGE: jacoblift(f); f poly 248 ASSUME: The polynomial f in a series ring (local ordering) defines 248 ASSUME: The polynomial f in a series ring (local ordering) defines 249 249 an isolated hypersurface singularity. 250 RETURN: The procedure returns a list with entries kappa, xi, u of type 250 RETURN: The procedure returns a list with entries kappa, xi, u of type 251 251 int, vector, poly such that kappa is minimal with f^kappa in jacob(f), 252 252 u is a unit, and u*f^kappa=(matrix(jacob(f))*xi)[1,1]. … … 405 405 for(i=1;i<=size(e);i++) 406 406 { 407 for(j,p=nvars(basering),0;j>=1;j--) 407 for(j,p=nvars(basering),0;j>=1;j--) 408 408 { 409 409 q=jet(e[i]*xi[j],N); … … 807 807 proc monodromy(poly f, list #) 808 808 "USAGE: monodromy(f[,opt]); f poly, opt int 809 ASSUME: The polynomial f in a series ring (local ordering) defines 809 ASSUME: The polynomial f in a series ring (local ordering) defines 810 810 an isolated hypersurface singularity. 811 RETURN: The procedure returns a residue matrix M of the meromorphic 812 Gauss-Manin connection of the singularity defined by f 813 or an empty matrix if the assumptions are not fulfilled. 814 If opt=0 (default), exp(2*pi*i*M) is a monodromy matrix of f, 815 else, only the characteristic polynomial of exp(2*pi*i*M) coincides 811 RETURN: The procedure returns a residue matrix M of the meromorphic 812 Gauss-Manin connection of the singularity defined by f 813 or an empty matrix if the assumptions are not fulfilled. 814 If opt=0 (default), exp(2*pi*i*M) is a monodromy matrix of f, 815 else, only the characteristic polynomial of exp(2*pi*i*M) coincides 816 816 with the characteristic polynomial of the monodromy of f. 817 THEORY: The procedure uses an algorithm by Brieskorn (See E. Brieskorn, 818 manuscipta math. 2 (1970), 103-161) to compute a connection matrix of 819 the meromorphic Gauss-Manin connection up to arbitrarily high order, 820 and an algorithm of Gerard and Levelt (See R. Gerard, A.H.M. Levelt, 821 Ann. Inst. Fourier, Grenoble 23,1 (1973), pp. 157-195) to transform 817 THEORY: The procedure uses an algorithm by Brieskorn (See E. Brieskorn, 818 manuscipta math. 2 (1970), 103-161) to compute a connection matrix of 819 the meromorphic Gauss-Manin connection up to arbitrarily high order, 820 and an algorithm of Gerard and Levelt (See R. Gerard, A.H.M. Levelt, 821 Ann. Inst. Fourier, Grenoble 23,1 (1973), pp. 157-195) to transform 822 822 it to a simple pole. 823 823 DISPLAY: The procedure displays more comments for higher printlevel. … … 837 837 return(); 838 838 } 839 839 840 840 } 841 841 … … 918 918 proc H''basis(poly f) 919 919 "USAGE: H''basis(f); f poly 920 ASSUME: The polynomial f in a series ring (local ordering) defines 920 ASSUME: The polynomial f in a series ring (local ordering) defines 921 921 an isolated hypersurface singularity. 922 922 RETURN: The procedure returns a list of representatives of a C{f}-basis of the -
Singular/LIB/noethernormal.lib
rce7ba6 r917fb5 1 // $Id: noethernormal.lib,v 1. 2 1999-07-06 11:33:03 obachmanExp $1 // $Id: noethernormal.lib,v 1.3 1999-07-06 15:32:53 Singular Exp $ 2 2 //(GP, last modified 15.08.98) 3 3 /////////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: noethernormal.lib,v 1. 2 1999-07-06 11:33:03 obachmanExp $";5 version="$Id: noethernormal.lib,v 1.3 1999-07-06 15:32:53 Singular Exp $"; 6 6 info=" 7 7 LIBRARY: noetherNormal.lib PROCEDURE FOR NOETHERNORMALIZATION … … 62 62 { 63 63 intvec v,w; 64 int j; 64 int j; 65 65 for(j=1;j<=size(i);j++) 66 66 { … … 95 95 RETURN: 1 if R---->basering/I is finite and 0 else 96 96 EXAMPLE: mapIsFinite; shows an example 97 " 97 " 98 98 { 99 99 int n=nvars(R); 100 100 def S=basering; 101 101 102 102 setring R; 103 103 ideal jj=maxideal(1); 104 104 setring S; 105 105 ideal jj=phi(jj); 106 106 107 107 def T=S+R; 108 setring T; 108 setring T; 109 109 changeord("@rr","lp"); 110 110 // ideal j=imap(S,phi(jj)); 111 111 ideal j=imap(S,jj); 112 112 113 113 int i; 114 114 for(i=1;i<=nvars(S);i++) … … 128 128 ideal i= xy; 129 129 map phi=r,(xy)^3+x2+z,y2-1,z3; 130 130 131 131 mapIsFinite(r,phi,i); 132 132 } -
Singular/LIB/normal.lib
rce7ba6 r917fb5 6 6 /////////////////////////////////////////////////////////////////////////////// 7 7 8 version="$Id: normal.lib,v 1.1 5 1999-07-06 11:33:04 obachmanExp $";8 version="$Id: normal.lib,v 1.16 1999-07-06 15:32:54 Singular Exp $"; 9 9 info=" 10 10 LIBRARY: normal.lib PROCEDURES FOR NORMALIZATION … … 13 13 normal(I); computes the normalization of basering/I 14 14 extraweight(R); intvec of variable weights of ring R 15 HomJJ(L); presentation of End_R(J) as affine ring, L a list 15 HomJJ(L); presentation of End_R(J) as affine ring, L a list 16 16 "; 17 17 … … 176 176 intvec rw,rw1; 177 177 list L; 178 178 179 179 y = printlevel-voice+2; // y=printlevel (default: y=0) 180 180 def P = basering; … … 219 219 //---------- computation of p*Hom(J,J) as R-ideal ----------------------------- 220 220 if ( y>=1 ) 221 { 221 { 222 222 "// compute p*Hom(rad(J),rad(J)) = p*J:J, p a non-zerodivisor"; 223 223 "// p is equal to:"; ""; 224 224 p; 225 ""; 225 ""; 226 226 } 227 227 … … 229 229 if ( y>=1 ) 230 230 { "// the module p*Hom(rad(J),rad(J)) = p*J:J, p a non-zerodivisor"; 231 231 232 232 "// p"; p; 233 233 "// f=p*J:J";f; … … 300 300 endphi; 301 301 " "; 302 pause ;302 pause(); 303 303 newline; 304 304 } … … 309 309 { 310 310 "// R is not equal to Hom(rad(J),rad(J)), we have to try again"; 311 pause ;311 pause(); 312 312 newline; 313 313 } … … 379 379 " "; 380 380 interred(Quad); 381 pause ;381 pause(); 382 382 newline; 383 383 } … … 434 434 endphi; 435 435 " "; 436 pause ;436 pause(); 437 437 newline; 438 438 } … … 463 463 (which is sometimes more efficient) 464 464 RETURN: a list of rings (say nor), in each ring nor[i] are two ideals 465 norid, normap such that the product of the nor[i]/norid is the 465 norid, normap such that the product of the nor[i]/norid is the 466 466 normalization of basering/id and normap is the map from basering/id 467 467 to nor[i]/norid … … 553 553 result = normalizationPrimes(prim[1],maxideal(1)); 554 554 sr = string(size(result)); 555 555 556 556 dbprint(y+1," 557 557 // 'normal' created a list of "+sr+" ring(s). … … 624 624 625 625 dbprint(y+1," 626 // 'normal' created a list of "+sr+" ring(s). 626 // 'normal' created a list of "+sr+" ring(s). 627 627 // To see the rings, type (if the name of your list is nor): 628 show( nor); 628 show( nor); 629 629 // To access the 1-st ring and map (and similair for the others), type: 630 def R = nor[1]; setring R; norid; normap; 630 def R = nor[1]; setring R; norid; normap; 631 631 // R/norid is the 1-st ring of the normalization and 632 632 // normap the map from the original basering to R/norid"); … … 661 661 { 662 662 int y = printlevel-voice+2; // y=printlevel (default: y=0) 663 663 664 664 if(y>=1) 665 665 { … … 668 668 i; ""; 669 669 basering; ""; 670 pause ;670 pause(); 671 671 newline; 672 672 } -
Singular/LIB/paramet.lib
rce7ba6 r917fb5 1 // $Id: paramet.lib,v 1. 4 1999-07-06 11:33:06 obachmanExp $1 // $Id: paramet.lib,v 1.5 1999-07-06 15:32:55 Singular Exp $ 2 2 // author : Thomas Keilen email: keilen@mathematik.uni-kl.de 3 3 // last change: 07.08.98 4 4 /////////////////////////////////////////////////////////////////////////////// 5 5 6 version="$Id: paramet.lib,v 1. 4 1999-07-06 11:33:06 obachmanExp $";6 version="$Id: paramet.lib,v 1.5 1999-07-06 15:32:55 Singular Exp $"; 7 7 info=" 8 LIBRARY: paramet.lib PROCEDURES FOR PARAMETRIZATION OF PRIMARY 8 LIBRARY: paramet.lib PROCEDURES FOR PARAMETRIZATION OF PRIMARY 9 9 DECOMPOSITION, ETC. 10 10 11 11 PROCEDURES: 12 parametrize(I); parametrizes a prime ideal if possible via the 12 parametrize(I); parametrizes a prime ideal if possible via the 13 13 normalization 14 parametrizepd(I); calculates the primary decomp. and parametrizes 14 parametrizepd(I); calculates the primary decomp. and parametrizes 15 15 the components 16 16 parametrizesing(f); parametrize an isolated plane curve singularity … … 25 25 proc parametrize(ideal I) 26 26 "USAGE: parametrize(); I ideal in an arbitrary number of variables, 27 whose radical is prime, in a ring with global ordering 27 whose radical is prime, in a ring with global ordering 28 28 RETURN: a list containing the parametrization ideal resp. the original ideal, 29 29 the number of variables needed for the parametrization resp. 0, and 30 1 resp. 0 depending on whether the parametrization was successful 30 1 resp. 0 depending on whether the parametrization was successful 31 31 or not 32 32 NOTE: if successful, the basering is changed to the parametrization ring; 33 the result will be incorrect, if the parametrization needs more than 33 the result will be incorrect, if the parametrization needs more than 34 34 two variables 35 35 EXAMPLE: example parametrize; shows an example … … 43 43 list nor=normal(newI); 44 44 def N=nor[1]; 45 ring PR=0,(s,t),dp; 45 ring PR=0,(s,t),dp; 46 46 setring N; 47 47 // If the ideal is zero dimensional, the procedure works as well in good cases. … … 53 53 ideal para=p(normap); 54 54 export para; 55 // The i-th list component contains the parametrization, the 55 // The i-th list component contains the parametrization, the 56 56 // number of necessary variables, and the information, if 57 57 // the parametrization was successful. … … 66 66 keepring(PR); 67 67 } 68 else 68 else 69 69 { 70 70 list param=I,0,0; … … 79 79 } 80 80 example 81 { "EXAMPLE:";echo = 2; 81 { "EXAMPLE:";echo = 2; 82 82 ring RING=0,(x,y,z),dp; 83 83 ideal I=z2-y2x2+x3; … … 94 94 resp. 0, and 1 resp. 0 depending on whether the parametrization 95 95 of the component was successful or not 96 NOTE: the basering will be changed to PR=0,(s,t),dp 96 NOTE: the basering will be changed to PR=0,(s,t),dp 97 97 the result will be incorrect, if the parametrization needs more than two 98 98 variables … … 108 108 for (int ii=1; ii<=size(primary); ii=ii+1) 109 109 { 110 no=normal(std(primary[ii][2])); 110 no=normal(std(primary[ii][2])); 111 111 nor[ii]=no[1]; 112 112 def N=nor[ii]; 113 113 setring N; 114 114 int d=dim(std(norid)); 115 // Test if the normalization is K, K[s] or K[s,t]. Then give back the parametrization. 115 // Test if the normalization is K, K[s] or K[s,t]. Then give back the parametrization. 116 116 if (size(norid)==0) 117 117 { … … 131 131 setring BAS; 132 132 } 133 else 133 else 134 134 { 135 135 setring PR; … … 141 141 } 142 142 export nor; 143 setring PR; 143 setring PR; 144 144 export PR; 145 145 keepring PR; … … 147 147 } 148 148 example 149 { "EXAMPLE:";echo = 2; 149 { "EXAMPLE:";echo = 2; 150 150 ring RING=0,(x,y,z),dp; 151 151 ideal I=(x2-y2z2+z3)*(x2-z2-z3),(x2-y2z2+z3)*yz; … … 160 160 "USAGE: parametrizesing(); f a polynomial in two variables with ordering ls or ds 161 161 RETURN: a list containing the parametrizations of the different branches of the 162 singularity at the origin resp. 0, if f was not of the desired kind 162 singularity at the origin resp. 0, if f was not of the desired kind 163 163 NOTE: if successful, the basering is changed to ring 0,(x,y),ls; 164 164 EXAMPLE: example parametrizesing; shows an example … … 185 185 } 186 186 example 187 { "EXAMPLE:";echo = 2; 187 { "EXAMPLE:";echo = 2; 188 188 ring RING=0,(x,y),ls; 189 189 poly f=(x^2-y^3)*(x^2-y^2-y^3); … … 265 265 /// Examples for parametrizepd 266 266 267 /// Example 1 267 /// Example 1 268 268 ring r=0,(x,y,z),dp; 269 269 ideal i=y2z5-x2y2z2+y2z4-z6-z5+x4-x2z2,-y3z3+yz4+x2yz; -
Singular/LIB/poly.lib
rce7ba6 r917fb5 1 // $Id: poly.lib,v 1.1 5 1999-07-06 11:33:07 obachmanExp $1 // $Id: poly.lib,v 1.16 1999-07-06 15:32:55 Singular Exp $ 2 2 //system("random",787422842); 3 3 //(GMG, last modified 22.06.96) … … 5 5 /////////////////////////////////////////////////////////////////////////////// 6 6 7 version="$Id: poly.lib,v 1.1 5 1999-07-06 11:33:07 obachmanExp $";7 version="$Id: poly.lib,v 1.16 1999-07-06 15:32:55 Singular Exp $"; 8 8 info=" 9 9 LIBRARY: poly.lib PROCEDURES FOR MANIPULATING POLYS, IDEALS, MODULES … … 61 61 proc katsura 62 62 "USAGE: katsura([n]): n integer 63 RETURN: katsura(n) : n-th katsura ideal of 64 (1) newly created and set ring (32003, x(0..n), dp), if 63 RETURN: katsura(n) : n-th katsura ideal of 64 (1) newly created and set ring (32003, x(0..n), dp), if 65 65 nvars(basering) < n 66 66 (2) basering, if nvars(basering) >= n … … 88 88 n = nvars(basering) -1; 89 89 } 90 90 91 91 ideal s; 92 92 int i, j; -
Singular/LIB/primdec.lib
rce7ba6 r917fb5 1 // $Id: primdec.lib,v 1.3 7 1999-07-06 11:33:09 obachmanExp $1 // $Id: primdec.lib,v 1.38 1999-07-06 15:32:56 Singular Exp $ 2 2 //////////////////////////////////////////////////////////////////////////////// 3 3 // primdec.lib // … … 11 11 //////////////////////////////////////////////////////////////////////////////// 12 12 13 version="$Id: primdec.lib,v 1.3 7 1999-07-06 11:33:09 obachmanExp $";13 version="$Id: primdec.lib,v 1.38 1999-07-06 15:32:56 Singular Exp $"; 14 14 info=" 15 15 LIBRARY: primdec.lib PROCEDURE FOR PRIMARY DECOMPOSITION … … 264 264 act; 265 265 keep; 266 pause ;266 pause(); 267 267 268 268 p; 269 269 q; 270 pause ;270 pause(); 271 271 } 272 272 } … … 1625 1625 { 1626 1626 //@pr[j]; 1627 //pause ;1627 //pause(); 1628 1628 @res[j]=decomp(@pr[j],2); 1629 1629 // @res[j]=decomp(@pr[j],2,@pr[j],ser); -
Singular/LIB/solve.lib
rce7ba6 r917fb5 1 1 /////////////////////////////////////////////////////////////////////////////// 2 2 3 version="$Id: solve.lib,v 1. 8 1999-07-06 11:33:13 obachmanExp $";3 version="$Id: solve.lib,v 1.9 1999-07-06 15:32:57 Singular Exp $"; 4 4 info=" 5 5 LIBRARY: solve.lib PROCEDURES TO SOLVE POLYNOMIAL SYSTEMS … … 21 21 l>0: defines precision of fractional part if ground field is Q 22 22 m=0,1,2: number of iterations for approximation of roots (default=2) 23 ASSUME: i is a zerodimensional ideal with 24 nvars(basering) = ncols(i) = number of vars actually occuring in i 23 ASSUME: i is a zerodimensional ideal with 24 nvars(basering) = ncols(i) = number of vars actually occuring in i 25 25 RETURN: list of all (complex) roots of the polynomial system i = 0, 26 26 of type number if the ground field is the complex numbers, … … 33 33 int prec=30; 34 34 35 if ( size(#) >= 1 ) 36 37 38 if ( typ < 0 || typ > 1 )39 40 ERROR("Valid values for second parameter k are: 41 42 43 44 45 if ( size(#) >= 2 ) 46 47 48 49 if ( prec < 0 )50 51 52 53 54 if ( size(#) >= 3 ) 55 56 57 if ( polish < 0 || polish > 2 )58 59 ERROR("Valid values for fourth parameter m are: 60 61 62 63 64 if ( size(#) > 3 ) 65 66 67 35 if ( size(#) >= 1 ) 36 { 37 typ= #[1]; 38 if ( typ < 0 || typ > 1 ) 39 { 40 ERROR("Valid values for second parameter k are: 41 0: use sparse Resultant (default) 42 1: use Macaulay Resultant"); 43 } 44 } 45 if ( size(#) >= 2 ) 46 { 47 prec= #[2]; 48 if ( prec == 0 ) { prec = 30; } 49 if ( prec < 0 ) 50 { 51 ERROR("Third parameter l must be positive!"); 52 } 53 } 54 if ( size(#) >= 3 ) 55 { 56 polish= #[3]; 57 if ( polish < 0 || polish > 2 ) 58 { 59 ERROR("Valid values for fourth parameter m are: 60 0,1,2: number of iterations for approximation of roots"); 61 } 62 } 63 64 if ( size(#) > 3 ) 65 { 66 ERROR("only three parameters allowed!"); 67 } 68 68 69 69 int digits= system("setFloatDigits",prec); 70 70 71 71 return(uressolve(gls,typ,polish)); 72 72 73 73 } 74 74 example … … 81 81 // result is a list (x,y)-coordinates as strings 82 82 83 pause ;84 // now with complex coefficient field, precision is 10 digits 83 pause(); 84 // now with complex coefficient field, precision is 10 digits 85 85 ring rsc= (real,10,I),(x,y),lp; 86 86 ideal i = (2+3*I)*x2 + (0.35+I*45.0e-2)*y2 - 8, x2 + xy + (42.7)*y2; … … 104 104 int prec=30; 105 105 106 if ( size(#) >= 1 ) 107 108 109 110 if ( prec < 0 )111 112 113 114 115 if ( size(#) >= 2 ) 116 117 118 if ( polish < 0 || polish > 2 )119 120 ERROR("Valid values for third parameter are: 121 122 123 124 if ( size(#) > 2 ) 125 126 127 106 if ( size(#) >= 1 ) 107 { 108 prec= #[1]; 109 if ( prec == 0 ) { prec = 30; } 110 if ( prec < 0 ) 111 { 112 ERROR("Fisrt parameter must be positive!"); 113 } 114 } 115 if ( size(#) >= 2 ) 116 { 117 polish= #[2]; 118 if ( polish < 0 || polish > 2 ) 119 { 120 ERROR("Valid values for third parameter are: 121 0,1,2: number of iterations for approximation of roots"); 122 } 123 } 124 if ( size(#) > 2 ) 125 { 126 ERROR("only two parameters allowed!"); 127 } 128 128 129 129 int digits= system("setFloatDigits",prec); 130 130 131 131 return(laguerre(f,polish)); 132 132 133 133 } 134 134 example … … 140 140 laguerre_solve(f); 141 141 142 pause ;142 pause(); 143 143 // Now with 10 digits precision: 144 144 laguerre_solve(f,10); 145 145 146 pause ;146 pause(); 147 147 // Now with complex coefficients, precision is 20 digits: 148 148 ring rsc= (real,20,I),x,lp; … … 158 158 k=1: resultant matrix of Macaulay (k=0 is default) 159 159 ASSUME: nvars(basering) = ncols(i)-1 = number of vars actually occuring in i, 160 for k=1 i must be homogeneous 161 RETURN: module representing the multipolynomial resultant matrix 160 for k=1 i must be homogeneous 161 RETURN: module representing the multipolynomial resultant matrix 162 162 EXAMPLE: example mp_res_mat; shows an example 163 163 " … … 165 165 int typ=2; 166 166 167 if ( size(#) == 1 ) 168 169 170 if ( typ < 0 || typ > 1 )171 172 173 174 175 176 177 if ( size(#) > 1 ) 178 179 180 167 if ( size(#) == 1 ) 168 { 169 typ= #[1]; 170 if ( typ < 0 || typ > 1 ) 171 { 172 ERROR("Valid values for third parameter are: 173 0: sparse resultant (default) 174 1: Macaulay resultant"); 175 } 176 } 177 if ( size(#) > 1 ) 178 { 179 ERROR("only two parameters allowed!"); 180 } 181 181 182 182 return(mpresmat(i,typ)); 183 183 184 184 } 185 185 example … … 194 194 det(m); 195 195 196 pause ;196 pause(); 197 197 // compute resultant matrix (Macaulay resultant matrix) 198 198 ring rdq= (0,u0,u1,u2),(x0,x1,x2),lp; … … 204 204 det(m); 205 205 206 pause ;206 pause(); 207 207 // compute numerical sparse resultant matrix 208 208 setring rsq; … … 219 219 ASSUME: ground field K is the rational numbers, 220 220 p and v consist of numbers of the ground filed K, p must have 221 n elements, v must have N=(d+1)^n elements where n=nvars(basering) 222 and d=deg(f) (f is the unknown polynomial in K[x1,...,xn]) 221 n elements, v must have N=(d+1)^n elements where n=nvars(basering) 222 and d=deg(f) (f is the unknown polynomial in K[x1,...,xn]) 223 223 COMPUTE: polynomial f with values given by v at points p1,..,pN derived from p; 224 224 more precisely: consider p as point in K^n and v as N elements in K, … … 251 251 } 252 252 /////////////////////////////////////////////////////////////////////////////// 253 254 255 256 257 258 -
Singular/LIB/solver.lib
rce7ba6 r917fb5 1 // $Id: solver.lib,v 1. 2 1999-07-06 11:33:14 obachmanExp $1 // $Id: solver.lib,v 1.3 1999-07-06 15:32:58 Singular Exp $ 2 2 //////////////////////////////////////////////////////////////////////////////// 3 3 // solver.lib // … … 7 7 //////////////////////////////////////////////////////////////////////////////// 8 8 9 version="$Id: solver.lib,v 1. 2 1999-07-06 11:33:14 obachmanExp $";9 version="$Id: solver.lib,v 1.3 1999-07-06 15:32:58 Singular Exp $"; 10 10 info=" 11 11 LIBRARY: solver.lib: PROCEDURES FOR SOLVING ZERO-DIMENSIONAL ALGEBRAIC SYSTEMS … … 58 58 p[i] = subst(p[i],var(j),a[j]); 59 59 for (k = n; k >= n-i+1; k--) 60 { 60 { 61 61 J[i,k] = subst(J[i,k],var(j),a[j]); 62 62 } … … 67 67 return(); 68 68 } 69 69 70 70 // solve linear equations 71 71 hh = -p[i]; -
Singular/LIB/spcurve.lib
rce7ba6 r917fb5 1 // $Id: spcurve.lib,v 1. 2 1999-07-06 11:33:14 obachmanExp $1 // $Id: spcurve.lib,v 1.3 1999-07-06 15:32:58 Singular Exp $ 2 2 // (anne, last modified 20.7.98) 3 3 ///////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: spcurve.lib,v 1. 2 1999-07-06 11:33:14 obachmanExp $";5 version="$Id: spcurve.lib,v 1.3 1999-07-06 15:32:58 Singular Exp $"; 6 6 info=" 7 7 LIBRARY: spcurve.lib PROCEDURES FOR CM CODIMENSION 2 SINGULARITIES … … 19 19 kod_ker(M,a); kernel of the Kodaira-Spencer map using eliminate 20 20 kod_noelim(M); kernel of the Kodaira-Spencer map (weighted 21 elimination) 21 elimination) 22 22 "; 23 23 24 24 LIB "elim.lib"; 25 25 LIB "homolog.lib"; … … 29 29 30 30 proc isCMcod2(ideal kurve) 31 USAGE: isCMcod2(i); 31 USAGE: isCMcod2(i); 32 32 where i is an ideal 33 33 RETURN: presentation matrix of i, if i is Cohen-Macaulay of codimension2 … … 42 42 list kurveres=mres(kurve,0); 43 43 matrix M=kurveres[2]; 44 if ((size(kurveres)>3) && 45 ((size(kurveres[3])>1) || 44 if ((size(kurveres)>3) && 45 ((size(kurveres[3])>1) || 46 46 ((size(kurveres[3])<=1) && (kurveres[3][1,1]!=0)))) 47 47 { … … 61 61 62 62 proc CMtype(ideal kurve) 63 USAGE: CMtype(i); 63 USAGE: CMtype(i); 64 64 where i is an ideal, Cohen-Macaulay of codimension 2 65 RETURN: Cohen-Macaulay type of i (integer) 65 RETURN: Cohen-Macaulay type of i (integer) 66 66 (-1, if i is not Cohen-Macaulay of codimension 2) 67 67 EXAMPLE: example CMtype; shows an example … … 76 76 kurveres=mres(kurve,0); 77 77 if (size(kurveres)>3) 78 { 78 { 79 79 dbprint(p,"//not Cohen-Macaulay, codim 2"); 80 80 return(gt); … … 96 96 97 97 proc matrixT1(matrix M ,int n) 98 USAGE: matrixT1(M,n); 99 where M is a presentation matrix of an ideal, 98 USAGE: matrixT1(M,n); 99 where M is a presentation matrix of an ideal, 100 100 Cohen-Macaulay of codimension 2 101 101 and n determines the number of variables used as variables, not as 102 102 parameters ( variables are assumed to precede parameters in the 103 definition of the basering ) 104 RETURN: T1 of i as a quotient of the module of matrices of the same 103 definition of the basering ) 104 RETURN: T1 of i as a quotient of the module of matrices of the same 105 105 size as M with polynomial entries 106 106 EXAMPLE: example matrixT1; shows an example … … 124 124 dbprint(p,"//not a k x (k+1) matrix"); 125 125 return("ERROR"); 126 } 126 } 127 127 //--------------------------------------------------------------------------- 128 128 // Construct the denominator - step by step … … 160 160 } 161 161 //--------------------------------------------------------------------------- 162 // step 4: so is L*M 162 // step 4: so is L*M 163 163 //--------------------------------------------------------------------------- 164 164 for( i=1; i <= (gt+1); i++) … … 227 227 matrix Mtemp[gt*(gt+1)][1]; 228 228 for( i=1; i<=tau; i++) 229 { 229 { 230 230 Mtemp=t1erz[i]; 231 231 N=N+A(i)*transpose(Mtemp); … … 264 264 int i; 265 265 ideal sem=std(kurve); 266 ideal semdiff; 266 ideal semdiff; 267 267 ideal J2; 268 268 int ncol=ncols(matrix(sem)); … … 306 306 USAGE: qhmatrix(M); 307 307 where M is a matrix with polynomial entries of size k x (k+1) 308 RETURN: list consisting of an integer vector containing the weights of 308 RETURN: list consisting of an integer vector containing the weights of 309 309 the variables of the basering and an integer matrix giving the 310 310 weights of the entries 311 311 integer vector and integer matrix both contain only 0, if the 312 matrix is not quasihomogeneous, i.e. does not allow row and 312 matrix is not quasihomogeneous, i.e. does not allow row and 313 313 column weights 314 314 EXAMPLE: example qhmatrix; shows an example … … 335 335 dbprint(p,"//not a k x (k+1) matrix"); 336 336 return("ERROR"); 337 } 337 } 338 338 ideal m=minor(M,nr); 339 339 //--------------------------------------------------------------------------- … … 362 362 { 363 363 if(M[i,j]==0) 364 { 364 { 365 365 comprow=0; 366 366 break; … … 371 371 //--------------------------------------------------------------------------- 372 372 // get the weights of the comprow'th row or use emergency exit 373 //--------------------------------------------------------------------------- 373 //--------------------------------------------------------------------------- 374 374 if(comprow==0) 375 375 { … … 392 392 { 393 393 if ( i==comprow ) 394 { 394 { 395 395 // this row should not be tested against itself 396 396 donttest=1; … … 487 487 proc relweight(matrix N, intmat W, intvec a) 488 488 USAGE: relweight(N,W); 489 where N is a non-zero matrix with polynomial entries, W is a 489 where N is a non-zero matrix with polynomial entries, W is a 490 490 matrix with integer entries of the same size and the entries 491 491 of a give the weight of the variables of the basering … … 558 558 ring rneu=char(basering),(var(1),..,var(nvars(basering)), 559 559 T(1),..,T(k),(dp nvars(basering),dp k); 560 a presentation matrix describing the deformation given by the 560 a presentation matrix describing the deformation given by the 561 561 generators of T1 of non-negative weight is returned as the first 562 562 list element, followed by the weight vector for the new variables … … 583 583 } 584 584 kill i; 585 if (defined(jj)) 585 if (defined(jj)) 586 586 { 587 587 if (jj==-1) … … 661 661 matrix Mtemp[gt*(gt+1)][1]; 662 662 for( i=1; i<=pw; i++) 663 { 663 { 664 664 mtemp=erz1[i]; 665 665 Mtemp=mtemp; … … 746 746 ker[i]=lead(ker[i]); 747 747 } 748 } 748 } 749 749 kill testlead; 750 } 750 } 751 751 ker=eliminate(interred(ker),p); 752 752 option(set,optvec); … … 797 797 matrix M=imap(rt,M); 798 798 int ne=size(M); 799 intvec iv=1..ne; 799 intvec iv=1..ne; 800 800 list l=matrixT1(M,3); 801 801 if (dim(std(l[2])) != 0) … … 825 825 } 826 826 } 827 ringre="ring re=" + charstr(r) +",(e(1.." + string(ne) + "),"+ varstr(basering) 828 + "),ws(" + string((-1)*intvec(wl[2])) + "," 827 ringre="ring re=" + charstr(r) +",(e(1.." + string(ne) + "),"+ varstr(basering) 828 + "),ws(" + string((-1)*intvec(wl[2])) + "," 829 829 + string(wl[1]) + ");"; 830 830 execute ringre; … … 900 900 } 901 901 ideal templ=lead(t1perts); 902 for(int j=1;j<=nv;j++) 902 for(int j=1;j<=nv;j++) 903 903 { 904 904 templ=subst(templ,T(j),0); … … 918 918 } 919 919 //-------------------------------------------------------------------------- 920 // multiply by the initial ring variables to shift the generators with 920 // multiply by the initial ring variables to shift the generators with 921 921 // leading term divisible by some T(i) and reduce afterwards 922 922 //-------------------------------------------------------------------------- 923 attrib(mx,"isSB",1); // This is obviously no SB, but we have to reduce by 923 attrib(mx,"isSB",1); // This is obviously no SB, but we have to reduce by 924 924 // it and setting isSB suppresses error messages 925 925 noether=noet[size(noet)]; … … 968 968 ovar=var(1); 969 969 for(i=2;i<=ne;i++) 970 { 970 { 971 971 ovar=ovar,var(i); 972 972 } … … 1005 1005 gen(i) will correspond to var(vpos[i]) 1006 1006 NOTE: this procedure should be used in the following situation: 1007 one wants to pass to a ring with new variables which stand 1008 for the generators of the module and consider the module as 1007 one wants to pass to a ring with new variables which stand 1008 for the generators of the module and consider the module as 1009 1009 an ideal 1010 1010 RETURN: ideal i in which each gen(i) from the module is replaced by 1011 var(vpos[i]) and all monomials var(vpos[i])*var(vpos[j]) have 1011 var(vpos[i]) and all monomials var(vpos[i])*var(vpos[j]) have 1012 1012 been added to the generating set of i 1013 1013 EXAMPLE: example mod2id; shows an example … … 1031 1031 } 1032 1032 //---------------------------------------------------------------------- 1033 // define the desired ideal 1033 // define the desired ideal 1034 1034 //---------------------------------------------------------------------- 1035 1035 ideal ret=vars^2,varm*M; … … 1042 1042 intvec iv=2,1; 1043 1043 mod2id(mo,iv); 1044 } 1044 } 1045 1045 //////////////////////////////////////////////////////////////////////// 1046 1046 static … … 1051 1051 NOTE: * use this procedure only makes sense if the ideal contains 1052 1052 all var(vpos[i])*var(vpos[j]) as monomial generators and 1053 all other generators are linear combinations of the 1053 all other generators are linear combinations of the 1054 1054 var(vpos[i]) over the ring in the other variables 1055 1055 * this is the inverse procedure to mod2id 1056 1056 RETURN: module corresponding to the ideal by replacing var(vpos[i]) by 1057 gen(i) and omitting all generators var(vpos[i])*var(vpos[j]) 1057 gen(i) and omitting all generators var(vpos[i])*var(vpos[j]) 1058 1058 EXAMPLE: example id2mod; shows an example; 1059 1059 { 1060 1060 //--------------------------------------------------------------------- 1061 // Initialization 1061 // Initialization 1062 1062 //--------------------------------------------------------------------- 1063 1063 int n=size(i); … … 1093 1093 sm ideal in a ring r with n + s variables, 1094 1094 e.g. x_1,..,x_n and t_1,..,t_s 1095 mon ideal with monomial generators (not divisible by 1095 mon ideal with monomial generators (not divisible by 1096 1096 one of the t_i) such that sm is contained in the module 1097 1097 k[t_1,..,t_s]*mon 1098 1098 iv intvec listing the variables which are supposed to be used 1099 1099 as x_i 1100 RETURN: interreduced system of generators of sm seen as a submodule 1100 RETURN: interreduced system of generators of sm seen as a submodule 1101 1101 of k[t_1,..,t_s]*mon 1102 1102 EXAMPLE: example subrInterred; shows an example -
Singular/LIB/standard.lib
rce7ba6 r917fb5 1 // $Id: standard.lib,v 1.3 5 1999-07-06 11:33:15 obachmanExp $1 // $Id: standard.lib,v 1.36 1999-07-06 15:32:59 Singular Exp $ 2 2 ////////////////////////////////////////////////////////////////////////////// 3 3 4 version="$Id: standard.lib,v 1.3 5 1999-07-06 11:33:15 obachmanExp $";4 version="$Id: standard.lib,v 1.36 1999-07-06 15:32:59 Singular Exp $"; 5 5 info=" 6 6 LIBRARY: standard.lib PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP … … 17 17 fprintf(link,fmt,..) writes formatted string to link 18 18 printf(fmt,...) displays formatted string 19 pause([prompt]) pause in the computation till user input 19 20 "; 20 21 … … 398 399 } 399 400 example 400 { 401 "EXAMPLE: "; echo = 2; 401 { "EXAMPLE: "; echo = 2; 402 402 ring r = 0, (a,b,c,d), lp; 403 403 option(prot); … … 816 816 } 817 817 example 818 { 818 { "EXAMPLE:"; echo=2; 819 819 ring r=0,(x,y,z),dp; 820 820 module m=[1,y],[0,x+z]; … … 855 855 } 856 856 example 857 { 857 { "EXAMPLE:"; echo=2; 858 858 ring r=0,(x,y,z),dp; 859 859 module m=[1,y],[0,x+z]; … … 895 895 } 896 896 example 897 { 897 { "EXAMPLE:"; echo=2; 898 898 ring r=0,(x,y,z),dp; 899 899 module m=[1,y],[0,x+z]; … … 911 911 912 912 913 proc pause(list #) 914 "USAGE: pause([ prompt ]) prompt string 915 RETURN: none 916 PURPOSE: pause in the computation till user input 917 EXAMPLE : example pause; shows an example 918 " 919 { 920 string pr="pause>"; 921 if (size(#)!=0) 922 { 923 pr=#[1]; 924 } 925 pr=read("",pr); 926 } 927 example 928 { "EXAMPLE:"; echo=2; 929 pause("press <return> to continue"); 930 pause(); 931 } 932 933 913 934 914 935 -
Singular/LIB/surf.lib
rce7ba6 r917fb5 1 // $Id: surf.lib,v 1. 4 1999-07-06 11:33:16 obachmanExp $1 // $Id: surf.lib,v 1.5 1999-07-06 15:33:00 Singular Exp $ 2 2 // 3 3 // author : Hans Schoenemann 4 4 // 5 5 /////////////////////////////////////////////////////////////////////////////// 6 version="$Id: surf.lib,v 1. 4 1999-07-06 11:33:16 obachmanExp $";6 version="$Id: surf.lib,v 1.5 1999-07-06 15:33:00 Singular Exp $"; 7 7 info=" 8 8 LIBRARY: surf.lib PROCEDURES FOR GRAPHICS WITH SURF (by Stephan Endrass) … … 33 33 "USAGE: plot(I); I ideal 34 34 RETURN: 35 NOTE: 35 NOTE: 36 36 EXAMPLE: example plot; shows an example 37 37 " … … 103 103 plot(I); 104 104 ideal J = x1^2-x1-x2^3; 105 plot(J); 105 plot(J); 106 106 107 107 ring rr1 = 0,(x,y,z),dp; 108 108 ideal I(1) = 2x2-1/2x3 +1-y+1; 109 109 plot(I(1)); 110 ideal I(2) = x3-x-y; 110 ideal I(2) = x3-x-y; 111 111 plot(I(2)); 112 112 … … 115 115 plot(logo); 116 116 117 117 118 118 // --------- implicit curves ------------ 119 119 // implicit curves … … 132 132 133 133 poly f = (x-y)*(x2+y); 134 plot(f,1); 134 plot(f,1); 135 135 ideal J = jacob(f); 136 136 J; … … 145 145 ideal J(2) = x^2*y^2+x^2*z^2+y^2*z^2-17*x*y*z; 146 146 plot(J(2)); 147 147 148 148 plot(x*(x2-y2)+z2); 149 149 -
Singular/LIB/tst.lib
rce7ba6 r917fb5 1 // $Id: tst.lib,v 1.1 3 1999-07-06 11:33:17 obachmanExp $1 // $Id: tst.lib,v 1.14 1999-07-06 15:33:00 Singular Exp $ 2 2 //(obachman, last modified 6/30/98) 3 3 ///////////////////////////////////////////////////////////////////////////// 4 4 5 version="$Id: tst.lib,v 1.1 3 1999-07-06 11:33:17 obachmanExp $";5 version="$Id: tst.lib,v 1.14 1999-07-06 15:33:00 Singular Exp $"; 6 6 info=" 7 7 LIBRARY: tst.lib PROCEDURES FOR RUNNING AUTOMATIC TST TESTS … … 13 13 tst_init() writes some identification data to GetTstStatusFile() 14 14 tst_status([any]) writes status info to to GetTstStatusFile() 15 tst_groebnerTest(ideal i) 16 tests groebner command 17 tst_stdEqual(ideal i1, ideal i2) 15 tst_groebnerTest(ideal i) 16 tests groebner command 17 tst_stdEqual(ideal i1, ideal i2) 18 18 test whether two std's are \"equal\" 19 19 "; … … 49 49 "USAGE: tst_ignore(any,[keyword], [link]) 50 50 any -- valid argument to string() 51 keyword -- an arbitrary string 51 keyword -- an arbitrary string 52 52 link -- a link which can be written to 53 53 RETURN: none; writes string(any) to link (or stdout, if no link given), 54 prepending prefix \"// tst_ignore:\", or 54 prepending prefix \"// tst_ignore:\", or 55 55 \"// tst_ignore:keyword hostname:\", 56 56 if keyword was given. … … 164 164 return ("tst_status.out"); 165 165 } 166 else 166 else 167 167 { 168 168 return (tst_status_file); 169 169 } 170 170 } 171 171 172 172 static proc tst_status_out (def prefix, def what, list #) 173 173 { 174 174 string outstring; 175 175 176 176 outstring = string(prefix) + " >> " + string(what); 177 177 if (size(#) > 0) 178 178 { 179 outstring = outstring + " :: " + 179 outstring = outstring + " :: " + 180 180 tst_system("hostname", 1) + ":" + string(#[1]); 181 181 } 182 182 write(":a " + GetTstStatusFile(), outstring); 183 183 } 184 184 185 185 proc tst_status (list #) 186 186 "USAGE: tst_status([any]) 187 187 RETURN: none; writes to stdout the current memory usage and used time 188 since last call to tst_status(), if no argument is given, or, 188 since last call to tst_status(), if no argument is given, or, 189 189 since start-up of Singular, if an argument is given. 190 NOTE: Should be used regularly within tst files to enable automatic 190 NOTE: Should be used regularly within tst files to enable automatic 191 191 tracking of memory and time performance. 192 192 EXAMPLE: example tst_status; shows example … … 204 204 tst_status_counter++; 205 205 } 206 206 207 207 tst_status_out(tst_status_counter, "tst_memory_0", memory(0)); 208 208 tst_status_out(tst_status_counter, "tst_memory_1", memory(1)); … … 230 230 } 231 231 232 232 233 233 proc tst_init() 234 234 "USAGE: tst_init() … … 263 263 0, otherwise 264 264 Two std's are \"equal\" here, if their redSB's are element-wise equal, 265 and if they reduce each other to zero, and if their leading ideals 265 and if they reduce each other to zero, and if their leading ideals 266 266 are equal 267 267 On success, times of std - groebner is written with tst_ignore, and 268 times are added to global variables tst_std_time and 269 tst_groebner_time. If v given, and <= 0, short ideal 268 times are added to global variables tst_std_time and 269 tst_groebner_time. If v given, and <= 0, short ideal 270 270 characteristic is printed, if v > 0, ideals are printed. 271 271 On failure, Error message and ideals are printed. … … 276 276 ideal si = std(i); 277 277 st = timer - st; 278 278 279 279 int gt = timer; 280 280 ideal gi = groebner(i); … … 322 322 } 323 323 324 324 325 325 // 326 326 // A routine which test for equality of "std-bases" 327 // 327 // 328 328 proc tst_stdEqual(ideal i1, ideal i2) 329 329 "USAGE: tst_stdEqual(i1, i2) ideal i1, i2 … … 331 331 0, otherwise 332 332 Two std's are \"equal\" here, if their redSB's are element-wise equal, 333 and if they reduce each other to zero, and if their leading ideals 333 and if they reduce each other to zero, and if their leading ideals 334 334 are equal 335 335 On failure, error message is printed. … … 341 341 intvec opts = option(get); 342 342 option(redSB); 343 343 344 344 ideal ri1 = simplify(interred(i1), 1); 345 345 ideal ri2 = simplify(interred(i2), 1); 346 346 347 347 option(set, opts); 348 348 … … 372 372 { 373 373 poly p1, p2; 374 374 375 375 ideal si1 = simplify(i1, 7); 376 376 ideal si2 = simplify(i2, 7); 377 377 378 378 if (size(si1) == size(si2)) 379 379 { … … 432 432 } 433 433 434 435 436 434 435 436 -
Singular/febase.cc
rce7ba6 r917fb5 2 2 * Computer Algebra System SINGULAR * 3 3 ****************************************/ 4 /* $Id: febase.cc,v 1.7 3 1999-05-01 15:30:44 obachmanExp $ */4 /* $Id: febase.cc,v 1.74 1999-07-06 15:32:43 Singular Exp $ */ 5 5 /* 6 6 * ABSTRACT: i/o system … … 989 989 { 990 990 lines = 0; 991 fePause(); 991 fputs("pause>\n",stderr); 992 uchar c = fgetc(stdin); 992 993 } 993 994 else … … 1023 1024 int ls = strlen(s); 1024 1025 if (ls == 0) return; 1025 1026 1026 1027 char* ns; 1027 1028 int l = strlen(sprint); 1028 1029 ns = (char*) AllocL((l + ls + 1)*sizeof(char)); 1029 1030 if (l > 0) strcpy(ns, sprint); 1030 1031 1031 1032 strcpy(&(ns[l]), s); 1032 1033 FreeL(sprint); … … 1052 1053 return; 1053 1054 } 1054 1055 1055 1056 if (feOut) /* do not print when option --no-out was given */ 1056 1057 { 1057 1058 1058 1059 #ifdef macintosh 1059 1060 char c; … … 1101 1102 ns = (char*) AllocL(sizeof(char)*(ls + l + 256)); 1102 1103 if (l > 0) strcpy(ns, sprint); 1103 1104 1104 1105 #ifdef HAVE_VSNPRINTF 1105 1106 l = vsnprintf(&(ns[l]), ls+255, fmt, ap); … … 1162 1163 } 1163 1164 1164 void fePause()1165 {1166 #ifdef HAVE_TCL1167 if(!tclmode)1168 #endif1169 {1170 mflush();1171 #ifndef macintosh1172 fputs("pause>",stderr);1173 #else1174 fputs("pause>\n",stderr);1175 #endif1176 uchar c = fgetc(stdin);1177 if (((c == '\003') || (c == 'C')) || (c == 'c'))1178 {1179 m2_end(4);1180 }1181 }1182 }1183 1184 1165 void monitor(char* s, int mode) 1185 1166 { -
Singular/febase.h
rce7ba6 r917fb5 4 4 * Computer Algebra System SINGULAR * 5 5 ****************************************/ 6 /* $Id: febase.h,v 1.2 8 1999-04-17 14:58:46 obachmanExp $ */6 /* $Id: febase.h,v 1.29 1999-07-06 15:32:44 Singular Exp $ */ 7 7 /* 8 8 * ABSTRACT: basic i/o … … 106 106 107 107 FILE * feFopen(char *path, char *mode, char *where=NULL, int useWerror=FALSE); 108 void fePause(void);109 108 #ifndef __MWERKS__ 110 109 #ifdef HAVE_TCL -
Singular/scanner.l
rce7ba6 r917fb5 3 3 * Computer Algebra System SINGULAR * 4 4 ****************************************/ 5 /* $Id: scanner.l,v 1.1 6 1999-04-15 17:28:06Singular Exp $ */5 /* $Id: scanner.l,v 1.17 1999-07-06 15:32:44 Singular Exp $ */ 6 6 #include <stdio.h> 7 7 #include <string.h> … … 110 110 yy_noeof=0; 111 111 } 112 pause[ \t\n]*[\.;] { fePause(); }113 112 while { prompt_char='.'; 114 113 blocknest = 0; yy_noeof = noeof_brace; BEGIN(brace);
Note: See TracChangeset
for help on using the changeset viewer.