Index: numeric/mpr_base.cc
===================================================================
--- numeric/mpr_base.cc	(revision c1f4a6837b81958494c813876fa2fa6cca551937)
+++ numeric/mpr_base.cc	(revision 08e15e7aa667fe0a2a40175b200adac4ea0592ca)
@@ -9,27 +9,32 @@
  */
 
-#include <math.h>
-
+//-> includes
 #include <kernel/mod2.h>
 
+#include <misc/auxiliary.h>
+#include <omalloc/omalloc.h>
+
 #include <misc/mylimits.h>
-#include <omalloc/omalloc.h>
-
-//-> includes
-#include <kernel/options.h>
+#include <misc/options.h>
+#include <misc/intvec.h>
+
+#include <coeffs/numbers.h>
+#include <coeffs/mpr_global.h>
+
+#include <polys/matpol.h>
+#include <polys/sparsmat.h>
+
+#ifdef HAVE_FACTORY
+#include <polys/clapsing.h>
+#endif
+
+#include <kernel/febase.h>
 #include <kernel/polys.h>
 #include <kernel/ideals.h>
-#include <kernel/febase.h>
-#include <kernel/intvec.h>
-#include <kernel/matpol.h>
-#include <kernel/numbers.h>
-#ifdef HAVE_FACTORY
-#include <kernel/clapsing.h>
-#endif
-#include <kernel/sparsmat.h>
-
-#include <kernel/mpr_global.h>
-#include <kernel/mpr_base.h>
-#include <kernel/mpr_numeric.h>
+
+#include "mpr_base.h"
+#include "mpr_numeric.h"
+
+#include <math.h>
 //<-
 
@@ -278,5 +283,5 @@
 {
 public:
-  mayanPyramidAlg( simplex * _pLP ) : n(pVariables), pLP(_pLP) {}
+  mayanPyramidAlg( simplex * _pLP ) : n((currRing->N)), pLP(_pLP) {}
   ~mayanPyramidAlg() {}
 
@@ -380,5 +385,5 @@
       && (!nIsZero(pGetCoeff( MATELEM( omat, i, j)))))
       {
-        val= n_Int(pGetCoeff( MATELEM( omat, i, j) ), currRing);
+        val= n_Int(pGetCoeff( MATELEM( omat, i, j) ), currRing->cf);
         if ( i==MATROWS(omat) && j==MATCOLS(omat) )
         {
@@ -781,10 +786,10 @@
   int * vert;
 
-  n= pVariables;
+  n= (currRing->N);
   vert= (int *)omAlloc( (idelem+1) * sizeof(int) );
 
   Q = (pointSet **)omAlloc( idelem * sizeof(pointSet*) );        // support hulls
   for ( i= 0; i < idelem; i++ )
-    Q[i] = new pointSet( pVariables, i+1, pLength((gls->m)[i])+1 );
+    Q[i] = new pointSet( (currRing->N), i+1, pLength((gls->m)[i])+1 );
 
   for( i= 0; i < idelem; i++ )
@@ -820,5 +825,5 @@
     for ( j=1; j <= Q[i]->num; j++ )
     {
-      Print("%d: <",j);print_exp( (*Q[i])[j] , pVariables );PrintS(">\n");
+      Print("%d: <",j);print_exp( (*Q[i])[j] , (currRing->N) );PrintS(">\n");
     }
     PrintLn();
@@ -841,5 +846,5 @@
   int * vert;
 
-  n= pVariables;
+  n= (currRing->N);
   vert= (int *)omAlloc( (idelem+1) * sizeof(int) );
   id= idInit( idelem, 1 );
@@ -1218,5 +1223,5 @@
 bool resMatrixSparse::remapXiToPoint( const int indx, pointSet **pQ, int *set, int *pnt )
 {
-  int i,nn= pVariables;
+  int i,nn= (currRing->N);
   int loffset= 0;
   for ( i= 0; i <= nn; i++ )
@@ -1421,5 +1426,5 @@
 
   epp_mon= (int *)omAlloc( (n+2) * sizeof(int) );
-  eexp= (int *)omAlloc0((pVariables+1)*sizeof(int));
+  eexp= (int *)omAlloc0(((currRing->N)+1)*sizeof(int));
 
   totDeg= numSet0;
@@ -1480,5 +1485,5 @@
   pDelete( &epp );
   omFreeSize( (void *) epp_mon, (n+2) * sizeof(int) );
-  omFreeSize( (void *) eexp, (pVariables+1)*sizeof(int));
+  omFreeSize( (void *) eexp, ((currRing->N)+1)*sizeof(int));
 
 #ifdef mprDEBUG_ALL
@@ -1525,5 +1530,5 @@
   int j,k,l;
 
-  vert.point=(Coord_t*)omAlloc( (pVariables+2) * sizeof(Coord_t) );
+  vert.point=(Coord_t*)omAlloc( ((currRing->N)+2) * sizeof(Coord_t) );
 
   vs= new pointSet( dim );
@@ -1542,5 +1547,5 @@
   }
 
-  omFreeSize( (void *) vert.point, (pVariables+2) * sizeof(Coord_t) );
+  omFreeSize( (void *) vert.point, ((currRing->N)+2) * sizeof(Coord_t) );
 
   return vs;
@@ -1579,5 +1584,5 @@
   mprfloat shift[MAXVARS+2];   // shiftvector delta, index [1..dim]
 
-  if ( pVariables > MAXVARS )
+  if ( (currRing->N) > MAXVARS )
   {
     WerrorS("resMatrixSparse::resMatrixSparse: Too many variables!");
@@ -1593,5 +1598,5 @@
   istate= resMatrixBase::ready;
 
-  n= pVariables;
+  n= (currRing->N);
   idelem= IDELEMS(gls);  // should be n+1
 
@@ -1974,5 +1979,5 @@
 
   /** Recursively generate all homogeneous monoms of
-   * pVariables variables of degree deg.
+   * (currRing->N) variables of degree deg.
    */
   void generateMonoms( poly m, int var, int deg );
@@ -2029,5 +2034,5 @@
 
   /** holds the index of u0, u1, ..., un, if (elementOfS == linPolyS)
-   *  the size is given by pVariables
+   *  the size is given by (currRing->N)
    */
   int *numColParNr;
@@ -2100,5 +2105,5 @@
                 numVectors * sizeof( number ) );
     omfreeSize( (void *)resVectorList[i].numColParNr,
-                (pVariables+1) * sizeof(int) );
+                ((currRing->N)+1) * sizeof(int) );
   }
 
@@ -2135,5 +2140,5 @@
     {
       mprSTICKYPROT(ST_DENSE_FR);
-      for ( i= 0; i < pVariables; i++ )
+      for ( i= 0; i < (currRing->N); i++ )
       {
         MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i])= pInit();
@@ -2161,5 +2166,5 @@
     if ( linPolyS == getMVector(k)->elementOfS )
     {
-      for ( i=0; i < pVariables; i++ )
+      for ( i=0; i < (currRing->N); i++ )
       {
         Print(" %d ",(getMVector(k)->numColParNr)[i]);
@@ -2207,5 +2212,5 @@
   else
   {
-    if ( var == pVariables+1 ) return;
+    if ( var == (currRing->N)+1 ) return;
     poly newm = pCopy( mm );
     while ( deg >= 0 )
@@ -2352,10 +2357,10 @@
   // the internal Variable Ordering
   // make sure that the homogenization variable goes last!
-  intvec iVO( pVariables );
+  intvec iVO( (currRing->N) );
   if ( linPolyS != SNONE )
   {
-    iVO[pVariables - 1]= linPolyS;
+    iVO[(currRing->N) - 1]= linPolyS;
     int p=0;
-    for ( k= pVariables - 1; k >= 0; k-- )
+    for ( k= (currRing->N) - 1; k >= 0; k-- )
     {
       if ( k != linPolyS )
@@ -2369,6 +2374,6 @@
   {
     linPolyS= 0;
-    for ( k= 0; k < pVariables; k++ )
-      iVO[k]= pVariables - k - 1;
+    for ( k= 0; k < (currRing->N); k++ )
+      iVO[k]= (currRing->N) - k - 1;
   }
 
@@ -2425,5 +2430,5 @@
       resVectorList[k].numColVectorSize= 0;
       resVectorList[k].numColVector= NULL;
-      resVectorList[k].numColParNr= (int *)omAlloc0( (pVariables+1) * sizeof(int) );
+      resVectorList[k].numColParNr= (int *)omAlloc0( ((currRing->N)+1) * sizeof(int) );
 
       pi= (gls->m)[ resVectorList[k].elementOfS ];
@@ -2489,5 +2494,5 @@
     if ( resVectorList[i].elementOfS == linPolyS )
     {
-      for (j=1; j <= pVariables; j++ )
+      for (j=1; j <= (currRing->N); j++ )
       {
         if ( MATELEM(resmat,numVectors-i,
@@ -2498,5 +2503,5 @@
         if ( FALSE )
         {
-          pSetCoeff( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]), nPar(j) );
+          pSetCoeff( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]), n_Param(j,currRing) );
         }
         else
@@ -2555,5 +2560,5 @@
     if ( linPolyS == getMVector(k)->elementOfS )
     {
-      for ( i= 0; i < pVariables; i++ )
+      for ( i= 0; i < (currRing->N); i++ )
       {
         pSetCoeff( MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i]),
@@ -2567,5 +2572,5 @@
   // evaluate determinant of matrix m using factory singclap_det
 #ifdef HAVE_FACTORY
-  poly res= singclap_det( m );
+  poly res= singclap_det( m, currRing );
 #else
   poly res= NULL;
@@ -2631,5 +2636,5 @@
 
 #ifdef HAVE_FACTORY
-  poly res= singclap_det( mat );
+  poly res= singclap_det( mat, currRing );
 #else
   poly res= NULL;
@@ -2753,5 +2758,5 @@
   poly actlp, rootlp= newlp;
 
-  for ( i= 1; i <= pVariables; i++ )
+  for ( i= 1; i <= (currRing->N); i++ )
   {
     actlp= newlp;
@@ -3201,5 +3206,5 @@
   ideal idr;
 
-  n= pVariables;
+  n= (currRing->N);
   idelem= IDELEMS(id);  // should be n+1
 
