Changeset 917fb5 in git


Ignore:
Timestamp:
Jul 6, 1999, 5:33:00 PM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
8e7ed6b81b8840e62d72f281eef096b71dc1b37e
Parents:
ce7ba606241efb95de4d1ab5581428b7143b3be2
Message:
* hannes: removed pause; (scanner.l, febase.*)
          introduced pause([string]) (standard.lib)


git-svn-id: file:///usr/local/Singular/svn/trunk@3237 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • Singular/LIB/all.lib

    rce7ba6 r917fb5  
    1 // $Id: all.lib,v 1.17 1999-06-22 10:42:23 obachman Exp $
     1// $Id: all.lib,v 1.18 1999-07-06 15:32:45 Singular Exp $
    22///////////////////////////////////////////////////////////////////////////////
    33
    4 version="$Id: all.lib,v 1.17 1999-06-22 10:42:23 obachman Exp $";
     4version="$Id: all.lib,v 1.18 1999-07-06 15:32:45 Singular Exp $";
    55info="
    66LIBRARY:  all.lib   Load all libraries
     
    1515  homolog.lib   PROCEDURES FOR HOMOLOGICAL ALGEBRA
    1616  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
    1818  latex.lib     PROCEDURES FOR TYPESET OF SINGULAROBJECTS IN LATEX2E
    1919  matrix.lib    PROCEDURES FOR MATRIX OPERATIONS
  • Singular/LIB/deform.lib

    rce7ba6 r917fb5  
    1 // $Id: deform.lib,v 1.15 1999-07-06 11:32:46 obachman Exp $
     1// $Id: deform.lib,v 1.16 1999-07-06 15:32:46 Singular Exp $
    22// author: Bernd Martin email: martin@math.tu-cottbus.de
    33//(bm, last modified 4/98)
    44///////////////////////////////////////////////////////////////////////////////
    5 version="$Id: deform.lib,v 1.15 1999-07-06 11:32:46 obachman Exp $";
     5version="$Id: deform.lib,v 1.16 1999-07-06 15:32:46 Singular Exp $";
    66info="
    77LIBRARY:  deform.lib       PROCEDURES FOR COMPUTING MINIVERSAL DEFORMATION
     
    564564  br = my+"Sx";
    565565  if (defined(`br`)) { kill `br`}
    566   if(system("with","Namespaces")) {
     566  if(system("with","Namespaces"))
     567  {
    567568    br = my+"Qx";
    568569    if (defined(Top::`br`)) { kill Top::`br`;}
  • Singular/LIB/general.lib

    rce7ba6 r917fb5  
    1 // $Id: general.lib,v 1.14 1999-07-06 11:32:54 obachman Exp $
     1// $Id: general.lib,v 1.15 1999-07-06 15:32:47 Singular Exp $
    22//system("random",787422842);
    33//GMG, last modified 18.6.99
    44///////////////////////////////////////////////////////////////////////////////
    55
    6 version="$Id: general.lib,v 1.14 1999-07-06 11:32:54 obachman Exp $";
     6version="$Id: general.lib,v 1.15 1999-07-06 15:32:47 Singular Exp $";
    77info="
    88LIBRARY:  general.lib   PROCEDURES OF GENERAL TYPE
     
    243243EXAMPLE: example kmemory; shows an example
    244244"
    245 { 
     245{
    246246   int n;
    247247   int verb;
     
    252252     { verb=#[2]; }
    253253   }
    254    
     254
    255255  if ( verb != 0)
    256256  {
  • Singular/LIB/graphics.lib

    rce7ba6 r917fb5  
    1 // $Id: graphics.lib,v 1.3 1999-07-06 11:32:55 obachman Exp $
     1// $Id: graphics.lib,v 1.4 1999-07-06 15:32:47 Singular Exp $
    22//
    33// author : Christian Gorzel email: gorzelc@math.uni-muenster.de
    44//
    55///////////////////////////////////////////////////////////////////////////////
    6 version="$Id: graphics.lib,v 1.3 1999-07-06 11:32:55 obachman Exp $";
     6version="$Id: graphics.lib,v 1.4 1999-07-06 15:32:47 Singular Exp $";
    77info="
    88LIBRARY: graphics.lib    PROCEDURES FOR GRAPHICS WITH MATHEMATICA
     
    136136
    137137 if (i>0)
    138  { suffix = filename[i,size(filename)-i+1]; 
     138 { suffix = filename[i,size(filename)-i+1];
    139139   name = ">" + filename[1,i-1]+ ".m";
    140140 }
    141141 else { print("--Error: Suffix of filename incorrect"); return("");}
    142142// 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 + "\", %]";}
    147147
    148148 }
     
    347347 // active evalutation of the cell with SHIFT RETURN
    348348
    349  // Hit RETURN to continue
    350  pause;
     349 pause("Hit RETURN to continue");
    351350   // --------- space curves --------------
    352351   I(1) = x3,-1/10x3+x2,x2;
     
    357356 // active evalutation of the cell with SHIFT RETURN
    358357
    359  // Hit RETURN to continue
    360  pause;
     358 pause("Hit RETURN to continue");
    361359   // --------- implicit curves ------------
    362360   ring rr = 0,(x,y),ds;  export rr;
     
    387385 // active evalutation of the cell with SHIFT RETURN
    388386
    389  // Hit RETURN to continue
    390  pause;
     387 pause("Hit RETURN to continue");
    391388   // ----------- surfaces -------------------
    392389   ideal J(1) = 3xy4 + 2xy2, x5y3 + x + y6,10x2;
  • Singular/LIB/hnoether.lib

    rce7ba6 r917fb5  
    1 // $Id: hnoether.lib,v 1.11 1999-07-06 11:32:56 obachman Exp $
     1// $Id: hnoether.lib,v 1.12 1999-07-06 15:32:48 Singular Exp $
    22// author:  Martin Lamm,  email: lamm@mathematik.uni-kl.de
    33// last change:           09.03.99
     
    55// This library is for Singular 1.2 or newer
    66
    7 version="$Id: hnoether.lib,v 1.11 1999-07-06 11:32:56 obachman Exp $";
     7version="$Id: hnoether.lib,v 1.12 1999-07-06 15:32:48 Singular Exp $";
    88info="
    99LIBRARY:  hnoether.lib   PROCEDURES FOR THE HAMBURGER-NOETHER DEVELOPMENT
     
    540540       "The given polynomial is in fact not squarefree.";
    541541       "I'll continue with the radical.";
    542        pause;
     542       pause("Hit RETURN to continue");
    543543       f=test_sqr;
    544544      }
     
    580580     {"But if the polynomial contains a factor of the form g^"+string(p)+",";
    581581      "this factor will be lost.";}
    582     pause;
     582    pause("Hit RETURN to continue");
    583583    f=test_sqr;
    584584    nm = getnm(f);              // N,M haben sich veraendert
     
    762762  //   (the missing x in the matrix indicates that this line is not complete.
    763763  //    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");
    765766  param(hne);
    766767  // returns the parametrization x(t)= -t14+O(t21), y(t)= -3t98+O(t105)
     
    870871 list hne_extended1=develop(f,6);
    871872 list hne_extended2=develop(f,10);
    872  pause;
     873 pause("Hit RETURN to continue");
    873874                                   //   compare the different matrices ...
    874875 print(hne[1]);
     
    19591960  list hne=reddevelop(x14-3y2x11-y3x10-y2x9+3y4x8+y5x7+3y4x6+x5*(-y6+y5)-3y6x3-y7x2+y8);
    19601961  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");
    19621964  print(hne[2][1]); // HNE that can be extended
    19631965  list ehne=extdevelop(hne[2],5);
     
    19651967  param(hne[2]);
    19661968  param(ehne);
    1967   param(extdevelop(ehne,7)); pause;
     1969  param(extdevelop(ehne,7));
     1970  pause("Hit RETURN to continue");
    19681971  //////////////////////////
    19691972  print(develop(x-y2-2y3-3y4)[1]);
     
    24192422  displayInvariants(hne);
    24202423  kill HNEring,r;
    2421   pause;
     2424  pause("Hit RETURN to continue");
    24222425  // a more interesting example:
    24232426  ring r = 32003,(x,y),dp;
     
    30763079      if (testpol!=0) {
    30773080        "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");
    30793083      }
    30803084 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 obachman Exp $
     1// $Id: inout.lib,v 1.9 1999-07-06 15:32:49 Singular Exp $
    22// system("random",787422842);
    33// (GMG/BM, last modified 22.06.96)
    44///////////////////////////////////////////////////////////////////////////////
    55
    6 version="$Id: inout.lib,v 1.8 1999-07-06 11:32:58 obachman Exp $";
     6version="$Id: inout.lib,v 1.9 1999-07-06 15:32:49 Singular Exp $";
    77info="
    88LIBRARY:  inout.lib     PROCEDURES FOR MANIPULATING IN- AND OUTPUT
     
    3737      int i;
    3838      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(); }
    4141   }
    4242   return();
     
    403403         {
    404404            "["+string(@ii)+"]:";
    405             tab(@li@+2),"//",id[@ii]; 
     405            tab(@li@+2),"//",id[@ii];
    406406         }
    407407      }
  • Singular/LIB/invar.lib

    rce7ba6 r917fb5  
    1 // $Id: invar.lib,v 1.8 1999-07-06 11:32:59 obachman Exp $
     1// $Id: invar.lib,v 1.9 1999-07-06 15:32:50 Singular Exp $
    22///////////////////////////////////////////////////////
    33// invar.lib
     
    77//////////////////////////////////////////////////////
    88
    9 version="$Id: invar.lib,v 1.8 1999-07-06 11:32:59 obachman Exp $";
     9version="$Id: invar.lib,v 1.9 1999-07-06 15:32:50 Singular Exp $";
    1010info="
    1111LIBRARY: invar.lib PROCEDURES FOR COMPUTING INVARIANTS OF (C,+)-ACTIONS
     
    490490     "                     ";
    491491     karl;
    492     // pause;
    493492     "                     ";
    494493  }
     
    529528       "                                  ";
    530529       karl;
    531       // pause;
    532530       "                                  ";
    533531    }
  • Singular/LIB/jordan.lib

    rce7ba6 r917fb5  
    11///////////////////////////////////////////////////////////////////////////////
    22
    3 version="$Id: jordan.lib,v 1.14 1999-07-06 11:32:59 obachman Exp $";
     3version="$Id: jordan.lib,v 1.15 1999-07-06 15:32:51 Singular Exp $";
    44info="
    55LIBRARY: jordan.lib  PROCEDURES TO COMPUTE THE JORDAN NORMAL FORM
     
    188188      {
    189189        for(j=ncols(eM0);j>=1;j--)
    190         {
     190        {
    191191          if(deg(eM0[j])>1)
    192192          {
     
    200200      {
    201201        for(j=ncols(eM0);j>=1;j--)
    202         {
     202        {
    203203          if(deg(eM0[j])>1)
    204204          {
     
    396396    print("//not enough entries in argument list");
    397397    matrix J[1][0];
    398     return(J); 
     398    return(J);
    399399  }
    400400  def eJ,bJ=jd[1..2];
     
    403403    print("//first entry in argument list not an ideal");
    404404    matrix J[1][0];
    405     return(J); 
     405    return(J);
    406406  }
    407407  if(typeof(bJ)!="list")
     
    409409    print("//second entry in argument list not a list");
    410410    matrix J[1][0];
    411     return(J); 
     411    return(J);
    412412  }
    413413  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 $
    22//                        1998/04/17
    33// author : Christian Gorzel email: gorzelc@math.uni-muenster.de
    4 // 
     4//
    55///////////////////////////////////////////////////////////////////////////////
    66
     
    2626 xdvi(s);             calls xdvi for dvi-file s
    2727         (parameters in square brackets [] are optional)
    28  
    29 GLOBAL VARIABLES: 
     28
     29GLOBAL VARIABLES:
    3030  TeXwidth, TeXnofrac, TeXbrack, TeXproj, TeXaligned, TeXreplace, NoDollars
    31                   are used to control the typesetting 
     31                  are used to control the typesetting
    3232    Call example texdemo; to become familiar with the features of latex.lib
    3333
     
    4545///////////////////////////////////////////////////////////////////////////////
    4646
    47 proc closetex(string fname, list #) 
     47proc closetex(string fname, list #)
    4848"USAGE:   closetex(fname[,style]); fname,style = string
    4949RETURN:  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; 
     50NOTE:    style overwrites the default setting latex2e; maybe latex,amstex,tex
     51         preceeding >> end ending \".tex\" may miss in fname;
    5252         overwriting an existing file is not possible
    5353EXAMPLE: example closetex; shows an example
    5454"
    5555{
    56   string default = "latex2e";   
     56  string default = "latex2e";
    5757  string s;
    5858  int i = 1;
     
    6161  if (size(#)) { default = #[1];}
    6262
    63   if (default=="latex2e" or default == "latex") 
     63  if (default=="latex2e" or default == "latex")
    6464   {  s = "\\end{document}"; flag = 1;}
    6565  if (default=="amstex") {s = "\\enddocument"; flag = 1;}
    6666  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))
    7070  {
    7171   while (fname[i]==">"){i++;}
    7272   fname = fname[i,size(fname)-i+1];
    73  
     73
    7474   if (size(fname)>=4)               // check if filename is ending with ".tex"
    7575   { if(fname[size(fname)-3,4]!=".tex") {fname = fname +".tex"; }
     
    7777   else {fname = fname + ".tex";}
    7878   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);}
    8282}
    8383example
     
    9292"USAGE:   tex(fname[,style]); fname,style = string
    9393RETURN:  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       
     94NOTE:    style overwrites the default setting latex2e; maybe latex,amstex,tex
     95         ending ".tex" may miss in fname
    9696EXAMPLE: example tex; shows an example
    9797"
    98 { 
     98{
    9999  string default = "latex2e";
    100   int retval;         
     100  int retval;
    101101  int i=1;
    102102
     
    107107   while (fname[i]==">"){i++;}
    108108   fname = fname[i,size(fname)-i+1];
    109  
     109
    110110   if (size(fname)>=4)               // check if filename is ending with ".tex"
    111111   { if(fname[size(fname)-3,4]!=".tex") {fname = fname +".tex"; }
     
    113113   else {fname = fname + ".tex";}
    114114   "calling ",default, " for :",fname,newline;
    115  
     115
    116116   retval = system("sh",default + " " +  fname);
    117117  }
     
    135135  tex("exp002","tex");
    136136  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>");
    139138  echo = 2;
    140139  system("sh","rm -i exp00?.*");
     
    142141///////////////////////////////////////////////////////////////////////////////
    143142
    144 proc opentex(string fname, list #)         
     143proc opentex(string fname, list #)
    145144"USAGE:   opentex(fname[,style]); fname,style = string
    146145RETURN:  nothing; writes as LaTeX2e header into a new file fname
    147146NOTE:    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
    149148EXAMPLE: example opentex; shows an example
    150149"
    151 { 
     150{
    152151  string default = "latex2e";
    153152  string s;
     
    157156  if (size(#)) { default = #[1];}
    158157
    159   if (default == "latex2e")          // the default  latex2e header 
    160   { s =     
     158  if (default == "latex2e")          // the default  latex2e header
     159  { s =
    161160      "\\documentclass[12pt]{article}" + newline +
    162161   //   "\\usepackage{fullpage,amsmath,amscd,amsthm,amssymb,amsxtra,latexsym,epsfig}" + newline +
    163162      "\\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 +
    167166      "\\newcommand{\\N}{{\\Bbb N}}" + newline +
    168167   // "\\newcommand{\\P}{{\\Bbb P}}" + newline +
    169       "\\newcommand{\\Q}{{\\Bbb Q}}" + newline + 
     168      "\\newcommand{\\Q}{{\\Bbb Q}}" + newline +
    170169      "\\newcommand{\\R}{{\\Bbb R}}" + newline +
    171170      "\\newcommand{\\T}{{\\Bbb T}}" + newline +
     
    175174  }
    176175  if (default == "latex")
    177   { s =     
     176  { s =
    178177      "\\documentstyle[12pt,amstex]{article}" + newline +
    179178      "\\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 +
    182181      "\\newcommand{\\N}{{\\Bbb N}}" + newline +
    183182   // "\\newcommand{\\P}{{\\Bbb P}}" + newline +
    184       "\\newcommand{\\Q}{{\\Bbb Q}}" + newline + 
     183      "\\newcommand{\\Q}{{\\Bbb Q}}" + newline +
    185184      "\\newcommand{\\R}{{\\Bbb R}}" + newline +
    186185      "\\newcommand{\\T}{{\\Bbb T}}" + newline +
     
    188187      "\\begin{document}";
    189188    flag = 1;
    190   } 
    191   if (default == "amstex") 
    192   { s = 
     189  }
     190  if (default == "amstex")
     191  { s =
    193192     "\\documentstyle{amsppt} " + newline + newline +
    194193     "\\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     "";
    201200    flag = 1;
    202201  }
     
    207206  if (not(flag)) { s = "";}
    208207
    209   if (size(fname))                     
     208  if (size(fname))
    210209  {
    211210   while (fname[i]==">"){i++;}
     
    219218   write(fname,s);
    220219  }
    221   else {return(s);}   
     220  else {return(s);}
    222221}
    223222example
     
    229228///////////////////////////////////////////////////////////////////////////////
    230229
    231 proc texdemo(list #) 
     230proc texdemo(list #)
    232231"USAGE:   texdemo();
    233232RETURN:  nothing; generates automatically a LaTeX2e file called: texlibdemo.tex
    234233         explaining the  features of latex.lib and its gloabl variables
    235 NOTE:    this proc takes a minutes         
     234NOTE:    this proc takes a minutes
    236235EXAMPLE: example texdemo; executes the generation
    237236"
     
    239238  string fname = "texlibdemo";
    240239
    241   if (size(#)) 
    242   { if (typeof(#[1])=="int") {TeXdemostart = #[1];} 
     240  if (size(#))
     241  { if (typeof(#[1])=="int") {TeXdemostart = #[1];}
    243242  }
    244243  system("random",TeXdemostart);
    245  
     244
    246245  if (size(#) ==2)
    247246  { if (typeof(#[2]) == "string") { fname = #[2];}
     
    274273///////////////////////////////////////////////////////////////////////////////
    275274
    276 proc texfactorize(string fname, poly f, list #) 
     275proc texfactorize(string fname, poly f, list #)
    277276"USAGE:   opentex(fname,f); fname = string; f = poly
    278277RETURN:  string, the poly as as product of its irreducible factors
    279278                 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
     280NOTE:    preceeding >> end ending \".tex\" may miss in fname
    282281EXAMPLE: example texfactorize; shows an example
    283282"
     
    295294  else { D = ""; }
    296295  TW = defined(TeXwidth);
    297   if (TW) {Tw = TeXwidth; TeXwidth = -1;} 
     296  if (TW) {Tw = TeXwidth; TeXwidth = -1;}
    298297  else {int TeXwidth = -1; export TeXwidth;}
    299298
     
    312311    if(size(g)>1 or (size(g)==1 and k>1))
    313312    { t = "(" + texpoly("",l[1][i]) + ")";}
    314     else { t =  texpoly("",l[1][i]);} 
     313    else { t =  texpoly("",l[1][i]);}
    315314    if (l[2][i]>1)
    316315    { t = t+"^{" +string(l[2][i]) + "}";}
     
    321320   if (TW) {TeXwidth = Tw;}
    322321  }
    323   if(size(fname)) 
     322  if(size(fname))
    324323  { i=1;
    325324    while (fname[i]==">"){i++;}
     
    342341  minpoly = a2 +a +3;
    343342  poly f = (a24x5 + x3)*a2x6*(x+1)^2;
    344   f; 
     343  f;
    345344  texfactorize("",f);
    346345}
     
    351350RETURN:  string, the map m from @r1 to @r2 preeceded by its name if m = string
    352351                 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
     353NOTE:    preceeding >> end ending \".tex\" may miss in fname
    355354EXAMPLE: example texmap; shows an example
    356355"
    357 { 
     356{
    358357  int saveDollars= defined(NoDollars);
    359358  int TX = defined(TeXwidth);
     
    371370  { int i;
    372371
    373     for(i=1;i<=size(TeXreplace);i++) 
     372    for(i=1;i<=size(TeXreplace);i++)
    374373    { if (TeXreplace[i][1]==s) {s= TeXreplace[i][2]; break;}}
    375374    return(s);
    376375  }
    377  
     376
    378377// --- store all actual informations
    379378  if(TX) { Tw = TeXwidth; TeXwidth = -1;}
     
    429428  t = t + texpoly("",@J[1]);
    430429  for (i=2;i<=n; i++)
    431   {if(defined(TeXaligned)) 
     430  {if(defined(TeXaligned))
    432431   { t = t + vrg + texpoly("",@J[i]); }
    433432   else { t = t + "\\\\" + newline + texpoly("",@J[i]);}
     
    479478  else {return(s);}
    480479}
    481 example 
     480example
    482481{ "EXAMPLE:"; echo = 2;
    483482  string fname = "tldemo";
     
    494493  texmap("",phi,r1,r2,"\\C");
    495494  kill r1,r2,TeXreplace,TeXaligned;
    496 }       
     495}
    497496///////////////////////////////////////////////////////////////////////////////
    498497
    499 proc texname(string fname, string s) 
     498proc texname(string fname, string s)
    500499"USAGE:   texname(fname,s);  fname,s = string
    501500RETURN:  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
     502NOTE:    preceeding >> end ending \".tex\" may miss in fname
    504503EXAMPLE: example texname; shows an example
    505504"
     
    528527  if (s[i]=="[") { anf = i+1;
    529528   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++;
    531530  // besser: while s[i]<> nwline : scan forward: end, return
    532531  }
     
    538537  n = n+5*(i-anf);
    539538  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;}
    541540   while(s[i] !=")"){ i++;}
    542541   if (i<>anf){st = st + "^{" + s[anf,i-anf] + "}"; n = n +5*(i-anf);}
     
    577576"USAGE:   texobj(fname,l); fname = string,l = list of Singular dataypes
    578577RETURN:  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
     579NOTE:    preceeding ">>" end ending ".tex" may miss in fname;
    581580EXAMPLE: example texobj; shows an example
    582581"
     
    591590 string D,DA,DE = "$","\\begin{equation*}" + newline,
    592591                     "\\end{equation*}"+ newline;
    593  string OB,CB = "(",")"; 
     592 string OB,CB = "(",")";
    594593 if (defined(TeXbrack))
    595594 {// if (TeXbrack=="(") {OB = "("; CB = ")";}
     
    610609 proc absterm(poly f)
    611610 { int k;
    612    
     611
    613612   for (k=1; k<=nvars(basering); k++)
    614613   { f = subst(f,var(k),0); }
     
    618617
    619618 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"
    621620   or typeof(#[1])=="number" or defined(TeXaligned)) { DA = D; DE = D; } }
    622621
     
    625624 for (k=1; k<=size(#); k++)
    626625 { def obj = #[k];
    627    if (typeof(obj) == "string") 
     626   if (typeof(obj) == "string")
    628627   { if (defined(`obj`))
    629      { if (typeof(`obj`)=="ideal") 
     628     { if (typeof(`obj`)=="ideal")
    630629       { Iname = obj; def e = `obj`;
    631630         kill obj; def obj = e; kill e;}
     
    635634   }
    636635   if (typeof(obj) == "int") { s = s + "  " + string(obj) + "  ";}
    637  
    638    if (typeof(obj) == "intvec") 
     636
     637   if (typeof(obj) == "intvec")
    639638   { s = s + "  (";
    640639     for(j=1; j<size(obj);j++) { s = s + string(obj[j]) + sep;}
     
    642641   }
    643642
    644    if (typeof(obj) == "number" ) 
     643   if (typeof(obj) == "number" )
    645644   { s = s + texpoly("",obj) + newline;
    646645   }
     
    654653   }
    655654
    656    if (typeof(obj) == "vector") 
     655   if (typeof(obj) == "vector")
    657656   { if (obj==0) { s = s  + "0" ;}
    658657     else
     
    665664    }
    666665
    667    if (typeof(obj) == "ideal") 
     666   if (typeof(obj) == "ideal")
    668667   { if (size(Iname))   // verwende hier align
    669668     { if (Tw==0) {TeXwidth = -1;}
     
    673672      //  { untereinander }
    674673      // else { hintereinander }
    675       // 
    676       // 
    677       //  s = s + Iname + "=" + texpoly("",obj,","); 
     674      //
     675      //
     676      //  s = s + Iname + "=" + texpoly("",obj,",");
    678677      //  siehe ebenso noch einmal am Ende : ! (TeXwidth <> 0 !? )
    679678
    680679       s =  s + "\\begin{array}{rcl}" + newline;
    681680       for (i=1;i<=size(matrix(obj));i++)
    682        { s =  s + Iname+ "_{" + string(i) + "} & = & " 
     681       { s =  s + Iname+ "_{" + string(i) + "} & = & "
    683682               + texpoly("",obj[i]);
    684683         if (i<size(matrix(obj))){ s = s  + "\\\\" + newline;}
     
    689688       Iname ="";
    690689     }
    691      else 
    692      { 
    693       if (TeXwidth==0) 
     690     else
     691     {
     692      if (TeXwidth==0)
    694693      { TeXwidth = -1;
    695694        obj= simplify(obj,2);
     
    711710        }
    712711        else   // linear
    713         { s = s + 
     712        { s = s +
    714713   "\\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]);
    717716             ineq = attrib(obj[j],"ineq");
    718717             if(!(size(ineq))) { ineq = "=" ; }
     
    725724                { if (t[1]!="-" and t[1]!= " " and nc ){sg = "+";}
    726725                  if  (t[1]=="-") { sg = "-"; nc =1; t=t[2,size(t)-1];}
    727                   if (t==" ") {sg ="";} 
     726                  if (t==" ") {sg ="";}
    728727                  l = l + " & " + sg + " & " + t;
    729728                }
     
    744743     if (defined(TeXaligned))
    745744     { s = s + texpoly("",obj,",");
    746      } 
     745     }
    747746     else
    748747     { s = s + newline + "\\begin{array}{c}" + newline +
    749                texpoly("",obj,", \\\\" + newline) + 
     748               texpoly("",obj,", \\\\" + newline) +
    750749                newline + "\\end{array}" + newline;
    751750     }
    752751    s = s + "\\right" + CB;
    753     } // end TeXwidth <> 0 
     752    } // end TeXwidth <> 0
    754753   }  // not Iname
    755754// s;
    756755  }
    757756
    758    if (typeof(obj) == "module") 
     757   if (typeof(obj) == "module")
    759758   { M = matrix(obj);
    760759     if (Tw ==0 or Tw > 9) { TeXwidth = -1;}
     
    762761     if (!(defined(TeXaligned)))
    763762     {  // 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++)
    766765      { l = "\\left" + OB + newline + "\\begin{array}{c}" + newline;
    767766        l = l + texpoly("",ideal(M[1..nrows(M),j]), " \\\\" + newline)
     
    772771     }
    773772     else    // TeXaligned
    774      { 
    775       for(j=1;j<=ncols(M);j++) 
     773     {
     774      for(j=1;j<=ncols(M);j++)
    776775      { s = s + "\\left" + OB + newline +
    777776           texpoly("",ideal(M[1..nrows(M),j]),",") + newline + "\\right" + CB;
     
    787786     l = "";
    788787   //  M = transpose(obj);
    789      s = s + "\\left" + OB + newline + 
     788     s = s + "\\left" + OB + newline +
    790789             "\\begin{array}{*{"+ string(ncols(obj)) + "}{c}" + "}"+ newline;
    791790     for(i=1;i<=nrows(obj);i++)
     
    794793     }
    795794     l = l + newline;
    796      s = s + l + "\\end{array}" + newline + 
     795     s = s + l + "\\end{array}" + newline +
    797796                 "\\right" + CB + newline;
    798797    TeXwidth = Tw;
    799798  }
    800  
     799
    801800   if (typeof(obj) == "intmat")
    802801   { nr,nc = nrows(obj),ncols(obj);
    803802     l = "";
    804      l =  "\\left" + OB + newline + 
     803     l =  "\\left" + OB + newline +
    805804          "\\begin{array}{*{"+ string(nc) + "}{r}}"+ newline;
    806805     for(i=1;i<=nr;i++)
    807      { for(j=1;j<=nc;j++) 
     806     { for(j=1;j<=nc;j++)
    808807       { l = l + string(obj[i,j]);
    809808         if (j <nc ) { l = l + " & ";}
     
    811810       }
    812811     }
    813      l = l + newline + "\\end{array}" + newline + 
     812     l = l + newline + "\\end{array}" + newline +
    814813             "\\right" + CB + newline;
    815     s = s + l; 
     814    s = s + l;
    816815  }
    817816
     
    854853///////////////////////////////////////////////////////////////////////////////
    855854
    856 proc texproc(string fname,string pname) 
     855proc texproc(string fname,string pname)
    857856"USAGE:   opentex(fname,pname); fname,pname = string
    858 RETURN:  string, the proc in a verbatim environment in TeX-typesetting 
     857RETURN:  string, the proc in a verbatim environment in TeX-typesetting
    859858                 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
     860NOTE:    preceeding >> end ending \".tex\" may miss in fname;
     861CAUTION: texproc cannot applied on itself correctly
    863862EXAMPLE: example texproc; shows an example
    864863"
     
    900899    { if(fname[size(fname)-3,4]!=".tex") {fname = fname +".tex"; }
    901900    }
    902     else {fname = fname + ".tex";} 
     901    else {fname = fname + ".tex";}
    903902    write(fname,s);
    904903  }
    905   else{return(s);}     
     904  else{return(s);}
    906905}
    907906example
     
    918917  }
    919918  export exp;
    920   texproc("","exp"); 
     919  texproc("","exp");
    921920}
    922921
    923922///////////////////////////////////////////////////////////////////////////////
    924923
    925 proc texring(string fname, def r, list #) 
     924proc texring(string fname, def r, list #)
    926925"USAGE:   texring(fname, r[,l]); fname = string; r = ring;
    927926         l=list of strings : controls the symbol for
    928          coefficient field etc. see example texdemo(); 
     927         coefficient field etc. see example texdemo();
    929928RETURN:  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
     930NOTE:    preceeding >> end ending \".tex\" may miss in fname;
    932931EXAMPLE: example texring; shows an example
    933932"
    934 { 
     933{
    935934  int i,galT,flag,mipo,nopar,Dollars,TB,TA;
    936935  string ob,cb,cf,en,s,t,savebrack; //opening bracket, closing br, coef.field
     
    939938
    940939  proc tvar(intvec v)
    941   { 
     940  {
    942941    int i,j,ldots;
    943942    string s;
    944    
     943
    945944    j = 1;
    946945    s = texpoly("",var(1));
    947    
     946
    948947    if (nvars(basering)==1) { return(s);}
    949948    if (nvars(basering)==2) { return(s + "," + texpoly("",var(2)));}
     
    957956        ldots =1;
    958957      }
    959       if (i== v[j]) 
     958      if (i== v[j])
    960959      { s = s + "," + texpoly("",var(i));
    961960        ldots =0;
     
    986985  if (size(#))
    987986  { if (typeof(#[1])=="list") { # = #[1];}
    988   } 
     987  }
    989988  for (i=1;i<=size(#);i++)
    990989  { flag =0;
     
    10181017   s = s + texpoly("",par(npars(r))) + ")";
    10191018  }                               // parameters done
    1020   if (!(galT) and mipo and minpoly!=0) 
     1019  if (!(galT) and mipo and minpoly!=0)
    10211020  { s = s + "/" + list(parsp(string(minpoly),0))[1];}
    10221021  s = s + ob;
     
    10291028  if (typeof(r)=="qring")
    10301029  { ideal @I = ideal(r);
    1031     if (defined(TeXbrack)) 
     1030    if (defined(TeXbrack))
    10321031    {
    1033       TB =1; savebrack = TeXbrack; 
     1032      TB =1; savebrack = TeXbrack;
    10341033      if (TeXbrack!= "<" and TeXbrack!="(") { TeXbrack = "<";}
    10351034    }
     
    10441043  }
    10451044
    1046   if (Dollars) 
     1045  if (Dollars)
    10471046  { kill NoDollars;
    10481047    s =  "$" + s + "$";
     
    10601059  }
    10611060  else{return(s);}
    1062 } 
     1061}
    10631062example
    10641063{ "EXAMPLE:"; echo=2;
    10651064  ring r0 = 0,(x,y,z),dp;       // short varnames polynomial ordering
    10661065  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
    10681067  texring("",r7);
    10691068  ring r1 = 0,(x1,x2,y1,y2),wp(1,2,3,4);
     
    10741073  texring("",rr);
    10751074  ring r;
    1076   texring("",r); 
     1075  texring("",r);
    10771076  ring rabc =(0,t1,t2,t3),(x,y),dp;  // parameters
    10781077  texring("",rabc);
     
    10821081  texring("",ralg,"mipo");
    10831082  ring r49=(49,a),x,dp;              // Galoisfield
    1084   texring("",r49); 
     1083  texring("",r49);
    10851084  setring r0;
    10861085  ideal i = x2-z,xy2+1;
     
    10941093  intvec v = 5,6;
    10951094  texring("",rxy,v);
    1096   texring("",r0,"C","{"); 
     1095  texring("",r0,"C","{");
    10971096  texring("",ralg,"k");
    10981097  texring("",r7,"^G");
     
    11101109proc rmx(string fname)
    11111110"USAGE:   rmx(fname); fname = string
    1112 RETURN:  nothing; removes .log and .aux files associated to file <fname>     
     1111RETURN:  nothing; removes .log and .aux files associated to file <fname>
    11131112         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           
     1113NOTE:    if fname ends by .dvi or .tex
     1114         fname.dvi or fname.dvi and fname.tex will be deleted, too
    11161115EXAMPLE: example rmx; shows an example
    11171116"
    11181117{
    11191118  int i,suffix= 1,0;
    1120   int retval; 
     1119  int retval;
    11211120
    11221121  if (size(fname))
     
    11281127     if (fname[size(fname)-3,4]==".dvi") { suffix = 1; }
    11291128     if (suffix) { fname = fname[1,size(fname)-4]; }
    1130    } 
     1129   }
    11311130   retval = system("sh","rm " + fname + ".aux");
    11321131   retval = system("sh","rm " + fname + ".log");
     
    11371136  {" -- Need a filename ";
    11381137    return();
    1139   } 
     1138  }
    11401139}
    11411140example
     
    11551154  rmx("exp002.tex");  // removes aux, log, dvi and tex file of exp002
    11561155  echo = 0;
    1157   print("remaining files will be deleted after pressing <RETURN> ");
    1158   pause;
     1156  pause("remaining files will be deleted after pressing <RETURN>");
    11591157  echo = 2;
    11601158  system("sh","rm -i exp00?.*");
     
    11721170  int i=1;
    11731171  int retval;
    1174   string default = "xdvi"; 
    1175  
     1172  string default = "xdvi";
     1173
    11761174  if (size(#)) {default = string(#[1]);}
    1177  
     1175
    11781176  if (size(fname))
    11791177  {
     
    11831181   if (size(fname)>=4)
    11841182   { 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
    11881186   retval = system("sh",default + " " +  fname + " &");
    11891187  }
     
    12031201  xdvi("exp001");
    12041202  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>");
    12071204  echo = 2;
    1208   system("sh","rm -i exp00?.*"); 
     1205  system("sh","rm -i exp00?.*");
    12091206}
    12101207///////////////////////////////////////////////////////////////////////////////
     
    12131210"USAGE:   texpoly(fname,p[,l]); fname = string; p = poly,ideal; l formation str
    12141211RETURN:  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
     1213NOTE:    preceeding ">>" end ending ".tex" may miss in fname;
    12171214EXAMPLE: example texpoly; shows an example
    12181215"
    1219 { 
     1216{
    12201217  def @r = basering;
    12211218
     
    12251222  string sign,cfmt,pt,s,bg,t,monomt,  lnbreak;
    12261223  string sep = newline;
    1227   int i,b,b2,n, msz,linesz, count,k; 
     1224  int i,b,b2,n, msz,linesz, count,k;
    12281225  int realT, parT, galT;
    12291226  int C = 2 + defined(TeXdisplay);
     
    12341231  if (typeof(p)  == "ring" or typeof(p) == "qring")
    12351232  { " -- Call  texring  instead "; return();}
    1236   if (find(notvalid,typeof(p))) 
     1233  if (find(notvalid,typeof(p)))
    12371234  { " -- Call  texobj  instead "; return();}
    12381235  if (typeof(p)  == "map")
     
    12471244
    12481245  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);}
    12521249    if (s=="     -Inf") { return("\\-infty",6);}
    12531250    if (s[7]=="-"){t ="-";}
    12541251    if (s[8]<>"0"){t = t + s[8];}
    12551252    if (s[9]<>"0" or s[8]<>"0"){t = t + s[9];}
    1256     if (size(t)) 
     1253    if (size(t))
    12571254    { if (t=="1") {return(s[1,5]+"*10",21);}
    12581255      if (size(t)>1) {return(s[1,5]+"*10^{"+t+"}",21+2*size(t));}
     
    12651262  { int i,j = 1,1;
    12661263    string t;
    1267    
     1264
    12681265    if (short)
    1269     { t =s[1]; 
     1266    { t =s[1];
    12701267     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);}
    12721269    }
    12731270    else
    12741271    { return(parselong(s+"!"));}
    12751272  }
    1276  
     1273
    12771274  if (defined(TeXdisplay)) { bg = "& ";}
    12781275  if (!(defined(TeXwidth))) { int TeXwidth = -1; export TeXwidth;}
     
    12801277
    12811278// -- Type check
    1282  
     1279
    12831280 if (typeof(p)=="string")
    12841281  { if(defined(`p`))
    1285     { pt = p + " = "; 
    1286       p = `p`; 
     1282    { pt = p + " = ";
     1283      p = `p`;
    12871284    }
    12881285  }
    12891286  if (typeof(p)=="poly" or typeof(p)=="number") {I = p;}
    1290  
    1291   if (typeof(p)=="ideal") 
     1287
     1288  if (typeof(p)=="ideal")
    12921289  { I = p;
    12931290    if(size(#)){ sep = #[1];}
    12941291  }
    12951292
    1296   if (I==0) 
     1293  if (I==0)
    12971294  { if (!(defined(NoDollars))){return("$0$");}
    12981295    else {return("0");}
    12991296  }
    13001297
    1301 // -- Type check ende 
    1302 
    1303 //--------------------- 
     1298// -- Type check ende
     1299
     1300//---------------------
    13041301
    13051302
    13061303//------- set flags: --------------------------------------------------------
    1307    
     1304
    13081305  if (size(#))
    13091306  { if (typeof(#[1])=="int") { linesz = #[1];}
     
    13171314  { t = charstr(@r)[1,i-1];
    13181315    galT = (t <> string(char(@r)));  // the char is not the same as the ...
    1319   } 
     1316  }
    13201317  i = 0;
    1321  
     1318
    13221319//------- parse the polynom
    13231320  pt = bg;
    1324  
     1321
    13251322 for(k=1;k<=size(matrix(I));k++)
    13261323 { i = 0; linesz = 0; count =0;
    1327    sign =""; 
     1324   sign ="";
    13281325   f = I[k];
    13291326   if (f==0) { pt = pt + "0";}
     
    13321329
    13331330// ------ tex the coefficient
    1334     monom = lead(f);   
    1335     f = f - monom;       
     1331    monom = lead(f);
     1332    f = f - monom;
    13361333    cfm = leadcoef(monom);
    13371334    if (cfm*1 != 0) { monom = monom/cfm;} // the normalized monom
    13381335    s = string(monom) + "!";              // add a terminating sign
    13391336    cfmt = "";
    1340    
     1337
    13411338    if (defined(TeXreplace)) { short =0;}  // this is essential
    13421339    cfmt = string(cfm);
     
    13621359     if (b) {b++;}
    13631360     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))
    13661363       { monomt = cfmt; msz = 3*size(monomt);}
    13671364       else
     
    13771374// -- now parse the monom
    13781375    if (monom <> 1)
    1379     { i = 1;   
     1376    { i = 1;
    13801377      if(short)
    13811378      { while(s[i]<>"!")
    1382         { monomt = monomt + s[i]; i++; 
     1379        { monomt = monomt + s[i]; i++;
    13831380          b = i;
    13841381          msz = msz + 3; // it was a single lettered var
     
    13961393      }
    13971394    }
    1398    
     1395
    13991396
    14001397
     
    14031400
    14041401   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;
    14071404   }
    1408    else { linesz = linesz + msz; }  // 3 for sign 
     1405   else { linesz = linesz + msz; }  // 3 for sign
    14091406    pt = pt + sign + monomt;
    14101407   sign = "+";
     
    14301427   }
    14311428  else {return(pt);}
    1432 }   
     1429}
    14331430example
    14341431{ "EXAMPLE:"; echo =2;
     
    14371434  texpoly("",f);
    14381435  texpoly("",2x2y23z);
    1439  
     1436
    14401437
    14411438  ring rr= real,(x,y),dp;
     
    14481445  f;
    14491446  texpoly("",f);
    1450 }     
     1447}
    14511448
    14521449static proc parsp(string cfmt, int b)
     
    14891486// sec parameter to see if in parsp a fraction follows
    14901487{ int i,j =1,-1;
    1491   int b,k,jj,mz;                         // begin and end 
     1488  int b,k,jj,mz;                         // begin and end
    14921489  int saveshort=short;
    14931490            string t,c,vn,nom,denom,sg;
     
    17841781 if(system("with","Namespaces")) { exportto(Current,splt); }
    17851782 else { export splt; }
    1786                
     1783
    17871784// string fname = "texlibdemo.tex";
    17881785 string nl = newline;
     
    18111808 Singular in \\LaTeX \\ text.
    18121809 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,
    18151812 every document does not show merely how the \\verb|latex.lib| works
    18161813 but looks differently in large parts.");
     
    18431840ev);
    18441841
    1845 write(fname,"A flag means in the following that a variable with the indicated 
     1842write(fname,"A flag means in the following that a variable with the indicated
    18461843name has to be defined. Usually it is from type \\verb|int|.");
    18471844
     
    18581855  TeXreplace    : list, entries twoelemented list for replacing symbols
    18591856  NoDollars     : (int) flag, suppresses surrounding \\$ signs
    1860    
     1857
    18611858" +
    18621859ev);
     
    19131910"> ring r0=0,(x,y,z),dp;                       texring(fname,r0);
    19141911> poly g = -x2y +2y13z +1; g;                 texpoly(fname,g);" +nl +
    1915  string(g) + nl + 
     1912 string(g) + nl +
    19161913"> poly f = randompoly(5,25,25); f;            texpoly(fname,f);" +nl +
    19171914 splt(string(f)) + nl2 +
     
    19301927write(fname,
    19311928bv +
    1932 "> f = f/280; 
     1929"> f = f/280;
    19331930> texpoly(fname,f);" +nl +
    1934  splt(string(f)) + nl2 + 
     1931 splt(string(f)) + nl2 +
    19351932ev
    19361933);
     
    19441941 if(system("with","Namespaces")) { exportto(Current, r1); }
    19451942 else { export r1; }
    1946  poly g = -2*x1 +x4 -1;                   
     1943 poly g = -2*x1 +x4 -1;
    19471944 poly f = randompoly(5,25,25); f; export f;
    19481945write(fname,
     
    19501947"> ring r1=7,(x1,x2,x3,x4),Ds;                 texring(fname,r1);
    19511948> poly g =  -2*x1 +x4 -1; g;                  texpoly(fname,g);" +nl +
    1952  string(g) + nl + 
     1949 string(g) + nl +
    19531950"> poly f = randompoly(5,25,25); f;            texpoly(fname,f);" +nl +
    1954  splt(string(f)) + nl2 + 
     1951 splt(string(f)) + nl2 +
    19551952ev
    1956 ); 
     1953);
    19571954  texring(fname,r1);             write(fname,lb);
    1958   texpoly(fname,g);              write(fname,lb); 
     1955  texpoly(fname,g);              write(fname,lb);
    19591956  texpoly(fname,f);              write(fname,lb);
    19601957write(fname,"\\Line");
     
    19651962" +nl);
    19661963 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;
    19681965 poly f = randompoly(5,25,25); f;
    19691966write(fname,
     
    19711968"> ring r2=0,(x(1..5),y(1..2)),(ds(5),dp(2));  texring(fname,r2);
    19721969> poly g = -y(1)*x(5) +y(1)*x(2); g;          texpoly(fname,g);"  +nl +
    1973  string(g) + nl + 
     1970 string(g) + nl +
    19741971"> poly f = randompoly(5,25,25); f;            texpoly(fname,f);" +nl +
    1975  splt(string(f)) + nl2 + 
    1976 ev 
    1977 ); 
     1972 splt(string(f)) + nl2 +
     1973ev
     1974);
    19781975  texring(fname,r2);             write(fname,lb);
    1979   texpoly(fname,g);              write(fname,lb); 
     1976  texpoly(fname,g);              write(fname,lb);
    19801977  texpoly(fname,f);              write(fname,lb);
    19811978write(fname,"\\Line");
     
    19881985 if(system("with","Namespaces")) { exportto(Current, r3); }
    19891986 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;
    19911988 poly f = randompoly(5,25,25); f;            export f;
    19921989write(fname,
     
    19941991"> ring r3=0,(x_1,x_2,x_3),wp(3,2,1);          texring(fname,r3);
    19951992> 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 +
    19971994"> poly f = randompoly(5,25,25); f;            texpoly(fname,f);" +nl +
    1998  splt(string(f)) + nl2 + 
     1995 splt(string(f)) + nl2 +
    19991996ev
    2000 ); 
     1997);
    20011998  texring(fname,r3);             write(fname,lb);
    2002   texpoly(fname,g);              write(fname,lb); 
     1999  texpoly(fname,g);              write(fname,lb);
    20032000  texpoly(fname,f);              write(fname,lb);
    20042001write(fname,"\\Line");
     
    20082005" A ring with real coefficients and matrix ordering.
    20092006" +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;
    20122009 poly f = randompoly(5,25,25); f;
    20132010write(fname,
     
    20152012"> ring rr =real,(x,y),M(1,2,3,4);             texring(fname,rr);
    20162013> poly g = -1.2e-10*x + y +1; g;              texpoly(fname,g);" +nl +
    2017  string(g) + nl + 
     2014 string(g) + nl +
    20182015"> poly f = randompoly(5,25,25); f;            texpoly(fname,f);" +nl +
    2019  splt(string(f)) + nl2 + 
     2016 splt(string(f)) + nl2 +
    20202017ev
    2021 ); 
     2018);
    20222019  texring(fname,rr);             write(fname,lb);
    2023   texpoly(fname,g);              write(fname,lb); 
     2020  texpoly(fname,g);              write(fname,lb);
    20242021  texpoly(fname,f);              write(fname,lb);
    20252022write(fname,"\\Line");
     
    20292026" A ring in characteristic 0 and indexed parameters.
    20302027" +nl);
    2031  ring r0t=(0,s,t),(x,y),dp; 
     2028 ring r0t=(0,s,t),(x,y),dp;
    20322029 if(system("with","Namespaces")) { exportto(Current, r0t); }
    20332030 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;
    20352032 poly f = randompoly(5,25,25); f;  export f;
    20362033write(fname,
     
    20382035"> ring r0t=(0,s,t),(x,y),dp;                  texring(fname,r0t);
    20392036> poly g = 8*(-s+2t)/(st+t3)*x + t2*x -1; g;  texpoly(fname,g);" +nl +
    2040  string(g) + nl + 
     2037 string(g) + nl +
    20412038"> poly f = randompoly(5,25,25); f;            texpoly(fname,f);" +nl +
    2042  splt(string(f)) + nl2 + 
     2039 splt(string(f)) + nl2 +
    20432040ev
    2044 ); 
     2041);
    20452042  texring(fname,r0t);            write(fname,lb);
    2046   texpoly(fname,g);              write(fname,lb); 
     2043  texpoly(fname,g);              write(fname,lb);
    20472044  texpoly(fname,f);              write(fname,lb);
    20482045write(fname,"\\Line");
     
    20532050" A ring in characteristic 11 and indexed parameters.
    20542051" +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;
    20572054 poly f = randompoly(5,25,25); f;
    20582055write(fname,
     
    20602057"> ring rt=(11003,t1,t2,t3),(X,Y),dp;             texring(fname,rt);
    20612058> poly g = 8*(-t1+t2)/(t1+t3)*X + t2*Y -1; g; texpoly(fname,g);" +nl +
    2062  string(g) + nl + 
     2059 string(g) + nl +
    20632060"> poly f = randompoly(5,25,25); f;            texpoly(fname,f);" +nl +
    2064  splt(string(f)) + nl2 + 
     2061 splt(string(f)) + nl2 +
    20652062ev
    2066 ); 
     2063);
    20672064  texring(fname,rt);             write(fname,lb);
    2068   texpoly(fname,g);              write(fname,lb); 
     2065  texpoly(fname,g);              write(fname,lb);
    20692066  texpoly(fname,f);              write(fname,lb);
    20702067write(fname,"\\Line");
     
    20742071" A ring over an algebraic extension in char 7.
    20752072" +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;
    20792076 poly f = randompoly(5,25,25); f;
    20802077write(fname,
    20812078bv +
    2082 "> ring ralg = (7,a),x,dp;               
     2079"> ring ralg = (7,a),x,dp;
    20832080> minpoly = a2-a+3;                           texring(fname,ralg);
    20842081> poly g = -(2a13 +a)*x2 + a2*x -a +1; g;    texpoly(fname,g);" +nl +
    2085  string(g) + nl + 
     2082 string(g) + nl +
    20862083"> poly f = randompoly(5,25,25); f;            texpoly(fname,f);" +nl +
    2087  splt(string(f)) + nl2 + 
     2084 splt(string(f)) + nl2 +
    20882085ev
    2089 ); 
     2086);
    20902087  texring(fname,ralg);           write(fname,lb);
    2091   texpoly(fname,g);              write(fname,lb); 
     2088  texpoly(fname,g);              write(fname,lb);
    20922089  texpoly(fname,f);              write(fname,lb);
    20932090write(fname,"\\Line");
     
    20952092// -8-------- the same ring a in 7 ralg, defined with gftables -- F_49 -------
    20962093write(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
    20982095with primitive element in the Galoisfield $\\F_{49}$." +nl);
    20992096 ring r49 =(49,a),x,dp;
    21002097 if(system("with","Namespaces")) { exportto(Current, r49); }
    21012098 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;
    21032100 poly f = randompoly(5,25,25); f;
    21042101write(fname,
     
    21062103"> ring r49 =(49,a),x,dp;                     texring(fname,r49);
    21072104> poly g = -(2a13 +a)*x2 + a2*x -a +1; g;    texpoly(fname,g);" +nl +
    2108  string(g) + nl + 
     2105 string(g) + nl +
    21092106"> poly f = randompoly(5,25,25); f;           texpoly(fname,f);" +nl +
    2110  splt(string(f)) + nl2 + 
     2107 splt(string(f)) + nl2 +
    21112108ev
    2112 ); 
     2109);
    21132110  texring(fname,r49);            write(fname,lb);
    2114   texpoly(fname,g);              write(fname,lb); 
     2111  texpoly(fname,g);              write(fname,lb);
    21152112  texpoly(fname,f);              write(fname,lb);
    21162113write(fname,"\\Line");
     
    21212118" +nl);
    21222119 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;
    21252122 poly f = randompoly(5,25,25); f;
    21262123write(fname,
     
    21292126> minpoly = i2 +1;                            texring(fname,ri);
    21302127> poly g = -(i+1)*x +2i2y2 +i +x; g;          texpoly(fname,g);" +nl +
    2131  string(g) + nl + 
     2128 string(g) + nl +
    21322129"> poly f = randompoly(5,25,25); f;            texpoly(fname,f);" +nl +
    2133  splt(string(f)) + nl2 + 
     2130 splt(string(f)) + nl2 +
    21342131ev
    2135 ); 
     2132);
    21362133  texring(fname,ri);              write(fname,lb);
    2137   texpoly(fname,g);              write(fname,lb); 
     2134  texpoly(fname,g);              write(fname,lb);
    21382135  texpoly(fname,f);              write(fname,lb);
    21392136write(fname,"\\Line");
     
    21442141" +nl);
    21452142 setring r0;
    2146  ideal I = x2-y,y+z2, xy;           
     2143 ideal I = x2-y,y+z2, xy;
    21472144 I = std(I);
    21482145string sI = string(I);
     
    21552152> string(I);" + nl +
    21562153splt(sI) + nl +
    2157 "> qring qr = I;                   texring(fname,qr);" + 
     2154"> qring qr = I;                   texring(fname,qr);" +
    21582155ev
    2159 ); 
     2156);
    21602157  texring(fname,qr);              write(fname,lb);
    21612158
     
    21702167// changing the brackets
    21712168
    2172 write(fname,"If the displayed  and defaulted brackets for the ring are not 
     2169write(fname,"If the displayed  and defaulted brackets for the ring are not
    21732170the rigth one,
    21742171correct brackets my be passed over to \\verb|texring|",nl,
     
    21802177write(fname,
    21812178bv +
    2182 "> texring(fname,rr,\"{{\");" + nl + 
     2179"> texring(fname,rr,\"{{\");" + nl +
    21832180ev
    2184 ); 
     2181);
    21852182
    21862183texring(fname,rr,"{{");
     
    21882185write(fname,
    21892186bv +
    2190 "> texring(fname,r2,\"[\");" + nl + 
     2187"> texring(fname,r2,\"[\");" + nl +
    21912188ev
    2192 ); 
     2189);
    21932190
    21942191texring(fname,r2,"[");
     
    21962193write(fname,nl2);
    21972194
    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 
     2195write(fname,nl2,"The brackets around the ideal in a quotientring can be
     2196changed  with the global variable \\verb|TeXbrack| (see the section
    22002197{\\tt ideal}).",nl);
    22012198
     
    22042201bv +
    22052202"> string TeXbrack = \"<\";
    2206 > texring(fname,qr); 
     2203> texring(fname,qr);
    22072204> kill TeXbrack;" + nl +
    22082205ev
    2209 ); 
     2206);
    22102207
    22112208string TeXbrack = "<"; export TeXbrack;
     
    22232220write(fname,
    22242221bv +
    2225 "> texring(fname,r3,\"\\\\C\");" + nl + 
     2222"> texring(fname,r3,\"\\\\C\");" + nl +
    22262223ev
    2227 ); 
     2224);
    22282225
    22292226texring(fname,r3,"\\C");
     
    22322229write(fname,nl2, "naechster abschnitt stimmt nicht"+lb,nl2);
    22332230
    2234 write(fname,"Predefined and accepted values here are 
     2231write(fname,"Predefined and accepted values here are
    22352232\\verb|\"\\\\C\"|, \\verb|\"\\\\R\"|,
    22362233 \\verb|\"\\\\C\"|, \\verb|\"k\"|, \\verb|\"K\"|, \\verb|\"R\"|.");
    2237 write(fname,"The latter are useful to print a ring whose coefficientfield is 
     2234write(fname,"The latter are useful to print a ring whose coefficientfield is
    22382235defined by an algebraic extension. Now the parameters will omitted completely.
    22392236");
    2240 write(fname,"The user may specify then the field in more detail."+lb,nl2); 
     2237write(fname,"The user may specify then the field in more detail."+lb,nl2);
    22412238
    22422239write(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| 
     2240the coefficientfield. If the letter is k, K or R it  forces \\verb|texring|
    22442241not to print the parameters. This will be useful for a ring described by an
    22452242algebraic extension",nl2);
     
    22472244write(fname,
    22482245bv +
    2249 "> texring(fname,ralg,\"k\");" + nl + 
     2246"> texring(fname,ralg,\"k\");" + nl +
    22502247ev
    2251 ); 
     2248);
    22522249
    22532250texring(fname, ralg,"k");
    2254  
     2251
    22552252// texobj(fname,"with k = ");
    22562253
     
    22602257write(fname,
    22612258bv +
    2262 "> texring(fname,ralg,\"mipo\");" + nl + 
     2259"> texring(fname,ralg,\"mipo\");" + nl +
    22632260ev
    2264 ); 
     2261);
    22652262
    22662263texring(fname, ralg,"mipo");
     
    22782275"> intvec v = 5,6;
    22792276> texring(fname,r2,v);
    2280 > kill v;" + nl + 
     2277> kill v;" + nl +
    22812278ev
    2282 ); 
     2279);
    22832280
    22842281intvec v = 5,6;
     
    22922289write(fname,
    22932290bv +
    2294 "> texring(fname,r1,1);" + nl + 
     2291"> texring(fname,r1,1);" + nl +
    22952292ev
    2296 ); 
     2293);
    22972294texring(fname,r1,1);
    22982295
     
    23072304write(fname,
    23082305bv +
    2309 "> texring(fname,r0,\"^G\");" + nl + 
     2306"> texring(fname,r0,\"^G\");" + nl +
    23102307ev
    2311 ); 
     2308);
    23122309
    23132310texring(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
     2312write(fname,nl2,"All these arguments may be passed over in any order as
     2313optional arguments, but it may give a rather nonsense result if too much of
    23172314them  are used at the same time",nl);
    23182315
    23192316write(fname,
    23202317bv +
    2321 "> texring(fname,r3,\"\\\\R\",1,\"{{\",\"^G\");" + nl + 
     2318"> texring(fname,r3,\"\\\\R\",1,\"{{\",\"^G\");" + nl +
    23222319ev
    2323 ); 
     2320);
    23242321
    23252322texring(fname, r3,"\\R",1,"<<","^G");
     
    23442341  }
    23452342  else { texdemopart=2; }
    2346  
     2343
    23472344 "Continuing Part2 of " + fname + nl;
    23482345
     
    23522349write(fname,"The command \\verb|texfactorize| calls internally the Singular
    23532350command \\verb|factorize| and returns the product of the irreducible factors.
    2354 at the present it is not possible to pass the optional arguments of 
     2351at the present it is not possible to pass the optional arguments of
    23552352\\verb|factorize| through \\verb|texfactorize|."+lb);
    23562353
     
    24072404// TeXreplace
    24082405// ---------------------------------------------
    2409 write(fname,"The global variable \\verb|TeXreplace| must be a list 
     2406write(fname,"The global variable \\verb|TeXreplace| must be a list
    24102407whose entries are twoelemented lists again; wherby the first entry is the
    24112408word 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
    24132410anmd texmap" + lb +
    24142411"It is most useful to write the greece letters correctly. Notice that it
    24152412is necesarry to write
    2416 a double backslash \\verb|\\\\\ | at the beginning of 
     2413a double backslash \\verb|\\\\\ | at the beginning of
    24172414a \\TeX \\ symbol." + lb);
    24182415
     
    24732470
    24742471write(fname,"If \\verb|TeXreplace| is defined, the translation into \\TeX  code
    2475 runs significantly slower, because every polynomial will be compiled in the 
     2472runs significantly slower, because every polynomial will be compiled in the
    24762473\\verb|non short| mode."+ lb );
    24772474
     
    24802477//linebreaking   TeXwdith
    24812478//-----------------------------------------------------------------------
    2482 write(fname,"The global variable \\verb|TeXwidth| controls the wrapping of 
     2479write(fname,"The global variable \\verb|TeXwidth| controls the wrapping of
    24832480polynomials; possible values are:" + lb);
    24842481
     
    24892486" -1 & \\text{no linebreaking} \\\\ ",
    24902487"  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
    24922489term} \\\\ ",
    24932490" > 5 & \\text{wrapping after n letters corresponding x} ",
     
    24952492"\\]",nl);
    24962493
    2497 write(fname,"Notice that two letters like x counts as three subscripts or 
     2494write(fname,"Notice that two letters like x counts as three subscripts or
    24982495exponents",nl);
    24992496
     
    25032500
    25042501write(fname,"\\verb|TeXwidth| is the only global variable which will be defined
    2505 automatically from Singular. Its default value is -1 
     2502automatically from Singular. Its default value is -1
    25062503i.e. wrapping is set off."+ lb);
    25072504
     
    25772574//write(fname,nl2,"\\Line",nl);
    25782575
    2579 write(fname,"As seen there are two possibilities to tex a polynomial. The 
     2576write(fname,"As seen there are two possibilities to tex a polynomial. The
    25802577command \\verb|texpoly| is the most basic one and sets the polynomials in
    25812578textmode. Notice that it counts the length of the terms convenientely." + lb +
     
    25882585bv +
    25892586"> setring r3;
    2590 > texpoly(fname,f/180);" + nl + 
     2587> texpoly(fname,f/180);" + nl +
    25912588ev);
    25922589
    25932590
    25942591setring r3;
    2595 texpoly(fname,f/180); 
     2592texpoly(fname,f/180);
    25962593
    25972594write(fname,nl2, "Now the same again with \\verb|texobj| "+ lb,nl);
     
    26082605write(fname,"Some explaination how it works: if \\verb|texobj| is called for
    26092606a 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
    26112608the displaymode."+lb,nl2);
    26122609
     
    26182615
    26192616
    2620 ring r; 
     2617ring r;
    26212618ideal I = 3xz5+x2y3-3z,7xz5+y3z+x-z,-xyz2+4yz+2x;
    26222619
     
    26722669 ideal I = -x(1) + 2*x(3) + x(5),x(2) -x(4) +2*x(5) -1,8*x(1) +x(4) +2;
    26732670
    2674  TeXwidth = 0; 
    2675 write(fname,
    2676 bv +
    2677 "> ring r5 = 0,x(1..5),dp ; 
     2671 TeXwidth = 0;
     2672write(fname,
     2673bv +
     2674"> ring r5 = 0,x(1..5),dp ;
    26782675> ideal I = -x(1) + 2*x(3) + x(5),x(2) -x(4) +2*x(5) -1,8*x(1) +x(4) +2;
    26792676> string(I);" + nl +
    2680 splt(string(I)) + nl2 + 
    2681 "> TeXwidth = 0; 
     2677splt(string(I)) + nl2 +
     2678"> TeXwidth = 0;
    26822679> texobj(fname,I);" +
    26832680//> TeXwidth = 0;" +
    26842681ev
    2685 ); 
     2682);
    26862683
    26872684 texobj(fname,I);
    26882685// TeXwidth = -1;
    2689  
     2686
    26902687 setring r;
    26912688 ideal J;
     
    27142711write(fname,
    27152712bv +
    2716 "> texobj(fname,J);" + 
     2713"> texobj(fname,J);" +
    27172714ev
    2718 ); 
    2719  
     2715);
     2716
    27202717 texobj(fname,J);
    27212718//% TeXwidth = 0; TeXbrackets
     
    27312728ev);
    27322729
    2733 setring r; 
     2730setring r;
    27342731ideal I = 3xz5+x2y3-3z,7xz5+y3z+x-z,-xyz2+4yz+2x;
    27352732if(system("with","Namespaces")) { exportto(Current, r, I); }
     
    27652762// int TeXwidth =-1;
    27662763write(fname,bv +
    2767 "> ring r1=0,(x,y,z),dp; 
     2764"> ring r1=0,(x,y,z),dp;
    27682765> ring r2=0,(u,v),dp;
    27692766> map phi = r1,u2,uv -v,v2;
     
    27862783write(fname,"\\item",nl);
    27872784
    2788 write(fname,"If the map will be called by its name \\verb|texmap| can in 
     2785write(fname,"If the map will be called by its name \\verb|texmap| can in
    27892786combination with \\verb|TeXreplace| print the name of the map." + lb ,nl);
    27902787
     
    27922789"> list TeXreplace;
    27932790> TeXreplace[1] = list(\"phi\",\"\\\\phi\");
    2794 > texmap(fname,\"phi\",r1,r2);" + nl + 
     2791> texmap(fname,\"phi\",r1,r2);" + nl +
    27952792ev);
    27962793
     
    28142811write(fname,"\\item",nl);
    28152812
    2816 write(fname,nl2,"The addtional arguments for \\verb|rings| may be passed over 
     2813write(fname,nl2,"The addtional arguments for \\verb|rings| may be passed over
    28172814in \\verb|texmap|.",nl);
    28182815
    2819 write(fname,"In the following form the arguments are valid for both 
     2816write(fname,"In the following form the arguments are valid for both
    28202817\\verb|rings|.",nl);
    28212818
     
    28672864texobj(fname,H);
    28682865
    2869 // probiere auch V = 0 bei texobj aus 
     2866// probiere auch V = 0 bei texobj aus
    28702867matrix M = H;
    28712868
     
    29052902//------------------------------------------------------------------------
    29062903
    2907 write(fname,"All the features for \\verb|poly| and the features for 
     2904write(fname,"All the features for \\verb|poly| and the features for
    29082905\\verb|intmat| or \\verb|intvec| hold here, too.");
    29092906
     
    29122909write(fname,bv +
    29132910"> TeXwidth = 1;",
    2914 "> texobj(fname,H);", 
     2911"> texobj(fname,H);",
    29152912"> TeXwidth = -1;",
    29162913ev );
    29172914
    29182915TeXwidth = 1;
    2919 texobj(fname,H); 
     2916texobj(fname,H);
    29202917TeXwidth = -1;
    29212918
     
    29362933
    29372934write(fname,bv +
    2938 "> int TeXnofrac;", 
     2935"> int TeXnofrac;",
    29392936"> texobj(fname,M);",
    29402937"> kill TeXnofrac;",
     
    30022999> v;" + nl +
    30033000string(v) + nl +
    3004 "> nrows(v);" + nl + 
     3001"> nrows(v);" + nl +
    30053002string(nrows(v)) + nl +
    30063003"texobj(fname,v);" + nl2 +
     
    30173014"> intmat m[3][4] = -1,3,5,2,-2,8,6,0,2,5,8,7;" + nl +
    30183015"> m;" + nl +
    3019 string(m) + nl + 
     3016string(m) + nl +
    30203017"> texobj(fname,m);" + nl2 +
    30213018ev );
     
    30703067"> intmat mat[3][3] = 1,2,3,4,5,6,7,8,9;" + nl +
    30713068"> string TeXbrack = \"|\";" + nl +
    3072 "> texobj(fname,mat,\"=\",det(mat)); " + nl2 + 
     3069"> texobj(fname,mat,\"=\",det(mat)); " + nl2 +
    30733070ev );
    30743071
     
    30833080
    30843081
    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
    30863083//correct way"+lb,nl);
    30873084
     
    31123109
    31133110 proc cleantexdemo()
    3114  { 
     3111 {
    31153112  kill fname,nl,nl2,lb,bv,ev;
    31163113  return();
  • Singular/LIB/mondromy.lib

    rce7ba6 r917fb5  
    11///////////////////////////////////////////////////////////////////////////////
    22
    3 version="$Id: mondromy.lib,v 1.6 1999-07-06 11:33:02 obachman Exp $";
     3version="$Id: mondromy.lib,v 1.7 1999-07-06 15:32:53 Singular Exp $";
    44info="
    55LIBRARY: mondromy.lib  PROCEDURES TO COMPUTE THE MONODROMY OF A SINGULARITY
     
    110110    }
    111111  }
    112   return(m); 
     112  return(m);
    113113}
    114114///////////////////////////////////////////////////////////////////////////////
     
    189189         If U is not a sqaure matrix, the list is empty.
    190190         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,
    192192         then the second entry is the adjoint matrix of U.
    193193DISPLAY: The procedure displays comments if printlevel>=1.
     
    246246proc jacoblift(poly f)
    247247"USAGE:   jacoblift(f); f poly
    248 ASSUME:  The polynomial f in a series ring (local ordering) defines 
     248ASSUME:  The polynomial f in a series ring (local ordering) defines
    249249         an isolated hypersurface singularity.
    250 RETURN:  The procedure returns a list with entries kappa, xi, u of type 
     250RETURN:  The procedure returns a list with entries kappa, xi, u of type
    251251         int, vector, poly such that kappa is minimal with f^kappa in jacob(f),
    252252         u is a unit, and u*f^kappa=(matrix(jacob(f))*xi)[1,1].
     
    405405  for(i=1;i<=size(e);i++)
    406406  {
    407     for(j,p=nvars(basering),0;j>=1;j--) 
     407    for(j,p=nvars(basering),0;j>=1;j--)
    408408    {
    409409      q=jet(e[i]*xi[j],N);
     
    807807proc monodromy(poly f, list #)
    808808"USAGE:   monodromy(f[,opt]); f poly, opt int
    809 ASSUME:  The polynomial f in a series ring (local ordering) defines 
     809ASSUME:  The polynomial f in a series ring (local ordering) defines
    810810         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 
     811RETURN:  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
    816816         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 
     817THEORY:  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
    822822         it to a simple pole.
    823823DISPLAY: The procedure displays more comments for higher printlevel.
     
    837837      return();
    838838    }
    839    
     839
    840840  }
    841841
     
    918918proc H''basis(poly f)
    919919"USAGE:   H''basis(f); f poly
    920 ASSUME:  The polynomial f in a series ring (local ordering) defines 
     920ASSUME:  The polynomial f in a series ring (local ordering) defines
    921921         an isolated hypersurface singularity.
    922922RETURN:  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 obachman Exp $
     1// $Id: noethernormal.lib,v 1.3 1999-07-06 15:32:53 Singular Exp $
    22//(GP, last modified 15.08.98)
    33///////////////////////////////////////////////////////////////////////////////
    44
    5 version="$Id: noethernormal.lib,v 1.2 1999-07-06 11:33:03 obachman Exp $";
     5version="$Id: noethernormal.lib,v 1.3 1999-07-06 15:32:53 Singular Exp $";
    66info="
    77LIBRARY:  noetherNormal.lib    PROCEDURE FOR NOETHERNORMALIZATION
     
    6262{
    6363   intvec v,w;
    64    int j;   
     64   int j;
    6565   for(j=1;j<=size(i);j++)
    6666   {
     
    9595RETURN:  1 if R---->basering/I is finite and 0 else
    9696EXAMPLE: mapIsFinite; shows an example
    97 " 
     97"
    9898{
    9999  int n=nvars(R);
    100100  def S=basering;
    101  
     101
    102102  setring R;
    103103  ideal jj=maxideal(1);
    104104  setring S;
    105105  ideal jj=phi(jj);
    106  
     106
    107107  def T=S+R;
    108   setring T; 
     108  setring T;
    109109  changeord("@rr","lp");
    110110//  ideal j=imap(S,phi(jj));
    111111  ideal j=imap(S,jj);
    112  
     112
    113113  int i;
    114114  for(i=1;i<=nvars(S);i++)
     
    128128   ideal i= xy;
    129129   map phi=r,(xy)^3+x2+z,y2-1,z3;
    130    
     130
    131131   mapIsFinite(r,phi,i);
    132132}
  • Singular/LIB/normal.lib

    rce7ba6 r917fb5  
    66///////////////////////////////////////////////////////////////////////////////
    77
    8 version="$Id: normal.lib,v 1.15 1999-07-06 11:33:04 obachman Exp $";
     8version="$Id: normal.lib,v 1.16 1999-07-06 15:32:54 Singular Exp $";
    99info="
    1010LIBRARY: normal.lib     PROCEDURES FOR NORMALIZATION
     
    1313 normal(I);             computes the normalization of basering/I
    1414 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
    1616";
    1717
     
    176176   intvec rw,rw1;
    177177   list L;
    178    
     178
    179179   y = printlevel-voice+2;  // y=printlevel (default: y=0)
    180180 def P = basering;
     
    219219//---------- computation of p*Hom(J,J) as R-ideal -----------------------------
    220220   if ( y>=1 )
    221    { 
     221   {
    222222     "// compute p*Hom(rad(J),rad(J)) = p*J:J, p a non-zerodivisor";
    223223     "//   p is equal to:"; "";
    224224     p;
    225      ""; 
     225     "";
    226226   }
    227227
     
    229229   if ( y>=1 )
    230230   { "// the module p*Hom(rad(J),rad(J)) = p*J:J, p a non-zerodivisor";
    231      
     231
    232232      "// p"; p;
    233233      "// f=p*J:J";f;
     
    300300         endphi;
    301301         "   ";
    302          pause;
     302         pause();
    303303         newline;
    304304      }
     
    309309   {
    310310      "// R is not equal to Hom(rad(J),rad(J)), we have to try again";
    311       pause;
     311      pause();
    312312      newline;
    313313   }
     
    379379      "   ";
    380380      interred(Quad);
    381       pause;
     381      pause();
    382382      newline;
    383383   }
     
    434434      endphi;
    435435      "   ";
    436       pause;
     436      pause();
    437437      newline;
    438438   }
     
    463463         (which is sometimes more efficient)
    464464RETURN:  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
    466466         normalization of basering/id and normap is the map from basering/id
    467467         to nor[i]/norid
     
    553553      result = normalizationPrimes(prim[1],maxideal(1));
    554554      sr = string(size(result));
    555      
     555
    556556      dbprint(y+1,"
    557557// 'normal' created a list of "+sr+" ring(s).
     
    624624
    625625      dbprint(y+1,"
    626 // 'normal' created a list of "+sr+" ring(s). 
     626// 'normal' created a list of "+sr+" ring(s).
    627627// To see the rings, type (if the name of your list is nor):
    628      show( nor);                 
     628     show( nor);
    629629// 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;
    631631// R/norid is the 1-st ring of the normalization and
    632632// normap the map from the original basering to R/norid");
     
    661661{
    662662   int y = printlevel-voice+2;  // y=printlevel (default: y=0)
    663  
     663
    664664   if(y>=1)
    665665   {
     
    668668     i;  "";
    669669     basering;  "";
    670      pause;
     670     pause();
    671671     newline;
    672672   }
  • Singular/LIB/paramet.lib

    rce7ba6 r917fb5  
    1 // $Id: paramet.lib,v 1.4 1999-07-06 11:33:06 obachman Exp $
     1// $Id: paramet.lib,v 1.5 1999-07-06 15:32:55 Singular Exp $
    22// author : Thomas Keilen email: keilen@mathematik.uni-kl.de
    33// last change:           07.08.98
    44///////////////////////////////////////////////////////////////////////////////
    55
    6 version="$Id: paramet.lib,v 1.4 1999-07-06 11:33:06 obachman Exp $";
     6version="$Id: paramet.lib,v 1.5 1999-07-06 15:32:55 Singular Exp $";
    77info="
    8 LIBRARY:  paramet.lib   PROCEDURES FOR PARAMETRIZATION OF PRIMARY 
     8LIBRARY:  paramet.lib   PROCEDURES FOR PARAMETRIZATION OF PRIMARY
    99                        DECOMPOSITION, ETC.
    1010
    1111PROCEDURES:
    12  parametrize(I);       parametrizes a prime ideal if possible via the 
     12 parametrize(I);       parametrizes a prime ideal if possible via the
    1313                       normalization
    14  parametrizepd(I);     calculates the primary decomp. and parametrizes 
     14 parametrizepd(I);     calculates the primary decomp. and parametrizes
    1515                       the components
    1616 parametrizesing(f);   parametrize an isolated plane curve singularity
     
    2525proc parametrize(ideal I)
    2626"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
    2828RETURN:  a list containing the parametrization ideal resp. the original ideal,
    2929         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
    3131         or not
    3232NOTE:    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
    3434         two variables
    3535EXAMPLE: example parametrize; shows an example
     
    4343   list nor=normal(newI);
    4444   def N=nor[1];
    45    ring PR=0,(s,t),dp;   
     45   ring PR=0,(s,t),dp;
    4646   setring N;
    4747   // If the ideal is zero dimensional, the procedure works as well in good cases.
     
    5353     ideal para=p(normap);
    5454     export para;
    55      // The i-th list component contains the parametrization, the 
     55     // The i-th list component contains the parametrization, the
    5656     // number of necessary variables, and the information, if
    5757     // the parametrization was successful.
     
    6666     keepring(PR);
    6767   }
    68    else 
     68   else
    6969   {
    7070     list param=I,0,0;
     
    7979}
    8080example
    81 { "EXAMPLE:";echo = 2; 
     81{ "EXAMPLE:";echo = 2;
    8282  ring RING=0,(x,y,z),dp;
    8383  ideal I=z2-y2x2+x3;
     
    9494         resp. 0, and 1 resp. 0 depending on whether the parametrization
    9595         of the component was successful or not
    96 NOTE:    the basering will be changed to PR=0,(s,t),dp         
     96NOTE:    the basering will be changed to PR=0,(s,t),dp
    9797         the result will be incorrect, if the parametrization needs more than two
    9898         variables
     
    108108 for (int ii=1; ii<=size(primary); ii=ii+1)
    109109   {
    110      no=normal(std(primary[ii][2]));     
     110     no=normal(std(primary[ii][2]));
    111111     nor[ii]=no[1];
    112112     def N=nor[ii];
    113113     setring N;
    114114     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.
    116116     if (size(norid)==0)
    117117     {
     
    131131       setring BAS;
    132132     }
    133      else 
     133     else
    134134     {
    135135       setring PR;
     
    141141   }
    142142 export nor;
    143  setring PR; 
     143 setring PR;
    144144 export PR;
    145145 keepring PR;
     
    147147}
    148148example
    149 { "EXAMPLE:";echo = 2; 
     149{ "EXAMPLE:";echo = 2;
    150150  ring RING=0,(x,y,z),dp;
    151151  ideal I=(x2-y2z2+z3)*(x2-z2-z3),(x2-y2z2+z3)*yz;
     
    160160"USAGE:  parametrizesing(); f a polynomial in two variables with ordering ls or ds
    161161RETURN:  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
    163163NOTE:    if successful, the basering is changed to ring 0,(x,y),ls;
    164164EXAMPLE: example parametrizesing; shows an example
     
    185185}
    186186example
    187 { "EXAMPLE:";echo = 2; 
     187{ "EXAMPLE:";echo = 2;
    188188  ring RING=0,(x,y),ls;
    189189  poly f=(x^2-y^3)*(x^2-y^2-y^3);
     
    265265/// Examples for parametrizepd
    266266
    267 /// Example 1 
     267/// Example 1
    268268ring r=0,(x,y,z),dp;
    269269ideal i=y2z5-x2y2z2+y2z4-z6-z5+x4-x2z2,-y3z3+yz4+x2yz;
  • Singular/LIB/poly.lib

    rce7ba6 r917fb5  
    1 // $Id: poly.lib,v 1.15 1999-07-06 11:33:07 obachman Exp $
     1// $Id: poly.lib,v 1.16 1999-07-06 15:32:55 Singular Exp $
    22//system("random",787422842);
    33//(GMG, last modified 22.06.96)
     
    55///////////////////////////////////////////////////////////////////////////////
    66
    7 version="$Id: poly.lib,v 1.15 1999-07-06 11:33:07 obachman Exp $";
     7version="$Id: poly.lib,v 1.16 1999-07-06 15:32:55 Singular Exp $";
    88info="
    99LIBRARY:  poly.lib      PROCEDURES FOR MANIPULATING POLYS, IDEALS, MODULES
     
    6161proc katsura
    6262"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 
     63RETURN: katsura(n) : n-th katsura ideal of
     64                      (1) newly created and set ring (32003, x(0..n), dp), if
    6565                          nvars(basering) < n
    6666                      (2) basering, if nvars(basering) >= n
     
    8888    n = nvars(basering) -1;
    8989  }
    90  
     90
    9191  ideal s;
    9292  int i, j;
  • Singular/LIB/primdec.lib

    rce7ba6 r917fb5  
    1 // $Id: primdec.lib,v 1.37 1999-07-06 11:33:09 obachman Exp $
     1// $Id: primdec.lib,v 1.38 1999-07-06 15:32:56 Singular Exp $
    22////////////////////////////////////////////////////////////////////////////////
    33// primdec.lib                                                                //
     
    1111////////////////////////////////////////////////////////////////////////////////
    1212
    13 version="$Id: primdec.lib,v 1.37 1999-07-06 11:33:09 obachman Exp $";
     13version="$Id: primdec.lib,v 1.38 1999-07-06 15:32:56 Singular Exp $";
    1414info="
    1515LIBRARY: primdec.lib PROCEDURE FOR PRIMARY DECOMPOSITION
     
    264264      act;
    265265      keep;
    266       pause;
     266      pause();
    267267
    268268      p;
    269269      q;
    270       pause;
     270      pause();
    271271   }
    272272}
     
    16251625     {
    16261626//@pr[j];
    1627 //pause;
     1627//pause();
    16281628        @res[j]=decomp(@pr[j],2);
    16291629//       @res[j]=decomp(@pr[j],2,@pr[j],ser);
  • Singular/LIB/solve.lib

    rce7ba6 r917fb5  
    11///////////////////////////////////////////////////////////////////////////////
    22
    3 version="$Id: solve.lib,v 1.8 1999-07-06 11:33:13 obachman Exp $";
     3version="$Id: solve.lib,v 1.9 1999-07-06 15:32:57 Singular Exp $";
    44info="
    55LIBRARY: solve.lib     PROCEDURES TO SOLVE POLYNOMIAL SYSTEMS
     
    2121         l>0: defines precision of fractional part if ground field is Q
    2222         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 
     23ASSUME:  i is a zerodimensional ideal with
     24         nvars(basering) = ncols(i) = number of vars actually occuring in i
    2525RETURN:  list of all (complex) roots of the polynomial system i = 0,
    2626         of type number if the ground field is the complex numbers,
     
    3333  int prec=30;
    3434
    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     }
     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  }
    6868
    6969  int digits= system("setFloatDigits",prec);
    7070
    7171  return(uressolve(gls,typ,polish));
    72  
     72
    7373}
    7474example
     
    8181  // result is a list (x,y)-coordinates as strings
    8282
    83   pause;
    84   // now with complex coefficient field, precision is 10 digits 
     83  pause();
     84  // now with complex coefficient field, precision is 10 digits
    8585  ring rsc= (real,10,I),(x,y),lp;
    8686  ideal i = (2+3*I)*x2 + (0.35+I*45.0e-2)*y2 - 8, x2 + xy + (42.7)*y2;
     
    104104  int prec=30;
    105105
    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     }
     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  }
    128128
    129129  int digits= system("setFloatDigits",prec);
    130130
    131131  return(laguerre(f,polish));
    132  
     132
    133133}
    134134example
     
    140140  laguerre_solve(f);
    141141
    142   pause;
     142  pause();
    143143  // Now with 10 digits precision:
    144144  laguerre_solve(f,10);
    145145
    146   pause;
     146  pause();
    147147  // Now with complex coefficients, precision is 20 digits:
    148148  ring rsc= (real,20,I),x,lp;
     
    158158         k=1: resultant matrix of Macaulay (k=0 is default)
    159159ASSUME:  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
     161RETURN:  module representing the multipolynomial resultant matrix
    162162EXAMPLE: example mp_res_mat; shows an example
    163163"
     
    165165  int typ=2;
    166166
    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     }
     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  }
    181181
    182182  return(mpresmat(i,typ));
    183  
     183
    184184}
    185185example
     
    194194  det(m);
    195195
    196   pause;
     196  pause();
    197197  // compute resultant matrix (Macaulay resultant matrix)
    198198  ring rdq= (0,u0,u1,u2),(x0,x1,x2),lp;
     
    204204  det(m);
    205205
    206   pause;
     206  pause();
    207207  // compute numerical sparse resultant matrix
    208208  setring rsq;
     
    219219ASSUME:  ground field K is the rational numbers,
    220220         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])
    223223COMPUTE: polynomial f with values given by v at points p1,..,pN derived from p;
    224224         more precisely: consider p as point in K^n and v as N elements in K,
     
    251251}
    252252///////////////////////////////////////////////////////////////////////////////
    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 obachman Exp $
     1// $Id: solver.lib,v 1.3 1999-07-06 15:32:58 Singular Exp $
    22////////////////////////////////////////////////////////////////////////////////
    33// solver.lib                                                                //
     
    77////////////////////////////////////////////////////////////////////////////////
    88
    9 version="$Id: solver.lib,v 1.2 1999-07-06 11:33:14 obachman Exp $";
     9version="$Id: solver.lib,v 1.3 1999-07-06 15:32:58 Singular Exp $";
    1010info="
    1111LIBRARY: solver.lib: PROCEDURES FOR SOLVING ZERO-DIMENSIONAL ALGEBRAIC SYSTEMS
     
    5858            p[i] = subst(p[i],var(j),a[j]);
    5959            for (k = n; k >= n-i+1; k--)
    60             {           
     60            {
    6161                J[i,k] = subst(J[i,k],var(j),a[j]);
    6262            }
     
    6767            return();
    6868        }
    69    
     69
    7070        // solve linear equations
    7171        hh = -p[i];
  • Singular/LIB/spcurve.lib

    rce7ba6 r917fb5  
    1 // $Id: spcurve.lib,v 1.2 1999-07-06 11:33:14 obachman Exp $
     1// $Id: spcurve.lib,v 1.3 1999-07-06 15:32:58 Singular Exp $
    22// (anne, last modified 20.7.98)
    33/////////////////////////////////////////////////////////////////////////////
    44
    5 version="$Id: spcurve.lib,v 1.2 1999-07-06 11:33:14 obachman Exp $";
     5version="$Id: spcurve.lib,v 1.3 1999-07-06 15:32:58 Singular Exp $";
    66info="
    77LIBRARY: spcurve.lib    PROCEDURES FOR CM CODIMENSION 2 SINGULARITIES
     
    1919 kod_ker(M,a);           kernel of the Kodaira-Spencer map using eliminate
    2020 kod_noelim(M);          kernel of the Kodaira-Spencer map (weighted
    21                          elimination) 
     21                         elimination)
    2222";
    23          
     23
    2424LIB "elim.lib";
    2525LIB "homolog.lib";
     
    2929
    3030proc isCMcod2(ideal kurve)
    31 USAGE:   isCMcod2(i); 
     31USAGE:   isCMcod2(i);
    3232         where i is an ideal
    3333RETURN:  presentation matrix of i, if i is Cohen-Macaulay of codimension2
     
    4242  list kurveres=mres(kurve,0);
    4343  matrix M=kurveres[2];
    44   if ((size(kurveres)>3) && 
    45          ((size(kurveres[3])>1) || 
     44  if ((size(kurveres)>3) &&
     45         ((size(kurveres[3])>1) ||
    4646          ((size(kurveres[3])<=1) && (kurveres[3][1,1]!=0))))
    4747  {
     
    6161
    6262proc CMtype(ideal kurve)
    63 USAGE:   CMtype(i); 
     63USAGE:   CMtype(i);
    6464         where i is an ideal, Cohen-Macaulay of codimension 2
    65 RETURN:  Cohen-Macaulay type of i (integer) 
     65RETURN:  Cohen-Macaulay type of i (integer)
    6666         (-1, if i is not Cohen-Macaulay of codimension 2)
    6767EXAMPLE: example CMtype; shows an example
     
    7676  kurveres=mres(kurve,0);
    7777  if (size(kurveres)>3)
    78   { 
     78  {
    7979    dbprint(p,"//not Cohen-Macaulay, codim 2");
    8080    return(gt);
     
    9696
    9797proc matrixT1(matrix M ,int n)
    98 USAGE:   matrixT1(M,n); 
    99          where M is a presentation matrix of an ideal, 
     98USAGE:   matrixT1(M,n);
     99         where M is a presentation matrix of an ideal,
    100100         Cohen-Macaulay of codimension 2
    101101         and n determines the number of variables used as variables, not as
    102102         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 )
     104RETURN:  T1 of i as a quotient of the module of matrices of the same
    105105         size as M with polynomial entries
    106106EXAMPLE: example matrixT1; shows an example
     
    124124    dbprint(p,"//not a k x (k+1) matrix");
    125125    return("ERROR");
    126   } 
     126  }
    127127//---------------------------------------------------------------------------
    128128// Construct the denominator - step by step
     
    160160  }
    161161//---------------------------------------------------------------------------
    162 // step 4: so is L*M 
     162// step 4: so is L*M
    163163//---------------------------------------------------------------------------
    164164  for( i=1; i <= (gt+1); i++)
     
    227227  matrix Mtemp[gt*(gt+1)][1];
    228228  for( i=1; i<=tau; i++)
    229   { 
     229  {
    230230    Mtemp=t1erz[i];
    231231    N=N+A(i)*transpose(Mtemp);
     
    264264  int i;
    265265  ideal sem=std(kurve);
    266   ideal semdiff; 
     266  ideal semdiff;
    267267  ideal J2;
    268268  int ncol=ncols(matrix(sem));
     
    306306USAGE:   qhmatrix(M);
    307307         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 
     308RETURN:  list consisting of an integer vector containing the weights of
    309309         the variables of the basering and an integer matrix giving the
    310310         weights of the entries
    311311         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
    313313         column weights
    314314EXAMPLE: example qhmatrix; shows an example
     
    335335    dbprint(p,"//not a k x (k+1) matrix");
    336336    return("ERROR");
    337   } 
     337  }
    338338  ideal m=minor(M,nr);
    339339//---------------------------------------------------------------------------
     
    362362      {
    363363        if(M[i,j]==0)
    364         { 
     364        {
    365365          comprow=0;
    366366          break;
     
    371371//---------------------------------------------------------------------------
    372372// get the weights of the comprow'th row or use emergency exit
    373 //--------------------------------------------------------------------------- 
     373//---------------------------------------------------------------------------
    374374  if(comprow==0)
    375375  {
     
    392392  {
    393393    if ( i==comprow )
    394     { 
     394    {
    395395// this row should not be tested against itself
    396396      donttest=1;
     
    487487proc relweight(matrix N, intmat W, intvec a)
    488488USAGE:   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
    490490         matrix with integer entries of the same size and the entries
    491491         of a give the weight of the variables of the basering
     
    558558         ring rneu=char(basering),(var(1),..,var(nvars(basering)),
    559559                    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
    561561         generators of T1 of non-negative weight is returned as the first
    562562         list element, followed by the weight vector for the new variables
     
    583583  }
    584584  kill i;
    585   if (defined(jj)) 
     585  if (defined(jj))
    586586  {
    587587    if (jj==-1)
     
    661661  matrix Mtemp[gt*(gt+1)][1];
    662662  for( i=1; i<=pw; i++)
    663   { 
     663  {
    664664    mtemp=erz1[i];
    665665    Mtemp=mtemp;
     
    746746          ker[i]=lead(ker[i]);
    747747      }
    748     } 
     748    }
    749749    kill testlead;
    750   } 
     750  }
    751751  ker=eliminate(interred(ker),p);
    752752  option(set,optvec);
     
    797797  matrix M=imap(rt,M);
    798798  int ne=size(M);
    799   intvec iv=1..ne; 
     799  intvec iv=1..ne;
    800800  list l=matrixT1(M,3);
    801801  if (dim(std(l[2])) != 0)
     
    825825    }
    826826  }
    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])) + ","
    829829                        + string(wl[1]) + ");";
    830830  execute ringre;
     
    900900  }
    901901  ideal templ=lead(t1perts);
    902   for(int j=1;j<=nv;j++) 
     902  for(int j=1;j<=nv;j++)
    903903  {
    904904    templ=subst(templ,T(j),0);
     
    918918  }
    919919//--------------------------------------------------------------------------
    920 // multiply by the initial ring variables to shift the generators with 
     920// multiply by the initial ring variables to shift the generators with
    921921// leading term divisible by some T(i) and reduce afterwards
    922922//--------------------------------------------------------------------------
    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
    924924                       // it and setting isSB suppresses error messages
    925925  noether=noet[size(noet)];
     
    968968  ovar=var(1);
    969969  for(i=2;i<=ne;i++)
    970   { 
     970  {
    971971    ovar=ovar,var(i);
    972972  }
     
    10051005           gen(i) will correspond to var(vpos[i])
    10061006NOTE:      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
    10091009           an ideal
    10101010RETURN:    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
    10121012           been added to the generating set of i
    10131013EXAMPLE:   example mod2id; shows an example
     
    10311031  }
    10321032//----------------------------------------------------------------------
    1033 // define the desired ideal 
     1033// define the desired ideal
    10341034//----------------------------------------------------------------------
    10351035  ideal ret=vars^2,varm*M;
     
    10421042  intvec iv=2,1;
    10431043  mod2id(mo,iv);
    1044 } 
     1044}
    10451045////////////////////////////////////////////////////////////////////////
    10461046static
     
    10511051NOTE:      * use this procedure only makes sense if the ideal contains
    10521052             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
    10541054             var(vpos[i]) over the ring in the other variables
    10551055           * this is the inverse procedure to mod2id
    10561056RETURN:    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])
    10581058EXAMPLE:   example id2mod; shows an example;
    10591059{
    10601060//---------------------------------------------------------------------
    1061 // Initialization 
     1061// Initialization
    10621062//---------------------------------------------------------------------
    10631063  int n=size(i);
     
    10931093          sm ideal in a ring r with n + s variables,
    10941094          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
    10961096          one of the t_i) such that sm is contained in the module
    10971097          k[t_1,..,t_s]*mon
    10981098          iv intvec listing the variables which are supposed to be used
    10991099          as x_i
    1100 RETURN:   interreduced system of generators of sm seen as a submodule 
     1100RETURN:   interreduced system of generators of sm seen as a submodule
    11011101          of k[t_1,..,t_s]*mon
    11021102EXAMPLE:  example subrInterred; shows an example
  • Singular/LIB/standard.lib

    rce7ba6 r917fb5  
    1 // $Id: standard.lib,v 1.35 1999-07-06 11:33:15 obachman Exp $
     1// $Id: standard.lib,v 1.36 1999-07-06 15:32:59 Singular Exp $
    22//////////////////////////////////////////////////////////////////////////////
    33
    4 version="$Id: standard.lib,v 1.35 1999-07-06 11:33:15 obachman Exp $";
     4version="$Id: standard.lib,v 1.36 1999-07-06 15:32:59 Singular Exp $";
    55info="
    66LIBRARY: standard.lib   PROCEDURES WHICH ARE ALWAYS LOADED AT START-UP
     
    1717 fprintf(link,fmt,..) writes formatted string to link
    1818 printf(fmt,...)      displays formatted string
     19 pause([prompt])      pause in the computation till user input
    1920";
    2021
     
    398399}
    399400example
    400 {
    401   "EXAMPLE: "; echo = 2;
     401{ "EXAMPLE: "; echo = 2;
    402402  ring r = 0, (a,b,c,d), lp;
    403403  option(prot);
     
    816816}
    817817example
    818 {
     818{ "EXAMPLE:"; echo=2;
    819819  ring r=0,(x,y,z),dp;
    820820  module m=[1,y],[0,x+z];
     
    855855}
    856856example
    857 {
     857{ "EXAMPLE:"; echo=2;
    858858  ring r=0,(x,y,z),dp;
    859859  module m=[1,y],[0,x+z];
     
    895895}
    896896example
    897 {
     897{ "EXAMPLE:"; echo=2;
    898898  ring r=0,(x,y,z),dp;
    899899  module m=[1,y],[0,x+z];
     
    911911
    912912
     913proc pause(list #)
     914"USAGE:    pause([ prompt ])  prompt string
     915RETURN:   none
     916PURPOSE: pause in the computation till user input
     917EXAMPLE : 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}
     927example
     928{ "EXAMPLE:"; echo=2;
     929  pause("press <return> to continue");
     930  pause();
     931}
     932
     933
    913934
    914935
  • Singular/LIB/surf.lib

    rce7ba6 r917fb5  
    1 // $Id: surf.lib,v 1.4 1999-07-06 11:33:16 obachman Exp $
     1// $Id: surf.lib,v 1.5 1999-07-06 15:33:00 Singular Exp $
    22//
    33// author : Hans Schoenemann
    44//
    55///////////////////////////////////////////////////////////////////////////////
    6 version="$Id: surf.lib,v 1.4 1999-07-06 11:33:16 obachman Exp $";
     6version="$Id: surf.lib,v 1.5 1999-07-06 15:33:00 Singular Exp $";
    77info="
    88LIBRARY: surf.lib    PROCEDURES FOR GRAPHICS WITH SURF (by Stephan Endrass)
     
    3333"USAGE:   plot(I);  I ideal
    3434RETURN:
    35 NOTE: 
     35NOTE:
    3636EXAMPLE: example plot; shows an example
    3737"
     
    103103   plot(I);
    104104   ideal J = x1^2-x1-x2^3;
    105    plot(J); 
     105   plot(J);
    106106
    107107   ring rr1 = 0,(x,y,z),dp;
    108108   ideal I(1) = 2x2-1/2x3 +1-y+1;
    109109   plot(I(1));
    110    ideal I(2) = x3-x-y; 
     110   ideal I(2) = x3-x-y;
    111111   plot(I(2));
    112112
     
    115115  plot(logo);
    116116
    117  
     117
    118118   // --------- implicit curves ------------
    119119   // implicit curves
     
    132132
    133133   poly f = (x-y)*(x2+y);
    134    plot(f,1); 
     134   plot(f,1);
    135135   ideal J = jacob(f);
    136136   J;
     
    145145   ideal J(2) = x^2*y^2+x^2*z^2+y^2*z^2-17*x*y*z;
    146146   plot(J(2));
    147  
     147
    148148  plot(x*(x2-y2)+z2);
    149149
  • Singular/LIB/tst.lib

    rce7ba6 r917fb5  
    1 // $Id: tst.lib,v 1.13 1999-07-06 11:33:17 obachman Exp $
     1// $Id: tst.lib,v 1.14 1999-07-06 15:33:00 Singular Exp $
    22//(obachman, last modified 6/30/98)
    33/////////////////////////////////////////////////////////////////////////////
    44
    5 version="$Id: tst.lib,v 1.13 1999-07-06 11:33:17 obachman Exp $";
     5version="$Id: tst.lib,v 1.14 1999-07-06 15:33:00 Singular Exp $";
    66info="
    77LIBRARY:  tst.lib      PROCEDURES FOR RUNNING AUTOMATIC TST TESTS
     
    1313 tst_init()             writes some identification data to GetTstStatusFile()
    1414 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)
    1818                        test whether two std's are \"equal\"
    1919";
     
    4949"USAGE:    tst_ignore(any,[keyword], [link])
    5050            any     -- valid argument to string()
    51             keyword -- an arbitrary string 
     51            keyword -- an arbitrary string
    5252            link    -- a link which can be written to
    5353RETURN:   none; writes string(any) to link (or stdout, if no link given),
    54           prepending prefix \"// tst_ignore:\", or 
     54          prepending prefix \"// tst_ignore:\", or
    5555                            \"// tst_ignore:keyword hostname:\",
    5656                            if keyword was given.
     
    164164    return ("tst_status.out");
    165165  }
    166   else 
     166  else
    167167  {
    168168    return (tst_status_file);
    169169  }
    170170}
    171  
     171
    172172static proc tst_status_out (def prefix, def what, list #)
    173173{
    174174  string outstring;
    175  
     175
    176176  outstring = string(prefix) + " >> " + string(what);
    177177  if (size(#) > 0)
    178178  {
    179     outstring = outstring + " :: " + 
     179    outstring = outstring + " :: " +
    180180      tst_system("hostname", 1) + ":" + string(#[1]);
    181181  }
    182182  write(":a " + GetTstStatusFile(), outstring);
    183183}
    184  
     184
    185185proc tst_status (list #)
    186186"USAGE:   tst_status([any])
    187187RETURN:   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,
    189189          since start-up of Singular, if an argument is given.
    190 NOTE:     Should be used regularly within tst files to enable automatic 
     190NOTE:     Should be used regularly within tst files to enable automatic
    191191          tracking of memory and time performance.
    192192EXAMPLE: example tst_status; shows example
     
    204204      tst_status_counter++;
    205205    }
    206  
     206
    207207    tst_status_out(tst_status_counter, "tst_memory_0", memory(0));
    208208    tst_status_out(tst_status_counter, "tst_memory_1", memory(1));
     
    230230}
    231231
    232  
     232
    233233proc tst_init()
    234234"USAGE:   tst_init()
     
    263263        0, otherwise
    264264        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
    266266        are equal
    267267        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
    270270        characteristic is printed, if v > 0, ideals are printed.
    271271        On failure, Error message and ideals are printed.
     
    276276  ideal si = std(i);
    277277  st = timer - st;
    278  
     278
    279279  int gt = timer;
    280280  ideal gi = groebner(i);
     
    322322}
    323323
    324  
     324
    325325//
    326326// A routine which test for equality of "std-bases"
    327 // 
     327//
    328328proc tst_stdEqual(ideal i1, ideal i2)
    329329"USAGE: tst_stdEqual(i1, i2)  ideal i1, i2
     
    331331       0, otherwise
    332332       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
    334334       are equal
    335335       On failure, error message is printed.
     
    341341  intvec opts = option(get);
    342342  option(redSB);
    343  
     343
    344344  ideal ri1 = simplify(interred(i1), 1);
    345345  ideal ri2 = simplify(interred(i2), 1);
    346  
     346
    347347  option(set, opts);
    348348
     
    372372    {
    373373      poly p1, p2;
    374      
     374
    375375      ideal si1 = simplify(i1, 7);
    376376      ideal si2 = simplify(i2, 7);
    377      
     377
    378378      if (size(si1) == size(si2))
    379379      {
     
    432432}
    433433
    434  
    435 
    436 
     434
     435
     436
  • Singular/febase.cc

    rce7ba6 r917fb5  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: febase.cc,v 1.73 1999-05-01 15:30:44 obachman Exp $ */
     4/* $Id: febase.cc,v 1.74 1999-07-06 15:32:43 Singular Exp $ */
    55/*
    66* ABSTRACT: i/o system
     
    989989    {
    990990      lines = 0;
    991       fePause();
     991      fputs("pause>\n",stderr);
     992      uchar c = fgetc(stdin);
    992993    }
    993994    else
     
    10231024  int ls = strlen(s);
    10241025  if (ls == 0) return;
    1025  
     1026
    10261027  char* ns;
    10271028  int l = strlen(sprint);
    10281029  ns = (char*) AllocL((l + ls + 1)*sizeof(char));
    10291030  if (l > 0) strcpy(ns, sprint);
    1030  
     1031
    10311032  strcpy(&(ns[l]), s);
    10321033  FreeL(sprint);
     
    10521053    return;
    10531054  }
    1054  
     1055
    10551056  if (feOut) /* do not print when option --no-out was given */
    10561057  {
    1057    
     1058
    10581059#ifdef macintosh
    10591060    char c;
     
    11011102      ns = (char*) AllocL(sizeof(char)*(ls + l + 256));
    11021103      if (l > 0)  strcpy(ns, sprint);
    1103                
     1104
    11041105#ifdef HAVE_VSNPRINTF
    11051106      l = vsnprintf(&(ns[l]), ls+255, fmt, ap);
     
    11621163}
    11631164
    1164 void fePause()
    1165 {
    1166 #ifdef HAVE_TCL
    1167   if(!tclmode)
    1168 #endif
    1169   {
    1170     mflush();
    1171 #ifndef macintosh
    1172     fputs("pause>",stderr);
    1173 #else
    1174     fputs("pause>\n",stderr);
    1175 #endif
    1176     uchar c = fgetc(stdin);
    1177     if (((c == '\003') || (c == 'C')) || (c == 'c'))
    1178     {
    1179       m2_end(4);
    1180     }
    1181   }
    1182 }
    1183 
    11841165void monitor(char* s, int mode)
    11851166{
  • Singular/febase.h

    rce7ba6 r917fb5  
    44*  Computer Algebra System SINGULAR     *
    55****************************************/
    6 /* $Id: febase.h,v 1.28 1999-04-17 14:58:46 obachman Exp $ */
     6/* $Id: febase.h,v 1.29 1999-07-06 15:32:44 Singular Exp $ */
    77/*
    88* ABSTRACT: basic i/o
     
    106106
    107107FILE *  feFopen(char *path, char *mode, char *where=NULL, int useWerror=FALSE);
    108 void    fePause(void);
    109108#ifndef __MWERKS__
    110109#ifdef HAVE_TCL
  • Singular/scanner.l

    rce7ba6 r917fb5  
    33*  Computer Algebra System SINGULAR     *
    44****************************************/
    5 /* $Id: scanner.l,v 1.16 1999-04-15 17:28:06 Singular Exp $ */
     5/* $Id: scanner.l,v 1.17 1999-07-06 15:32:44 Singular Exp $ */
    66#include <stdio.h>
    77#include <string.h>
     
    110110                           yy_noeof=0;
    111111                         }
    112 pause[ \t\n]*[\.;]       { fePause(); }
    113112while                    { prompt_char='.';
    114113                           blocknest = 0; yy_noeof = noeof_brace; BEGIN(brace);
Note: See TracChangeset for help on using the changeset viewer.