Index: IntegerProgramming/IP.lib
===================================================================
--- IntegerProgramming/IP.lib	(revision 0658d94b02b071f2a019543baea28fe2c95d9226)
+++ IntegerProgramming/IP.lib	(revision 27e935d2c9219a328c4212edf32245b9b2d24782)
@@ -1,35 +1,35 @@
-// $Id: IP.lib,v 1.1.1.1 2000-05-02 12:58:31 Singular Exp $
+// $Id: IP.lib,v 1.2 2000-05-11 09:04:05 Singular Exp $
 //
 // author : Christine Theis
 //
 
-//version="$Id: IP.lib,v 1.1.1.1 2000-05-02 12:58:31 Singular Exp $";
+//version="$Id: IP.lib,v 1.2 2000-05-11 09:04:05 Singular Exp $";
 
 ///////////////////////////////////////////////////////////////////////////////
 
 info="
-LIBRARY: IP.lib		PROCEDURES FOR INTEGER PROGRAMMING USING GROEBNER BASIS METHODS    
+LIBRARY: IP.lib                PROCEDURES FOR INTEGER PROGRAMMING USING GROEBNER BASIS METHODS
 
 
 Let A an integral (mxn)-matrix, b a vector with m integral
 coefficients and c a vector with n nonnegative integral coefficients. The
-solution of the IP-problem 
-          
+solution of the IP-problem
+
 (*)    minimize{ cx | Ax=b, all components of x are nonnegative integers }
-              
+
 proceeds in two steps:
-           
+
 1. We compute the toric ideal of A and its Groebner basis with respect
    to a term ordering refining the cost function c (such an ordering
    exists because c is nonnegative).
-            
+
 2. We reduce the right hand vector b or an initial solution of the problem
    modulo this ideal.
-              
+
 For these purposes, we can use seven different algorithms:
 The algorithm of Conti/Traverso (ct) can compute an optimal solution
 of the IP-problem directly from the right hand vector b. The same is
 true for its `positive' variant (pct) which can only be applied if A
-and b have nonnegative entries, but should be faster in that case. 
+and b have nonnegative entries, but should be faster in that case.
 All other algorithms need initial solutions of the IP-problem. Except
 from the Conti-Traverso algorithm with elimination (ect),
@@ -40,54 +40,52 @@
 
 
-solve_IP(intmat A, intvec bx, intvec c, string alg);	
+solve_IP(intmat A, intvec bx, intvec c, string alg);
 solve_IP(intmat A, list bx, intvec c, string alg);
-solve_IP(intmat A, intvec bx, intvec c, string alg, intvec prsv);	
+solve_IP(intmat A, intvec bx, intvec c, string alg, intvec prsv);
 solve_IP(intmat A, list bx, intvec c, string alg, intvec prsv);
-	
-	procedures for solving the IP-problem (*) 
-    They return the solution(s) of the given problem(s) or the 
+
+        procedures for solving the IP-problem (*)
+    They return the solution(s) of the given problem(s) or the
     message `not solvable'.
     `alg' may be one of the algorithm abbreviations as above.
-    If `alg' is chosen to be `ct' or `pct', bx is read as the right 
+    If `alg' is chosen to be `ct' or `pct', bx is read as the right
     hand vector b of the system Ax=b. b should then be an intvec of
     size m where m is the number of rows of A. Furthermore, bx and
-    A should be nonnegative if `pct' is used. 
-	If `alg' is chosen to be `ect',`pt',`blr',`hs' or `du', bx is
-	read as an initial solution x of the system Ax=b. bx should
-	then be a nonnegative intvec of size n where n is the number
-	of columns of A.
+    A should be nonnegative if `pct' is used.
+        If `alg' is chosen to be `ect',`pt',`blr',`hs' or `du', bx is
+        read as an initial solution x of the system Ax=b. bx should
+        then be a nonnegative intvec of size n where n is the number
+        of columns of A.
     If `alg' is chosen to be `blr' or `hs', the algorithm needs a
     vector with positive coefficcients in the row space of A. If
     no row of A contains only positive entries, one must use the
     versions of solve_IP which take such a vector prsv as
-    argument. 
-	solve_IP may also be called with a list bx of intvecs instead
-	of a single intvec.       
-    
-                          
+    argument.
+        solve_IP may also be called with a list bx of intvecs instead
+        of a single intvec.
+
+
 ";
 
 ///////////////////////////////////////////////////////////////////////////////
 
-
-
 static proc solve_IP_1(intmat A, intvec bx, intvec c, string alg)
-{	
+{
   intvec v;
   // to be returned
 
   // check arguments as far as necessary
-  // other inconsistencies are detected by the external program	
+  // other inconsistencies are detected by the external program
   if(size(c)!=ncols(A))
   {
     "ERROR: number of matrix columns must equal size of cost vector";
     return(v);
-  }	
+  }
 
   // create first temporary file with that the external program is
-  // called 
+  // called
 
   int process=system("pid");
-  string matrixfile="temp_MATRIX"+string(process);	
+  string matrixfile="temp_MATRIX"+string(process);
   link MATRIX=":w "+matrixfile;
   open(MATRIX);
@@ -107,10 +105,10 @@
     }
   }
- 
+
   // search for positive row space vector, if required by the
-  // algorithm    
+  // algorithm
   int found=0;
   if((alg=="blr") || (alg=="hs"))
-  { 
+  {
     for(i=1;i<=nrows(A);i++)
     {
@@ -130,12 +128,12 @@
     if(found==0)
     {
-      "ERROR: algorithm needs positive vector in the row space of the matrix";     
+      "ERROR: algorithm needs positive vector in the row space of the matrix";
       close(MATRIX);
       system("sh","rm -f "+matrixfile);
       return(v);
-    } 
+    }
     write(MATRIX,"positive row space vector:");
     for(j=1;j<=ncols(A);j++)
-    { 
+    {
       write(MATRIX,A[found,j]);
     }
@@ -145,9 +143,9 @@
   // create second temporary file for the external program
 
-  string problemfile="temp_PROBLEM"+string(process);	
+  string problemfile="temp_PROBLEM"+string(process);
   link PROBLEM=":w "+problemfile;
   open(PROBLEM);
 
-  write(PROBLEM,"PROBLEM","vector size:",size(bx),"number of instances:",1,"right hand or initial solution vectors:"); 
+  write(PROBLEM,"PROBLEM","vector size:",size(bx),"number of instances:",1,"right hand or initial solution vectors:");
   for(i=1;i<=size(bx);i++)
   {
@@ -165,5 +163,5 @@
   string s;
   if(alg=="ct" || alg=="pct")
-  { 
+  {
     pos=find(solution,"NO");
     if(pos!=0)
@@ -193,5 +191,5 @@
   }
   else
-  { 
+  {
     pos=find(solution,"optimal");
     pos=find(solution,":",pos);
@@ -212,5 +210,5 @@
     }
   }
-     
+
   // delete all created files
   dummy=system("sh","rm -f "+matrixfile);
@@ -222,18 +220,16 @@
 }
 
-
-
 static proc solve_IP_2(intmat A, list bx, intvec c, string alg)
-{	
+{
   list l;;
   // to be returned
 
   // check arguments as far as necessary
-  // other inconsistencies are detected by the external program	
+  // other inconsistencies are detected by the external program
   if(size(c)!=ncols(A))
   {
     "ERROR: number of matrix columns must equal size of cost vector";
     return(l);
-  }	
+  }
 
   int k;
@@ -248,8 +244,8 @@
 
   // create first temporary file with that the external program is
-  // called 
+  // called
 
   int process=system("pid");
-  string matrixfile="temp_MATRIX"+string(process);	
+  string matrixfile="temp_MATRIX"+string(process);
   link MATRIX=":w "+matrixfile;
   open(MATRIX);
@@ -269,10 +265,10 @@
     }
   }
- 
+
   // search for positive row space vector, if required by the
-  // algorithm    
+  // algorithm
   int found=0;
   if((alg=="blr") || (alg=="hs"))
-  { 
+  {
     for(i=1;i<=nrows(A);i++)
     {
@@ -292,12 +288,12 @@
     if(found==0)
     {
-      "ERROR: algorithm needs positive vector in the row space of the matrix";     
+      "ERROR: algorithm needs positive vector in the row space of the matrix";
       close(MATRIX);
       system("sh","rm -f "+matrixfile);
       return(l);
-    } 
+    }
     write(MATRIX,"positive row space vector:");
     for(j=1;j<=ncols(A);j++)
-    { 
+    {
       write(MATRIX,A[found,j]);
     }
@@ -307,9 +303,9 @@
   // create second temporary file for the external program
 
-  string problemfile="temp_PROBLEM"+string(process);	
+  string problemfile="temp_PROBLEM"+string(process);
   link PROBLEM=":w "+problemfile;
   open(PROBLEM);
 
-  write(PROBLEM,"PROBLEM","vector size:",size(bx[1]),"number of instances:",size(bx),"right hand or initial solution vectors:"); 
+  write(PROBLEM,"PROBLEM","vector size:",size(bx[1]),"number of instances:",size(bx),"right hand or initial solution vectors:");
   for(k=1;k<=size(bx);k++)
   {
@@ -331,8 +327,8 @@
   string s;
   if(alg=="ct" || alg=="pct")
-  { 
+  {
     pos=1;
     for(k=1;k<=size(bx);k++)
-    {      
+    {
       pos1=find(solution,"NO",pos);
       pos2=find(solution,"YES",pos);
@@ -359,5 +355,5 @@
             s=s+solution[pos];
             pos++;
-          }  
+          }
           execute("v[j]="+s+";");
         }
@@ -367,5 +363,5 @@
   }
   else
-  { 
+  {
     pos=1;
     for(k=1;k<=size(bx);k++)
@@ -385,5 +381,5 @@
           s=s+solution[pos];
           pos++;
-        }  
+        }
         execute("v[j]="+s+";");
       }
@@ -391,5 +387,5 @@
     }
   }
-     
+
   // delete all created files
   dummy=system("sh","rm -f "+matrixfile);
@@ -401,18 +397,16 @@
 }
 
-
-
 static proc solve_IP_3(intmat A, intvec bx, intvec c, string alg, intvec prsv)
-{	
+{
   intvec v;
   // to be returned
 
   // check arguments as far as necessary
-  // other inconsistencies are detected by the external program	
+  // other inconsistencies are detected by the external program
   if(size(c)!=ncols(A))
   {
     "ERROR: number of matrix columns must equal size of cost vector";
     return(v);
-  }	
+  }
 
   if(size(prsv)!=ncols(A))
@@ -420,11 +414,11 @@
     "ERROR: number of matrix columns must equal size of positive row space vector";
     return(v);
-  }	
+  }
 
   // create first temporary file with that the external program is
-  // called 
+  // called
 
   int process=system("pid");
-  string matrixfile="temp_MATRIX"+string(process);	
+  string matrixfile="temp_MATRIX"+string(process);
   link MATRIX=":w "+matrixfile;
   open(MATRIX);
@@ -444,11 +438,11 @@
     }
   }
- 
+
   // enter positive row space vector, if required by the algorithm
   if((alg=="blr") || (alg=="hs"))
-  { 
+  {
     write(MATRIX,"positive row space vector:");
     for(j=1;j<=ncols(A);j++)
-    { 
+    {
       write(MATRIX,prsv[j]);
     }
@@ -458,9 +452,9 @@
   // create second temporary file for the external program
 
-  string problemfile="temp_PROBLEM"+string(process);	
+  string problemfile="temp_PROBLEM"+string(process);
   link PROBLEM=":w "+problemfile;
   open(PROBLEM);
 
-  write(PROBLEM,"PROBLEM","vector size:",size(bx),"number of instances:",1,"right hand or initial solution vectors:"); 
+  write(PROBLEM,"PROBLEM","vector size:",size(bx),"number of instances:",1,"right hand or initial solution vectors:");
   for(i=1;i<=size(bx);i++)
   {
@@ -478,5 +472,5 @@
   string s;
   if(alg=="ct" || alg=="pct")
-  { 
+  {
     pos=find(solution,"NO");
     if(pos!=0)
@@ -500,5 +494,5 @@
           s=s+solution[pos];
           pos++;
-        }  
+        }
         execute("v[j]="+s+";");
       }
@@ -506,5 +500,5 @@
   }
   else
-  { 
+  {
     pos=find(solution,"optimal");
     pos=find(solution,":",pos);
@@ -521,9 +515,9 @@
         s=s+solution[pos];
         pos++;
-      }  
+      }
       execute("v[j]="+s+";");
     }
   }
-     
+
   // delete all created files
   dummy=system("sh","rm -f "+matrixfile);
@@ -535,18 +529,16 @@
 }
 
-
-
 static proc solve_IP_4(intmat A, list bx, intvec c, string alg, intvec prsv)
-{	
+{
   list l;
   // to be returned
 
   // check arguments as far as necessary
-  // other inconsistencies are detected by the external program	
+  // other inconsistencies are detected by the external program
   if(size(c)!=ncols(A))
   {
     "ERROR: number of matrix columns must equal size of cost vector";
     return(l);
-  }	
+  }
 
   if(size(prsv)!=ncols(A))
@@ -554,5 +546,5 @@
     "ERROR: number of matrix columns must equal size of positive row space vector";
     return(v);
-  }	
+  }
 
   int k;
@@ -567,8 +559,8 @@
 
   // create first temporary file with that the external program is
-  // called 
+  // called
 
   int process=system("pid");
-  string matrixfile="temp_MATRIX"+string(process);	
+  string matrixfile="temp_MATRIX"+string(process);
   link MATRIX=":w "+matrixfile;
   open(MATRIX);
@@ -588,11 +580,11 @@
     }
   }
- 
+
   // enter positive row space vector if required by the algorithm
   if((alg=="blr") || (alg=="hs"))
-  { 
+  {
     write(MATRIX,"positive row space vector:");
     for(j=1;j<=ncols(A);j++)
-    { 
+    {
       write(MATRIX,prsv[j]);
     }
@@ -602,9 +594,9 @@
   // create second temporary file for the external program
 
-  string problemfile="temp_PROBLEM"+string(process);	
+  string problemfile="temp_PROBLEM"+string(process);
   link PROBLEM=":w "+problemfile;
   open(PROBLEM);
 
-  write(PROBLEM,"PROBLEM","vector size:",size(bx[1]),"number of instances:",size(bx),"right hand or initial solution vectors:"); 
+  write(PROBLEM,"PROBLEM","vector size:",size(bx[1]),"number of instances:",size(bx),"right hand or initial solution vectors:");
   for(k=1;k<=size(bx);k++)
   {
@@ -626,8 +618,8 @@
   string s;
   if(alg=="ct" || alg=="pct")
-  { 
+  {
     pos=1;
     for(k=1;k<=size(bx);k++)
-    {      
+    {
       pos1=find(solution,"NO",pos);
       pos2=find(solution,"YES",pos);
@@ -654,5 +646,5 @@
             s=s+solution[pos];
             pos++;
-          }  
+          }
           execute("v[j]="+s+";");
         }
@@ -662,5 +654,5 @@
   }
   else
-  { 
+  {
     pos=1;
     for(k=1;k<=size(bx);k++)
@@ -686,5 +678,5 @@
     }
   }
-     
+
   // delete all created files
   dummy=system("sh","rm -f "+matrixfile);
@@ -696,20 +688,15 @@
 }
 
-
-
-
-
-
 proc solve_IP
-"USAGE:   
+"USAGE:
 solve_IP(A,bx,c,alg);       A intmat, bx intvec, c intvec, alg string
-solve_IP(A,bx,c,alg);       A intmat, bx list of intvec, c intvec, alg string 
+solve_IP(A,bx,c,alg);       A intmat, bx list of intvec, c intvec, alg string
 solve_IP(A,bx,c,alg,prsv);  A intmat, bx intvec, c intvec, alg string,
-                            prsv intvec  
+                            prsv intvec
 solve_IP(A,bx,c,alg,prsv);  A intmat, bx list of intvec, c intvec, alg string,
-                            prsv intvec  
-RETURN:  solution of the associated integer programming problem as explained 
+                            prsv intvec
+RETURN:  solution of the associated integer programming problem as explained
          in IP.lib
-         return type = type of bx 
+         return type = type of bx
 EXAMPLE: example solve_IP;  shows an example"
 {
@@ -737,52 +724,46 @@
   }
 }
-
-
-
 example
 {
-"EXAMPLE"; echo=2;
-
-// call with single right hand vector
-intmat A[2][3]=1,1,0,0,1,1;
-A;
-intvec b1=1,1;
-b1;
-intvec c=2,2,1;
-c;
-intvec solution_vector=solve_IP(A,b1,c,"pct");
-solution_vector;
- 
-// call with list of right hand vectors
-intvec b2=-1,1;
-list l=b1,b2;
-l;
-list solution_list=solve_IP(A,l,c,"ct");
-solution_list;			
-
-// call with single initial solution vector
-A=2,1,-1,-1,1,2;
-A;
-b1=3,4,5; 
-solution_vector=solve_IP(A,b1,c,"du");
-
-// call with single initial solution vector and algorithm needing a positive
-// row space vector
-solution_vector=solve_IP(A,b1,c,"hs");
-
-// call with single initial solution vector and positive row space vector
-intvec prsv=1,2,1;
-prsv;
-solution_vector=solve_IP(A,b1,c,"hs",prsv);
-solution_vector;
- 
-// call with list of initial solution vectors and positive row space vector
-b2=7,8,0;
-l=b1,b2;
-l;
-solution_list=solve_IP(A,l,c,"blr",prsv);
-solution_list;
+  "EXAMPLE"; echo=2;
+
+  // call with single right hand vector
+  intmat A[2][3]=1,1,0,0,1,1;
+  A;
+  intvec b1=1,1;
+  b1;
+  intvec c=2,2,1;
+  c;
+  intvec solution_vector=solve_IP(A,b1,c,"pct");
+  solution_vector;
+
+  // call with list of right hand vectors
+  intvec b2=-1,1;
+  list l=b1,b2;
+  l;
+  list solution_list=solve_IP(A,l,c,"ct");
+  solution_list;
+
+  // call with single initial solution vector
+  A=2,1,-1,-1,1,2;
+  A;
+  b1=3,4,5;
+  solution_vector=solve_IP(A,b1,c,"du");
+
+  // call with single initial solution vector and algorithm needing a positive
+  // row space vector
+  solution_vector=solve_IP(A,b1,c,"hs");
+
+  // call with single initial solution vector and positive row space vector
+  intvec prsv=1,2,1;
+  prsv;
+  solution_vector=solve_IP(A,b1,c,"hs",prsv);
+  solution_vector;
+
+  // call with list of initial solution vectors and positive row space vector
+  b2=7,8,0;
+  l=b1,b2;
+  l;
+  solution_list=solve_IP(A,l,c,"blr",prsv);
+  solution_list;
 }
-
-
-
Index: IntegerProgramming/toric.lib
===================================================================
--- IntegerProgramming/toric.lib	(revision 0658d94b02b071f2a019543baea28fe2c95d9226)
+++ IntegerProgramming/toric.lib	(revision 27e935d2c9219a328c4212edf32245b9b2d24782)
@@ -1,16 +1,15 @@
-// $Id: toric.lib,v 1.1.1.1 2000-05-02 12:58:31 Singular Exp $
+// $Id: toric.lib,v 1.2 2000-05-11 09:03:41 Singular Exp $
 //
 // author : Christine Theis
 //
-
-//version="$Id: toric.lib,v 1.1.1.1 2000-05-02 12:58:31 Singular Exp $";
+//version="$Id: toric.lib,v 1.2 2000-05-11 09:03:41 Singular Exp $";
 
 ///////////////////////////////////////////////////////////////////////////////
 
 info="
-LIBRARY: toric.lib		PROCEDURES FOR COMPUTING TORIC IDEALS   
-
-
-Let A an integral (mxn)-matrix. The toric ideal I_A of A is defined 
+LIBRARY: toric.lib                PROCEDURES FOR COMPUTING TORIC IDEALS
+
+
+Let A an integral (mxn)-matrix. The toric ideal I_A of A is defined
 as the ideal
 
@@ -18,17 +17,17 @@
 
 in the ring of n variables x:=x1,...,xn.
-Toric ideals play an important role in polyhedral geometry and may also be 
-used for integer programming. They are generated by binomials with 
-relatively prime monomials. Buchberger's algorithm can be specialized to 
-these structures in a way that considerably speeds up computation.   
+Toric ideals play an important role in polyhedral geometry and may also be
+used for integer programming. They are generated by binomials with
+relatively prime monomials. Buchberger's algorithm can be specialized to
+these structures in a way that considerably speeds up computation.
 
 
 toric_ideal(intmat A, string alg);
 toric_ideal(intmat A, string alg, intvec prsv);
-  
+
     procedures for computing the toric ideal of A
-    They return the standard basis of the toric ideal of A with respect 
+    They return the standard basis of the toric ideal of A with respect
     to the term ordering in the actual basering.
-    When calling this procedure, a ring with n variables should be active. 
+    When calling this procedure, a ring with n variables should be active.
     Not all term orderings are supported: The usual global term orderings
     may be used, but no block orderings combining them.
@@ -42,32 +41,30 @@
 
     The last two seem to be the fastest in the actual implementation.
-    `alg' should be the abbreviation (in brackets) for an algorithm 
-    as above. 
+    `alg' should be the abbreviation (in brackets) for an algorithm
+    as above.
     If `alg' is chosen to be `blr' or `hs', the algorithm needs a
     vector with positive coefficcients in the row space of A. If
     no row of A contains only positive entries, one must use the
-    second version of toric_ideal which takes such a vector in the 
-    third argument. 
-   
+    second version of toric_ideal which takes such a vector in the
+    third argument.
+
 
 toric_std(ideal I);
 
-    computes the standard basis of I using the specialized Buchberger 
-    algorithm. The generating system by which I is given has to consist 
+    computes the standard basis of I using the specialized Buchberger
+    algorithm. The generating system by which I is given has to consist
     of binomials of the form x^u-x^v (although there are other generating
     systems of toric ideals). There is no real check if I is toric.
-    If the generator list of I contains a binomial whose monomials are not 
+    If the generator list of I contains a binomial whose monomials are not
     relatively prime, the procedure outputs a warning. If I is generated by
-    binomials of the above form, but not toric, toric_std computes an ideal 
+    binomials of the above form, but not toric, toric_std computes an ideal
     `between' I and its saturation with respect to all variables.
-                          
+
 ";
 
 ///////////////////////////////////////////////////////////////////////////////
 
-
-
 static proc toric_ideal_1(intmat A, string alg)
-{	
+{
   ideal I;
   // to be returned
@@ -78,5 +75,5 @@
     "ERROR: number of matrix columns must be greater or equal number of ring variables";
     return(I);
-  }	
+  }
 
   // check suitability of actual term ordering
@@ -167,5 +164,5 @@
       "Warning: block orderings are not supported; Dp used for computation";
     }
-  }  
+  }
 
   int pos;
@@ -263,5 +260,5 @@
     return(I);
   }
- 
+
   // check algorithm
   if(alg=="ct" || alg=="pct")
@@ -274,9 +271,9 @@
   }
 
-  // create temporary file with that the external program is called 
+  // create temporary file with that the external program is called
 
   int dummy;
   int process=system("pid");
-  string matrixfile="temp_MATRIX"+string(process);	
+  string matrixfile="temp_MATRIX"+string(process);
   link MATRIX=":w "+matrixfile;
   open(MATRIX);
@@ -295,10 +292,10 @@
     }
   }
- 
+
   // search for positive row space vector, if required by the
-  // algorithm    
+  // algorithm
   int found=0;
   if((alg=="blr") || (alg=="hs"))
-  { 
+  {
     for(i=1;i<=nrows(A);i++)
     {
@@ -318,12 +315,12 @@
     if(found==0)
     {
-      "ERROR: algorithm needs positive vector in the row space of the matrix";     
+      "ERROR: algorithm needs positive vector in the row space of the matrix";
       close(MATRIX);
       dummy=system("sh","rm -f "+matrixfile);
       return(I);
-    } 
+    }
     write(MATRIX,"positive row space vector:");
     for(j=1;j<=ncols(A);j++)
-    { 
+    {
       write(MATRIX,A[found,j]);
     }
@@ -343,5 +340,5 @@
   pos=find(toric_ideal,":",pos);
   pos++;
-  
+
   while(toric_ideal[pos]==" " || toric_ideal[pos]==newline)
   {
@@ -355,5 +352,5 @@
   }
   execute("generators="+number_string+";");
-  
+
   intvec v;
   poly head;
@@ -388,10 +385,10 @@
       if(v[j]>0)
       {
-        head=head*var(j)^v[j];    
+        head=head*var(j)^v[j];
       }
     }
     I[i]=head-tail;
   }
-     
+
   // delete all created files
   dummy=system("sh","rm -f "+matrixfile);
@@ -401,8 +398,6 @@
 }
 
-
-
 static proc toric_ideal_2(intmat A, string alg, intvec prsv)
-{	
+{
   ideal I;
   // to be returned
@@ -413,5 +408,5 @@
     "ERROR: number of matrix columns must equal size of positive row space vector";
     return(I);
-  }	
+  }
 
   // check suitability of actual basering
@@ -420,5 +415,5 @@
     "ERROR: number of matrix columns must be greater or equal number of ring variables";
     return(I);
-  }	
+  }
 
   // check suitability of actual term ordering
@@ -509,5 +504,5 @@
       "Warning: block orderings are not supported; Dp used for computation";
     }
-  }  
+  }
 
   int pos;
@@ -605,5 +600,5 @@
     return(I);
   }
- 
+
   // check algorithm
   if(alg=="ct" || alg=="pct")
@@ -616,9 +611,9 @@
   }
 
-  // create temporary file with that the external program is called 
+  // create temporary file with that the external program is called
 
   int dummy;
   int process=system("pid");
-  string matrixfile="temp_MATRIX"+string(process);	
+  string matrixfile="temp_MATRIX"+string(process);
   link MATRIX=":w "+matrixfile;
   open(MATRIX);
@@ -640,8 +635,8 @@
   // enter positive row space vector, if required by the algorithm
   if((alg=="blr") || (alg=="hs"))
-  { 
+  {
     write(MATRIX,"positive row space vector:");
     for(j=1;j<=ncols(A);j++)
-    { 
+    {
       write(MATRIX,prsv[j]);
     }
@@ -660,5 +655,5 @@
   pos=find(toric_ideal,":",pos);
   pos++;
-  
+
   while(toric_ideal[pos]==" " || toric_ideal[pos]==newline)
   {
@@ -672,5 +667,5 @@
   }
   execute("generators="+number_string+";");
-  
+
   intvec v;
   poly head;
@@ -705,10 +700,10 @@
       if(v[j]>0)
       {
-        head=head*var(j)^v[j];    
+        head=head*var(j)^v[j];
       }
     }
     I[i]=head-tail;
   }
-     
+
   // delete all created files
   dummy=system("sh","rm -f "+matrixfile);
@@ -718,10 +713,8 @@
 }
 
-
-
 proc toric_ideal
-"USAGE:   
+"USAGE:
 toric_ideal(A,alg);            A intmat, alg string
-toric_ideal(A,alg,prsv);       A intmat, alg string, prsv intvec  
+toric_ideal(A,alg,prsv);       A intmat, alg string, prsv intvec
 RETURN:  toric ideal of A as explained in toric.lib
          return type = ideal
@@ -737,34 +730,29 @@
   }
 }
-
-
-
 example
 {
-"EXAMPLE"; echo=2;
-
-ring r=0,(x,y,z),dp; 
-
-// call with two arguments
-intmat A[2][3]=1,1,0,0,1,1;
-A;
-
-ideal I=toric_ideal(A,"du");
-I;
- 
-I=toric_ideal(A,"blr");
-I;
- 
-// call with three arguments
-intvec prsv=1,2,1;
-I=toric_ideal(A,"blr",prsv);
-I;
- 
+  "EXAMPLE"; echo=2;
+  
+  ring r=0,(x,y,z),dp;
+  
+  // call with two arguments
+  intmat A[2][3]=1,1,0,0,1,1;
+  A;
+  
+  ideal I=toric_ideal(A,"du");
+  I;
+  
+  I=toric_ideal(A,"blr");
+  I;
+  
+  // call with three arguments
+  intvec prsv=1,2,1;
+  I=toric_ideal(A,"blr",prsv);
+  I;
+
 }
 
-
-
 proc toric_std(ideal I)
-"USAGE:   toric_std(I);        I ideal        
+"USAGE:   toric_std(I);        I ideal
 RETURN:  standard basis of I as explained in toric.lib
          return type = ideal
@@ -861,5 +849,5 @@
       "Warning: block orderings are not supported; Dp used for computation";
     }
-  }  
+  }
 
   int pos;
@@ -887,5 +875,5 @@
     }
   }
-  
+
   if(external_ord=="" && find(singular_ord,"wp")==3)
   {
@@ -958,10 +946,10 @@
     return(I);
   }
- 
+
   // create first temporary file with which the external program is called
- 
+
   int dummy;
   int process=system("pid");
-  string groebnerfile="temp_GROEBNER"+string(process);	
+  string groebnerfile="temp_GROEBNER"+string(process);
   link GROEBNER=":w "+groebnerfile;
   open(GROEBNER);
@@ -969,10 +957,10 @@
   write(GROEBNER,"GROEBNER","computed with algorithm:","pt","term ordering:","elimination block",0,"weighted block",nvars(basering),external_ord);
   // algorithm is totally unimportant, only required by the external program
-  
+
   for(i=1;i<=nvars(basering);i++)
   {
     write(GROEBNER,weightvec[i]);
   }
-  
+
   write(GROEBNER,"size:",size(I),"Groebner basis:");
   poly head;
@@ -983,5 +971,5 @@
   for(j=1;j<=size(I);j++)
   {
-    // test suitability of generator j 
+    // test suitability of generator j
     rest=I[j];
     head=lead(rest);
@@ -989,5 +977,5 @@
     tail=lead(rest);
     rest=rest-tail;
-    
+
     if(head==0 && tail==0 && rest!=0)
     {
@@ -997,5 +985,5 @@
       return(J);
     }
-    
+
     if(leadcoef(tail)!=-leadcoef(head))
       // generator no difference of monomials (or a constant multiple)
@@ -1006,10 +994,10 @@
       return(J);
     }
-       
+
     if(gcd(head,tail)!=1)
     {
       "Warning: monomials of generator "+string(j)+" of input ideal are not relatively prime";
     }
-    
+
     // write vector representation of generator j into the file
     v=leadexp(head)-leadexp(tail);
@@ -1020,20 +1008,20 @@
   }
   close(GROEBNER);
-  
+
   // create second temporary file
 
-  string newcostfile="temp_NEW_COST"+string(process);	
+  string newcostfile="temp_NEW_COST"+string(process);
   link NEW_COST=":w "+newcostfile;
   open(NEW_COST);
 
-  write(NEW_COST,"NEW_COST","variables:",nvars(basering),"cost vector:");  
+  write(NEW_COST,"NEW_COST","variables:",nvars(basering),"cost vector:");
   for(i=1;i<=nvars(basering);i++)
   {
     write(NEW_COST,weightvec[i]);
   }
-  
+
   // call external program
   dummy=system("sh","change_cost "+groebnerfile+" "+newcostfile);
-  
+
   // read toric standard basis from created file
   link TORIC_IDEAL=":r "+newcostfile+".GB.pt";
@@ -1044,5 +1032,5 @@
   pos=find(toric_ideal,":",pos);
   pos++;
-  
+
   while(toric_ideal[pos]==" " || toric_ideal[pos]==newline)
   {
@@ -1085,55 +1073,47 @@
       if(v[i]>0)
       {
-        head=head*var(i)^v[i];    
+        head=head*var(i)^v[i];
       }
     }
     J[j]=head-tail;
   }
-     
+
   // delete all created files
   dummy=system("sh","rm -f "+groebnerfile);
   dummy=system("sh","rm -f "+groebnerfile+".GB.pt");
-  dummy=system("sh","rm -f "+newcostfile);  
+  dummy=system("sh","rm -f "+newcostfile);
 
   return(J);
 }
-
-
-
 example
 {
-"EXAMPLE"; echo=2;
-
-ring r=0,(x,y,z),wp(3,2,1);
-
-// call with toric ideal (of the matrix A=(1,1,1))
-ideal I=x-y,x-z;
-ideal J=toric_std(I);
-J;
- 
-// call with the same ideal, but badly chosen generators:
-// not only binomials 
-I=x-y,2x-y-z;
-J=toric_std(I);
-// binomials whose monomials are not relatively prime
-I=x-y,xy-yz,y-z;
-J=toric_std(I);
-J;
- 
-// call with a non-toric ideal that seems to be toric
-I=x-yz,xy-z;
-J=toric_std(I);
-J;
-// comparison with real standard basis and saturation 
-ideal H=std(I);
-H;
-LIB "elim.lib";
-sat(H,xyz);
+  "EXAMPLE"; echo=2;
+  
+  ring r=0,(x,y,z),wp(3,2,1);
+  
+  // call with toric ideal (of the matrix A=(1,1,1))
+  ideal I=x-y,x-z;
+  ideal J=toric_std(I);
+  J;
+  
+  // call with the same ideal, but badly chosen generators:
+  // not only binomials
+  I=x-y,2x-y-z;
+  J=toric_std(I);
+  // binomials whose monomials are not relatively prime
+  I=x-y,xy-yz,y-z;
+  J=toric_std(I);
+  J;
+  
+  // call with a non-toric ideal that seems to be toric
+  I=x-yz,xy-z;
+  J=toric_std(I);
+  J;
+  // comparison with real standard basis and saturation
+  ideal H=std(I);
+  H;
+  LIB "elim.lib";
+  sat(H,xyz);
 }
 
-
-
 //////////////////////////////////////////////////////////////////////////////
-
-
-// toric_std(ideal I); ring term ordering
