Changeset 08e15e7 in git for numeric/mpr_base.cc


Ignore:
Timestamp:
Sep 6, 2011, 7:40:16 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', '4a9821a93ffdc22a6696668bd4f6b8c9de3e6c5f')
Children:
213d649793d02bccc46292a68beead7b202af509
Parents:
b9cf410a96c73af3a43f5d317b0ff37eec0a49de
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-09-06 19:40:16+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 16:12:32+01:00
Message:
FIX: numeric/mpr_*
File:
1 edited

Legend:

Unmodified
Added
Removed
  • numeric/mpr_base.cc

    rb9cf41 r08e15e7  
    99 */
    1010
    11 #include <math.h>
    12 
     11//-> includes
    1312#include <kernel/mod2.h>
    1413
     14#include <misc/auxiliary.h>
     15#include <omalloc/omalloc.h>
     16
    1517#include <misc/mylimits.h>
    16 #include <omalloc/omalloc.h>
    17 
    18 //-> includes
    19 #include <kernel/options.h>
     18#include <misc/options.h>
     19#include <misc/intvec.h>
     20
     21#include <coeffs/numbers.h>
     22#include <coeffs/mpr_global.h>
     23
     24#include <polys/matpol.h>
     25#include <polys/sparsmat.h>
     26
     27#ifdef HAVE_FACTORY
     28#include <polys/clapsing.h>
     29#endif
     30
     31#include <kernel/febase.h>
    2032#include <kernel/polys.h>
    2133#include <kernel/ideals.h>
    22 #include <kernel/febase.h>
    23 #include <kernel/intvec.h>
    24 #include <kernel/matpol.h>
    25 #include <kernel/numbers.h>
    26 #ifdef HAVE_FACTORY
    27 #include <kernel/clapsing.h>
    28 #endif
    29 #include <kernel/sparsmat.h>
    30 
    31 #include <kernel/mpr_global.h>
    32 #include <kernel/mpr_base.h>
    33 #include <kernel/mpr_numeric.h>
     34
     35#include "mpr_base.h"
     36#include "mpr_numeric.h"
     37
     38#include <math.h>
    3439//<-
    3540
     
    278283{
    279284public:
    280   mayanPyramidAlg( simplex * _pLP ) : n(pVariables), pLP(_pLP) {}
     285  mayanPyramidAlg( simplex * _pLP ) : n((currRing->N)), pLP(_pLP) {}
    281286  ~mayanPyramidAlg() {}
    282287
     
    380385      && (!nIsZero(pGetCoeff( MATELEM( omat, i, j)))))
    381386      {
    382         val= n_Int(pGetCoeff( MATELEM( omat, i, j) ), currRing);
     387        val= n_Int(pGetCoeff( MATELEM( omat, i, j) ), currRing->cf);
    383388        if ( i==MATROWS(omat) && j==MATCOLS(omat) )
    384389        {
     
    781786  int * vert;
    782787
    783   n= pVariables;
     788  n= (currRing->N);
    784789  vert= (int *)omAlloc( (idelem+1) * sizeof(int) );
    785790
    786791  Q = (pointSet **)omAlloc( idelem * sizeof(pointSet*) );        // support hulls
    787792  for ( i= 0; i < idelem; i++ )
    788     Q[i] = new pointSet( pVariables, i+1, pLength((gls->m)[i])+1 );
     793    Q[i] = new pointSet( (currRing->N), i+1, pLength((gls->m)[i])+1 );
    789794
    790795  for( i= 0; i < idelem; i++ )
     
    820825    for ( j=1; j <= Q[i]->num; j++ )
    821826    {
    822       Print("%d: <",j);print_exp( (*Q[i])[j] , pVariables );PrintS(">\n");
     827      Print("%d: <",j);print_exp( (*Q[i])[j] , (currRing->N) );PrintS(">\n");
    823828    }
    824829    PrintLn();
     
    841846  int * vert;
    842847
    843   n= pVariables;
     848  n= (currRing->N);
    844849  vert= (int *)omAlloc( (idelem+1) * sizeof(int) );
    845850  id= idInit( idelem, 1 );
     
    12181223bool resMatrixSparse::remapXiToPoint( const int indx, pointSet **pQ, int *set, int *pnt )
    12191224{
    1220   int i,nn= pVariables;
     1225  int i,nn= (currRing->N);
    12211226  int loffset= 0;
    12221227  for ( i= 0; i <= nn; i++ )
     
    14211426
    14221427  epp_mon= (int *)omAlloc( (n+2) * sizeof(int) );
    1423   eexp= (int *)omAlloc0((pVariables+1)*sizeof(int));
     1428  eexp= (int *)omAlloc0(((currRing->N)+1)*sizeof(int));
    14241429
    14251430  totDeg= numSet0;
     
    14801485  pDelete( &epp );
    14811486  omFreeSize( (void *) epp_mon, (n+2) * sizeof(int) );
    1482   omFreeSize( (void *) eexp, (pVariables+1)*sizeof(int));
     1487  omFreeSize( (void *) eexp, ((currRing->N)+1)*sizeof(int));
    14831488
    14841489#ifdef mprDEBUG_ALL
     
    15251530  int j,k,l;
    15261531
    1527   vert.point=(Coord_t*)omAlloc( (pVariables+2) * sizeof(Coord_t) );
     1532  vert.point=(Coord_t*)omAlloc( ((currRing->N)+2) * sizeof(Coord_t) );
    15281533
    15291534  vs= new pointSet( dim );
     
    15421547  }
    15431548
    1544   omFreeSize( (void *) vert.point, (pVariables+2) * sizeof(Coord_t) );
     1549  omFreeSize( (void *) vert.point, ((currRing->N)+2) * sizeof(Coord_t) );
    15451550
    15461551  return vs;
     
    15791584  mprfloat shift[MAXVARS+2];   // shiftvector delta, index [1..dim]
    15801585
    1581   if ( pVariables > MAXVARS )
     1586  if ( (currRing->N) > MAXVARS )
    15821587  {
    15831588    WerrorS("resMatrixSparse::resMatrixSparse: Too many variables!");
     
    15931598  istate= resMatrixBase::ready;
    15941599
    1595   n= pVariables;
     1600  n= (currRing->N);
    15961601  idelem= IDELEMS(gls);  // should be n+1
    15971602
     
    19741979
    19751980  /** Recursively generate all homogeneous monoms of
    1976    * pVariables variables of degree deg.
     1981   * (currRing->N) variables of degree deg.
    19771982   */
    19781983  void generateMonoms( poly m, int var, int deg );
     
    20292034
    20302035  /** holds the index of u0, u1, ..., un, if (elementOfS == linPolyS)
    2031    *  the size is given by pVariables
     2036   *  the size is given by (currRing->N)
    20322037   */
    20332038  int *numColParNr;
     
    21002105                numVectors * sizeof( number ) );
    21012106    omfreeSize( (void *)resVectorList[i].numColParNr,
    2102                 (pVariables+1) * sizeof(int) );
     2107                ((currRing->N)+1) * sizeof(int) );
    21032108  }
    21042109
     
    21352140    {
    21362141      mprSTICKYPROT(ST_DENSE_FR);
    2137       for ( i= 0; i < pVariables; i++ )
     2142      for ( i= 0; i < (currRing->N); i++ )
    21382143      {
    21392144        MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i])= pInit();
     
    21612166    if ( linPolyS == getMVector(k)->elementOfS )
    21622167    {
    2163       for ( i=0; i < pVariables; i++ )
     2168      for ( i=0; i < (currRing->N); i++ )
    21642169      {
    21652170        Print(" %d ",(getMVector(k)->numColParNr)[i]);
     
    22072212  else
    22082213  {
    2209     if ( var == pVariables+1 ) return;
     2214    if ( var == (currRing->N)+1 ) return;
    22102215    poly newm = pCopy( mm );
    22112216    while ( deg >= 0 )
     
    23522357  // the internal Variable Ordering
    23532358  // make sure that the homogenization variable goes last!
    2354   intvec iVO( pVariables );
     2359  intvec iVO( (currRing->N) );
    23552360  if ( linPolyS != SNONE )
    23562361  {
    2357     iVO[pVariables - 1]= linPolyS;
     2362    iVO[(currRing->N) - 1]= linPolyS;
    23582363    int p=0;
    2359     for ( k= pVariables - 1; k >= 0; k-- )
     2364    for ( k= (currRing->N) - 1; k >= 0; k-- )
    23602365    {
    23612366      if ( k != linPolyS )
     
    23692374  {
    23702375    linPolyS= 0;
    2371     for ( k= 0; k < pVariables; k++ )
    2372       iVO[k]= pVariables - k - 1;
     2376    for ( k= 0; k < (currRing->N); k++ )
     2377      iVO[k]= (currRing->N) - k - 1;
    23732378  }
    23742379
     
    24252430      resVectorList[k].numColVectorSize= 0;
    24262431      resVectorList[k].numColVector= NULL;
    2427       resVectorList[k].numColParNr= (int *)omAlloc0( (pVariables+1) * sizeof(int) );
     2432      resVectorList[k].numColParNr= (int *)omAlloc0( ((currRing->N)+1) * sizeof(int) );
    24282433
    24292434      pi= (gls->m)[ resVectorList[k].elementOfS ];
     
    24892494    if ( resVectorList[i].elementOfS == linPolyS )
    24902495    {
    2491       for (j=1; j <= pVariables; j++ )
     2496      for (j=1; j <= (currRing->N); j++ )
    24922497      {
    24932498        if ( MATELEM(resmat,numVectors-i,
     
    24982503        if ( FALSE )
    24992504        {
    2500           pSetCoeff( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]), nPar(j) );
     2505          pSetCoeff( MATELEM(resmat,numVectors-i,numVectors-resVectorList[i].numColParNr[j-1]), n_Param(j,currRing) );
    25012506        }
    25022507        else
     
    25552560    if ( linPolyS == getMVector(k)->elementOfS )
    25562561    {
    2557       for ( i= 0; i < pVariables; i++ )
     2562      for ( i= 0; i < (currRing->N); i++ )
    25582563      {
    25592564        pSetCoeff( MATELEM(m,numVectors-k,numVectors-(getMVector(k)->numColParNr)[i]),
     
    25672572  // evaluate determinant of matrix m using factory singclap_det
    25682573#ifdef HAVE_FACTORY
    2569   poly res= singclap_det( m );
     2574  poly res= singclap_det( m, currRing );
    25702575#else
    25712576  poly res= NULL;
     
    26312636
    26322637#ifdef HAVE_FACTORY
    2633   poly res= singclap_det( mat );
     2638  poly res= singclap_det( mat, currRing );
    26342639#else
    26352640  poly res= NULL;
     
    27532758  poly actlp, rootlp= newlp;
    27542759
    2755   for ( i= 1; i <= pVariables; i++ )
     2760  for ( i= 1; i <= (currRing->N); i++ )
    27562761  {
    27572762    actlp= newlp;
     
    32013206  ideal idr;
    32023207
    3203   n= pVariables;
     3208  n= (currRing->N);
    32043209  idelem= IDELEMS(id);  // should be n+1
    32053210
Note: See TracChangeset for help on using the changeset viewer.