Index: Singular/clapsing.cc
===================================================================
--- Singular/clapsing.cc	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/clapsing.cc	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -3,5 +3,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-// $Id: clapsing.cc,v 1.52 1999-06-15 08:32:31 Singular Exp $
+// $Id: clapsing.cc,v 1.53 1999-06-28 16:06:22 Singular Exp $
 /*
 * ABSTRACT: interface between Singular and factory
@@ -639,5 +639,5 @@
     {
       (*v)=new intvec(1);
-      (*v)[1]=1;
+      (**v)[0]=1;
     }
     return res;
@@ -1138,4 +1138,7 @@
   ideal f=singclap_factorize((poly)(u->Data()), &v, 0);
   if (f==NULL) return TRUE;
+  #ifdef MDEBUG
+  v->ivTEST();
+  #endif
   lists l=(lists)Alloc(sizeof(slists));
   l->Init(2);
Index: Singular/intvec.cc
===================================================================
--- Singular/intvec.cc	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/intvec.cc	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR      *
 *****************************************/
-/* $Id: intvec.cc,v 1.12 1999-04-17 12:30:17 Singular Exp $ */
+/* $Id: intvec.cc,v 1.13 1999-06-28 16:06:23 Singular Exp $ */
 /*
 * ABSTRACT: class intvec: lists/vectors of integers
@@ -82,6 +82,6 @@
   if ((col == 1)&&(mat!=INTMAT_CMD))
   {
-    int i;
-    for (i=0; i<row-1; i++)
+    int i=0;
+    for (; i<row-1; i++)
     {
       StringAppend("%d,",v[i]);
Index: Singular/intvec.h
===================================================================
--- Singular/intvec.h	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/intvec.h	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -4,5 +4,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: intvec.h,v 1.7 1999-04-16 07:53:34 obachman Exp $ */
+/* $Id: intvec.h,v 1.8 1999-06-28 16:06:23 Singular Exp $ */
 /*
 * ABSTRACT: class intvec: lists/vectors of integers
@@ -32,10 +32,14 @@
     int range(int i, int j)
        { return ((i<row) && (i>=0) && (j<col) && (j>=0)); }
-    int& operator[](int i) {
+    int& operator[](int i)
+    {
+       #ifndef NDEBUG
        if((i<0)||(i>=row*col))
        {
           Werror("wrong intvec index:%d\n",i);
        }
-       return v[i];}
+       #endif
+       return v[i];
+    }
 #define IMATELEM(M,I,J) (M)[(I-1)*(M).cols()+J-1]
     void operator+=(int intop);
@@ -68,4 +72,11 @@
          }
        }
+    void ivTEST()
+       {
+#ifdef MDEBUG
+         mmTestL(this);
+         mmTest((ADDRESS)v,sizeof(int)*row*col);
+#endif
+       }
 };
 intvec * ivCopy(intvec * o);
Index: Singular/mpr_base.cc
===================================================================
--- Singular/mpr_base.cc	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/mpr_base.cc	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -2,7 +2,7 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mpr_base.cc,v 1.1 1999-06-28 12:48:11 wenk Exp $ */
-
-/* 
+/* $Id: mpr_base.cc,v 1.2 1999-06-28 16:06:24 Singular Exp $ */
+
+/*
  * ABSTRACT - multipolynomial resultants - resultant matrices
  *            ( sparse, dense, u-resultant solver )
@@ -53,5 +53,5 @@
 #define MINVDIST       0.0
 #define RVMULT         0.00005 // 0.000000005
-#define MAXVARS        100           
+#define MAXVARS        100
 //<-
 
@@ -62,8 +62,9 @@
 
 /* Linear Program stuff */
-struct linProg {          // Linear Program stuff
-  mprfloat **LiPM;            
-  int *izrov, *iposv;       
-  int LiPM_cols,LiPM_rows; 
+struct linProg
+{
+  mprfloat **LiPM;
+  int *izrov, *iposv;
+  int LiPM_cols,LiPM_rows;
 };
 
@@ -89,5 +90,5 @@
 
   const poly getUDet( const number* evpoint );
-  
+
 private:
   resMatrixSparse( const resMatrixSparse & );
@@ -102,5 +103,5 @@
 
   /* Remaps a result of LP to the according point set Qi.
-   * Returns false iff remaping was not possible, otherwise true. 
+   * Returns false iff remaping was not possible, otherwise true.
    */
   bool remapXiToPoint( const int indx, pointSet **pQ, int *set, int *vtx );
@@ -120,13 +121,13 @@
 private:
   ideal gls;
-  
+
   int n, idelem;     // number of variables, polynoms
   int numSet0;       // number of elements in S0
   int msize;         // size of matrix
-  
+
   intvec *uRPos;
 
   ideal rmat;        // sparse matrix representation
-  
+
   linProg LP;
 };
@@ -138,10 +139,12 @@
 typedef unsigned int Coord_t;
 
-struct setID {
+struct setID
+{
   int set;
   int pnt;
 };
 
-struct onePoint {
+struct onePoint
+{
   Coord_t * point;             // point[0] is unused, maxial dimension is MAXVARS+1
   setID rc;                    // filled in by Row Content Function
@@ -151,6 +154,7 @@
 typedef struct onePoint * onePointP;
 
-/* sparse matrix entry */ 
-struct _entry {
+/* sparse matrix entry */
+struct _entry
+{
   number num;
   int col;
@@ -162,5 +166,6 @@
 
 //-> class pointSet
-class pointSet {
+class pointSet
+{
 private:
   onePointP *points;     // set of onePoint's, index [1..num], supports of monoms
@@ -218,5 +223,5 @@
   /* Returns index of supp(LT(p)) in pointSet. */
   int getExpPos( const poly p );
-  
+
   /** sort lex
    */
@@ -252,5 +257,6 @@
 //-> class convexHull
 /* Compute convex hull of given exponent set */
-class convexHull {
+class convexHull
+{
 public:
   convexHull( linProgP _pLP ) : pLP(_pLP) {}
@@ -264,5 +270,5 @@
 
 private:
-  /** Returns true iff the support of poly pointPoly is inside the 
+  /** Returns true iff the support of poly pointPoly is inside the
    * convex hull of all points given by the  support of poly p.
    */
@@ -278,5 +284,6 @@
 //-> class mayanPyramidAlg
 /* Compute all lattice points in a given convex hull */
-class mayanPyramidAlg {
+class mayanPyramidAlg
+{
 public:
   mayanPyramidAlg( linProgP _pLP ) : n(pVariables), pLP(_pLP) {}
@@ -290,6 +297,6 @@
 private:
 
-  /** Recursive Mayan Pyramid algorithm for directly computing MinkowskiSum 
-   * lattice points for (n+1)-fold MinkowskiSum of given point sets Qi[].		
+  /** Recursive Mayan Pyramid algorithm for directly computing MinkowskiSum
+   * lattice points for (n+1)-fold MinkowskiSum of given point sets Qi[].
    * Recursively for range of dim: dim in [0..n); acoords[0..var) fixed.
    * Stores only MinkowskiSum points of udist > 0: done by storeMinkowskiSumPoints.
@@ -299,5 +306,5 @@
   /**  Compute v-distance via Linear Programing
    * Linear Program finds the v-distance of the point in accords[].
-   * The v-distance is the distance along the direction v to boundary of 
+   * The v-distance is the distance along the direction v to boundary of
    * Minkowski Sum of Qi (here vector v is represented by shift[]).
    * Returns the v-distance or -1.0 if an error occured.
@@ -307,5 +314,5 @@
   /** LP for finding min/max coord in MinkowskiSum, given previous coors.
    * Assume MinkowskiSum in non-negative quadrants
-   * coor in [0,n); fixed coords in acoords[0..coor)			
+   * coor in [0,n); fixed coords in acoords[0..coor)
    */
   void mn_mx_MinkowskiSum( int dim, Coord_t *minR, Coord_t *maxR );
@@ -315,5 +322,5 @@
    */
   bool storeMinkowskiSumPoint();
-  
+
 private:
   pointSet **Qi;
@@ -335,5 +342,6 @@
   int i, j;
 
-  for (i = 1; i <= maxrow; i++) {
+  for (i = 1; i <= maxrow; i++)
+  {
     Print("[");
     for (j = 1; j <= maxcol; j++) Print("% 7.2f, ", a[i][j]);
@@ -346,5 +354,6 @@
 
   printf("Output matrix from LinProg");
-  for (i = 1; i <= nrows; i++) {
+  for (i = 1; i <= nrows; i++)
+  {
     printf("\n[ ");
     if (i == 1) printf("  ");
@@ -360,5 +369,6 @@
 {
   int i;
-  for ( i= 1; i <= n; i++ ) {
+  for ( i= 1; i <= n; i++ )
+  {
     Print(" %d",vert->point[i] );
 #ifdef LONG_OUTPUT
@@ -372,21 +382,32 @@
   int val;
   Print(" matrix m[%d][%d]=(\n",MATROWS( omat ),MATCOLS( omat ));
-  for ( i= 1; i <= MATROWS( omat ); i++ ) {
-    for ( j= 1; j <= MATCOLS( omat ); j++ ) {
-      if ( MATELEM( omat, i, j) && pGetCoeff( MATELEM( omat, i, j) ) ) {
-	val= nInt(pGetCoeff( MATELEM( omat, i, j) ));
-	if ( i==MATROWS(omat) && j==MATCOLS(omat) ) {
-	  if ( !val ) Print(" 0 ");
-	  else Print("%d ",val);
-	} else {
-	  if ( !val ) Print(" 0, ");
-	  else Print("%d, ",val);
-	}
-      } else {
-	if ( i==MATROWS(omat) && j==MATCOLS(omat) ) {
-	  Print("  0");
-	} else {
-	  Print("  0, ");
-	}
+  for ( i= 1; i <= MATROWS( omat ); i++ )
+  {
+    for ( j= 1; j <= MATCOLS( omat ); j++ )
+    {
+      if ( MATELEM( omat, i, j) && pGetCoeff( MATELEM( omat, i, j) ) )
+      {
+        val= nInt(pGetCoeff( MATELEM( omat, i, j) ));
+        if ( i==MATROWS(omat) && j==MATCOLS(omat) )
+        {
+          if ( !val ) Print(" 0 ");
+          else Print("%d ",val);
+        }
+        else
+        {
+          if ( !val ) Print(" 0, ");
+          else Print("%d, ",val);
+        }
+      }
+      else
+      {
+        if ( i==MATROWS(omat) && j==MATCOLS(omat) )
+        {
+          Print("  0");
+        }
+        else
+        {
+          Print("  0, ");
+        }
       }
     }
@@ -394,5 +415,5 @@
   }
   Print(");\n");
-}    
+}
 #endif
 //<-
@@ -404,5 +425,6 @@
   int i;
   points = (onePointP *)Alloc( (count+1) * sizeof(onePointP) );
-  for ( i= 0; i <= max; i++ ) {
+  for ( i= 0; i <= max; i++ )
+  {
     points[i]= (onePointP)Alloc( sizeof(onePoint) );
     points[i]->point= (Coord_t *)Alloc0( (dim+2) * sizeof(Coord_t) );
@@ -415,5 +437,6 @@
   int i;
   int fdim= lifted ? dim+1 : dim+2;
-  for ( i= 0; i <= max; i++ ) {
+  for ( i= 0; i <= max; i++ )
+  {
     Free( (ADDRESS) points[i]->point, fdim * sizeof(Coord_t) );
     Free( (ADDRESS) points[i], sizeof(onePoint) );
@@ -430,11 +453,13 @@
 inline bool pointSet::checkMem()
 {
-  if ( num >= max ) {
+  if ( num >= max )
+  {
     int i;
     int fdim= lifted ? dim+1 : dim+2;
-    points= (onePointP*)ReAlloc( points, 
-				 (max+1) * sizeof(onePointP), 
-				 (2*max + 1) * sizeof(onePointP) );
-    for ( i= max+1; i <= max*2; i++ ) {
+    points= (onePointP*)ReAlloc( points,
+                                 (max+1) * sizeof(onePointP),
+                                 (2*max + 1) * sizeof(onePointP) );
+    for ( i= max+1; i <= max*2; i++ )
+    {
       points[i]= (onePointP)Alloc( sizeof(struct onePoint) );
       points[i]->point= (Coord_t *)Alloc0( fdim * sizeof(Coord_t) );
@@ -483,5 +508,6 @@
 {
   assume( indx > 0 && indx <= num );
-  if ( indx != num ) {
+  if ( indx != num )
+  {
     onePointP tmp;
     tmp= points[indx];
@@ -498,11 +524,13 @@
   int i,j;
 
-  for ( i= 1; i <= num; i++ ) {
+  for ( i= 1; i <= num; i++ )
+  {
     for ( j= 1; j <= dim; j++ )
       if ( points[i]->point[j] != vert->point[j] ) break;
     if ( j > dim ) break;
   }
-  
-  if ( i > num ) {
+
+  if ( i > num )
+  {
     addPoint( vert );
     return true;
@@ -515,11 +543,13 @@
   int i,j;
 
-  for ( i= 1; i <= num; i++ ) {
+  for ( i= 1; i <= num; i++ )
+  {
     for ( j= 1; j <= dim; j++ )
       if ( points[i]->point[j] != (Coord_t) vert[j] ) break;
     if ( j > dim ) break;
   }
-  
-  if ( i > num ) {
+
+  if ( i > num )
+  {
     addPoint( vert );
     return true;
@@ -535,14 +565,17 @@
   vert= (Exponent_t *)Alloc( (dim+1) * sizeof(Exponent_t) );
 
-  while ( piter ) {
+  while ( piter )
+  {
     pGetExpV( piter, vert );
 
-    for ( i= 1; i <= num; i++ ) {
+    for ( i= 1; i <= num; i++ )
+    {
       for ( j= 1; j <= dim; j++ )
-	if ( points[i]->point[j] != (Coord_t) vert[j] ) break;
+        if ( points[i]->point[j] != (Coord_t) vert[j] ) break;
       if ( j > dim ) break;
     }
 
-    if ( i > num ) {
+    if ( i > num )
+    {
       addPoint( vert );
     }
@@ -562,5 +595,6 @@
 
   pGetExpV( p, vert );
-  for ( i= 1; i <= num; i++ ) {
+  for ( i= 1; i <= num; i++ )
+  {
     for ( j= 1; j <= dim; j++ )
       if ( points[i]->point[j] != (Coord_t) vert[j] ) break;
@@ -586,10 +620,13 @@
 {
   int i;
-  
-  for ( i= 1; i <= dim; i++ ) {
-    if ( points[a]->point[i] > points[b]->point[i] ) {
+
+  for ( i= 1; i <= dim; i++ )
+  {
+    if ( points[a]->point[i] > points[b]->point[i] )
+    {
       return false;
     }
-    if ( points[a]->point[i] < points[b]->point[i] ) {
+    if ( points[a]->point[i] < points[b]->point[i] )
+    {
       return true;
     }
@@ -602,10 +639,13 @@
 {
   int i;
-  
-  for ( i= 1; i <= dim; i++ ) {
-    if ( points[a]->point[i] < points[b]->point[i] ) {
+
+  for ( i= 1; i <= dim; i++ )
+  {
+    if ( points[a]->point[i] < points[b]->point[i] )
+    {
       return false;
     }
-    if ( points[a]->point[i] > points[b]->point[i] ) {
+    if ( points[a]->point[i] > points[b]->point[i] )
+    {
       return true;
     }
@@ -621,13 +661,16 @@
   onePointP tmp;
 
-  while ( found ) {
+  while ( found )
+  {
     found= false;
-    for ( i= 1; i < num; i++ ) {
-      if ( larger( i, i+1 ) ) {
-	tmp= points[i];
-	points[i]= points[i+1];
-	points[i+1]= tmp;
-	
-	found= true;
+    for ( i= 1; i < num; i++ )
+    {
+      if ( larger( i, i+1 ) )
+      {
+        tmp= points[i];
+        points[i]= points[i+1];
+        points[i+1]= tmp;
+
+        found= true;
       }
     }
@@ -642,26 +685,30 @@
 
   time_t *tp = NULL;
-  seed = ((int)time(tp) % MAXSEED) + index; // secs since 1/1/70 ->[1,MAXSEED] 
+  seed = ((int)time(tp) % MAXSEED) + index; // secs since 1/1/70 ->[1,MAXSEED]
   //seed= 100+index;
-  
+
   dim++;
 
-  if ( !l ) {
+  if ( l==NULL )
+  {
     outerL= false;
     l= (int *)Alloc( (dim+1) * sizeof(int) ); // [1..dim-1]
-    
+
     srand48( (long)(seed*(index+MAXSEED*18)) );  // index+MAXSEED*MAXVARS
-    for(i = 1; i < dim; i++) {
+    for(i = 1; i < dim; i++)
+    {
       l[i]= 1 + ((unsigned int) mrand48()) % LIFT_COOR;
     }
   }
-  for ( j=1; j <= num; j++ ) {
+  for ( j=1; j <= num; j++ )
+  {
     sum= 0;
-    for ( i=1; i < dim; i++ ) {
+    for ( i=1; i < dim; i++ )
+    {
       sum += (int)points[j]->point[i] * l[i];
     }
     points[j]->point[dim]= sum;
   }
-  
+
 #ifdef mprDEBUG_ALL
   Print(" lift vector: ");
@@ -670,5 +717,6 @@
 #ifdef mprDEBUG_ALL
   Print(" lifted points: \n");
-  for ( j=1; j <= num; j++ ) {
+  for ( j=1; j <= num; j++ )
+  {
     Print("%d: <",j);print_exp(points[j],dim);Print(">\n");
   }
@@ -698,23 +746,26 @@
 {
   int i, j, col, icase;
-  int numcons;		// num of constraints 
-  int numpts;		// num of pts in defining support 
-  int numcols;		// tot number of cols 
-  
-  numcons = n+1;	
-  numpts = m-1;	
-  numcols = numpts+1;		// this includes col of cts 
-
-  pLP->LiPM[1][1] = +0.0;  pLP->LiPM[1][2] = +1.0;	// optimize (arbitrary) var 
-  pLP->LiPM[2][1] = +1.0;  pLP->LiPM[2][2] = -1.0; 	// lambda vars sum up to 1 
-  for ( j=3; j<=numcols; j++) {
+  int numcons;                // num of constraints
+  int numpts;                // num of pts in defining support
+  int numcols;                // tot number of cols
+
+  numcons = n+1;
+  numpts = m-1;
+  numcols = numpts+1;                // this includes col of cts
+
+  pLP->LiPM[1][1] = +0.0;  pLP->LiPM[1][2] = +1.0;        // optimize (arbitrary) var
+  pLP->LiPM[2][1] = +1.0;  pLP->LiPM[2][2] = -1.0;         // lambda vars sum up to 1
+  for ( j=3; j<=numcols; j++)
+  {
     pLP->LiPM[1][j] = +0.0; pLP->LiPM[2][j] = -1.0;
   }
 
-  for( i= 1; i <= n; i++) {	// each row constraints one coor 
+  for( i= 1; i <= n; i++) {        // each row constraints one coor
     pLP->LiPM[i+2][1] = (mprfloat)pGetExp(pointPoly,i);
     col = 2;
-    for( j= 1; j <= m; j++ ) {
-      if( j != site ) {
+    for( j= 1; j <= m; j++ )
+    {
+      if( j != site )
+      {
         pLP->LiPM[i+2][col] = -(mprfloat)pGetExp( monomAt(p,j), i );
         col++;
@@ -728,11 +779,13 @@
 #endif
 #if 1
-  if ( numcons + 1 > pLP->LiPM_rows ) Werror("convexHull::inHull: #rows > #pLP->LiPM_rows!");
-  if ( numcols + 1 > pLP->LiPM_cols ) Werror("convexHull::inHull: #cols > #pLP->LiPM_cols!");
+  if ( numcons + 1 > pLP->LiPM_rows )
+    WerrorS("convexHull::inHull: #rows > #pLP->LiPM_rows!");
+  if ( numcols + 1 > pLP->LiPM_cols )
+    WerrorS("convexHull::inHull: #cols > #pLP->LiPM_cols!");
 #endif
 
   simplx( pLP->LiPM, numcons, numcols-1, 0, 0, numcons, &icase, pLP->izrov, pLP->iposv);
 
-  return (icase == 0);	
+  return (icase == 0);
 }
 
@@ -747,24 +800,28 @@
   Exponent_t * vert;
 
-  n= pVariables;	
+  n= pVariables;
   vert= (Exponent_t *)Alloc( (idelem+1) * sizeof(Exponent_t) );
 
-  Q = (pointSet **)Alloc( idelem * sizeof(pointSet*) );	// support hulls 
+  Q = (pointSet **)Alloc( idelem * sizeof(pointSet*) );        // support hulls
   for ( i= 0; i < idelem; i++ )
     Q[i] = new pointSet( pVariables, i+1, pLength((gls->m)[i])+1 );
 
-  for( i= 0; i < idelem; i++ ) {
+  for( i= 0; i < idelem; i++ )
+  {
     k=1;
     m = pLength( (gls->m)[i] );
 
     poly p= (gls->m)[i];
-    for( j= 1; j <= m; j++) {  // für jeden Exponentvektor 
-      if( !inHull( (gls->m)[i], p, m, j ) ) {
-	pGetExpV( p, vert );
+    for( j= 1; j <= m; j++) {  // für jeden Exponentvektor
+      if( !inHull( (gls->m)[i], p, m, j ) )
+      {
+        pGetExpV( p, vert );
         Q[i]->addPoint( vert );
-	k++;
-	mprSTICKYPROT(ST_SPARSE_VADD);
-      } else {
-	mprSTICKYPROT(ST_SPARSE_VREJ);
+        k++;
+        mprSTICKYPROT(ST_SPARSE_VADD);
+      }
+      else
+      {
+        mprSTICKYPROT(ST_SPARSE_VREJ);
       }
       pIter( p );
@@ -777,7 +834,9 @@
 #ifdef mprDEBUG_PROT
   PrintLn();
-  for( i= 0; i < idelem; i++ ) {
+  for( i= 0; i < idelem; i++ )
+  {
     Print(" \\Conv(Qi[%d]): #%d\n", i,Q[i]->num );
-    for ( j=1; j <= Q[i]->num; j++ ) {
+    for ( j=1; j <= Q[i]->num; j++ )
+    {
       Print("%d: <",j);print_exp( (*Q[i])[j] , pVariables );Print(">\n");
     }
@@ -815,20 +874,22 @@
 
   numverts = 0;
-  for( i=0; i<=n; i++) {
+  for( i=0; i<=n; i++)
+  {
     numverts += Qi[i]->num;
   }
-  cols = numverts + 2;  
-
-  //if( dim < 1 || dim > n ) Werror("mayanPyramidAlg::vDistance: Known coords dim off range");
-
-  pLP->LiPM[1][1] = 0.0; 
-  pLP->LiPM[1][2] = 1.0;	// maximize	
+  cols = numverts + 2;
+
+  //if( dim < 1 || dim > n )
+  //  WerrorS("mayanPyramidAlg::vDistance: Known coords dim off range");
+
+  pLP->LiPM[1][1] = 0.0;
+  pLP->LiPM[1][2] = 1.0;        // maximize
   for( j=3; j<=cols; j++) pLP->LiPM[1][j] = 0.0;
 
-  for( i=0; i <= n; i++ ) {			
+  for( i=0; i <= n; i++ ) {
     pLP->LiPM[i+2][1] = 1.0;
     pLP->LiPM[i+2][2] = 0.0;
   }
-  for( i=1; i<=dim; i++) {		
+  for( i=1; i<=dim; i++) {
     pLP->LiPM[n+2+i][1] = (mprfloat)(acoords[i-1]);
     pLP->LiPM[n+2+i][2] = -shift[i];
@@ -837,11 +898,13 @@
   ii = -1;
   col = 2;
-  for ( i= 0; i <= n; i++ ) {			
+  for ( i= 0; i <= n; i++ ) {
     ii++;
-    for( k= 1; k <= Qi[ii]->num; k++ ) {
+    for( k= 1; k <= Qi[ii]->num; k++ )
+    {
       col++;
-      for ( r= 0; r <= n; r++ ) {
-	if ( r == i ) pLP->LiPM[r+2][col] = -1.0;
-	else pLP->LiPM[r+2][col] = 0.0;
+      for ( r= 0; r <= n; r++ )
+      {
+        if ( r == i ) pLP->LiPM[r+2][col] = -1.0;
+        else pLP->LiPM[r+2][col] = 0.0;
       }
       for( r= 1; r <= dim; r++ ) pLP->LiPM[r+n+2][col] = -(mprfloat)((*Qi[ii])[k]->point[r]);
@@ -849,7 +912,8 @@
   }
 
-  if( col != cols) Werror("mayanPyramidAlg::vDistance:" 
-			  "setting up matrix for udist: col %d != cols %d",col,cols);
-  constr = n+dim+1;			
+  if( col != cols)
+    Werror("mayanPyramidAlg::vDistance:"
+           "setting up matrix for udist: col %d != cols %d",col,cols);
+  constr = n+dim+1;
 
 #ifdef mprDEBUG_ALL
@@ -861,6 +925,8 @@
 
 #if 1
-  if ( constr + 1 > pLP->LiPM_rows ) Werror("mayanPyramidAlg::vDistance: #rows > #pLP->LiPM_rows!");
-  if ( cols + 1 > pLP->LiPM_cols ) Werror("mayanPyramidAlg::vDistance: #cols > #pLP->LiPM_cols!");
+  if ( constr + 1 > pLP->LiPM_rows )
+    WerrorS("mayanPyramidAlg::vDistance: #rows > #pLP->LiPM_rows!");
+  if ( cols + 1 > pLP->LiPM_cols )
+    WerrorS("mayanPyramidAlg::vDistance: #cols > #pLP->LiPM_cols!");
 #endif
 
@@ -873,9 +939,11 @@
   print_bmat( pLP->LiPM, constr+1, cols+1-constr, cols, pLP->iposv);
 #endif
-   
+
   if( icase != 0 ) {  // check for errors
-    Werror("mayanPyramidAlg::vDistance: \n");
-    if( icase == 1 ) Werror(" vDistance: Unbounded v-distance: probably 1st v-coor=0");
-    if( icase == -1 ) Werror(" vDistance: Infeasible v-distance");
+    WerrorS("mayanPyramidAlg::vDistance:");
+    if( icase == 1 )
+      WerrorS(" vDistance: Unbounded v-distance: probably 1st v-coor=0");
+    if( icase == -1 )
+      WerrorS(" vDistance: Infeasible v-distance");
     return -1.0;
   }
@@ -895,20 +963,22 @@
 
   // common part of the matrix
-  pLP->LiPM[1][1] = 0.0;		
-  for( i=2; i<=n+2; i++) {	
-    pLP->LiPM[i][1] = 1.0;	// 1st col	
-    pLP->LiPM[i][2] = 0.0;	// 2nd col	
+  pLP->LiPM[1][1] = 0.0;
+  for( i=2; i<=n+2; i++) {
+    pLP->LiPM[i][1] = 1.0;        // 1st col
+    pLP->LiPM[i][2] = 0.0;        // 2nd col
   }
 
   la_cons_row = 1;
   cols = 2;
-  for( i=0; i<=n; i++) { 
+  for( i=0; i<=n; i++)
+  {
     la_cons_row++;
-    for( j=1; j<= Qi[i]->num; j++) {
+    for( j=1; j<= Qi[i]->num; j++)
+    {
       cols++;
-      pLP->LiPM[1][cols] = 0.0;	// set 1st row 0
+      pLP->LiPM[1][cols] = 0.0;        // set 1st row 0
       for( k=2; k<=n+2; k++) {  // lambdas sum up to 1
-	if( k != la_cons_row) pLP->LiPM[k][cols] = 0.0;
-	else pLP->LiPM[k][cols] = -1.0;
+        if( k != la_cons_row) pLP->LiPM[k][cols] = 0.0;
+        else pLP->LiPM[k][cols] = -1.0;
       }
       for( k=1; k<=n; k++) pLP->LiPM[k+n+2][cols] = -(mprfloat)((*Qi[i])[j]->point[k]);
@@ -916,5 +986,5 @@
   } // i
 
-  for( i= 0; i < dim; i++ ) {		// fixed coords
+  for( i= 0; i < dim; i++ ) {                // fixed coords
     pLP->LiPM[i+n+3][1] = acoords[i];
     pLP->LiPM[i+n+3][2] = 0.0;
@@ -922,6 +992,6 @@
   pLP->LiPM[dim+n+3][1] = 0.0;
 
-  
-  pLP->LiPM[1][2] = -1.0;	                // minimize
+
+  pLP->LiPM[1][2] = -1.0;                        // minimize
   pLP->LiPM[dim+n+3][2] = 1.0;
 
@@ -934,14 +1004,18 @@
 
 #if 1
-  if ( cons + 1 > pLP->LiPM_rows ) Werror(" mn_mx_MinkowskiSum: #rows > #pLP->LiPM_rows!");
-  if ( cols + 1 > pLP->LiPM_cols ) Werror(" mn_mx_MinkowskiSum: #cols > #pLP->LiPM_cols!");
+  if ( cons + 1 > pLP->LiPM_rows )
+    WerrorS(" mn_mx_MinkowskiSum: #rows > #pLP->LiPM_rows!");
+  if ( cols + 1 > pLP->LiPM_cols )
+    WerrorS(" mn_mx_MinkowskiSum: #cols > #pLP->LiPM_cols!");
 #endif
 
   // simplx finds MIN for obj.fnc, puts it in [1,1]
   simplx(pLP->LiPM, cons, cols-1, 0, 0, cons, &icase, pLP->izrov, pLP->iposv);
-  
+
   if ( icase != 0 ) { // check for errors
-    if( icase < 0) Werror(" mn_mx_MinkowskiSum: LinearProgram: minR: infeasible");
-    if( icase > 0) Werror(" mn_mx_MinkowskiSum: LinearProgram: minR: unbounded");
+    if( icase < 0)
+      WerrorS(" mn_mx_MinkowskiSum: LinearProgram: minR: infeasible");
+    else if( icase > 0)
+      WerrorS(" mn_mx_MinkowskiSum: LinearProgram: minR: unbounded");
   }
 
@@ -952,19 +1026,21 @@
 
   // common part of the matrix again
-  pLP->LiPM[1][1] = 0.0;			
-  for( i=2; i<=n+2; i++) {		
-    pLP->LiPM[i][1] = 1.0;			
-    pLP->LiPM[i][2] = 0.0;			
+  pLP->LiPM[1][1] = 0.0;
+  for( i=2; i<=n+2; i++) {
+    pLP->LiPM[i][1] = 1.0;
+    pLP->LiPM[i][2] = 0.0;
   }
   la_cons_row = 1;
   cols = 2;
-  for( i=0; i<=n; i++) { 
+  for( i=0; i<=n; i++)
+  {
     la_cons_row++;
-    for( j=1; j<=Qi[i]->num; j++) {
+    for( j=1; j<=Qi[i]->num; j++)
+    {
       cols++;
-      pLP->LiPM[1][cols] = 0.0;		
-      for( k=2; k<=n+2; k++) {	
-	if( k != la_cons_row) pLP->LiPM[k][cols] = 0.0;
-	else pLP->LiPM[k][cols] = -1.0;
+      pLP->LiPM[1][cols] = 0.0;
+      for( k=2; k<=n+2; k++) {
+        if( k != la_cons_row) pLP->LiPM[k][cols] = 0.0;
+        else pLP->LiPM[k][cols] = -1.0;
       }
       for( k=1; k<=n; k++) pLP->LiPM[k+n+2][cols] = -(mprfloat)((*Qi[i])[j]->point[k]);
@@ -972,5 +1048,5 @@
   }  // i
 
-  for( i= 0; i < dim; i++ ) {		// fixed coords 
+  for( i= 0; i < dim; i++ ) {                // fixed coords
     pLP->LiPM[i+n+3][1] = acoords[i];
     pLP->LiPM[i+n+3][2] = 0.0;
@@ -978,6 +1054,6 @@
   pLP->LiPM[dim+n+3][1] = 0.0;
 
-  pLP->LiPM[1][2] = 1.0;			// maximize  
-  pLP->LiPM[dim+n+3][2] = 1.0;		// var = sum of pnt coords 
+  pLP->LiPM[1][2] = 1.0;                        // maximize
+  pLP->LiPM[dim+n+3][2] = 1.0;                // var = sum of pnt coords
 
 #ifdef mprDEBUG_ALL
@@ -987,6 +1063,8 @@
 
 #if 1
-  if ( cons + 1 > pLP->LiPM_rows ) Werror(" mn_mx_MinkowskiSum: #rows > #pLP->LiPM_rows!");
-  if ( cols + 1 > pLP->LiPM_cols ) Werror(" mn_mx_MinkowskiSum: #cols > #pLP->LiPM_cols!");
+  if ( cons + 1 > pLP->LiPM_rows )
+    WerrorS(" mn_mx_MinkowskiSum: #rows > #pLP->LiPM_rows!");
+  if ( cols + 1 > pLP->LiPM_cols )
+    WerrorS(" mn_mx_MinkowskiSum: #cols > #pLP->LiPM_cols!");
 #endif
 
@@ -994,10 +1072,13 @@
   simplx(pLP->LiPM, cons, cols-1, 0, 0, cons, &icase, pLP->izrov, pLP->iposv);
 
-  if ( icase != 0 ) {
-    if( icase < 0) Werror(" mn_mx_MinkowskiSum: LinearProgram: maxR: infeasible");
-    if( icase > 0) Werror(" mn_mx_MinkowskiSum: LinearProgram: maxR: unbounded");
-  }
-
-  *maxR = (Coord_t)( pLP->LiPM[1][1] + SIMPLEX_EPS );	
+  if ( icase != 0 )
+  {
+    if( icase < 0)
+      WerrorS(" mn_mx_MinkowskiSum: LinearProgram: maxR: infeasible");
+    else if( icase > 0)
+      WerrorS(" mn_mx_MinkowskiSum: LinearProgram: maxR: unbounded");
+  }
+
+  *maxR = (Coord_t)( pLP->LiPM[1][1] + SIMPLEX_EPS );
 
 #ifdef mprDEBUG_ALL
@@ -1007,6 +1088,6 @@
 
 // mprSTICKYPROT:
-// ST_SPARSE_VREJ: rejected point 
-// ST_SPARSE_VADD: added point to set 
+// ST_SPARSE_VREJ: rejected point
+// ST_SPARSE_VADD: added point to set
 bool mayanPyramidAlg::storeMinkowskiSumPoint()
 {
@@ -1016,6 +1097,7 @@
   dist= vDistance( &(acoords[0]), n );
 
-  // store only points with v-distance > minVdist 
-  if( dist <= MINVDIST + SIMPLEX_EPS ) {
+  // store only points with v-distance > minVdist
+  if( dist <= MINVDIST + SIMPLEX_EPS )
+  {
     mprSTICKYPROT(ST_SPARSE_VREJ);
     return false;
@@ -1024,6 +1106,6 @@
   E->addPoint( &(acoords[0]) );
   mprSTICKYPROT(ST_SPARSE_VADD);
-  
-  return true; 
+
+  return true;
 }
 
@@ -1047,9 +1129,10 @@
 
   // step 5 -> terminate
-  if( dim == n-1 ) {	
-    int lastKilled = 0;			
+  if( dim == n-1 ) {
+    int lastKilled = 0;
     // insert points
     acoords[dim] = minR;
-    while( acoords[dim] <= maxR ) {
+    while( acoords[dim] <= maxR )
+    {
       if( !storeMinkowskiSumPoint() ) lastKilled++;
       acoords[dim]++;
@@ -1060,16 +1143,18 @@
 
   // step 4 -> recurse at step 3
-  acoords[dim] = minR;				
-  while ( acoords[dim] <= maxR ) {
+  acoords[dim] = minR;
+  while ( acoords[dim] <= maxR )
+  {
     if ( (acoords[dim] > minR) && (acoords[dim] <= maxR) ) {     // acoords[dim] >= minR  ??
       mprSTICKYPROT(ST_SPARSE_MREC1);
       runMayanPyramid( dim + 1 );         // recurse with higer dimension
-    } else {	
+    } else {
       // get v-distance of pt
       dist= vDistance( &(acoords[0]), dim + 1 );// dim+1 == known coordinates
 
-      if( dist >= SIMPLEX_EPS ) {  
-	mprSTICKYPROT(ST_SPARSE_MREC2);
-	runMayanPyramid( dim + 1 );       // recurse with higer dimension
+      if( dist >= SIMPLEX_EPS )
+      {
+        mprSTICKYPROT(ST_SPARSE_MREC2);
+        runMayanPyramid( dim + 1 );       // recurse with higer dimension
       }
     }
@@ -1086,6 +1171,8 @@
   int i,n= pVariables;
   int loffset= 0;
-  for ( i= 0; i <= n; i++ ) {
-    if ( (loffset < indx) && (indx <= pQ[i]->num + loffset) ) {
+  for ( i= 0; i <= n; i++ )
+  {
+    if ( (loffset < indx) && (indx <= pQ[i]->num + loffset) )
+    {
       *set= i;
       *pnt= indx-loffset;
@@ -1113,28 +1200,32 @@
 
   // fill in LP matrix
-  for ( i= 0; i <= n; i++ ) {
+  for ( i= 0; i <= n; i++ )
+  {
     size= pQ[i]->num;
-    for ( k= 1; k <= size; k++ ) {
+    for ( k= 1; k <= size; k++ )
+    {
       ncols++;
 
       // objective funtion, minimize
       LP.LiPM[1][ncols] = - ( (mprfloat) (*pQ[i])[k]->point[pQ[i]->dim] / SCALEDOWN );
-      
+
       // lambdas sum up to 1
-      for ( j = 0; j <= n; j++ ) 
-	if ( i==j )
-	  LP.LiPM[j+2][ncols] = -1.0;
-	else
-	  LP.LiPM[j+2][ncols] = 0.0;
+      for ( j = 0; j <= n; j++ )
+        if ( i==j )
+          LP.LiPM[j+2][ncols] = -1.0;
+        else
+          LP.LiPM[j+2][ncols] = 0.0;
 
       // the points
-      for ( j = 1; j <= n; j++ ) {
-	LP.LiPM[j+n+2][ncols] =  - ( (mprfloat) (*pQ[i])[k]->point[j] );
-      }
-    }
-  }
-    
-  for ( j = 0; j <= n; j++ ) LP.LiPM[j+2][1] = 1.0;   
-  for ( j= 1; j <= n; j++ ) {
+      for ( j = 1; j <= n; j++ )
+      {
+        LP.LiPM[j+n+2][ncols] =  - ( (mprfloat) (*pQ[i])[k]->point[j] );
+      }
+    }
+  }
+
+  for ( j = 0; j <= n; j++ ) LP.LiPM[j+2][1] = 1.0;
+  for ( j= 1; j <= n; j++ )
+  {
     LP.LiPM[j+n+2][1]= (mprfloat)(*E)[vert]->point[j] - shift[j];
   }
@@ -1146,10 +1237,12 @@
   PrintLn();
   Print(" n= %d, NumCons=M= %d, ncols=N= %d\n",n,NumCons,ncols);
-  print_mat(LP.LiPM, NumCons+1, ncols+1);   
-#endif  
+  print_mat(LP.LiPM, NumCons+1, ncols+1);
+#endif
 
 #if 1
-  if ( NumCons + 1 > LP.LiPM_rows ) Werror("resMatrixSparse::RC: #rows > #LP.LiPM_rows!");
-  if ( ncols + 1 > LP.LiPM_cols ) Werror("resMatrixSparse::RC: #cols > #LP.LiPM_cols!");
+  if ( NumCons + 1 > LP.LiPM_rows )
+    WerrorS("resMatrixSparse::RC: #rows > #LP.LiPM_rows!");
+  if ( ncols + 1 > LP.LiPM_cols )
+    WerrorS("resMatrixSparse::RC: #cols > #LP.LiPM_cols!");
 #endif
 
@@ -1157,5 +1250,6 @@
   simplx(LP.LiPM, NumCons, ncols,  0,  0, NumCons, &icase, LP.izrov, LP.iposv);
 
-  if (icase < 0) {
+  if (icase < 0)
+  {
     // infeasibility: the point does not lie in a cell -> remove it
     return -1;
@@ -1170,21 +1264,24 @@
   //print_mat(LP.LiPM, NumCons+1, ncols);
 #endif
-  
+
 #if 1
   // sort LP results
-  while (found) {
+  while (found)
+  {
     found=false;
-    for ( i= 1; i < NumCons; i++ ) {
-      if ( LP.iposv[i] > LP.iposv[i+1] ) {
-
-	c= LP.iposv[i];
-	LP.iposv[i]=LP.iposv[i+1];
-	LP.iposv[i+1]=c;
-
-	cd=LP.LiPM[i+1][1];
-	LP.LiPM[i+1][1]=LP.LiPM[i+2][1];
-	LP.LiPM[i+2][1]=cd;
-
-	found= true;
+    for ( i= 1; i < NumCons; i++ )
+    {
+      if ( LP.iposv[i] > LP.iposv[i+1] )
+      {
+
+        c= LP.iposv[i];
+        LP.iposv[i]=LP.iposv[i+1];
+        LP.iposv[i+1]=c;
+
+        cd=LP.LiPM[i+1][1];
+        LP.LiPM[i+1][1]=LP.LiPM[i+2][1];
+        LP.LiPM[i+2][1]=cd;
+
+        found= true;
       }
     }
@@ -1203,11 +1300,14 @@
   c=0;
   optSum= (setID*)Alloc( (NumCons) * sizeof(struct setID) );
-  for ( i= 0; i < NumCons; i++ ) {
+  for ( i= 0; i < NumCons; i++ )
+  {
     //Print("% .15f\n",LP.LiPM[i+2][1]);
-    if ( LP.LiPM[i+2][1] > 1e-12 ) {
-      if ( !remapXiToPoint( LP.iposv[i+1], pQ, &(optSum[c].set), &(optSum[c].pnt) ) ) {
-	Werror(" resMatrixSparse::RC: Found bad solution in LP: %d!",LP.iposv[i+1]);
-	Werror(" resMatrixSparse::RC: remapXiToPoint faild!");
-	return -1;
+    if ( LP.LiPM[i+2][1] > 1e-12 )
+    {
+      if ( !remapXiToPoint( LP.iposv[i+1], pQ, &(optSum[c].set), &(optSum[c].pnt) ) )
+      {
+        Werror(" resMatrixSparse::RC: Found bad solution in LP: %d!",LP.iposv[i+1]);
+        WerrorS(" resMatrixSparse::RC: remapXiToPoint faild!");
+        return -1;
       }
       bucket[optSum[c].set]++;
@@ -1219,12 +1319,15 @@
   // find last min in bucket[]: maximum i such that Fi is a point
   c= 0;
-  for ( i= 1; i < E->dim; i++ ) {
-    if ( bucket[c] >= bucket[i] ) {
+  for ( i= 1; i < E->dim; i++ )
+  {
+    if ( bucket[c] >= bucket[i] )
+    {
       c= i;
     }
   }
   // find matching point set
-  for ( i= onum - 1; i >= 0; i-- ) {
-    if ( optSum[i].set == c ) 
+  for ( i= onum - 1; i >= 0; i-- )
+  {
+    if ( optSum[i].set == c )
       break;
   }
@@ -1233,14 +1336,16 @@
   (*E)[vert]->rc.pnt= optSum[i].pnt;
   (*E)[vert]->rcPnt= (*pQ[c])[optSum[i].pnt];
-  // count 
+  // count
   if ( (*E)[vert]->rc.set == linPolyS ) numSet0++;
 
 #ifdef mprDEBUG_PROT
   Print("\n Point E[%d] was <",vert);print_exp((*E)[vert],E->dim-1);Print(">, bucket={");
-  for ( j= 0; j < E->dim; j++ ) {
+  for ( j= 0; j < E->dim; j++ )
+  {
     Print(" %d",bucket[j]);
   }
   Print(" }\n optimal Sum: Qi ");
-  for ( j= 0; j < NumCons; j++ ) {
+  for ( j= 0; j < NumCons; j++ )
+  {
     Print(" [ %d, %d ]",optSum[j].set,optSum[j].pnt);
   }
@@ -1253,5 +1358,5 @@
   mprSTICKYPROT(ST_SPARSE_RC);
 
-  return (int)(-LP.LiPM[1][1] * SCALEDOWN);  
+  return (int)(-LP.LiPM[1][1] * SCALEDOWN);
 }
 
@@ -1290,7 +1395,7 @@
   for ( i= 1; i <= E->num; i++ ) {       // for every row
     E->getRowMP( i, epp_mon );           // compute (p-a[ij]), (i,j) = RC(p)
-    pSetExpV( epp, epp_mon );           
-
-    // 
+    pSetExpV( epp, epp_mon );
+
+    //
     rowp= pMult( pCopy(epp), pCopy((gls->m)[(*E)[i]->rc.set]) );  // x^(p-a[ij]) * f(i)
     pSetm( rowp );
@@ -1299,18 +1404,20 @@
     // get column for every monomial in rowp and store it
     iterp= rowp;
-    while ( iterp ) {
+    while ( iterp )
+    {
       epos= E->getExpPos( iterp );
-      if ( epos == 0 ) {
-	// this can happen, if the shift vektor or the lift funktions 
-	// are not generically choosen.
-	Werror("resMatrixSparse::createMatrix: Found exponent not in E, id %d, set [%d, %d]!",
-	       i,(*E)[i]->rc.set,(*E)[i]->rc.pnt);
-	return i;
+      if ( epos == 0 )
+      {
+        // this can happen, if the shift vektor or the lift funktions
+        // are not generically choosen.
+        Werror("resMatrixSparse::createMatrix: Found exponent not in E, id %d, set [%d, %d]!",
+               i,(*E)[i]->rc.set,(*E)[i]->rc.pnt);
+        return i;
       }
       pSetExpV(iterp,eexp);
       pSetComp(iterp, epos );
       if ( (*E)[i]->rc.set == linPolyS ) { // store coeff positions
-	IMATELEM(*uRPos,rp,cp)= epos;
-	cp++;
+        IMATELEM(*uRPos,rp,cp)= epos;
+        cp++;
       }
       pIter( iterp );
@@ -1329,9 +1436,11 @@
 
 #ifdef mprDEBUG_ALL
-  if ( E->num <= 40 ) {
+  if ( E->num <= 40 )
+  {
     matrix mout= idModule2Matrix( idCopy(rmat) );
     print_matrix(mout);
   }
-  for ( i= 1; i <= numSet0; i++ ) {
+  for ( i= 1; i <= numSet0; i++ )
+  {
     Print(" row  %d contains coeffs of f_%d\n",IMATELEM(*uRPos,i,1),linPolyS);
   }
@@ -1351,11 +1460,14 @@
   srand((long)(((int)time(tp) % MAXSEED)+MAXSEED*18));
 
-  while ( i <= dim ) {
+  while ( i <= dim )
+  {
     shift[i]= (mprfloat) (RVMULT*rand()/(RAND_MAX+1.0));
     i++;
-    for ( j= 1; j < i-1; j++ ) {
-      if ( (shift[j] < shift[i-1] + SIMPLEX_EPS) && (shift[j] > shift[i-1] - SIMPLEX_EPS) ) {
-	i--;
-	break;
+    for ( j= 1; j < i-1; j++ )
+    {
+      if ( (shift[j] < shift[i-1] + SIMPLEX_EPS) && (shift[j] > shift[i-1] - SIMPLEX_EPS) )
+      {
+        i--;
+        break;
       }
     }
@@ -1373,8 +1485,11 @@
   vs= new pointSet( dim );
 
-  for ( j= 1; j <= Q1->num; j++ ) {
-    for ( k= 1; k <= Q2->num; k++ ) {
-      for ( l= 1; l <= dim; l++ ) {
-	vert.point[l]= (*Q1)[j]->point[l] + (*Q2)[k]->point[l];
+  for ( j= 1; j <= Q1->num; j++ )
+  {
+    for ( k= 1; k <= Q2->num; k++ )
+    {
+      for ( l= 1; l <= dim; l++ )
+      {
+        vert.point[l]= (*Q1)[j]->point[l] + (*Q2)[k]->point[l];
       }
       vs->mergeWithExp( &vert );
@@ -1397,5 +1512,6 @@
   for ( j= 1; j <= pQ[0]->num; j++ ) vs->addPoint( (*pQ[0])[j] );
 
-  for ( j= 1; j < numq; j++ ) {
+  for ( j= 1; j < numq; j++ )
+  {
     vs_old= vs;
     vs= minkSumTwo( vs_old, pQ[j], dim );
@@ -1419,6 +1535,7 @@
   mprfloat shift[MAXVARS+2];   // shiftvector delta, index [1..dim]
 
-  if ( pVariables > MAXVARS ) {
-    Werror("resMatrixSparse::resMatrixSparse: To many variables!");
+  if ( pVariables > MAXVARS )
+  {
+    WerrorS("resMatrixSparse::resMatrixSparse: To many variables!");
     return;
   }
@@ -1447,6 +1564,7 @@
 
   // need AllocAligned since we allocate mem for type double
-  LP.LiPM = (mprfloat **)Alloc( LP.LiPM_rows * sizeof(mprfloat *) );  // LP matrix 
-  for( i= 0; i < LP.LiPM_rows; i++ ) {
+  LP.LiPM = (mprfloat **)Alloc( LP.LiPM_rows * sizeof(mprfloat *) );  // LP matrix
+  for( i= 0; i < LP.LiPM_rows; i++ )
+  {
     // Mem must be allocated aligned, also for type double!
     LP.LiPM[i] = (mprfloat *)AllocAligned0( LP.LiPM_cols * sizeof(mprfloat) );
@@ -1475,5 +1593,5 @@
 
 #ifdef mprMINKSUM
-  E= minkSumAll( Qi, n+1, n);  
+  E= minkSumAll( Qi, n+1, n);
 #else
   // get inner points
@@ -1487,5 +1605,6 @@
 #endif
   Print("\n E = (Q_0 + ... + Q_n) \\cap \\N :\n");
-  for ( pnt= 1; pnt <= E->num; pnt++ ) {
+  for ( pnt= 1; pnt <= E->num; pnt++ )
+  {
     Print("%d: <",pnt);print_exp( (*E)[pnt], E->dim );Print(">\n");
   }
@@ -1495,6 +1614,6 @@
 #ifdef mprTEST
   int lift[5][5];
-  lift[0][1]=3; lift[0][2]=4; lift[0][3]=8;  lift[0][4]=2; 
-  lift[1][1]=6; lift[1][2]=1; lift[1][3]=7;  lift[1][4]=4; 
+  lift[0][1]=3; lift[0][2]=4; lift[0][3]=8;  lift[0][4]=2;
+  lift[1][1]=6; lift[1][2]=1; lift[1][3]=7;  lift[1][4]=4;
   lift[2][1]=2; lift[2][2]=5; lift[2][3]=9;  lift[2][4]=6;
   lift[3][1]=2; lift[3][2]=1; lift[3][3]=9;  lift[3][4]=5;
@@ -1510,5 +1629,6 @@
 
   // run Row Content Function for every point in E
-  for ( pnt= 1; pnt <= E->num; pnt++ ) {
+  for ( pnt= 1; pnt <= E->num; pnt++ )
+  {
     RC( Qi, E, pnt, shift );
   }
@@ -1516,6 +1636,8 @@
   // remove points not in cells
   k= E->num;
-  for ( pnt= k; pnt > 0; pnt-- ) {
-    if ( (*E)[pnt]->rcPnt == NULL ) {
+  for ( pnt= k; pnt > 0; pnt-- )
+  {
+    if ( (*E)[pnt]->rcPnt == NULL )
+    {
       E->removePoint(pnt);
       mprSTICKYPROT(ST_SPARSE_RCRJ);
@@ -1526,5 +1648,6 @@
 #ifdef mprDEBUG_PROT
   Print(" points which lie in a cell:\n");
-  for ( pnt= 1; pnt <= E->num; pnt++ ) {
+  for ( pnt= 1; pnt <= E->num; pnt++ )
+  {
     Print("%d: <",pnt);print_exp( (*E)[pnt], E->dim );Print(">\n");
   }
@@ -1539,5 +1662,6 @@
 #ifdef mprDEBUG_PROT
   Print(" points with a[ij] (%d):\n",E->num);
-  for ( pnt= 1; pnt <= E->num; pnt++ ) {
+  for ( pnt= 1; pnt <= E->num; pnt++ )
+  {
     Print("Punkt p \\in E[%d]: <",pnt);print_exp( (*E)[pnt], E->dim );
     Print(">, RC(p) = (i:%d, j:%d), a[i,j] = <",(*E)[pnt]->rc.set,(*E)[pnt]->rc.pnt);
@@ -1548,8 +1672,9 @@
 
   // now create matrix
-  if ( createMatrix( E ) != E->num ) {
+  if ( createMatrix( E ) != E->num )
+  {
     // this can happen if the shiftvector shift is to large or not generic
     istate= resMatrixBase::fatalError;
-    Werror("resMatrixSparse::resMatrixSparse: Error in resMatrixSparse::createMatrix!");
+    WerrorS("resMatrixSparse::resMatrixSparse: Error in resMatrixSparse::createMatrix!");
     goto theEnd;
     //return;
@@ -1558,5 +1683,6 @@
  theEnd:
   // clean up
-  for ( i= 0; i < idelem; i++ ) {
+  for ( i= 0; i < idelem; i++ )
+  {
     delete Qi[i];
   }
@@ -1565,9 +1691,10 @@
   delete E;
 
-  for( i= 0; i < LP.LiPM_rows; i++ ) {
+  for( i= 0; i < LP.LiPM_rows; i++ )
+  {
     FreeAligned( (ADDRESS) LP.LiPM[i], LP.LiPM_cols * sizeof(mprfloat) );
     //    Free( (ADDRESS) LP.LiPM[i], LP.LiPM_cols * sizeof(mprfloat) );
   }
-  Free( (ADDRESS) LP.LiPM, LP.LiPM_rows * sizeof(mprfloat *) );	
+  Free( (ADDRESS) LP.LiPM, LP.LiPM_rows * sizeof(mprfloat *) );
 
   Free( (ADDRESS) LP.iposv, (idelem * MAXPOINTS) * sizeof(int) );
@@ -1592,5 +1719,6 @@
 
   // now fill in coeffs of f0
-  for ( i= 1; i <= numSet0; i++ ) {
+  for ( i= 1; i <= numSet0; i++ )
+  {
 
     pgls= (gls->m)[0]; // f0
@@ -1605,14 +1733,18 @@
     // u_1,..,u_k
     cp=2;
-    while ( pNext(pgls) ) {
+    while ( pNext(pgls) )
+    {
       phelp= pOne();
       pSetCoeff( phelp, nCopy(pGetCoeff(pgls)) );
       pSetComp( phelp, IMATELEM(*uRPos,i,cp) );
-      if ( piter ) {
-	pNext(piter)= phelp;
-	piter= phelp;
-      } else {
-	pp= phelp;
-	piter= phelp;
+      if ( piter )
+      {
+        pNext(piter)= phelp;
+        piter= phelp;
+      }
+      else
+      {
+        pp= phelp;
+        piter= phelp;
       }
       cp++;
@@ -1643,5 +1775,6 @@
   mprPROTnl("smCallDet");
 
-  for ( i= 1; i <= numSet0; i++ ) {
+  for ( i= 1; i <= numSet0; i++ )
+  {
     pp= (rmat->m)[IMATELEM(*uRPos,i,1)];
     pDelete( &pp );
@@ -1650,16 +1783,21 @@
     piter= NULL;
     // u_1,..,u_n
-    for ( cp= 2; cp <= idelem; cp++ ) {
-      if ( !nIsZero(evpoint[cp-1]) ) {
-	phelp= pOne();
-	pSetCoeff( phelp, nCopy(evpoint[cp-1]) );
-	pSetComp( phelp, IMATELEM(*uRPos,i,cp) );
-	if ( piter ) {
-	  pNext(piter)= phelp;
-	  piter= phelp;
-	} else {
-	  pp= phelp;
-	  piter= phelp;
-	}
+    for ( cp= 2; cp <= idelem; cp++ )
+    {
+      if ( !nIsZero(evpoint[cp-1]) )
+      {
+        phelp= pOne();
+        pSetCoeff( phelp, nCopy(evpoint[cp-1]) );
+        pSetComp( phelp, IMATELEM(*uRPos,i,cp) );
+        if ( piter )
+        {
+          pNext(piter)= phelp;
+          piter= phelp;
+        }
+        else
+        {
+          pp= phelp;
+          piter= phelp;
+        }
       }
     }
@@ -1695,5 +1833,6 @@
   mprPROTnl("smCallDet");
 
-  for ( i= 1; i <= numSet0; i++ ) {
+  for ( i= 1; i <= numSet0; i++ )
+  {
     pp= (rmat->m)[IMATELEM(*uRPos,i,1)];
     pDelete( &pp );
@@ -1702,15 +1841,19 @@
     piter= NULL;
     for ( cp= 2; cp <= idelem; cp++ ) { // u1 .. un
-      if ( !nIsZero(evpoint[cp-1]) ) {
-	phelp= pOne();
-	pSetCoeff( phelp, nCopy(evpoint[cp-1]) );
-	pSetComp( phelp, IMATELEM(*uRPos,i,cp) );
-	if ( piter ) {
-	  pNext(piter)= phelp;
-	  piter= phelp;
-	} else {
-	  pp= phelp;
-	  piter= phelp;
-	}
+      if ( !nIsZero(evpoint[cp-1]) )
+      {
+        phelp= pOne();
+        pSetCoeff( phelp, nCopy(evpoint[cp-1]) );
+        pSetComp( phelp, IMATELEM(*uRPos,i,cp) );
+        if ( piter )
+        {
+          pNext(piter)= phelp;
+          piter= phelp;
+        }
+        else
+        {
+          pp= phelp;
+          piter= phelp;
+        }
       }
     }
@@ -1748,5 +1891,5 @@
    * _gls: system of multivariate polynoms
    * special: -1 -> resMatrixDense is a symbolic matrix
-   *    0,1, ... -> resMatrixDense ist eine u-Resultante, wobei special das 
+   *    0,1, ... -> resMatrixDense ist eine u-Resultante, wobei special das
    *                        lineare u-Polynom angibt
    */
@@ -1774,5 +1917,5 @@
    */
   const number getSubDet();
-  
+
 private:
   /** deactivated copy constructor */
@@ -1789,5 +1932,5 @@
   void generateMonomData( int deg, intvec* polyDegs , intvec* iVO );
 
-  /** Recursively generate all homogeneous monoms of 
+  /** Recursively generate all homogeneous monoms of
    * pVariables variables of degree deg.
    */
@@ -1812,22 +1955,24 @@
 //<-
 
-//-> struct resVector 
+//-> struct resVector
 /* Holds a row vector of the dense resultant matrix */
 struct resVector
 {
 public:
-  void init() {
+  void init()
+  {
     isReduced = FALSE;
-    elementOfS = SFREE; 
+    elementOfS = SFREE;
     mon = NULL;
   }
-  void init( const poly m ) {
+  void init( const poly m )
+  {
     isReduced = FALSE;
-    elementOfS = SFREE; 
-    mon = m; 
+    elementOfS = SFREE;
+    mon = m;
   }
 
   /** index von 0 ... numVectors-1 */
-  poly getElem( const int i ); 
+  poly getElem( const int i );
 
   /** index von 0 ... numVectors-1 */
@@ -1842,14 +1987,14 @@
   int elementOfS;
 
-  /** holds the index of u0, u1, ..., un, if (elementOfS == linPolyS) 
-   *  the size is given by pVariables 
+  /** holds the index of u0, u1, ..., un, if (elementOfS == linPolyS)
+   *  the size is given by pVariables
    */
-  int *numColParNr;        
+  int *numColParNr;
 
   /** holds the column vector if (elementOfS != linPolyS) */
-  number *numColVector;   
+  number *numColVector;
 
   /** size of numColVector */
-  int numColVectorSize;   
+  int numColVectorSize;
 
   number *numColVecCopy;
@@ -1859,10 +2004,10 @@
 //-> resVector::*
 poly resVector::getElem( const int i ) // inline ???
-{ 
+{
   assume( 0 < i || i > numColVectorSize );
   poly out= pOne();
   pSetCoeff( out, numColVector[i] );
   pTest( out );
-  return( out ); 
+  return( out );
 }
 
@@ -1870,5 +2015,5 @@
 {
   assume( i >= 0 && i < numColVectorSize );
-  return( numColVector[i] ); 
+  return( numColVector[i] );
 }
 //<-
@@ -1877,7 +2022,7 @@
 resMatrixDense::resMatrixDense( const ideal _gls, const int special )
   : resMatrixBase()
-{ 
+{
   int i;
-  
+
   sourceRing=currRing;
   gls= idCopy( _gls );
@@ -1886,8 +2031,9 @@
 
   // init all
-  generateBaseData(); 
+  generateBaseData();
 
   totDeg= 1;
-  for ( i= 0; i < IDELEMS(gls); i++ ) {
+  for ( i= 0; i < IDELEMS(gls); i++ )
+  {
     totDeg*=pTotaldegree( (gls->m)[i] );
   }
@@ -1897,26 +2043,28 @@
   istate= resMatrixBase::ready;
 }
- 
+
 resMatrixDense::~resMatrixDense()
 {
   int i,j;
-  for (i=0; i < numVectors; i++) 
-    {
-      pDelete( &resVectorList[i].mon );
-      pDelete( &resVectorList[i].dividedBy );
-      for ( j=0; j < resVectorList[i].numColVectorSize; j++ ) {
-	nDelete( resVectorList[i].numColVector+j );
-      }
-      Free( (ADDRESS)resVectorList[i].numColVector, numVectors*sizeof( number ) );
-      Free( (ADDRESS)resVectorList[i].numColParNr, (pVariables+1) * sizeof(int) );
-    }
-  
+  for (i=0; i < numVectors; i++)
+  {
+    pDelete( &resVectorList[i].mon );
+    pDelete( &resVectorList[i].dividedBy );
+    for ( j=0; j < resVectorList[i].numColVectorSize; j++ )
+    {
+        nDelete( resVectorList[i].numColVector+j );
+    }
+    Free( (ADDRESS)resVectorList[i].numColVector, numVectors*sizeof( number ) );
+    Free( (ADDRESS)resVectorList[i].numColParNr, (pVariables+1) * sizeof(int) );
+  }
+
   Free( (ADDRESS)resVectorList, veclistmax*sizeof( resVector ) );
 
-  // free matrix m 
-  if ( m != NULL ) {
+  // free matrix m
+  if ( m != NULL )
+  {
     for ( i= 1; i <= numVectors; i++ )
       for ( j= 1; j <= numVectors; j++ )
-	pDelete( &MATELEM(m , i, j) );
+        pDelete( &MATELEM(m , i, j) );
     Free( (ADDRESS)m->m, numVectors * numVectors * sizeof(poly) );
     Free( (ADDRESS)m, sizeof(ip_smatrix) );
@@ -1931,42 +2079,53 @@
   int k,i,j;
   resVector *vecp;
-  
+
   m= mpNew( numVectors, numVectors );
-  
-  for ( i= 1; i <= MATROWS( m ); i++ ) 
-    for ( j= 1; j <= MATCOLS( m ); j++ ) {
+
+  for ( i= 1; i <= MATROWS( m ); i++ )
+    for ( j= 1; j <= MATCOLS( m ); j++ )
+    {
       MATELEM(m,i,j)= pInit();
       pSetCoeff0( MATELEM(m,i,j), nInit(0) );
     }
-  
-
-  for ( k= 0; k <= numVectors - 1; k++ ) {
-    if ( linPolyS == getMVector(k)->elementOfS ) {
+
+
+  for ( k= 0; k <= numVectors - 1; k++ )
+  {
+    if ( linPolyS == getMVector(k)->elementOfS )
+    {
       mprSTICKYPROT(ST_DENSE_FR);
-      for ( i= 0; i < pVariables; i++ ) {
-	MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i])= pInit();
-      }
-    } else {
+      for ( i= 0; i < pVariables; i++ )
+      {
+        MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i])= pInit();
+      }
+    }
+    else
+    {
       mprSTICKYPROT(ST_DENSE_NR);
       vecp= getMVector(k);
-      for ( i= 0; i < numVectors; i++) 
-	if ( !nIsZero( vecp->getElemNum(i) ) ) {
-	  MATELEM(m,numVectors - k,i + 1)= pInit();
-	  pSetCoeff( MATELEM(m,numVectors - k,i + 1), nCopy(vecp->getElemNum(i)) );
-	}
+      for ( i= 0; i < numVectors; i++)
+        if ( !nIsZero( vecp->getElemNum(i) ) )
+        {
+          MATELEM(m,numVectors - k,i + 1)= pInit();
+          pSetCoeff( MATELEM(m,numVectors - k,i + 1), nCopy(vecp->getElemNum(i)) );
+        }
     }
   } // for
   mprSTICKYPROT("\n");
-  
+
 #ifdef mprDEBUG_ALL
-  for ( k= numVectors - 1; k >= 0; k-- ) 
-    if ( linPolyS == getMVector(k)->elementOfS ) {
-      for ( i=0; i < pVariables; i++ ) {
-	Print(" %d ",(getMVector(k)->numColParNr)[i]);
+  for ( k= numVectors - 1; k >= 0; k-- )
+    if ( linPolyS == getMVector(k)->elementOfS )
+    {
+      for ( i=0; i < pVariables; i++ )
+      {
+        Print(" %d ",(getMVector(k)->numColParNr)[i]);
       }
       PrintLn();
     }
-  for (i=1; i <= numVectors; i++) {
-    for (j=1; j <= numVectors; j++ ) {
+  for (i=1; i <= numVectors; i++)
+  {
+    for (j=1; j <= numVectors; j++ )
+    {
       pWrite0(MATELEM(m,i,j));Print("  ");
     }
@@ -1984,12 +2143,13 @@
     poly mon = pCopy( m );
     pSetm( mon );
-	
-    if ( numVectors == veclistmax ) {
-      resVectorList= (resVector * )ReAlloc( resVectorList, 
-					    (veclistmax) * sizeof( resVector ),
-					    (veclistmax + veclistblock) * sizeof( resVector ) );
+
+    if ( numVectors == veclistmax )
+    {
+      resVectorList= (resVector * )ReAlloc( resVectorList,
+                                            (veclistmax) * sizeof( resVector ),
+                                            (veclistmax + veclistblock) * sizeof( resVector ) );
       int k;
-      for ( k= veclistmax; k < (veclistmax + veclistblock); k++ ) 
-	resVectorList[k].init();
+      for ( k= veclistmax; k < (veclistmax + veclistblock); k++ )
+        resVectorList[k].init();
       veclistmax+= veclistblock;
       mprSTICKYPROT(ST_DENSE_MEM);
@@ -1998,10 +2158,13 @@
     resVectorList[numVectors].init( mon );
     numVectors++;
-    mprSTICKYPROT(ST_DENSE_NMON); 
+    mprSTICKYPROT(ST_DENSE_NMON);
     return;
-  } else {
+  }
+  else
+  {
     if ( var == pVariables+1 ) return;
     poly newm = pCopy( m );
-    while ( deg >= 0 ) {
+    while ( deg >= 0 )
+    {
       generateMonoms( newm, var+1, deg );
       pIncrExp( newm, var );
@@ -2011,5 +2174,5 @@
     pDelete( & newm );
   }
-  
+
   return;
 }
@@ -2023,10 +2186,10 @@
   veclistmax= veclistblock;
   resVectorList= (resVector *)Alloc( veclistmax*sizeof( resVector ) );
-  
+
   // Init resVector()s
   for ( j= veclistmax - 1; j >= 0; j-- ) resVectorList[j].init();
   numVectors= 0;
 
-  // Generate all monoms of degree deg  
+  // Generate all monoms of degree deg
   poly start= pOne();
   generateMonoms( start, 1, deg );
@@ -2034,10 +2197,11 @@
 
   mprSTICKYPROT("\n");
-  
+
   // Check for reduced monoms
   // First generate polyDegs.rows() monoms
   //  x(k)^(polyDegs[k]),  0 <= k < polyDegs.rows()
   ideal pDegDiv= idInit( polyDegs->rows(), 1 );
-  for ( k= 0; k < polyDegs->rows(); k++ ) {
+  for ( k= 0; k < polyDegs->rows(); k++ )
+  {
     poly p= pOne();
     pSetExp( p, k + 1, (*polyDegs)[k] );
@@ -2050,41 +2214,49 @@
   // exactly one x(k)^(polyDegs[k]) that divides the monom.
   int divCount;
-  for ( j= numVectors - 1; j >= 0; j-- ) {
+  for ( j= numVectors - 1; j >= 0; j-- )
+  {
     divCount= 0;
-    for ( k= 0; k < IDELEMS(pDegDiv); k++ ) 
-      if ( pDivisibleBy2( (pDegDiv->m)[k], resVectorList[j].mon ) ) 
-	divCount++;
+    for ( k= 0; k < IDELEMS(pDegDiv); k++ )
+      if ( pDivisibleBy2( (pDegDiv->m)[k], resVectorList[j].mon ) )
+        divCount++;
     resVectorList[j].isReduced= (divCount == 1);
   }
 
   // create the sets S(k)s
-  // a monom x(i)^deg, deg given, is element of the set S(i) 
+  // a monom x(i)^deg, deg given, is element of the set S(i)
   // if all x(0)^(polyDegs[0]) ... x(i-1)^(polyDegs[i-1]) DONT divide
   // x(i)^deg and only x(i)^(polyDegs[i]) divides x(i)^deg
   bool doInsert;
-  for ( k= 0; k < iVO->rows(); k++) {
+  for ( k= 0; k < iVO->rows(); k++)
+  {
     //mprPROTInl(" ------------ var:",(*iVO)[k]);
-    for ( j= numVectors - 1; j >= 0; j-- ) {
+    for ( j= numVectors - 1; j >= 0; j-- )
+    {
       //mprPROTPnl("testing monom",resVectorList[j].mon);
-      if ( resVectorList[j].elementOfS == SFREE ) {
-	//mprPROTnl("\tfree");
-	if ( pDivisibleBy2( (pDegDiv->m)[ (*iVO)[k] ], resVectorList[j].mon ) ) {
-	  //mprPROTPnl("\tdivisible by ",(pDegDiv->m)[ (*iVO)[k] ]);
-	  doInsert=TRUE;
-	  for ( i= 0; i < k; i++ ) {
-	    //mprPROTPnl("\tchecking db ",(pDegDiv->m)[ (*iVO)[i] ]);
-	    if ( pDivisibleBy2( (pDegDiv->m)[ (*iVO)[i] ], resVectorList[j].mon ) ) {
-	      //mprPROTPnl("\t and divisible by",(pDegDiv->m)[ (*iVO)[i] ]);
-	      doInsert=FALSE;
-	      break;
-	    } 
-	  }
-	  if ( doInsert ) {
-	    //mprPROTInl("\t------------------> S ",(*iVO)[k]);
-	    resVectorList[j].elementOfS= (*iVO)[k];
-	    resVectorList[j].dividedBy= pCopy( (pDegDiv->m)[ (*iVO)[i] ] );
-	    pSetm( resVectorList[j].dividedBy );
-	  }
-	}
+      if ( resVectorList[j].elementOfS == SFREE )
+      {
+        //mprPROTnl("\tfree");
+        if ( pDivisibleBy2( (pDegDiv->m)[ (*iVO)[k] ], resVectorList[j].mon ) )
+        {
+          //mprPROTPnl("\tdivisible by ",(pDegDiv->m)[ (*iVO)[k] ]);
+          doInsert=TRUE;
+          for ( i= 0; i < k; i++ )
+          {
+            //mprPROTPnl("\tchecking db ",(pDegDiv->m)[ (*iVO)[i] ]);
+            if ( pDivisibleBy2( (pDegDiv->m)[ (*iVO)[i] ], resVectorList[j].mon ) )
+            {
+              //mprPROTPnl("\t and divisible by",(pDegDiv->m)[ (*iVO)[i] ]);
+              doInsert=FALSE;
+              break;
+            }
+          }
+          if ( doInsert )
+          {
+            //mprPROTInl("\t------------------> S ",(*iVO)[k]);
+            resVectorList[j].elementOfS= (*iVO)[k];
+            resVectorList[j].dividedBy= pCopy( (pDegDiv->m)[ (*iVO)[i] ] );
+            pSetm( resVectorList[j].dividedBy );
+          }
+        }
       }
     }
@@ -2095,7 +2267,8 @@
   subSize= 0;
   int sub;
-  for ( i= 0; i < polyDegs->rows(); i++ ) {
+  for ( i= 0; i < polyDegs->rows(); i++ )
+  {
     sub= 1;
-    for ( k= 0; k < polyDegs->rows(); k++ ) 
+    for ( k= 0; k < polyDegs->rows(); k++ )
       if ( i != k ) sub*= (*polyDegs)[k];
     subSize+= sub;
@@ -2109,9 +2282,10 @@
   // Print a list of monoms and their properties
   Print("// \n");
-  for ( j= numVectors - 1; j >= 0; j-- ) {
+  for ( j= numVectors - 1; j >= 0; j-- )
+  {
     Print("// %s, S(%d),  db ",
-	  resVectorList[j].isReduced?"reduced":"nonreduced",
-	  resVectorList[j].elementOfS);
-    pWrite0(resVectorList[j].dividedBy); 
+          resVectorList[j].isReduced?"reduced":"nonreduced",
+          resVectorList[j].elementOfS);
+    pWrite0(resVectorList[j].dividedBy);
     Print("  monom ");
     pWrite(resVectorList[j].mon);
@@ -2136,16 +2310,21 @@
   // make sure that the homogenization variable goes last!
   intvec iVO( pVariables );
-  if ( linPolyS != SNONE ) {
+  if ( linPolyS != SNONE )
+  {
     iVO[pVariables - 1]= linPolyS;
     int p=0;
-    for ( k= pVariables - 1; k >= 0; k-- ) {
-      if ( k != linPolyS ) {
-	iVO[p]= k;
-	p++;
-      }
-    }
-  } else { 
+    for ( k= pVariables - 1; k >= 0; k-- )
+    {
+      if ( k != linPolyS )
+      {
+        iVO[p]= k;
+        p++;
+      }
+    }
+  }
+  else
+  {
     linPolyS= 0;
-    for ( k= 0; k < pVariables; k++ ) 
+    for ( k= 0; k < pVariables; k++ )
       iVO[k]= pVariables - k - 1;
   }
@@ -2161,6 +2340,8 @@
 
   // generate "matrix"
-  for ( k= numVectors - 1; k >= 0; k-- ) {
-    if ( resVectorList[k].elementOfS != linPolyS ) {
+  for ( k= numVectors - 1; k >= 0; k-- )
+  {
+    if ( resVectorList[k].elementOfS != linPolyS )
+    {
       // column k is a normal column with numerical or symbolic entries
       // init stuff
@@ -2177,23 +2358,26 @@
 
       // fill in "matrix"
-      while ( pi ) {
-	matEntry= nCopy(pGetCoeff(pi));
-	pmatchPos= pHead0( pi );
-	pSetCoeff( pmatchPos, nInit(1) );
-	pSetm( pmatchPos );
-
-	for ( i= 0; i < numVectors; i++) 
-	  if ( pEqual( pmatchPos, resVectorList[i].mon ) )
-	    break;
-
-	resVectorList[k].numColVector[numVectors - i - 1] = nCopy(matEntry);
-
-	pDelete( &pmatchPos );
-	nDelete( &matEntry );
-
-	pIter( pi );
+      while ( pi )
+      {
+        matEntry= nCopy(pGetCoeff(pi));
+        pmatchPos= pHead0( pi );
+        pSetCoeff( pmatchPos, nInit(1) );
+        pSetm( pmatchPos );
+
+        for ( i= 0; i < numVectors; i++)
+          if ( pEqual( pmatchPos, resVectorList[i].mon ) )
+            break;
+
+        resVectorList[k].numColVector[numVectors - i - 1] = nCopy(matEntry);
+
+        pDelete( &pmatchPos );
+        nDelete( &matEntry );
+
+        pIter( pi );
       }
       pDelete( &pi );
-    } else {
+    }
+    else
+    {
       // column is a special column, i.e. is generated by S0 and F0
       // safe only the positions of the ui's in the column
@@ -2209,15 +2393,15 @@
       j=0;
       while ( pi ) { // fill in "matrix"
-	pmp= pMult( pHead( pi ), pCopy( factor ) );
-	pSetm( pmp );pTest( pi );
-
-	for ( i= 0; i < numVectors; i++) 
-	  if ( pEqual( pmp, resVectorList[i].mon ) )
-	    break;
-
-	resVectorList[k].numColParNr[j]= i;
-	pDelete( &pmp );
-	pIter( pi );
-	j++;
+        pmp= pMult( pHead( pi ), pCopy( factor ) );
+        pSetm( pmp );pTest( pi );
+
+        for ( i= 0; i < numVectors; i++)
+          if ( pEqual( pmp, resVectorList[i].mon ) )
+            break;
+
+        resVectorList[k].numColParNr[j]= i;
+        pDelete( &pmp );
+        pIter( pi );
+        j++;
       }
       pDelete( &pi );
@@ -2233,35 +2417,44 @@
 }
 
-resVector *resMatrixDense::getMVector(int i) 
-{ 
+resVector *resMatrixDense::getMVector(int i)
+{
   assume( i >= 0 && i < numVectors );
-  return &resVectorList[i]; 
+  return &resVectorList[i];
 }
 
 const ideal resMatrixDense::getMatrix()
-{ 
+{
   int k,i,j;
 
   // copy matrix
   matrix resmat= mpNew(numVectors,numVectors);
-  for (i=1; i <= numVectors; i++) {
-    for (j=1; j <= numVectors; j++ ) {
-      if ( MATELEM(m,i,j) && pGetCoeff(MATELEM(m,i,j)) ) {
-	MATELEM(resmat,i,j)= pCopy( MATELEM(m,i,j) );
-      }
-    }
-  }
-  for (i=0; i < numVectors; i++) {
-    if ( resVectorList[i].elementOfS == linPolyS ) {
-      for (j=1; j <= pVariables; j++ ) {
-	if ( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]) ) 
-	  pDelete( &MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]) );
-	MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1])= pOne();
-	// FIX ME
-	if ( true ) {
-	  pSetCoeff( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]), nPar(j) );
-	} else {
-	  pSetExp( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]), j, 1 );
-	}
+  for (i=1; i <= numVectors; i++)
+  {
+    for (j=1; j <= numVectors; j++ )
+    {
+      if ( MATELEM(m,i,j) && pGetCoeff(MATELEM(m,i,j)) )
+      {
+        MATELEM(resmat,i,j)= pCopy( MATELEM(m,i,j) );
+      }
+    }
+  }
+  for (i=0; i < numVectors; i++)
+  {
+    if ( resVectorList[i].elementOfS == linPolyS )
+    {
+      for (j=1; j <= pVariables; j++ )
+      {
+        if ( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]) )
+          pDelete( &MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]) );
+        MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1])= pOne();
+        // FIX ME
+        if ( true )
+        {
+          pSetCoeff( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]), nPar(j) );
+        }
+        else
+        {
+          pSetExp( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]), j, 1 );
+        }
       }
     }
@@ -2270,8 +2463,9 @@
   ideal resmod= idMatrix2Module(resmat);
 
-  if ( resmat != NULL ) {
+  if ( resmat != NULL )
+  {
     for ( i= 1; i <= numVectors; i++ )
       for ( j= 1; j <= numVectors; j++ )
-	pDelete( &MATELEM(resmat , i, j) );
+        pDelete( &MATELEM(resmat , i, j) );
     Free( (ADDRESS)resmat->m, numVectors * numVectors * sizeof(poly) );
     Free( (ADDRESS)resmat, sizeof(ip_smatrix) );
@@ -2290,25 +2484,29 @@
 
   j=1;
-  for ( k= numVectors - 1; k >= 0; k-- ) {
+  for ( k= numVectors - 1; k >= 0; k-- )
+  {
     vecp= getMVector(k);
     if ( vecp->isReduced ) continue;
     l=1;
-    for ( i= numVectors - 1; i >= 0; i-- ) {
+    for ( i= numVectors - 1; i >= 0; i-- )
+    {
       if ( getMVector(i)->isReduced ) continue;
-      if ( !nIsZero(vecp->getElemNum(numVectors - i - 1)) ) {
-	MATELEM(resmat,j,l)= pInit();
-	MATELEM(resmat,j,l)= pCopy( vecp->getElem(numVectors-i-1) );
+      if ( !nIsZero(vecp->getElemNum(numVectors - i - 1)) )
+      {
+        MATELEM(resmat,j,l)= pInit();
+        MATELEM(resmat,j,l)= pCopy( vecp->getElem(numVectors-i-1) );
       }
       l++;
     }
     j++;
-  } 
+  }
 
   ideal resmod= idMatrix2Module(resmat);
 
-  if ( resmat != NULL ) {
+  if ( resmat != NULL )
+  {
     for ( i= 1; i <= numVectors; i++ )
       for ( j= 1; j <= numVectors; j++ )
-	pDelete( &MATELEM(resmat , i, j) );
+        pDelete( &MATELEM(resmat , i, j) );
     Free( (ADDRESS)resmat->m, numVectors * numVectors * sizeof(poly) );
     Free( (ADDRESS)resmat, sizeof(ip_smatrix) );
@@ -2324,9 +2522,12 @@
   // copy evaluation point into matrix
   // p0, p1, ..., pn replace u0, u1, ..., un
-  for ( k= numVectors - 1; k >= 0; k-- ) {
-    if ( linPolyS == getMVector(k)->elementOfS ) {
-      for ( i= 0; i < pVariables; i++ ) {
-	pSetCoeff( MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i]), 
-		   nCopy(evpoint[i]) );
+  for ( k= numVectors - 1; k >= 0; k-- )
+  {
+    if ( linPolyS == getMVector(k)->elementOfS )
+    {
+      for ( i= 0; i < pVariables; i++ )
+      {
+        pSetCoeff( MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i]),
+                   nCopy(evpoint[i]) );
       }
     }
@@ -2340,11 +2541,14 @@
   // avoid errors for det==0
   number numres;
-  if ( res && pGetCoeff( res ) ) {
+  if ( res && pGetCoeff( res ) )
+  {
     numres= nCopy( pGetCoeff( res ) );
-  } else {
+  }
+  else
+  {
     numres= nInit(0);
     mprPROT("0");
   }
-  pDelete( &res );  
+  pDelete( &res );
 
   mprSTICKYPROT(ST__DET);
@@ -2361,6 +2565,8 @@
   matrix mat= mpNew( subSize, subSize );
 
-  for ( i= 1; i <= MATROWS( mat ); i++ ) {
-    for ( j= 1; j <= MATCOLS( mat ); j++ ) {
+  for ( i= 1; i <= MATROWS( mat ); i++ )
+  {
+    for ( j= 1; j <= MATCOLS( mat ); j++ )
+    {
       MATELEM(mat,i,j)= pInit();
       pSetCoeff0( MATELEM(mat,i,j), nInit(0) );
@@ -2368,29 +2574,37 @@
   }
   j=1;
-  for ( k= numVectors - 1; k >= 0; k-- ) {
+  for ( k= numVectors - 1; k >= 0; k-- )
+  {
     vecp= getMVector(k);
     if ( vecp->isReduced ) continue;
     l=1;
-    for ( i= numVectors - 1; i >= 0; i-- ) {
+    for ( i= numVectors - 1; i >= 0; i-- )
+    {
       if ( getMVector(i)->isReduced ) continue;
-      if ( vecp->getElemNum(numVectors - i - 1) && !nIsZero(vecp->getElemNum(numVectors - i - 1)) ) {
-	pSetCoeff(MATELEM(mat, j , l ), nCopy(vecp->getElemNum(numVectors - i - 1)));
-      } /* else {
-	   MATELEM(mat, j , l )= pOne();
-	   pSetCoeff(MATELEM(mat, j , l ), nInit(0) );
-	   }
-	*/
+      if ( vecp->getElemNum(numVectors - i - 1) && !nIsZero(vecp->getElemNum(numVectors - i - 1)) )
+      {
+        pSetCoeff(MATELEM(mat, j , l ), nCopy(vecp->getElemNum(numVectors - i - 1)));
+      }
+      /* else
+      {
+           MATELEM(mat, j , l )= pOne();
+           pSetCoeff(MATELEM(mat, j , l ), nInit(0) );
+      }
+      */
       l++;
     }
     j++;
-  } 
+  }
 
   poly res= singclap_det( mat );
 
   number numres;
-  if ( res && pGetCoeff( res ) ) {
+  if ( res && pGetCoeff( res ) )
+  {
     numres= nCopy(pGetCoeff( res ));
-    pDelete( &res );    
-  } else {
+    pDelete( &res );
+  }
+  else
+  {
     numres= nInit(0);
   }
@@ -2416,5 +2630,5 @@
   mpz_init(md);mpz_set_ui(md,1);
   mpz_init(mn);mpz_set_ui(mn,1);
- 
+
   mpz_fac_ui(m,n+d);
   mpz_fac_ui(md,d);
@@ -2436,13 +2650,15 @@
 uResultant::uResultant( const ideal _gls, const resMatType _rmt, BOOLEAN extIdeal )
   : rmt( _rmt )
-{ 
-  if ( extIdeal ) {
+{
+  if ( extIdeal )
+  {
     // extend given ideal by linear poly F0=u0x0 + u1x1 +...+ unxn
     gls= extendIdeal( _gls, linearPoly( rmt ), rmt );
     n= IDELEMS( gls );
-  } else 
+  } else
     gls= idCopy( _gls );
 
-  switch ( rmt ) {
+  switch ( rmt )
+  {
   case sparseResMat:
     resMat= new resMatrixSparse( gls );
@@ -2452,5 +2668,5 @@
     break;
   default:
-    Werror("uResultant::uResultant: Unknown resultant matrix type choosen!");
+    WerrorS("uResultant::uResultant: Unknown resultant matrix type choosen!");
   }
 }
@@ -2464,16 +2680,18 @@
 {
   ideal newGls= idCopy( gls );
-  newGls->m= (poly *)ReAlloc( newGls->m, 
-			      IDELEMS(gls) * sizeof(poly), 
-			      (IDELEMS(gls) + 1) * sizeof(poly) );
+  newGls->m= (poly *)ReAlloc( newGls->m,
+                              IDELEMS(gls) * sizeof(poly),
+                              (IDELEMS(gls) + 1) * sizeof(poly) );
   IDELEMS(newGls)++;
- 
-  switch ( rmt ) {
+
+  switch ( rmt )
+  {
   case sparseResMat:
   case denseResMat:
     {
       int i;
-      for ( i= IDELEMS(newGls)-1; i > 0; i-- ) {
-	newGls->m[i]= newGls->m[i-1];
+      for ( i= IDELEMS(newGls)-1; i > 0; i-- )
+      {
+        newGls->m[i]= newGls->m[i-1];
       }
       newGls->m[0]= linPoly;
@@ -2481,7 +2699,7 @@
     break;
   default:
-    Werror("uResultant::extendIdeal: Unknown resultant matrix type choosen!");
-  }
-      
+    WerrorS("uResultant::extendIdeal: Unknown resultant matrix type choosen!");
+  }
+
   return( newGls );
 }
@@ -2494,5 +2712,6 @@
   poly actlp, rootlp= newlp;
 
-  for ( i= 1; i <= pVariables; i++ ) {
+  for ( i= 1; i <= pVariables; i++ )
+  {
     actlp= newlp;
     pSetExp( actlp, i, 1 );
@@ -2504,5 +2723,6 @@
   pDelete( &newlp );
 
-  if ( rmt == sparseResMat ) {
+  if ( rmt == sparseResMat )
+  {
     newlp= pOne();
     actlp->next= newlp;
@@ -2524,5 +2744,5 @@
   // long mdg= (facul(tdg+n-1) / facul( tdg )) / facul( n - 1 );
   long mdg= over( n-1, tdg );
-  
+
   // maxiaml number of terms in a polynom of degree tdg
   long l=(long)pow( tdg+1, n );
@@ -2534,5 +2754,5 @@
 #endif
 
-  // we need mdg results of D(p0,p1,...,pn) 
+  // we need mdg results of D(p0,p1,...,pn)
   number *presults;
   presults= (number *)Alloc( mdg * sizeof( number ) );
@@ -2546,6 +2766,7 @@
   // initial evaluatoin point
   p=1;
-  for (i=0; i < n; i++) {
-    // init pevpoint with primes 3,5,7,11, ... 
+  for (i=0; i < n; i++)
+  {
+    // init pevpoint with primes 3,5,7,11, ...
     p= nextPrime( p );
     pevpoint[i]=nInit( p );
@@ -2556,6 +2777,8 @@
   // evaluate the determinant in the points pev^0, pev^1, ..., pev^mdg
   mprPROTnl("// evaluating:");
-  for ( i=0; i < mdg; i++ ) {
-    for (j=0; j < n; j++) {
+  for ( i=0; i < mdg; i++ )
+  {
+    for (j=0; j < n; j++)
+    {
       nDelete( &pev[j] );
       nPower(pevpoint[j],i,&pev[j]);
@@ -2574,5 +2797,5 @@
   mprPROTnl("// interpolating:");
   number *ncpoly;
-  { 
+  {
     vandermonde vm( mdg, n, tdg, pevpoint );
     ncpoly= vm.interpolateDense( presults );
@@ -2581,16 +2804,18 @@
   if ( subDetVal != NULL ) {   // divide by common factor
       number detdiv;
-      for ( i= 0; i <= mdg; i++ ) {
-	detdiv= nDiv( ncpoly[i], subDetVal );
-	nNormalize( detdiv );
-	nDelete( &ncpoly[i] );
-	ncpoly[i]= detdiv;
-      }
-    }
-  
+      for ( i= 0; i <= mdg; i++ )
+      {
+        detdiv= nDiv( ncpoly[i], subDetVal );
+        nNormalize( detdiv );
+        nDelete( &ncpoly[i] );
+        ncpoly[i]= detdiv;
+      }
+    }
+
 #ifdef mprDEBUG_ALL
   PrintLn();
-  for ( i=0; i < mdg; i++ ) { 
-    nPrint(ncpoly[i]); Print(" --- "); 
+  for ( i=0; i < mdg; i++ )
+  {
+    nPrint(ncpoly[i]); Print(" --- ");
   }
   PrintLn();
@@ -2599,6 +2824,8 @@
   // prepare ncpoly for later use
   number nn=nInit(0);
-  for ( i=0; i < mdg; i++ ) { 
-    if ( nEqual(ncpoly[i],nn) ) { 
+  for ( i=0; i < mdg; i++ )
+  {
+    if ( nEqual(ncpoly[i],nn) )
+    {
       nDelete( &ncpoly[i] );
       ncpoly[i]=NULL;
@@ -2616,18 +2843,24 @@
   long c=0;
 
-  for ( i=0; i < l; i++ ) {
-    if ( sum == tdg ) {
-      if ( ncpoly[c] ) {
-	poly p= pOne();
-	if ( rmt == denseResMat ) {
-	  for ( j= 0; j < n; j++ ) pSetExp( p, j+1, exp[j] );
-	} else if ( rmt == sparseResMat ) {
-	  for ( j= 1; j < n; j++ ) pSetExp( p, j, exp[j] );
-	}
-	pSetCoeff( p, ncpoly[c] );
-	pSetm( p );
-	if (result) result= pAdd( pCopy(result), pCopy(p) );
-	else result= pCopy( p );
-	pDelete( &p );
+  for ( i=0; i < l; i++ )
+  {
+    if ( sum == tdg )
+    {
+      if ( ncpoly[c] )
+      {
+        poly p= pOne();
+        if ( rmt == denseResMat )
+        {
+          for ( j= 0; j < n; j++ ) pSetExp( p, j+1, exp[j] );
+        }
+        else if ( rmt == sparseResMat )
+        {
+          for ( j= 1; j < n; j++ ) pSetExp( p, j, exp[j] );
+        }
+        pSetCoeff( p, ncpoly[c] );
+        pSetm( p );
+        if (result) result= pAdd( pCopy(result), pCopy(p) );
+        else result= pCopy( p );
+        pDelete( &p );
       }
       c++;
@@ -2635,17 +2868,19 @@
     sum=0;
     exp[0]++;
-    for ( j= 0; j < n - 1; j++ ) {
-      if ( exp[j] > tdg ) {
-	exp[j]= 0;
-	exp[j + 1]++;
+    for ( j= 0; j < n - 1; j++ )
+    {
+      if ( exp[j] > tdg )
+      {
+        exp[j]= 0;
+        exp[j + 1]++;
       }
       sum+=exp[j];
-    } 
+    }
     sum+=exp[n-1];
-  } 
-  
+  }
+
   pSetm( result );
   pTest( result );
-  
+
   return result;
 }
@@ -2662,5 +2897,5 @@
 
   // evaluate D in tdg+1 distinct points, so
-  // we need tdg+1 results of D(p0,1,0,...,0) = 
+  // we need tdg+1 results of D(p0,1,0,...,0) =
   //              c(0)*u0^tdg + c(1)*u0^tdg-1 + ... + c(tdg-1)*u0 + c(tdg)
   number *presults;
@@ -2682,42 +2917,55 @@
   // this gives us n-1 evaluations
   p=3;
-  for ( uvar= 0; uvar < loops; uvar++ ) { 
+  for ( uvar= 0; uvar < loops; uvar++ )
+  {
     // generate initial evaluation point
-    if ( matchUp ) {
-      for (i=0; i < n; i++) {
-	// prime(random number) between 1 and MAXEVPOINT
-	nDelete( &pevpoint[i] );
-	if ( i == 0 ) {
-	  //p= nextPrime( p );
-	  pevpoint[i]= nInit( p );
-	} else 
-	  if ( i <= uvar + 2 ) {
-	    pevpoint[i]=nInit(IsPrime(1+(int) (MAXEVPOINT*rand()/(RAND_MAX+1.0))));
-	    //pevpoint[i]=nInit(383);
-	  } else pevpoint[i]=nInit(0);
-	mprPROTNnl(" ",pevpoint[i]);
-      }
-    } else {
-      for (i=0; i < n; i++) {
-	// init pevpoint with  prime,0,...0,1,0,...,0
-	nDelete( &pevpoint[i] );
-	if ( i == 0 ) {
-	  //p=nextPrime( p );
-	  pevpoint[i]=nInit( p );
-	} 
-	else 
-	  if ( i == (uvar + 1) ) pevpoint[i]= nInit(-1);
-	  else pevpoint[i]= nInit(0);
-	mprPROTNnl(" ",pevpoint[i]);
+    if ( matchUp )
+    {
+      for (i=0; i < n; i++)
+      {
+        // prime(random number) between 1 and MAXEVPOINT
+        nDelete( &pevpoint[i] );
+        if ( i == 0 )
+        {
+          //p= nextPrime( p );
+          pevpoint[i]= nInit( p );
+        }
+        else if ( i <= uvar + 2 )
+        {
+          pevpoint[i]=nInit(IsPrime(1+(int) (MAXEVPOINT*rand()/(RAND_MAX+1.0))));
+          //pevpoint[i]=nInit(383);
+        }
+        else
+          pevpoint[i]=nInit(0);
+        mprPROTNnl(" ",pevpoint[i]);
+      }
+    }
+    else
+    {
+      for (i=0; i < n; i++)
+      {
+        // init pevpoint with  prime,0,...0,1,0,...,0
+        nDelete( &pevpoint[i] );
+        if ( i == 0 )
+        {
+          //p=nextPrime( p );
+          pevpoint[i]=nInit( p );
+        }
+        else
+          if ( i == (uvar + 1) ) pevpoint[i]= nInit(-1);
+          else pevpoint[i]= nInit(0);
+        mprPROTNnl(" ",pevpoint[i]);
       }
     }
 
     // prepare aktual evaluation point
-    for (i=0; i < n; i++) {
+    for (i=0; i < n; i++)
+    {
       nDelete( &pev[i] );
       pev[i]= nCopy( pevpoint[i] );
     }
     // evaluate the determinant in the points pev^0, pev^1, ..., pev^tdg
-    for ( i=0; i <= tdg; i++ ) {
+    for ( i=0; i <= tdg; i++ )
+    {
       nDelete( &pev[0] );
       nPower(pevpoint[0],i,&pev[0]);          // new evpoint
@@ -2733,5 +2981,5 @@
     mprSTICKYPROT("\n");
 
-    // now interpolate 
+    // now interpolate
     vandermonde vm( tdg + 1, 1, tdg, pevpoint, FALSE );
     number *ncpoly= vm.interpolateDense( presults );
@@ -2739,9 +2987,10 @@
     if ( subDetVal != NULL ) {  // divide by common factor
       number detdiv;
-      for ( i= 0; i <= tdg; i++ ) {
-	detdiv= nDiv( ncpoly[i], subDetVal );
-	nNormalize( detdiv );
-	nDelete( &ncpoly[i] );
-	ncpoly[i]= detdiv;
+      for ( i= 0; i <= tdg; i++ )
+      {
+        detdiv= nDiv( ncpoly[i], subDetVal );
+        nNormalize( detdiv );
+        nDelete( &ncpoly[i] );
+        ncpoly[i]= detdiv;
       }
     }
@@ -2749,6 +2998,7 @@
 #ifdef mprDEBUG_ALL
     PrintLn();
-    for ( i=0; i <= tdg; i++ ) { 
-      nPrint(ncpoly[i]); Print(" --- "); 
+    for ( i=0; i <= tdg; i++ )
+    {
+      nPrint(ncpoly[i]); Print(" --- ");
     }
     PrintLn();
@@ -2756,7 +3006,7 @@
 
     // save results
-    roots[uvar]->fillContainer( ncpoly, pevpoint, uvar+1, tdg, 
-				(matchUp?rootContainer::cspecialmu:rootContainer::cspecial),
-				loops );
+    roots[uvar]->fillContainer( ncpoly, pevpoint, uvar+1, tdg,
+                                (matchUp?rootContainer::cspecialmu:rootContainer::cspecial),
+                                loops );
   }
 
@@ -2792,23 +3042,30 @@
   // or D(u0,k1,k2,0,...,0), D(u0,k1,k2,k3,0,...,0), ..., D(u0,k1,k2,k3,...,kn)
   p=3;
-  for ( uvar= 0; uvar < loops; uvar++ ) { 
+  for ( uvar= 0; uvar < loops; uvar++ )
+  {
     // generate initial evaluation point
-    if ( matchUp ) {
-      for (i=0; i < n; i++) {
-	// prime(random number) between 1 and MAXEVPOINT
-	nDelete( &pevpoint[i] );
-	if ( i <= uvar + 2 ) {
-	  pevpoint[i]=nInit(IsPrime(1+(int) (MAXEVPOINT*rand()/(RAND_MAX+1.0))));
-	  //pevpoint[i]=nInit(383);
-	} else pevpoint[i]=nInit(0);
-	mprPROTNnl(" ",pevpoint[i]);
-      }
-    } else {
-      for (i=0; i < n; i++) {
-	// init pevpoint with  prime,0,...0,-1,0,...,0
-	nDelete( &(pevpoint[i]) );
-	if ( i == (uvar + 1) ) pevpoint[i]= nInit(-1);
-	else pevpoint[i]= nInit(0);
-	mprPROTNnl(" ",pevpoint[i]);
+    if ( matchUp )
+    {
+      for (i=0; i < n; i++)
+      {
+        // prime(random number) between 1 and MAXEVPOINT
+        nDelete( &pevpoint[i] );
+        if ( i <= uvar + 2 )
+        {
+          pevpoint[i]=nInit(IsPrime(1+(int) (MAXEVPOINT*rand()/(RAND_MAX+1.0))));
+          //pevpoint[i]=nInit(383);
+        } else pevpoint[i]=nInit(0);
+        mprPROTNnl(" ",pevpoint[i]);
+      }
+    }
+    else
+    {
+      for (i=0; i < n; i++)
+      {
+        // init pevpoint with  prime,0,...0,-1,0,...,0
+        nDelete( &(pevpoint[i]) );
+        if ( i == (uvar + 1) ) pevpoint[i]= nInit(-1);
+        else pevpoint[i]= nInit(0);
+        mprPROTNnl(" ",pevpoint[i]);
       }
     }
@@ -2819,24 +3076,29 @@
 
     piter= pures;
-    for ( i= tdg; i >= 0; i-- ) {
+    for ( i= tdg; i >= 0; i-- )
+    {
       //if ( piter ) Print("deg %d, pDeg(piter) %d\n",i,pTotaldegree(piter));
-      if ( piter && pTotaldegree(piter) == i ) {
-	ncpoly[i]= nCopy( pGetCoeff( piter ) );
-	pIter( piter );
-      } else {
-	ncpoly[i]= nInit(0);
+      if ( piter && pTotaldegree(piter) == i )
+      {
+        ncpoly[i]= nCopy( pGetCoeff( piter ) );
+        pIter( piter );
+      }
+      else
+      {
+        ncpoly[i]= nInit(0);
       }
       mprPROTNnl("", ncpoly[i] );
-    }  
-    
+    }
+
     mprSTICKYPROT(ST_BASE_EV); // .
 
     if ( subDetVal != NULL ) {  // divide by common factor
       number detdiv;
-      for ( i= 0; i <= tdg; i++ ) {
-	detdiv= nDiv( ncpoly[i], subDetVal );
-	nNormalize( detdiv );
-	nDelete( &ncpoly[i] );
-	ncpoly[i]= detdiv;
+      for ( i= 0; i <= tdg; i++ )
+      {
+        detdiv= nDiv( ncpoly[i], subDetVal );
+        nNormalize( detdiv );
+        nDelete( &ncpoly[i] );
+        ncpoly[i]= detdiv;
       }
     }
@@ -2845,7 +3107,7 @@
 
     // save results
-    roots[uvar]->fillContainer( ncpoly, pevpoint, uvar+1, tdg, 
-				(matchUp?rootContainer::cspecialmu:rootContainer::cspecial),
-				loops );
+    roots[uvar]->fillContainer( ncpoly, pevpoint, uvar+1, tdg,
+                                (matchUp?rootContainer::cspecialmu:rootContainer::cspecial),
+                                loops );
   }
 
@@ -2864,5 +3126,6 @@
   i+=2;
   int j= IsPrime( i );
-  while ( j <= init ) {
+  while ( j <= init )
+  {
     i+=2;
     j= IsPrime( i );
@@ -2879,5 +3142,5 @@
 // compile-command-1: "make installg" ***
 // compile-command-2: "make install" ***
-// End: *** 
+// End: ***
 
 // in folding: C-c x
Index: Singular/mpr_base.h
===================================================================
--- Singular/mpr_base.h	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/mpr_base.h	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -4,7 +4,7 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mpr_base.h,v 1.1 1999-06-28 12:48:12 wenk Exp $ */
+/* $Id: mpr_base.h,v 1.2 1999-06-28 16:06:25 Singular Exp $ */
 
-/* 
+/*
 * ABSTRACT - multipolynomial resultants - resultant matrices
 *            ( sparse, dense, u-resultant solver )
@@ -21,5 +21,6 @@
  * Base class for sparse and dense u-Resultant computation
  */
-class resMatrixBase {
+class resMatrixBase
+{
 public:
   /* state of the resultant */
@@ -37,7 +38,7 @@
   virtual const number getSubDet() { return NULL; }
 
-  virtual const long getDetDeg() const { return totDeg; } 
+  virtual const long getDetDeg() const { return totDeg; }
 
-  virtual const IStateType initState() const { return istate; }  
+  virtual const IStateType initState() const { return istate; }
 
 protected:
@@ -49,5 +50,5 @@
 
   int totDeg;
-  
+
 private:
   /* disables the copy constructor */
@@ -60,5 +61,6 @@
  * Base class for solving 0-dim poly systems using u-resultant
  */
-class uResultant {
+class uResultant
+{
 public:
   enum resMatType { none, sparseResMat, denseResMat };
@@ -75,10 +77,10 @@
   rootContainer ** specializeInU( BOOLEAN matchUp= false, const number subDetVal= NULL );
 
-  resMatrixBase * accessResMat() { return resMat; } 
+  resMatrixBase * accessResMat() { return resMat; }
 
 private:
   /* deactivated copy constructor */
   uResultant( const uResultant & );
-  
+
   ideal extendIdeal( const ideal gls, poly linPoly, const resMatType rmt );
   poly linearPoly( const resMatType rmt );
@@ -99,12 +101,3 @@
 // compile-command-2: "make install" ***
 // compile-command: "make installg" ***
-// End: *** 
-
-
-
-
-
-
-
-
-
+// End: ***
Index: Singular/mpr_complex.cc
===================================================================
--- Singular/mpr_complex.cc	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/mpr_complex.cc	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mpr_complex.cc,v 1.7 1999-06-28 12:48:12 wenk Exp $ */
+/* $Id: mpr_complex.cc,v 1.8 1999-06-28 16:06:26 Singular Exp $ */
 
 /*
@@ -199,46 +199,53 @@
   gmp_float r;
 
-  if ( rField_is_Q() ) {
+  if ( rField_is_Q() )
+  {
     if ( num != NULL )
+    {
+      if (SR_HDL(num) & SR_INT)
       {
-	if (SR_HDL(num) & SR_INT)
-	  {
-	    r= SR_TO_INT(num);
-	  }
-	else
-	  {
-	    if ( num->s == 0 )
-	      {
-		nlNormalize( num );
-	      }
-	    if (SR_HDL(num) & SR_INT)
-	      {
-		r= SR_TO_INT(num);
-	      }
-	    else
-	      {
-		if ( num->s != 3 )
-		  {
-		    r= &num->z;
-		    r/= (gmp_float)&num->n;
-		  }
-		else
-		  {
-		    r= &num->z;
-		  }
-	      }
-	  }
+        r= SR_TO_INT(num);
       }
+      else
+      {
+        if ( num->s == 0 )
+        {
+          nlNormalize( num );
+        }
+        if (SR_HDL(num) & SR_INT)
+        {
+          r= SR_TO_INT(num);
+        }
+        else
+        {
+          if ( num->s != 3 )
+          {
+            r= &num->z;
+            r/= (gmp_float)&num->n;
+          }
+          else
+          {
+            r= &num->z;
+          }
+        }
+      }
+    }
     else
-      {
-	r= 0.0;
-      }
-  } else if (rField_is_long_R() || rField_is_long_C()) {
+    {
+      r= 0.0;
+    }
+  }
+  else if (rField_is_long_R() || rField_is_long_C())
+  {
     r= *(gmp_float*)num;
-  } else if ( rField_is_R() ) {
+  }
+  else if ( rField_is_R() )
+  {
     // Add some code here :-)
-    Werror("Ground field not implemented!");
-  } else {
-    Werror("Ground field not implemented!");
+    WerrorS("Ground field not implemented!");
+  }
+  else
+  {
+    WerrorS("Ground field not implemented!");
   }
 
@@ -499,9 +506,12 @@
     in_real=floatToStr( c.real(), oprec );         // get real part
     in_imag=floatToStr( abs(c.imag()), oprec );    // get imaginary part
-    
-    if (rField_is_long_C()) {
+
+    if (rField_is_long_C())
+    {
       out=(char*)AllocL((strlen(in_real)+strlen(in_imag)+5+strlen(currRing->parameter[0]))*sizeof(char));
       sprintf(out,"%s%s%s*%s",in_real,c.imag().sign()>=0?"+":"-",currRing->parameter[0],in_imag);
-    } else {
+    }
+    else
+    {
       out=(char*)AllocL( (strlen(in_real)+strlen(in_imag)+8) * sizeof(char));
       sprintf(out,"%s%s%s",in_real,c.imag().sign()>=0?" + I ":" - I ",in_imag);
Index: Singular/mpr_complex.h
===================================================================
--- Singular/mpr_complex.h	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/mpr_complex.h	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -4,15 +4,15 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mpr_complex.h,v 1.5 1999-06-28 12:48:13 wenk Exp $ */
-
-/* 
+/* $Id: mpr_complex.h,v 1.6 1999-06-28 16:06:26 Singular Exp $ */
+
+/*
 * ABSTRACT - multipolynomial resultants - real floating-point numbers using gmp
 *            and complex numbers based on pairs of real floating-point numbers
-*   
+*
 */
 
 //-> include & define stuff
 // must have gmp version >= 2
-extern "C" { 
+extern "C" {
 #include <gmp.h>
 }
@@ -106,6 +106,6 @@
 
   inline bool setFromStr( char * in );
-  
-  // access 
+
+  // access
   inline const mpf_t *mpfp() const;
 
@@ -117,16 +117,16 @@
 
 public:
-  static void setPrecision( const unsigned long int prec ) { 
-    gmp_default_prec_bits= prec; 
-  }
-  static void setEqualBits( const unsigned long int prec ) { 
-    gmp_needequal_bits= prec; 
-  }
-
-  static const unsigned long int getPrecision() { 
-    return gmp_default_prec_bits; 
-  }
-  static const unsigned long int getEqualBits() { 
-    return gmp_needequal_bits; 
+  static void setPrecision( const unsigned long int prec ) {
+    gmp_default_prec_bits= prec;
+  }
+  static void setEqualBits( const unsigned long int prec ) {
+    gmp_needequal_bits= prec;
+  }
+
+  static const unsigned long int getPrecision() {
+    return gmp_default_prec_bits;
+  }
+  static const unsigned long int getEqualBits() {
+    return gmp_needequal_bits;
   }
 
@@ -270,5 +270,5 @@
 //-> class gmp_complex
 /**
- * @short gmp_complex numbers based on 
+ * @short gmp_complex numbers based on
  */
 class gmp_complex
@@ -306,5 +306,5 @@
 
   // gmp_complex <operator> real
-  inline friend gmp_complex operator + ( const gmp_complex & a, const gmp_float b_d );  
+  inline friend gmp_complex operator + ( const gmp_complex & a, const gmp_float b_d );
   inline friend gmp_complex operator - ( const gmp_complex & a, const gmp_float b_d );
   inline friend gmp_complex operator * ( const gmp_complex & a, const gmp_float b_d );
@@ -388,8 +388,3 @@
 // compile-command-1: "make installg" ***
 // compile-command-2: "make install" ***
-// End: *** 
-
-
-
-
-
+// End: ***
Index: Singular/mpr_global.h
===================================================================
--- Singular/mpr_global.h	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/mpr_global.h	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -4,8 +4,8 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mpr_global.h,v 1.3 1999-06-28 12:48:14 wenk Exp $ */
+/* $Id: mpr_global.h,v 1.4 1999-06-28 16:06:27 Singular Exp $ */
 
-/* 
-* ABSTRACT - multipolynomial resultants - 
+/*
+* ABSTRACT - multipolynomial resultants -
 *                                global definitions and debugging stuff
 */
@@ -36,12 +36,12 @@
 #define mprPROT(msg) Print("%s",msg)
 #define mprPROTnl(msg) Print("%s\n",msg)
-#define mprPROTP(msg,poly) Print("%s",msg);pWrite0(poly) 
-#define mprPROTPnl(msg,poly) Print("%s",msg);pWrite(poly) 
+#define mprPROTP(msg,poly) Print("%s",msg);pWrite0(poly)
+#define mprPROTPnl(msg,poly) Print("%s",msg);pWrite(poly)
 #define mprPROTI(msg,intval) Print("%s%d",msg,intval)
 #define mprPROTInl(msg,intval) Print("%s%d\n",msg,intval)
 #define mprPROTN(msg,nval) Print("%s",msg);nPrint(nval);
 #define mprPROTNnl(msg,nval) Print("%s",msg);nPrint(nval);PrintLn();
-#else 
-#define mprPROT(msg) 
+#else
+#define mprPROT(msg)
 #define mprPROTnl(msg)
 #define mprPROTP(msg,poly)
@@ -93,6 +93,3 @@
 // compile-command-1: "make installg" ***
 // compile-command-2: "make install" ***
-// End: *** 
-
-
-
+// End: ***
Index: Singular/mpr_inout.cc
===================================================================
--- Singular/mpr_inout.cc	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/mpr_inout.cc	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -2,7 +2,7 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mpr_inout.cc,v 1.1 1999-06-28 12:48:14 wenk Exp $ */
-
-/* 
+/* $Id: mpr_inout.cc,v 1.2 1999-06-28 16:06:28 Singular Exp $ */
+
+/*
 * ABSTRACT - multipolynomial resultant
 */
@@ -14,5 +14,5 @@
 #include "tok.h"
 #include "structs.h"
-#include "subexpr.h"  
+#include "subexpr.h"
 #include "polys.h"
 #include "ideals.h"
@@ -47,8 +47,9 @@
 #define TIMING_EPR(t,msg) TIMING_END_AND_PRINT(t,msg);TIMING_RESET(t);
 
-enum mprState{ 
-    mprOk, 
+enum mprState
+{
+    mprOk,
     mprWrongRType,
-    mprHasOne, 
+    mprHasOne,
     mprInfNumOfVars,
     mprNotReduced,
@@ -61,5 +62,5 @@
 //<-
 
-//-> nPrint(number n) 
+//-> nPrint(number n)
 void nPrint(number n)
 {
@@ -76,7 +77,8 @@
 void mprPrintError( mprState state, const char * name )
 {
-  switch (state) {
+  switch (state)
+  {
   case mprWrongRType:
-    Werror("Unknown resultant matrix type choosen!");
+    WerrorS("Unknown resultant matrix type choosen!");
     break;
   case mprHasOne:
@@ -85,5 +87,5 @@
   case mprInfNumOfVars:
     Werror("Numer of elements in given ideal %s must be equal to %d!",
-	   name,pVariables+1);
+           name,pVariables+1);
     break;
   case mprNotZeroDim:
@@ -92,5 +94,5 @@
   case mprNotHomog:
     Werror("The given ideal %s has to be homogeneous in"
-	   " the first ring variable!",name);
+           " the first ring variable!",name);
     break;
   case mprNotReduced:
@@ -98,5 +100,5 @@
     break;
   case mprUnSupField:
-    Werror("Ground field not implemented!");
+    WerrorS("Ground field not implemented!");
     break;
   default:
@@ -107,17 +109,17 @@
 
 //-> mprState mprIdealCheck()
-mprState mprIdealCheck( const ideal theIdeal, 
-			const char * name, 
-			uResultant::resMatType mtype, 
-			BOOLEAN rmatrix= false )
+mprState mprIdealCheck( const ideal theIdeal,
+                        const char * name,
+                        uResultant::resMatType mtype,
+                        BOOLEAN rmatrix= false )
 {
   mprState state = mprOk;
   int power;
-  int k; 
+  int k;
 
   int numOfVars= mtype == uResultant::denseResMat?pVariables-1:pVariables;
   if ( rmatrix ) numOfVars++;
 
-  if ( mtype == uResultant::none ) 
+  if ( mtype == uResultant::none )
     state= mprWrongRType;
 
@@ -125,17 +127,18 @@
     state= mprInfNumOfVars;
 
-  for ( k= IDELEMS(theIdeal) - 1; (state == mprOk) && (k >= 0); k-- ) {
+  for ( k= IDELEMS(theIdeal) - 1; (state == mprOk) && (k >= 0); k-- )
+  {
     poly p = (theIdeal->m)[k];
     if ( pIsConstant(p) ) state= mprHasOne;
-    else 
-    if ( (mtype == uResultant::denseResMat) && !pIsHomogeneous(p) ) 
+    else
+    if ( (mtype == uResultant::denseResMat) && !pIsHomogeneous(p) )
       state=mprNotHomog;
   }
 
   if ( !(rField_is_R()||
-	 rField_is_Q()||
-	 rField_is_long_R()||
-	 rField_is_long_C()||
-	 (rmatrix && rField_is_Q_a())) ) 
+         rField_is_Q()||
+         rField_is_long_R()||
+         rField_is_long_C()||
+         (rmatrix && rField_is_Q_a())) )
     state= mprUnSupField;
 
@@ -149,5 +152,6 @@
 uResultant::resMatType determineMType( int imtype )
 {
-  switch ( imtype ) {
+  switch ( imtype )
+  {
   case MPR_DENSE:
     return uResultant::denseResMat;
@@ -181,9 +185,10 @@
   res->rtyp = LIST_CMD;
   res->data= (void *)emptylist;
-  
+
   TIMING_START(mpr_overall);
 
   // check input ideal ( = polynomial system )
-  if ( mprIdealCheck( gls, arg1->Name(), mtype ) != mprOk ) {
+  if ( mprIdealCheck( gls, arg1->Name(), mtype ) != mprOk )
+  {
     return TRUE;
   }
@@ -197,6 +202,7 @@
   TIMING_START(mpr_constr);
   ures= new uResultant( gls, mtype );
-  if ( ures->accessResMat()->initState() != resMatrixBase::ready ) {
-    Werror("Error occurred during matrix setup!");
+  if ( ures->accessResMat()->initState() != resMatrixBase::ready )
+  {
+    WerrorS("Error occurred during matrix setup!");
     return TRUE;
   }
@@ -205,11 +211,13 @@
   // if dense resultant, check if minor nonsingular
   TIMING_START(mpr_check);
-  if ( mtype == uResultant::denseResMat ) {
+  if ( mtype == uResultant::denseResMat )
+  {
     smv= ures->accessResMat()->getSubDet();
 #ifdef mprDEBUG_PROT
     Print("// Determinant of submatrix: ");nPrint(smv);PrintLn();
 #endif
-    if ( nIsZero(smv) ) {
-      Werror("Unsuitable input ideal: Minor of resultant matrix is singular!");
+    if ( nIsZero(smv) )
+    {
+      WerrorS("Unsuitable input ideal: Minor of resultant matrix is singular!");
       return TRUE;
     }
@@ -220,6 +228,6 @@
   TIMING_START(mpr_ures);
   if ( interpolate_det )
-    iproots= ures->interpolateDenseSP( false, smv );  
-  else 
+    iproots= ures->interpolateDenseSP( false, smv );
+  else
     iproots= ures->specializeInU( false, smv );
   TIMING_EPR(mpr_ures,   "interpolation ures\t")
@@ -227,7 +235,7 @@
   // main task 3: Interpolate specialized resultant polynomials
   TIMING_START(mpr_mures);
-  if ( interpolate_det ) 
+  if ( interpolate_det )
     muiproots= ures->interpolateDenseSP( true, smv );
-  else 
+  else
     muiproots= ures->specializeInU( true, smv );
   TIMING_EPR(mpr_mures,  "interpolation mures\t")
@@ -245,13 +253,16 @@
   arranger->solve_all();
   TIMING_EPR(mpr_solver, "solver time\t\t");
-   
+
   // get list of roots
-  if ( arranger->success() ) {
+  if ( arranger->success() )
+  {
     TIMING_START(mpr_arrange);
     arranger->arrange();
     TIMING_EPR(mpr_arrange, "arrange time\t\t");
     listofroots= arranger->listOfRoots( gmp_output_digits );
-  } else {
-    Werror("Solver was unable to find any root!");
+  }
+  else
+  {
+    WerrorS("Solver was unable to find any root!");
     return TRUE;
   }
@@ -273,5 +284,5 @@
   emptylist->Clean();
   //Free( (ADDRESS) emptylist, sizeof(slists) );
-  
+
   TIMING_EPR(mpr_overall,"overall time\t\t")
 
@@ -290,5 +301,6 @@
 
   // check input ideal ( = polynomial system )
-  if ( mprIdealCheck( gls, arg1->Name(), mtype, true ) != mprOk ) {
+  if ( mprIdealCheck( gls, arg1->Name(), mtype, true ) != mprOk )
+  {
     return TRUE;
   }
@@ -300,5 +312,5 @@
 
   delete resMat;
-  
+
   return FALSE;
 }
@@ -312,5 +324,5 @@
   gls= (poly)(arg1->Data());
   int howclean= (int)arg2->Data();
-  
+
   int deg= pTotaldegree( gls );
   //  int deg= pDeg( gls );
@@ -325,24 +337,29 @@
 
   if ( !(rField_is_R() ||
-	 rField_is_Q() ||
-	 rField_is_long_R() ||
-	 rField_is_long_C()) ) {
-    Werror("Ground field not implemented!\n");
-    return TRUE;
-  }
-
-  if ( pVariables > 1 ) {
+         rField_is_Q() ||
+         rField_is_long_R() ||
+         rField_is_long_C()) )
+         {
+    WerrorS("Ground field not implemented!");
+    return TRUE;
+  }
+
+  if ( pVariables > 1 )
+  {
     piter= gls;
-    for ( i= 1; i <= pVariables; i++ ) 
-      if ( pGetExp( piter, i ) ) {
-	vpos= i;
-	break;
+    for ( i= 1; i <= pVariables; i++ )
+      if ( pGetExp( piter, i ) )
+      {
+        vpos= i;
+        break;
       }
-    while ( piter ) {
-      for ( i= 1; i <= pVariables; i++ ) 
-	if ( (vpos != i) && (pGetExp( piter, i ) != 0) ) {
-	  Werror("The polynomial %s must be univariate!",arg1->Name());
-	  return TRUE;
-	}
+    while ( piter )
+    {
+      for ( i= 1; i <= pVariables; i++ )
+        if ( (vpos != i) && (pGetExp( piter, i ) != 0) )
+        {
+          Werror("The polynomial %s must be univariate!",arg1->Name());
+          return TRUE;
+        }
       pIter( piter );
     }
@@ -352,17 +369,22 @@
   number * pcoeffs= (number *)Alloc( (deg+1) * sizeof( number ) );
   piter= gls;
-  for ( i= deg; i >= 0; i-- ) {
+  for ( i= deg; i >= 0; i-- )
+  {
     //if ( piter ) Print("deg %d, pDeg(piter) %d\n",i,pTotaldegree(piter));
-    if ( piter && pTotaldegree(piter) == i ) {
+    if ( piter && pTotaldegree(piter) == i )
+    {
       pcoeffs[i]= nCopy( pGetCoeff( piter ) );
       //nPrint( pcoeffs[i] );Print("  ");
       pIter( piter );
-    } else {
+    }
+    else
+    {
       pcoeffs[i]= nInit(0);
     }
-  }  
+  }
 
 #ifdef mprDEBUG_PROT
-  for (i=deg; i >= 0; i--) {
+  for (i=deg; i >= 0; i--)
+  {
     nPrint( pcoeffs[i] );Print("  ");
   }
@@ -383,12 +405,17 @@
   rlist->Init( elem );
 
-  if (rField_is_long_C()) {
-    for ( j= 0; j < elem; j++ ) {
+  if (rField_is_long_C())
+  {
+    for ( j= 0; j < elem; j++ )
+    {
       rlist->m[j].rtyp=NUMBER_CMD;
       rlist->m[j].data=(void *)nCopy((number)(roots->getRoot(j)));
       //rlist->m[j].data=(void *)(number)(roots->getRoot(j));
     }
-  } else {
-    for ( j= 0; j < elem; j++ ) {
+  }
+  else
+  {
+    for ( j= 0; j < elem; j++ )
+    {
       dummy = complexToStr( (*roots)[j], gmp_output_digits );
       rlist->m[j].rtyp=STRING_CMD;
@@ -423,29 +450,34 @@
   // p can be a vector of numbers (multivariate polynom)
   //   or one number (univariate polynom)
-  // tdg = deg(f) 
-
-  int n= IDELEMS( p ); 
+  // tdg = deg(f)
+
+  int n= IDELEMS( p );
   int m= IDELEMS( w );
   int tdg= (int)arg3->Data();
 
   res->data= (void*)NULL;
-  
+
   // check the input
-  if ( tdg < 1 ) {
-    Werror("Last input parameter must be > 0!");
-    return TRUE;
-  }
-  if ( n != pVariables ) {
-    Werror("Size of first input ideal must be equal to %d!\n",pVariables);
-    return TRUE;
-  }
-  if ( m != (int)pow((double)tdg+1,(int)n) ) {
-    Werror("Size of second input ideal must be equal to %d!\n",(int)pow((double)tdg+1,(int)n));
+  if ( tdg < 1 )
+  {
+    WerrorS("Last input parameter must be > 0!");
+    return TRUE;
+  }
+  if ( n != pVariables )
+  {
+    Werror("Size of first input ideal must be equal to %d!",pVariables);
+    return TRUE;
+  }
+  if ( m != (int)pow((double)tdg+1,(int)n) )
+  {
+    Werror("Size of second input ideal must be equal to %d!",
+      (int)pow((double)tdg+1,(int)n));
     return TRUE;
   }
   if ( !(rField_is_Q() /* ||
-	 rField_is_R() || rField_is_long_R() ||
-	 rField_is_long_C()*/ ) ) {
-    Werror("Ground field not implemented!\n");
+         rField_is_R() || rField_is_long_R() ||
+         rField_is_long_C()*/ ) )
+         {
+    WerrorS("Ground field not implemented!");
     return TRUE;
   }
@@ -453,19 +485,24 @@
   number tmp;
   number *pevpoint= (number *)Alloc( n * sizeof( number ) );
-  for ( i= 0; i < n; i++ ) {
+  for ( i= 0; i < n; i++ )
+  {
     pevpoint[i]=nInit(0);
-    if (  (p->m)[i] ) {
+    if (  (p->m)[i] )
+    {
       tmp = pGetCoeff( (p->m)[i] );
-      if ( nIsZero(tmp) || nIsOne(tmp) || nIsMOne(tmp) ) {
-	Free( (ADDRESS)pevpoint, n * sizeof( number ) );
-	Werror("Elements of first input ideal must not be equal to -1, 0, 1!");
-	return TRUE;
+      if ( nIsZero(tmp) || nIsOne(tmp) || nIsMOne(tmp) )
+      {
+        Free( (ADDRESS)pevpoint, n * sizeof( number ) );
+        WerrorS("Elements of first input ideal must not be equal to -1, 0, 1!");
+        return TRUE;
       }
     } else tmp= NULL;
-    if ( !nIsZero(tmp) ) {
-      if ( !pIsConstant((p->m)[i])) {
-	Free( (ADDRESS)pevpoint, n * sizeof( number ) );
-	Werror("Elements of first input ideal must be numbers!");
-	return TRUE;
+    if ( !nIsZero(tmp) )
+    {
+      if ( !pIsConstant((p->m)[i]))
+      {
+        Free( (ADDRESS)pevpoint, n * sizeof( number ) );
+        WerrorS("Elements of first input ideal must be numbers!");
+        return TRUE;
       }
       pevpoint[i]= nCopy( tmp );
@@ -474,12 +511,15 @@
 
   number *wresults= (number *)Alloc( m * sizeof( number ) );
-  for ( i= 0; i < m; i++ ) {
+  for ( i= 0; i < m; i++ )
+  {
     wresults[i]= nInit(0);
-    if ( (w->m)[i] && !nIsZero(pGetCoeff((w->m)[i])) ) {
-      if ( !pIsConstant((w->m)[i])) {
-	Free( (ADDRESS)pevpoint, n * sizeof( number ) );
-	Free( (ADDRESS)wresults, m * sizeof( number ) );
-	Werror("Elements of second input ideal must be numbers!");
-	return TRUE;
+    if ( (w->m)[i] && !nIsZero(pGetCoeff((w->m)[i])) )
+    {
+      if ( !pIsConstant((w->m)[i]))
+      {
+        Free( (ADDRESS)pevpoint, n * sizeof( number ) );
+        Free( (ADDRESS)wresults, m * sizeof( number ) );
+        WerrorS("Elements of second input ideal must be numbers!");
+        return TRUE;
       }
       wresults[i]= nCopy(pGetCoeff((w->m)[i]));
@@ -500,5 +540,5 @@
 //<-
 
-//-> function u_resultant_det 
+//-> function u_resultant_det
 poly u_resultant_det( ideal gls, int imtype )
 {
@@ -511,5 +551,6 @@
 
   // check input ideal ( = polynomial system )
-  if ( mprIdealCheck( gls, "", mtype ) != mprOk ) {
+  if ( mprIdealCheck( gls, "", mtype ) != mprOk )
+  {
     return emptypoly;
   }
@@ -523,11 +564,13 @@
 
   // if dense resultant, check if minor nonsingular
-  if ( mtype == uResultant::denseResMat ) {
+  if ( mtype == uResultant::denseResMat )
+  {
     smv= ures->accessResMat()->getSubDet();
 #ifdef mprDEBUG_PROT
     Print("// Determinant of submatrix: ");nPrint(smv); PrintLn();
 #endif
-    if ( nIsZero(smv) ) {
-      Werror("Unsuitable input ideal: Minor of resultant matrix is singular!");
+    if ( nIsZero(smv) )
+    {
+      WerrorS("Unsuitable input ideal: Minor of resultant matrix is singular!");
       return emptypoly;
     }
@@ -558,5 +601,5 @@
 // compile-command-1: "make installg" ***
 // compile-command-2: "make install" ***
-// End: *** 
+// End: ***
 
 // in folding: C-c x
Index: Singular/mpr_inout.h
===================================================================
--- Singular/mpr_inout.h	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/mpr_inout.h	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -4,9 +4,9 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mpr_inout.h,v 1.1 1999-06-28 12:48:15 wenk Exp $ */
+/* $Id: mpr_inout.h,v 1.2 1999-06-28 16:06:28 Singular Exp $ */
 
-/* 
+/*
 * ABSTRACT - multipolynomial resultants - interface to Singular
-*   
+*
 */
 
@@ -18,9 +18,9 @@
 /** solve a multipolynomial system using the u-resultant
  * Input ideal must be 0-dimensional and pVariables == IDELEMS(ideal).
- * Resultant method can be MPR_DENSE, which uses Macaulay Resultant (good for 
- * dense homogeneous polynoms) or MPR_SPARSE, which uses Sparse Resultant 
+ * Resultant method can be MPR_DENSE, which uses Macaulay Resultant (good for
+ * dense homogeneous polynoms) or MPR_SPARSE, which uses Sparse Resultant
  * (Gelfand, Kapranov, Zelevinsky).
- * If interpolate == true then the determinant of the u-resultant will be 
- * numerically interpolatet using a Vandermonde System. 
+ * If interpolate == true then the determinant of the u-resultant will be
+ * numerically interpolatet using a Vandermonde System.
  * Otherwise, the Sparse Bareiss will be used (faster!).
  * Returns a list containing the roots of the system.
@@ -34,5 +34,5 @@
 
 /** find the (complex) roots an univariate polynomial
- * Determines the roots of an univariate polynomial using Laguerres' 
+ * Determines the roots of an univariate polynomial using Laguerres'
  * root-solver. Good for polynomials with low and middle degree (<40).
  * Returns a list containing the roots of the polynomial.
@@ -50,3 +50,3 @@
 // compile-command-1: "make installg" ***
 // compile-command-2: "make install" ***
-// End: *** 
+// End: ***
Index: Singular/mpr_numeric.cc
===================================================================
--- Singular/mpr_numeric.cc	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/mpr_numeric.cc	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -2,9 +2,9 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mpr_numeric.cc,v 1.1 1999-06-28 12:48:16 wenk Exp $ */
-
-/* 
+/* $Id: mpr_numeric.cc,v 1.2 1999-06-28 16:06:29 Singular Exp $ */
+
+/*
 * ABSTRACT - multipolynomial resultants - numeric stuff
-*            ( root finder, vandermonde system solver, simplex )   
+*            ( root finder, vandermonde system solver, simplex )
 */
 
@@ -40,6 +40,6 @@
 
 //-> vandermonde::*
-vandermonde::vandermonde( const long _cn, const long _n, const long _maxdeg, 
-			  number *_p, const bool _homog )
+vandermonde::vandermonde( const long _cn, const long _n, const long _maxdeg,
+                          number *_p, const bool _homog )
   : n(_n), cn(_cn), maxdeg(_maxdeg), p(_p), homog(_homog)
 {
@@ -70,11 +70,14 @@
   for ( j= 0; j < n; j++ ) exp[j]=0;
 
-  for ( i= 0; i < l; i++ ) {
-    if ( !homog || (sum == maxdeg) ) {
-      for ( j= 0; j < n; j++ ) {
-	nPower( p[j], exp[j], &tmp );
-	tmp1 = nMult( tmp, x[c] );
-	x[c]= tmp1;
-	nDelete( &tmp );
+  for ( i= 0; i < l; i++ )
+  {
+    if ( !homog || (sum == maxdeg) )
+    {
+      for ( j= 0; j < n; j++ )
+      {
+        nPower( p[j], exp[j], &tmp );
+        tmp1 = nMult( tmp, x[c] );
+        x[c]= tmp1;
+        nDelete( &tmp );
       }
       c++;
@@ -82,9 +85,11 @@
     exp[0]++;
     sum=0;
-    for ( j= 0; j < n - 1; j++ ) {
-      if ( exp[j] > maxdeg ) {
-	exp[j]= 0;
-	exp[j + 1]++;
-	}
+    for ( j= 0; j < n - 1; j++ )
+    {
+      if ( exp[j] > maxdeg )
+      {
+        exp[j]= 0;
+        exp[j + 1]++;
+        }
       sum+= exp[j];
     }
@@ -108,25 +113,32 @@
   for ( j= 0; j < n+1; j++ ) exp[j]=0;
 
-  for ( i= 0; i < l; i++ ) {
-    if ( (!homog || (sum == maxdeg)) && q[i] && !nIsZero(q[i]) ) {
+  for ( i= 0; i < l; i++ )
+  {
+    if ( (!homog || (sum == maxdeg)) && q[i] && !nIsZero(q[i]) )
+    {
       pnew= pOne();
       pSetCoeff(pnew,q[i]);
       pSetExpV(pnew,exp);
-      if ( pit ) {
-	pNext(pnew)= pit;
-	pit= pnew;
-      } else {
-	pit= pnew;
-	pNext(pnew)= NULL;
-      } 
+      if ( pit )
+      {
+        pNext(pnew)= pit;
+        pit= pnew;
+      }
+      else
+      {
+        pit= pnew;
+        pNext(pnew)= NULL;
+      }
       pSetm(pit);
     }
     exp[1]++;
     sum=0;
-    for ( j= 1; j < n; j++ ) {
-      if ( exp[j] > maxdeg ) {
-	exp[j]= 0;
-	exp[j + 1]++;
-	}
+    for ( j= 1; j < n; j++ )
+    {
+      if ( exp[j] > maxdeg )
+      {
+        exp[j]= 0;
+        exp[j + 1]++;
+        }
       sum+= exp[j];
     }
@@ -135,5 +147,5 @@
 
   Free( (ADDRESS) exp, (n+1) * sizeof(Exponent_t) );
-  
+
   pOrdPolyMerge(pit);
   return pit;
@@ -152,13 +164,17 @@
   w= (number *)Alloc( cn * sizeof(number) );
   c= (number *)Alloc( cn * sizeof(number) );
-  for ( j= 0; j < cn; j++ ) {
+  for ( j= 0; j < cn; j++ )
+  {
     w[j]= nInit(0);
     c[j]= nInit(0);
   }
 
-  if ( cn == 1 ) {
+  if ( cn == 1 )
+  {
     nDelete( &w[0] );
     w[0]= nCopy(q[0]);
-  } else {
+  }
+  else
+  {
     nDelete( &c[cn-1] );
     c[cn-1]= nCopy(x[0]);
@@ -171,9 +187,9 @@
 
       for ( j= (cn-i-1); j <= (cn-2); j++) { // j=(cn+1-i); j <= (cn-1)
-	nDelete( &tmp1 );
-	tmp1= nMult( xx, c[j+1] );           // c[j]= c[j] + (xx * c[j+1])
-	newnum= nAdd( c[j], tmp1 );
-	nDelete( &c[j] );
-	c[j]= newnum;
+        nDelete( &tmp1 );
+        tmp1= nMult( xx, c[j+1] );           // c[j]= c[j] + (xx * c[j+1])
+        newnum= nAdd( c[j], tmp1 );
+        nDelete( &c[j] );
+        c[j]= newnum;
       }
 
@@ -187,28 +203,28 @@
       xx= nCopy(x[i]);                     // xx= x[i]
 
-      nDelete( &t );          
+      nDelete( &t );
       t= nInit( 1 );                         // t= b= 1
       nDelete( &b );
-      b= nInit( 1 );         
+      b= nInit( 1 );
       nDelete( &s );                         // s= q[cn-1]
       s= nCopy( q[cn-1] );
 
       for ( k= cn-1; k >= 1; k-- ) {         // k=cn; k >= 2
-	nDelete( &tmp1 );
-	tmp1= nMult( xx, b );                // b= c[k] + (xx * b)
-	nDelete( &b );
-	b= nAdd( c[k], tmp1 ); 
-
-	nDelete( &tmp1 );
-	tmp1= nMult( q[k-1], b );            // s= s + (q[k-1] * b)
-	newnum= nAdd( s, tmp1 );
-	nDelete( &s );
-	s= newnum;
-
-	nDelete( &tmp1 );
-	tmp1= nMult( xx, t );                // t= (t * xx) + b
-	newnum= nAdd( tmp1, b );
-	nDelete( &t );
-	t= newnum;
+        nDelete( &tmp1 );
+        tmp1= nMult( xx, b );                // b= c[k] + (xx * b)
+        nDelete( &b );
+        b= nAdd( c[k], tmp1 );
+
+        nDelete( &tmp1 );
+        tmp1= nMult( q[k-1], b );            // s= s + (q[k-1] * b)
+        newnum= nAdd( s, tmp1 );
+        nDelete( &s );
+        s= newnum;
+
+        nDelete( &tmp1 );
+        tmp1= nMult( xx, t );                // t= (t * xx) + b
+        newnum= nAdd( tmp1, b );
+        nDelete( &t );
+        t= newnum;
       }
 
@@ -245,5 +261,5 @@
 //-> definitions
 #define MR       8        // never change this value
-#define MT      20       
+#define MT      20
 #define MAXIT   (MT*MR)   // max number of iterations in laguer root finder
 
@@ -252,5 +268,5 @@
 //<-
 
-//-> rootContainer::rootContainer() 
+//-> rootContainer::rootContainer()
 rootContainer::rootContainer()
 {
@@ -265,5 +281,5 @@
 //<-
 
-//-> rootContainer::~rootContainer() 
+//-> rootContainer::~rootContainer()
 rootContainer::~rootContainer()
 {
@@ -272,5 +288,6 @@
 
   // free coeffs, ievpoint
-  if ( ievpoint != NULL ) {
+  if ( ievpoint != NULL )
+  {
     for ( i=0; i < anz+2; i++ ) nDelete( ievpoint + i );
     Free( (ADDRESS)ievpoint, (anz+2) * sizeof( number ) );
@@ -283,13 +300,13 @@
   for ( i=0; i < tdg; i++ ) delete theroots[i];
   Free( (ADDRESS) theroots, (tdg)*sizeof(gmp_complex*) );
-  
+
   mprPROTnl("~rootContainer()");
 }
 //<-
 
-//-> void rootContainer::fillContainer( ... ) 
-void rootContainer::fillContainer( number *_coeffs, number *_ievpoint, 
-				   const int _var, const int _tdg, 
-				   const rootType  _rt, const int _anz )
+//-> void rootContainer::fillContainer( ... )
+void rootContainer::fillContainer( number *_coeffs, number *_ievpoint,
+                                   const int _var, const int _tdg,
+                                   const rootType  _rt, const int _anz )
 {
   int i;
@@ -301,6 +318,8 @@
   anz=_anz;
 
-  for ( i=0; i <= tdg; i++ ) { 
-    if ( nEqual(coeffs[i],nn) ) { 
+  for ( i=0; i <= tdg; i++ )
+  {
+    if ( nEqual(coeffs[i],nn) )
+    {
       nDelete( &coeffs[i] );
       coeffs[i]=NULL;
@@ -312,5 +331,5 @@
     ievpoint= (number *)Alloc( (anz+2) * sizeof( number ) );
     for (i=0; i < anz+2; i++) ievpoint[i]= nCopy( _ievpoint[i] );
-  } 
+  }
 
   theroots= NULL;
@@ -319,5 +338,5 @@
 //<-
 
-//-> poly rootContainer::getPoly() 
+//-> poly rootContainer::getPoly()
 poly rootContainer::getPoly()
 {
@@ -327,24 +346,30 @@
   poly ppos;
 
-  if ( (rt == cspecial) || ( rt == cspecialmu ) ) {
-    for ( i= tdg; i >= 0; i-- ) {
-      if ( coeffs[i] ) {
-	poly p= pOne();
-	//pSetExp( p, var+1, i);
-	pSetExp( p, 1, i);
-	pSetCoeff( p, nCopy( coeffs[i] ) );
-	pSetm( p );
-	if (result) {
-	  ppos->next=p;
-	  ppos=ppos->next;
-	} else {
-	  result=p;
-	  ppos=p;
-	}
-      
+  if ( (rt == cspecial) || ( rt == cspecialmu ) )
+  {
+    for ( i= tdg; i >= 0; i-- )
+    {
+      if ( coeffs[i] )
+      {
+        poly p= pOne();
+        //pSetExp( p, var+1, i);
+        pSetExp( p, 1, i);
+        pSetCoeff( p, nCopy( coeffs[i] ) );
+        pSetm( p );
+        if (result)
+        {
+          ppos->next=p;
+          ppos=ppos->next;
+        }
+        else
+        {
+          result=p;
+          ppos=p;
+        }
+
       }
     }
     pSetm( result );
-  } 
+  }
 
   return result;
@@ -352,11 +377,12 @@
 //<-
 
-//-> const gmp_complex & rootContainer::opterator[] ( const int i ) 
+//-> const gmp_complex & rootContainer::opterator[] ( const int i )
 // this is now inline!
 //  gmp_complex & rootContainer::operator[] ( const int i )
 //  {
-//    if ( found_roots && ( i >= 0) && ( i < tdg ) ) {
+//    if ( found_roots && ( i >= 0) && ( i < tdg ) )
+//    {
 //      return *theroots[i];
-//    } 
+//    }
 //    // warning
 //    Werror("rootContainer::getRoot: Wrong index %d, found_roots %s",i,found_roots?"true":"false");
@@ -366,22 +392,25 @@
 //<-
 
-//-> gmp_complex & rootContainer::evPointCoord( int i ) 
+//-> gmp_complex & rootContainer::evPointCoord( int i )
 gmp_complex & rootContainer::evPointCoord( const int i )
 {
   if (! ((i >= 0) && (i < anz+2) ) )
-    Werror("rootContainer::evPointCoord: index out of range");
+    WerrorS("rootContainer::evPointCoord: index out of range");
   if (ievpoint == NULL)
-    Werror("rootContainer::evPointCoord: ievpoint == NULL");
+    WerrorS("rootContainer::evPointCoord: ievpoint == NULL");
 
   if ( (rt == cspecialmu) && found_roots ) {  // FIX ME
-    if ( ievpoint[i] != NULL ) {
+    if ( ievpoint[i] != NULL )
+    {
       gmp_complex *tmp= new gmp_complex();
       *tmp= numberToGmp_Complex(ievpoint[i]);
       return *tmp;
-    } else {
+    }
+    else
+    {
       Werror("rootContainer::evPointCoord: NULL index %d",i);
     }
   }
-   
+
   // warning
   Werror("rootContainer::evPointCoord: Wrong index %d, found_roots %s",i,found_roots?"true":"false");
@@ -391,9 +420,11 @@
 //<-
 
-//-> bool rootContainer::changeRoots( int from, int to ) 
+//-> bool rootContainer::changeRoots( int from, int to )
 bool rootContainer::swapRoots( const int from, const int to )
 {
-  if ( found_roots && ( from >= 0) && ( from < tdg ) && ( to >= 0) && ( to < tdg ) ) {
-    if ( to != from ) {
+  if ( found_roots && ( from >= 0) && ( from < tdg ) && ( to >= 0) && ( to < tdg ) )
+  {
+    if ( to != from )
+    {
       gmp_complex tmp( *theroots[from] );
       *theroots[from]= *theroots[to];
@@ -401,6 +432,6 @@
     }
     return true;
-  } 
-    
+  }
+
   // warning
   Werror(" rootContainer::changeRoots: Wrong index %d, %d",from,to);
@@ -409,5 +440,5 @@
 //<-
 
-//-> void rootContainer::solver() 
+//-> void rootContainer::solver()
 bool rootContainer::solver( const int polishmode )
 {
@@ -420,5 +451,6 @@
   // copy the coefficients of type number to type gmp_complex
   gmp_complex **ad= (gmp_complex**)Alloc( (tdg+1)*sizeof(gmp_complex*) );
-  for ( i=0; i <= tdg; i++ ) {
+  for ( i=0; i <= tdg; i++ )
+  {
     ad[i]= new gmp_complex();
     if ( coeffs[i] ) *ad[i] = numberToGmp_Complex( coeffs[i] );
@@ -426,22 +458,25 @@
 
   // now solve
-  switch (polishmode) {
+  switch (polishmode)
+  {
   case PM_NONE:
   case PM_POLISH:
     found_roots= laguer_driver( ad, theroots, polishmode == PM_POLISH );
-    if (!found_roots) {
-      Werror("rootContainer::solver: No roots found!");
+    if (!found_roots)
+    {
+      WerrorS("rootContainer::solver: No roots found!");
       goto solverend;
     }
     break;
   case PM_CORRUPT:
-    found_roots= laguer_driver( ad, theroots, false ); 
+    found_roots= laguer_driver( ad, theroots, false );
     // corrupt the roots
     for ( i= 0; i < tdg; i++ )
       *theroots[i]= *theroots[i] * (gmp_float)(1.0+0.01*(mprfloat)i);
-    // and interpolate again      
+    // and interpolate again
     found_roots= laguer_driver( ad, theroots, true );
-    if (!found_roots) {
-      Werror("rootContainer::solver: No roots found!");
+    if (!found_roots)
+    {
+      WerrorS("rootContainer::solver: No roots found!");
       goto solverend;
     }
@@ -460,5 +495,5 @@
 //<-
 
-//-> gmp_complex* rootContainer::laguer_driver( bool polish ) 
+//-> gmp_complex* rootContainer::laguer_driver( bool polish )
 bool rootContainer::laguer_driver(gmp_complex ** a, gmp_complex ** roots, bool polish )
 {
@@ -471,5 +506,6 @@
   for ( i=0; i <= tdg; i++ ) ad[i]= new gmp_complex( *a[i] );
 
-  for ( j= tdg; j >= 1; j-- ) {
+  for ( j= tdg; j >= 1; j-- )
+  {
     x= gmp_complex();
 
@@ -479,14 +515,16 @@
     mprSTICKYPROT(ST_ROOTS_LGSTEP);
     if ( its > MAXIT ) {  // error
-      Werror("rootContainer::laguer_driver: To many iterations!");
+      WerrorS("rootContainer::laguer_driver: To many iterations!");
       ret= false;
       goto theend;
     }
-    if ( abs(x.imag()) <= (gmp_float)(2.0*EPS)*abs(x.real())) {
+    if ( abs(x.imag()) <= (gmp_float)(2.0*EPS)*abs(x.real()))
+    {
       x= gmp_complex( x.real() );
     }
     *roots[j-1]= x;
     b= *ad[j];
-    for ( jj= j-1; jj >= 0; jj-- ) {
+    for ( jj= j-1; jj >= 0; jj-- )
+    {
       c= *ad[jj];
       *ad[jj]= b;
@@ -495,25 +533,30 @@
   }
 
-  if ( polish ) {
+  if ( polish )
+  {
     mprSTICKYPROT(ST_ROOTS_LGPOLISH);
     for ( i=0; i <= tdg; i++ ) *ad[i]=*a[i];
 
-    for ( j= 1; j <= tdg; j++ ) {
+    for ( j= 1; j <= tdg; j++ )
+    {
       // run laguer alg with corrupted roots
       laguer( ad, tdg, roots[j-1], &its );
 
       mprSTICKYPROT(ST_ROOTS_LGSTEP);
-      if ( its > MAXIT ) {  // error
-	Werror("rootContainer::laguer_driver: To many iterations!");
-	ret= false;
-	goto theend;
-      }
-    }
-    for ( j= 2; j <= tdg; j++ ) { 
+      if ( its > MAXIT )
+      {  // error
+        WerrorS("rootContainer::laguer_driver: To many iterations!");
+        ret= false;
+        goto theend;
+      }
+    }
+    for ( j= 2; j <= tdg; j++ )
+    {
       // sort root by their absolute real parts by straight insertion
       x= *roots[j-1];
-      for ( i= j-1; i >= 1; i-- ) {
-	if ( abs(roots[i-1]->real()) <= abs(x.real()) ) break;
-	*roots[i]= *roots[i-1];
+      for ( i= j-1; i >= 1; i-- )
+      {
+        if ( abs(roots[i-1]->real()) <= abs(x.real()) ) break;
+        *roots[i]= *roots[i-1];
       }
       *roots[i]= x;
@@ -530,5 +573,5 @@
 //<-
 
-//-> void rootContainer::laguer(...) 
+//-> void rootContainer::laguer(...)
 void rootContainer::laguer(gmp_complex ** a, int m, gmp_complex *x, int *its)
 {
@@ -540,5 +583,6 @@
   gmp_float epss(1.0/pow(10.0,(int)(gmp_output_digits+gmp_output_digits/4)));
 
-  for ( iter= 1; iter <= MAXIT; iter++ ) {
+  for ( iter= 1; iter <= MAXIT; iter++ )
+  {
     mprSTICKYPROT(ST_ROOTS_LG);
 
@@ -546,19 +590,20 @@
 
     b= *a[m];
-    err_g= abs(b);  
+    err_g= abs(b);
     d= gmp_complex();
     f= gmp_complex();
-    abx_g= abs(*x);  
-
-    for ( j= m-1; j >= 0; j-- ) {
+    abx_g= abs(*x);
+
+    for ( j= m-1; j >= 0; j-- )
+    {
       f= ( *x * f ) + d;
       d= ( *x * d ) + b;
       b= ( *x * b ) + *a[j];
-      err_g= abs( b ) + ( abx_g * err_g ); 
+      err_g= abs( b ) + ( abx_g * err_g );
     }
 
     err_g *= epss; // EPSS;
 
-    if ( abs(b) <= err_g ) return;  
+    if ( abs(b) <= err_g ) return;
 
     g= d / b;
@@ -568,14 +613,14 @@
     gp= g + sq;
     gm= g - sq;
-    abp_g= abs( gp );  
-    abm_g= abs( gm );  
+    abp_g= abs( gp );
+    abm_g= abs( gm );
 
     if ( abp_g < abm_g ) gp= gm;
 
-    dx = ( (max(abp_g,abm_g) > (gmp_float)0.0) 
-	   ? ( gmp_complex( (mprfloat)m ) / gp ) 
-	   : ( gmp_complex( cos((mprfloat)iter),sin((mprfloat)iter)) 
-	       * exp(log((gmp_float)1.0+abx_g))) );
-    
+    dx = ( (max(abp_g,abm_g) > (gmp_float)0.0)
+           ? ( gmp_complex( (mprfloat)m ) / gp )
+           : ( gmp_complex( cos((mprfloat)iter),sin((mprfloat)iter))
+               * exp(log((gmp_float)1.0+abx_g))) );
+
     x1= *x - dx;
 
@@ -596,8 +641,8 @@
 //-----------------------------------------------------------------------------
 
-//-> rootArranger::rootArranger(...) 
-rootArranger::rootArranger( rootContainer ** _roots, 
-			    rootContainer ** _mu, 
-			    const int _howclean )
+//-> rootArranger::rootArranger(...)
+rootArranger::rootArranger( rootContainer ** _roots,
+                            rootContainer ** _mu,
+                            const int _howclean )
   : roots(_roots), mu(_mu), howclean(_howclean)
 {
@@ -614,6 +659,7 @@
   // find roots of polys given by coeffs in roots
   rc= roots[0]->getAnzElems();
-  for ( i= 0; i < rc; i++ ) 
-    if ( !roots[i]->solver( howclean ) ) {
+  for ( i= 0; i < rc; i++ )
+    if ( !roots[i]->solver( howclean ) )
+    {
       found_roots= false;
       return;
@@ -621,6 +667,7 @@
   // find roots of polys given by coeffs in mu
   mc= mu[0]->getAnzElems();
-  for ( i= 0; i < mc; i++ ) 
-    if ( ! mu[i]->solver( howclean ) ) {
+  for ( i= 0; i < mc; i++ )
+    if ( ! mu[i]->solver( howclean ) )
+    {
       found_roots= false;
       return;
@@ -629,5 +676,5 @@
 //<-
 
-//-> void rootArranger::arrange() 
+//-> void rootArranger::arrange()
 void rootArranger::arrange()
 {
@@ -641,42 +688,50 @@
 
   for ( xkoord= 0; xkoord < anzm; xkoord++ ) {    // für x1,x2, x1,x2,x3, x1,x2,...,xn
-    for ( r= 0; r < anzr; r++ ) {                 // für jede Nullstelle 
-      // (x1-koordinate) * evp[1] + (x2-koordinate) * evp[2] + 
+    for ( r= 0; r < anzr; r++ ) {                 // für jede Nullstelle
+      // (x1-koordinate) * evp[1] + (x2-koordinate) * evp[2] +
       //                                  ... + (xkoord-koordinate) * evp[xkoord]
       tmp= gmp_complex();
-      for ( xk =0; xk <= xkoord; xk++ ){ 
-	tmp -= (*roots[xk])[r] * mu[xkoord]->evPointCoord(xk+1); //xk+1
+      for ( xk =0; xk <= xkoord; xk++ )
+      {
+        tmp -= (*roots[xk])[r] * mu[xkoord]->evPointCoord(xk+1); //xk+1
       }
       found= false;
-      for ( rtest= r; rtest < anzr; rtest++ ) {   // für jede Nullstelle 
-	zwerg = tmp - (*roots[xk])[rtest] * mu[xkoord]->evPointCoord(xk+1); // xk+1, xkoord+2
-        for ( mtest= 0; mtest < anzr; mtest++ ) {
-	  //	  if ( tmp == (*mu[xkoord])[mtest] ) {
-	  if ( ((zwerg.real() <= (*mu[xkoord])[mtest].real() + mprec) && 
-		(zwerg.real() >= (*mu[xkoord])[mtest].real() - mprec)) &&
-	       ((zwerg.imag() <= (*mu[xkoord])[mtest].imag() + mprec) && 
-		(zwerg.imag() >= (*mu[xkoord])[mtest].imag() - mprec)) ) {
-	    roots[xk]->swapRoots( r, rtest );
-	    found= true;
-	    break;
-	  }
-	}
+      for ( rtest= r; rtest < anzr; rtest++ ) {   // für jede Nullstelle
+        zwerg = tmp - (*roots[xk])[rtest] * mu[xkoord]->evPointCoord(xk+1); // xk+1, xkoord+2
+        for ( mtest= 0; mtest < anzr; mtest++ )
+        {
+          //          if ( tmp == (*mu[xkoord])[mtest] )
+          //          {
+          if ( ((zwerg.real() <= (*mu[xkoord])[mtest].real() + mprec) &&
+                (zwerg.real() >= (*mu[xkoord])[mtest].real() - mprec)) &&
+               ((zwerg.imag() <= (*mu[xkoord])[mtest].imag() + mprec) &&
+                (zwerg.imag() >= (*mu[xkoord])[mtest].imag() - mprec)) )
+           {
+             roots[xk]->swapRoots( r, rtest );
+             found= true;
+             break;
+           }
+        }
       } // rtest
-      if ( !found ) {
-	Werror("rootArranger::arrange: No match? coord %d, root %d.",xkoord,r);
+      if ( !found )
+      {
+        Werror("rootArranger::arrange: No match? coord %d, root %d.",xkoord,r);
 #ifdef mprDEBUG_PROT
-	Werror("One of these ...");
-	for ( rtest= r; rtest < anzr; rtest++ ) { 
-	  tmp= gmp_complex();
-	  for ( xk =0; xk <= xkoord; xk++ ){ 
-	    tmp-= (*roots[xk])[r] * mu[xkoord]->evPointCoord(xk+1);
-	  }
-	  tmp-= (*roots[xk])[rtest] * mu[xkoord]->evPointCoord(xk+1); // xkoord+2
-	  Werror("  %s",complexToStr(tmp,gmp_output_digits+1),rtest);
-	}
-	Werror(" ... must match to one of these:");
-	for ( mtest= 0; mtest < anzr; mtest++ ) {
-	  Werror("                  %s",complexToStr((*mu[xkoord])[mtest],gmp_output_digits+1));
-	}
+        WerrorS("One of these ...");
+        for ( rtest= r; rtest < anzr; rtest++ )
+        {
+          tmp= gmp_complex();
+          for ( xk =0; xk <= xkoord; xk++ )
+          {
+            tmp-= (*roots[xk])[r] * mu[xkoord]->evPointCoord(xk+1);
+          }
+          tmp-= (*roots[xk])[rtest] * mu[xkoord]->evPointCoord(xk+1); // xkoord+2
+          Werror("  %s",complexToStr(tmp,gmp_output_digits+1),rtest);
+        }
+        WerrorS(" ... must match to one of these:");
+        for ( mtest= 0; mtest < anzr; mtest++ )
+        {
+          Werror("                  %s",complexToStr((*mu[xkoord])[mtest],gmp_output_digits+1));
+        }
 #endif
       }
@@ -686,5 +741,5 @@
 //<-
 
-//-> lists rootArranger::listOfRoots( int oprec ) 
+//-> lists rootArranger::listOfRoots( int oprec )
 lists rootArranger::listOfRoots( const unsigned int oprec )
 {
@@ -695,20 +750,26 @@
   lists listofroots= (lists)Alloc( sizeof(slists) ); // must be done this way!
 
-  if ( found_roots ) {
+  if ( found_roots )
+  {
     listofroots->Init( count );
-    
-    for (i=0; i < count; i++) {
+
+    for (i=0; i < count; i++)
+    {
       lists onepoint= (lists)Alloc(sizeof(slists)); // must be done this way!
       onepoint->Init(elem);
-      for ( j= 0; j < elem; j++ ) {
-	if ( !rField_is_long_C() ) {
-	  onepoint->m[j].rtyp=STRING_CMD;
-	  onepoint->m[j].data=(void *)complexToStr((*roots[j])[i],oprec);
-	} else {
-	  onepoint->m[j].rtyp=NUMBER_CMD;
-	  onepoint->m[j].data=(void *)nCopy((number)(roots[j]->getRoot(i)));
-	}
-	onepoint->m[j].next= NULL;
-	onepoint->m[j].name= NULL;
+      for ( j= 0; j < elem; j++ )
+      {
+        if ( !rField_is_long_C() )
+        {
+          onepoint->m[j].rtyp=STRING_CMD;
+          onepoint->m[j].data=(void *)complexToStr((*roots[j])[i],oprec);
+        }
+        else
+        {
+          onepoint->m[j].rtyp=NUMBER_CMD;
+          onepoint->m[j].data=(void *)nCopy((number)(roots[j]->getRoot(i)));
+        }
+        onepoint->m[j].next= NULL;
+        onepoint->m[j].name= NULL;
       }
       listofroots->m[i].rtyp=LIST_CMD;
@@ -718,5 +779,7 @@
     }
 
-  } else {
+  }
+  else
+  {
     listofroots->Init( 0 );
   }
@@ -743,9 +806,10 @@
   int i,ip,ir,is,k,kh,kp,m12,nl1,nl2;
   int *l1,*l2,*l3;
-  mprfloat q1, bmax; 
-
-  if ( m != (m1+m2+m3)) {
+  mprfloat q1, bmax;
+
+  if ( m != (m1+m2+m3))
+  {
     // error: bad input
-    error(Werror(" bad input constraint counts in simplex ");)
+    error(WerrorS(" bad input constraint counts in simplex ");)
     *icase=-2;
     return;
@@ -759,8 +823,10 @@
   for ( k=1; k<=n; k++ ) l1[k]=izrov[k]=k;
   nl2=m;
-  for ( i=1; i<=m; i++ ) {
-    if ( a[i+1][1] < 0.0 ) {
+  for ( i=1; i<=m; i++ )
+  {
+    if ( a[i+1][1] < 0.0 )
+    {
       // error: bad input
-      error(Werror(" bad input tableau in simplex ");)
+      error(WerrorS(" bad input tableau in simplex ");)
       *icase=-2;
       // free mem l1,l2,l3;
@@ -775,7 +841,9 @@
   for ( i=1; i<=m2; i++) l3[i]= 1;
   ir= 0;
-  if (m2+m3) {
+  if (m2+m3)
+  {
     ir=1;
-    for ( k=1; k <= (n+1); k++ ) {
+    for ( k=1; k <= (n+1); k++ )
+    {
       q1=0.0;
       for ( i=m1+1; i <= m; i++ ) q1+= a[i+1][k];
@@ -783,32 +851,39 @@
     }
 
-    do {
+    do
+    {
       simp1(a,m+1,l1,nl1,0,&kp,&bmax);
-      if ( bmax <= SIMPLEX_EPS && a[m+2][1] < -SIMPLEX_EPS ) {
-	*icase= -1; // no solution found
-	// free mem l1,l2,l3;
-	Free( (ADDRESS) l3, (m+1) * sizeof(int) );
-	Free( (ADDRESS) l2, (m+1) * sizeof(int) );
-	Free( (ADDRESS) l1, (n+1) * sizeof(int) );
-	return;
-      } else if ( bmax <= SIMPLEX_EPS && a[m+2][1] <= SIMPLEX_EPS ) {
-	m12= m1+m2+1;
-	if ( m12 <= m ) {
-	  for ( ip= m12; ip <= m; ip++ ) {
-	    if ( iposv[ip] == (ip+n) ) {
-	      simp1(a,ip,l1,nl1,1,&kp,&bmax);
-	      if ( fabs(bmax) >= SIMPLEX_EPS)
-		goto one;
-	    }
-	  }
-	}
-	ir= 0;
-	--m12;
-	if ( m1+1 <= m12 )
-	  for ( i=m1+1; i <= m12; i++ ) 
-	    if ( l3[i-m1] == 1 ) 
-	      for ( k=1; k <= n+1; k++ ) 
-		a[i+1][k] = -a[i+1][k];
-	break;
+      if ( bmax <= SIMPLEX_EPS && a[m+2][1] < -SIMPLEX_EPS )
+      {
+        *icase= -1; // no solution found
+        // free mem l1,l2,l3;
+        Free( (ADDRESS) l3, (m+1) * sizeof(int) );
+        Free( (ADDRESS) l2, (m+1) * sizeof(int) );
+        Free( (ADDRESS) l1, (n+1) * sizeof(int) );
+        return;
+      }
+      else if ( bmax <= SIMPLEX_EPS && a[m+2][1] <= SIMPLEX_EPS )
+      {
+        m12= m1+m2+1;
+        if ( m12 <= m )
+        {
+          for ( ip= m12; ip <= m; ip++ )
+          {
+            if ( iposv[ip] == (ip+n) )
+            {
+              simp1(a,ip,l1,nl1,1,&kp,&bmax);
+              if ( fabs(bmax) >= SIMPLEX_EPS)
+                goto one;
+            }
+          }
+        }
+        ir= 0;
+        --m12;
+        if ( m1+1 <= m12 )
+          for ( i=m1+1; i <= m12; i++ )
+            if ( l3[i-m1] == 1 )
+              for ( k=1; k <= n+1; k++ )
+                a[i+1][k] = -a[i+1][k];
+        break;
       }
       //#if DEBUG
@@ -816,11 +891,12 @@
       //#endif
       simp2(a,n,l2,nl2,&ip,kp,&q1);
-      if ( ip == 0 ) {
-	*icase = -1; // no solution found
-	// free mem l1,l2,l3;
-	Free( (ADDRESS) l3, (m+1) * sizeof(int) );
-	Free( (ADDRESS) l2, (m+1) * sizeof(int) );
-	Free( (ADDRESS) l1, (n+1) * sizeof(int) );
-	return;
+      if ( ip == 0 )
+      {
+        *icase = -1; // no solution found
+        // free mem l1,l2,l3;
+        Free( (ADDRESS) l3, (m+1) * sizeof(int) );
+        Free( (ADDRESS) l2, (m+1) * sizeof(int) );
+        Free( (ADDRESS) l1, (n+1) * sizeof(int) );
+        return;
       }
     one: simp3(a,m+1,n,ip,kp);
@@ -828,21 +904,26 @@
       // print_bmat(a,m+2,n+3);
       // #endif
-      if ( iposv[ip] >= (n+m1+m2+1)) {
-	for ( k=1; k<= nl1; k++ ) 
-	  if ( l1[k] == kp ) break;
-	--nl1;
-	for ( is=k; is <= nl1; is++ ) l1[is]= l1[is+1];
-	++a[m+2][kp+1];
-	for ( i= 1; i <= m+2; i++ ) a[i][kp+1] = -a[i][kp+1];
-      } else {
-	if ( iposv[ip] >= (n+m1+1) ) {
-	  kh= iposv[ip]-m1-n;
-	  if ( l3[kh] ) {
-	    l3[kh]= 0;
-	    ++a[m+2][kp+1];
-	    for ( i=1; i<= m+2; i++ )
-	      a[i][kp+1] = -a[i][kp+1];
-	  }
-	}
+      if ( iposv[ip] >= (n+m1+m2+1))
+      {
+        for ( k=1; k<= nl1; k++ )
+          if ( l1[k] == kp ) break;
+        --nl1;
+        for ( is=k; is <= nl1; is++ ) l1[is]= l1[is+1];
+        ++a[m+2][kp+1];
+        for ( i= 1; i <= m+2; i++ ) a[i][kp+1] = -a[i][kp+1];
+      }
+      else
+      {
+        if ( iposv[ip] >= (n+m1+1) )
+        {
+          kh= iposv[ip]-m1-n;
+          if ( l3[kh] )
+          {
+            l3[kh]= 0;
+            ++a[m+2][kp+1];
+            for ( i=1; i<= m+2; i++ )
+              a[i][kp+1] = -a[i][kp+1];
+          }
+        }
       }
       is= izrov[kp];
@@ -852,10 +933,12 @@
   }
   /* end of phase 1, have feasible sol, now optimize it */
-  for (;;) {
+  loop
+  {
     // #if DEBUG
     // print_bmat( a, m+1, n+5);
     // #endif
     simp1(a,0,l1,nl1,0,&kp,&bmax);
-    if (bmax <= /*SIMPLEX_EPS*/0.0) {
+    if (bmax <= /*SIMPLEX_EPS*/0.0)
+    {
       *icase=0; // finite solution found
       // free mem l1,l2,l3
@@ -866,10 +949,11 @@
     }
     simp2(a,n,l2,nl2,&ip,kp,&q1);
-    if (ip == 0) {
+    if (ip == 0)
+    {
       //printf("Unbounded:");
       // #if DEBUG
       //       print_bmat( a, m+1, n+1);
       // #endif
-      *icase=1;		/* unbounded */
+      *icase=1;                /* unbounded */
       // free mem
       Free( (ADDRESS) l3, (m+1) * sizeof(int) );
@@ -881,5 +965,5 @@
     is= izrov[kp];
     izrov[kp]= iposv[ip];
-    iposv[ip]= is;	
+    iposv[ip]= is;
   }/*for ;;*/
 }
@@ -890,5 +974,6 @@
   mprfloat test;
 
-  if( nll <= 0) {			/* init'tion: fixed */
+  if( nll <= 0)
+  {                        /* init'tion: fixed */
     *bmax = 0.0;
     return;
@@ -896,16 +981,22 @@
   *kp=ll[1];
   *bmax=a[mm+1][*kp+1];
-  for (k=2;k<=nll;k++) {
-    if (iabf == 0) {
+  for (k=2;k<=nll;k++)
+  {
+    if (iabf == 0)
+    {
       test=a[mm+1][ll[k]+1]-(*bmax);
-      if (test > 0.0) {
-	*bmax=a[mm+1][ll[k]+1];
-	*kp=ll[k];
-      }
-    } else {			/* abs values: have fixed it */
+      if (test > 0.0)
+      {
+        *bmax=a[mm+1][ll[k]+1];
+        *kp=ll[k];
+      }
+    }
+    else
+    {                        /* abs values: have fixed it */
       test=fabs(a[mm+1][ll[k]+1])-fabs(*bmax);
-      if (test > 0.0) {
-	*bmax=a[mm+1][ll[k]+1];
-	*kp=ll[k];
+      if (test > 0.0)
+      {
+        *bmax=a[mm+1][ll[k]+1];
+        *kp=ll[k];
       }
     }
@@ -919,24 +1010,32 @@
 
   *ip= 0;
-  for ( i=1; i <= nl2; i++ ) {
-    if ( a[l2[i]+1][kp+1] < -SIMPLEX_EPS ) {
+  for ( i=1; i <= nl2; i++ )
+  {
+    if ( a[l2[i]+1][kp+1] < -SIMPLEX_EPS )
+    {
       *q1= -a[l2[i]+1][1] / a[l2[i]+1][kp+1];
       *ip= l2[i];
-      for ( i= i+1; i <= nl2; i++ ) {
-	ii= l2[i];
-	if (a[ii+1][kp+1] < -SIMPLEX_EPS) {
-	  q= -a[ii+1][1] / a[ii+1][kp+1];
-	  if (q - *q1 < -SIMPLEX_EPS) {
-	    *ip=ii;
-	    *q1=q;
-	  } else if (q - *q1 < SIMPLEX_EPS) {
-	    for ( k=1; k<= n; k++ ) {
-	      qp= -a[*ip+1][k+1]/a[*ip+1][kp+1];
-	      q0= -a[ii+1][k+1]/a[ii+1][kp+1];
-	      if ( q0 != qp ) break;
-	    }
-	    if ( q0 < qp ) *ip= ii;
-	  }
-	}
+      for ( i= i+1; i <= nl2; i++ )
+      {
+        ii= l2[i];
+        if (a[ii+1][kp+1] < -SIMPLEX_EPS)
+        {
+          q= -a[ii+1][1] / a[ii+1][kp+1];
+          if (q - *q1 < -SIMPLEX_EPS)
+          {
+            *ip=ii;
+            *q1=q;
+          }
+          else if (q - *q1 < SIMPLEX_EPS)
+          {
+            for ( k=1; k<= n; k++ )
+            {
+              qp= -a[*ip+1][k+1]/a[*ip+1][kp+1];
+              q0= -a[ii+1][k+1]/a[ii+1][kp+1];
+              if ( q0 != qp ) break;
+            }
+            if ( q0 < qp ) *ip= ii;
+          }
+        }
       }
     }
@@ -950,12 +1049,15 @@
 
   piv= 1.0 / a[ip+1][kp+1];
-  for ( ii=1; ii <= i1+1; ii++ ) 
-    if ( ii -1 != ip ) {
+  for ( ii=1; ii <= i1+1; ii++ )
+  {
+    if ( ii -1 != ip )
+    {
       a[ii][kp+1] *= piv;
-      for ( kk=1; kk <= k1+1; kk++ )  
-	if ( kk-1 != kp ) 
-	  a[ii][kk] -= a[ip+1][kk] * a[ii][kp+1];
-    }
-  for ( kk=1; kk<= k1+1; kk++ ) 
+      for ( kk=1; kk <= k1+1; kk++ )
+        if ( kk-1 != kp )
+          a[ii][kk] -= a[ip+1][kk] * a[ii][kp+1];
+    }
+  }
+  for ( kk=1; kk<= k1+1; kk++ )
     if ( kk-1 != kp ) a[ip+1][kk] *= -piv;
   a[ip+1][kp+1]= piv;
@@ -972,5 +1074,2 @@
 // compile-command-2: "make install" ***
 // End: ***
-
-
-
Index: Singular/mpr_numeric.h
===================================================================
--- Singular/mpr_numeric.h	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/mpr_numeric.h	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -4,9 +4,9 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: mpr_numeric.h,v 1.1 1999-06-28 12:48:16 wenk Exp $ */
+/* $Id: mpr_numeric.h,v 1.2 1999-06-28 16:06:30 Singular Exp $ */
 
-/* 
+/*
 * ABSTRACT - multipolynomial resultants - numeric stuff
-*            ( root finder, vandermonde system solver, simplex )   
+*            ( root finder, vandermonde system solver, simplex )
 */
 
@@ -17,5 +17,5 @@
 
 // define polish mode when finding roots
-#define PM_NONE    1 
+#define PM_NONE    1
 #define PM_POLISH  2
 #define PM_CORRUPT 3
@@ -29,10 +29,10 @@
 {
 public:
-  vandermonde( const long _cn, const long _n, 
+  vandermonde( const long _cn, const long _n,
 	       const long _maxdeg, number *_p, const bool _homog = true );
   ~vandermonde();
-  
-  /** Solves the Vandermode linear system 
-   *    \sum_{i=1}^{n} x_i^k-1 w_i = q_k, k=1,..,n. 
+
+  /** Solves the Vandermode linear system
+   *    \sum_{i=1}^{n} x_i^k-1 w_i = q_k, k=1,..,n.
      * Any computations are done using type number to get high pecision results.
    * @param  q n-tuple of results (right hand of equations)
@@ -71,6 +71,6 @@
   ~rootContainer();
 
-  void fillContainer( number *_coeffs, number *_ievpoint, 
-		      const int _var, const int _tdg, 
+  void fillContainer( number *_coeffs, number *_ievpoint,
+		      const int _var, const int _tdg,
 		      const rootType _rt, const int _anz );
 
@@ -98,7 +98,7 @@
   rootContainer( const rootContainer & v );
 
-  /** Given the degree tdg and the tdg+1 complex coefficients ad[0..tdg] 
+  /** Given the degree tdg and the tdg+1 complex coefficients ad[0..tdg]
    * (generated from the number coefficients coeffs[0..tdg]) of the polynomial
-   * this routine successively calls "laguer" and finds all m complex roots in 
+   * this routine successively calls "laguer" and finds all m complex roots in
    * roots[0..tdg]. The bool var "polish" should be input as "true" if polishing
    * (also by "laguer") is desired, "false" if the roots will be subsequently
@@ -114,5 +114,5 @@
    */
   void laguer(gmp_complex ** a, int m, gmp_complex * x, int * its);
-  
+
   int var;
   int tdg;
@@ -123,5 +123,5 @@
 
   gmp_complex ** theroots;
-  
+
   int anz;
   bool found_roots;
@@ -130,9 +130,9 @@
 
 //-> class rootArranger
-class rootArranger 
+class rootArranger
 {
-public: 
-  rootArranger( rootContainer ** _roots, 
-		rootContainer ** _mu, 
+public:
+  rootArranger( rootContainer ** _roots,
+		rootContainer ** _mu,
 		const int _howclean = PM_CORRUPT );
   ~rootArranger() {}
@@ -170,6 +170,3 @@
 // compile-command-1: "make installg" ***
 // compile-command-2: "make install" ***
-// End: *** 
-
-
-
+// End: ***
Index: Singular/pcv.cc
===================================================================
--- Singular/pcv.cc	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/pcv.cc	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR      *
 *****************************************/
-/* $Id: pcv.cc,v 1.25 1999-06-11 17:13:40 mschulze Exp $ */
+/* $Id: pcv.cc,v 1.26 1999-06-28 16:06:30 Singular Exp $ */
 /*
 * ABSTRACT: conversion between polys and coef vectors
@@ -41,5 +41,5 @@
       l0->m[i].data=pCopy((poly)l1->m[i].data);
       if(i<=l2->nr&&l2->m[i].rtyp==l1->m[i].rtyp)
-        l0->m[i].data=pAdd(l0->m[i].data,pCopy((poly)l2->m[i].data));
+        l0->m[i].data=pAdd((poly)l0->m[i].data,pCopy((poly)l2->m[i].data));
     }
     else
@@ -231,5 +231,5 @@
   {
     k=j;
-    for(j=0;j<pcvMaxDegree&&pcvIndex[i][j]<=n;j++);
+    for(j=0; (j<pcvMaxDegree) && (pcvIndex[i][j]<=(unsigned)n); j++);
     j--;
     n-=pcvIndex[i][j];
Index: Singular/shortfl.cc
===================================================================
--- Singular/shortfl.cc	(revision 0f5091ea1879ab5dca9d221f9cfc0b248090d973)
+++ Singular/shortfl.cc	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -2,5 +2,5 @@
 *  Computer Algebra System SINGULAR     *
 ****************************************/
-/* $Id: shortfl.cc,v 1.8 1999-05-10 15:10:55 Singular Exp $ */
+/* $Id: shortfl.cc,v 1.9 1999-06-28 16:06:31 Singular Exp $ */
 
 /*
@@ -339,5 +339,5 @@
     if(i>4)
     {
-      Werror("float overflow");
+      WerrorS("float overflow");
       return nf(rr).N();
     }
@@ -369,5 +369,5 @@
   {
     if(j==s)
-      Werror("float overflow");
+      WerrorS("float overflow");
     return nf(rr).N();
   }
@@ -382,5 +382,5 @@
       MPZ_CLEAR(g);
       if(j==s)
-        Werror("float overflow");
+        WerrorS("float overflow");
       return nf(rr).N();
     }
Index: Tst/Short/bug_12.res.gz.uu
===================================================================
--- Tst/Short/bug_12.res.gz.uu	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
+++ Tst/Short/bug_12.res.gz.uu	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -0,0 +1,65 @@
+begin 640 bug_12.res.gz
+M'XL(")65=S<``V)U9U\Q,BYR97,`E9E+;^-&$L?O^A1$L`=I*"KLZ@?)>&4L
+M%KD$6.0R"^QAX`G$L6S+8\N&)34T"O:[;U4_JMJ>6,D>+-:?_:[JZOY)_OCO
+MGW_YM:HJ=5G]ZY=_5C_L=_O%PV;\X6+R,97`984O?]ML-_OI[&)"S^HROMOM
+M5_O#;O%TV'-M?5FQ;1;5CS]NML^'?;7[\K)YWE?[N]6^^O*RVMVM=]7'S?;V
+M\+!ZX?J6ZE?5=GUX7&VW_WC<+0[;S>/Z85RLKP^+U:&:_F?UL%^_5#\OJE]C
+MI1DW=HOJ!3NL7I;M?'J<?YN?YH>YGZ_FXVS^\"S+Z2ZKI^?]YFD[?7YYVL\N
+MDGA</\ZD4G]9/3\]?*MNED?WS33'9G41].WR.'QSJ$>I.Z2ZN^6I.1P;_XV+
+M5'M9;:[7JP?\7.[F-U*@<O]JN7[8/&ZVJ_UZNKF>?YM]4E<7-^IBHA8[T^P6
+MNZF:[::`?WJVLXNF:28X[>O#%W+C!GV!<_])55_N5IMM\<9-CJH]F,8<A]-!
+MU^[8G^``*+N3/M1'=\(U>=-XL^(IP:NYWEY4$XS%AP_5R_IZ?8-!1]=NKO$%
+M-]!I#;=_N(;;N`;W=@U3@W]VMNMH+7]Q-<KB<NS!->ZHS.E@:V6/2N.*3`/M
+M40&N28=WZF1PE5BK/5E<YG#"4'G7>#?RK$V:]=WR9;T[/.Q7V_WT1LUOU?PX
+MN[B[F'R"UGR]^J3;'C^-`ORTRN&G@_;K57-R!VN\:U=#K=EV(S2B]&CJ+$:<
+M,T[%6BI0;0TLAEKU+#KL0.I1=T6AP?ZD4+]2V#]WB;:RZ`#KPF`*J[%H:\-B
+M&!NQ:R--^CANEC0I]&V6;M2X9%&XFZ2IQ5D536G*15,]VD87"@NE*00?986"
+M9SIV-9NN#KVC3V'EFH%M.]8@H@'+PHRU4:PTKRU(P,6X0F&AU,4R[F:D+8;[
+MRW;!CX"M6*@Z;+VDVK%V(@?R3Z%H\*S(SUKZZ4;=.)$N^DZDKHNVY.BBK1EM
+M#2(U[0$HI&VD$%X7CEW#8NQKGBQZ78?Q+/FB:PRP<&-<4Q38F2A;%N&<BE9F
+MA-JVA41?2UV-JS>ND.@;&1[CE.:<)-1&VJ(O0`K)C5G@PA4/B3'$_08'VX=`
+M:=PQ+(!\S4J-M54BVY@!60\Q;EGV-*!FV=%L#$L7`Y6EQ4!IJ6PH<5N6*6Y9
+M`L9&FF)P6)`=A*,5]TT'++JQ+D2C86`5XL:B=M$;+L8-/:"Z0A>]8#[U/2M#
+MD2HE4+J)1"7]Z)!$HJ`&+:48DMJTA=2U*U0X6K*D4,KL*99*E&YX0NA@;D2U
+MPC(PA<T*`ZY8P%CW(IJ!;8JU%M6P&;LE$U?!)@;H8(>P37`M;&/W($I1IUQQ
+MP.EJ5GW<+TDY2F16EO8#U]1A.R0!(5>C&`=*K)"VL!H::[+=C^3>+!H31NWB
+M+FDP9;*H.^!JCG:"E.&>T<`=6CJ%9*RP:YRHQMD^*]HF2D8/V2]UZ?"'MA6)
+ME5MN2WEKG"A3C$)'@71+-XH(K)<%WA0J3YMZ(]M2&$W=M]G6(Z51%C$H-NX.
+MV@5&9/16%'7/-BY*&E'*)+-1N6WP0K8Q4[+9'%P;]@9NUVR&4=NDAK":)!QN
+MA%Q-8^2C.>)]KDPX$0!/*3S=DCV,M6:[`7Z/^P&R66M^33=\IUC@RG,)W3JF
+M5:P03[HN*=H+T++`$YF;F7#4MJQT,V2A:8-WEA56[/ND*'=5RP+SR25!>3!D
+M&T,>3;RBTDLLI\$=^=[6+IMX]P]]MG&C)),N%X".%1[?V:Y5EVVZ9'`/L`JN
+MCG9C<F,Z>89L8Z^Y,<8W&G5Z$\`HF;I.37"$9-3A.'&K)C['R:<.D#\SK=K+
+MZF;U9?_TLCFMIW?X!>53#P2F@R8P5:TF,E5*#_0`H^FA34</8Q4]K+7T<#94
+MZ5RHTKM09>A"E:N?)O@UYC<TEBI:<+4\1$M?+7VTS-42Z3=R;R;>Q+J)<C/@
+M9K9EK!6B99AECLT(F^D5,KE"IE9(Q`J95D%(%812@0D5A$Y!R!2$2H&)%(1&
+M@4D4,H5")%"(].D3>?I,G3X3IV?:]$*:GBG3"V'Z3)>>R5)GJM1,E%IH4C-)
+M:J9(+02IA1ZUD*,6:M1"C%IH40LI:J9$+82H,QWJ1(8Z4Z%G)/3,@UY@T#,)
+M>L%`7S"@+P#0%_3G"_3S!??Y`OJ\$)]GW//,>IY!SV3(,PQX1N#.%&!G!.J,
+M`)T1F#,"<D8@S@C`&8$WP^!F,K29#&S@&=?(3+`6S(1JX!G4@IDP#7P):>`9
+MT<`+H($O\"R*!&=1)#0#+V`6[8QEX`LH`R](!KX`,A(9QX*=8`P\HQCX#&+@
+M,X;YC&`^XY=/Z.49NWQ$+A]QRT?4\@FS,F()7A5H)5@E2"4X)2C%&,4(E?!)
+M^PQ/9"5T"F8$)^T9FX(9H4G[`IFBB,"D?8%+V@LL13NBDO8%*&E?8)+V!21I
+M7R"2]@)(V@L>:2]PI#VCD?8,1F@F+-(^0Y'/1.09AWQF(5^`D&<*\AF!//./
+M3_#C$_GXC#T^,8\/P)-@1T"'(2<#3H*;!#9T3$:L(2M"3;`"TAB?@"88`6>,
+M9YB)9D"9<&(GD(EVQ!CC&6*,%X2)QW@$&.,97^*9'N$EVA%=XK$>P,5XQI9P
+MP@=H,2D49`1@H6?`%=KE`5;(B*@2+`*5D"P)4Z)-D!)3B!`EYE`$E)1/*ED$
+M)R&/`IJDW(+8!*,0<BNHB"1D$)#$9`N/VB.(T(]E"`"!"=3<FKEKYXI_/G/I
+MY[,3?BX)&9`+Y&?-[K+:;/?5YB(\[N/CJY3WB#-/+]5TLW18=KEL\7.Y:13_
+MBJN&1?5[%M`NJ/JTNJ>*]W]?N@9[OE_>U](`H&Q@%M57JM7<\YC@%M5F?C^7
+M64"_**"*%O+C]/1Y\^'P^?Z#__QU)C\#:YS`?UD`"5>U53MYAYD:#-((A??T
+MQ&)]];I^*Q6P6+WM#K@[C4G%%/9=W]2[P=[AO=GTA"OAM@B8$A$EX4D\WQ.6
+M!"093=DW]JS.S=M4\';>3>$'A8<L=E_357]^!1I7H-\?1^,TX#W_J`$O3U!T
+M\A*!Q&^BA!T*7]*F#HMN;!?.4-!Q[4,X+,/:D27"$4D>:`B#WGI!XS+/>$%7
+M^CLO0.$%_,Y6Z^")L:9<',_[`EU:F7>=NFJDN0*Z/S&K>[PN\01XU9'"CM0Y
+MIP*NBL9N._LN_N-7$L*5`"H140*<1"S)0,*;J^\3?B3P2,@182-C1@*,8NL9
+M&W$B@D0XN`@>W@0!T,MG@@"5^9.MB)<IG9YT1E,H\!(8X7PD,"DK^_Z0F!K?
+M!0K^,%"XP71,MT;33M!T8>)2FW!;47:\CASN]G.1P["^GP[H=KP@NW`WMA@]
+MP'%I"(7(HN-/]A@\"J-*W^*[&,F>\H8B3#'LVI0Z??QJU+8A>ZP)[`$Z1#&<
+M'\B_(7R6<@@QJ^Y&^RIPZ*1S@5.5/9,].-"?)(R9X%%<N?>./PI#.1L\A\_%
+M%`_2OYA\VH:KFJ[FH0\;:P@[BV9LPJ7;X5ZF;5WK\#4,W3E\GZ1X[IT+-1X%
+M[Q_MRD0^BFP4N2C$/?)08J'$09F!,O\D]LG<DYDG\4YFG<PYB7$2WT2V"5Q#
+M3#.Z-RZVYP*.P?H_[D[+%V_Q+V6--[S\XWFJ9A=_PWWT_7^C_P=$YW-*UAX`
+!````
+`
+end
Index: Tst/Short/bug_12.stat
===================================================================
--- Tst/Short/bug_12.stat	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
+++ Tst/Short/bug_12.stat	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -0,0 +1,11 @@
+Status Output of tst_status.out
+init >> USER    :hannes
+init >> HOSTNAME:nepomuck.mathematik.uni-kl.de
+init >> uname -a:Linux nepomuck.mathematik.uni-kl.de 2.0.33 #1 Wed Jan 21 18:50:57 MET 1998 i686 unknown
+init >> date    :Mon Jun 28 17:32:13 MET DST 1999
+init >> version :1303
+init >> ticks   :100
+1 >> tst_memory_0 :: nepomuck.mathematik.uni-kl.de:1513354
+1 >> tst_memory_1 :: nepomuck.mathematik.uni-kl.de:2152486
+1 >> tst_memory_2 :: nepomuck.mathematik.uni-kl.de:2064384
+1 >> tst_timer_1 :: nepomuck.mathematik.uni-kl.de:2145
Index: Tst/Short/bug_12.tst
===================================================================
--- Tst/Short/bug_12.tst	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
+++ Tst/Short/bug_12.tst	(revision e858e7474c86dc4faa76dde10fcfb590dcdaabae)
@@ -0,0 +1,28 @@
+LIB "tst.lib";
+tst_init();
+
+//input script that crashes Singular
+//  neumann@ms.unimelb.edu.au (Walter D. Neumann)
+ring r=0,(x,y,z,u,v,a,b),lp;
+option(prot);option(mem);
+poly f=x6y4-x-a;poly g=x9y6-x-b;
+poly s=z-ux-vy;
+ideal id=s,f;
+poly f1=eliminate(id,y)[1];f1;
+ideal id=s,g; 
+poly g1=eliminate(id,y)[1];g1;
+poly h=resultant(f1,g1,x);h;
+factorize(h);
+poly zpol=_[1][4];
+int i; int j; int k;
+for (i=6; i>=0; i=i-1)
+{
+for( j=0; j<=6-i; j=j+1)
+{
+k=6-i-j;
+i,j,k;
+factorize(zpol/(z^i*u^j*v^k));
+}
+}
+
+tst_status(1);$
