Changeset 1f637e in git


Ignore:
Timestamp:
Jul 19, 2011, 5:11:57 PM (13 years ago)
Author:
Oleksandr Motsak <motsak@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
1c4e9a5798bda4bc92d0013041b99005a50a7d7c
Parents:
6ed8c424bfe6fd9dc397bfdde3e8acf884469342
git-author:
Oleksandr Motsak <motsak@mathematik.uni-kl.de>2011-07-19 17:11:57+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 12:52:40+01:00
Message:
FIX: replaced pVariables by currRing->N...
ADD: added 'void rChangeCurrRing(ring r);' to polys/polys.h
CHG: started changing gr_kstd2.cc and syz*.cc
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • kernel/fast_mult.cc

    r6ed8c4 r1f637e  
    441441  n_Delete(&y,r);
    442442  p_SetCoeff0(p,x,r);
    443   //for (i=pVariables; i!=0; i--)
     443  //for (i=(currRing->N); i!=0; i--)
    444444  //{
    445445  //  pAddExp(p,i, pGetExp(q,i));
  • kernel/fglmcomb.cc

    r6ed8c4 r1f637e  
    9999
    100100        poly m = pOne();
    101         for ( i= pVariables; i > 0; i-- )
     101        for ( i= (currRing->N); i > 0; i-- )
    102102        {
    103103            diff= pGetExp( *pptr, i ) - pGetExp( p2, i );
  • kernel/fglmhom.cc

    r6ed8c4 r1f637e  
    139139generateMonoms( poly m, int var, int deg, homogData * dat )
    140140{
    141     if ( var == pVariables ) {
     141    if ( var == (currRing->N) ) {
    142142        BOOLEAN inSource = FALSE;
    143143        BOOLEAN inDest = FALSE;
  • kernel/fglmzero.cc

    r6ed8c4 r1f637e  
    310310fglmSelem::fglmSelem( poly p, int var ) : monom( p ), numVars( 0 )
    311311{
    312     for ( int k = pVariables; k > 0; k-- )
     312    for ( int k = (currRing->N); k > 0; k-- )
    313313        if ( pGetExp( monom, k ) > 0 )
    314314            numVars++;
     
    367367    theIdeal= thisIdeal;
    368368    idelems= IDELEMS( theIdeal );
    369     varpermutation = (int*)omAlloc( (pVariables+1)*sizeof(int) );
     369    varpermutation = (int*)omAlloc( ((currRing->N)+1)*sizeof(int) );
    370370    // Sort ring variables by increasing values (because of weighted orderings)
    371371    ideal perm = idMaxIdeal(1);
    372372    intvec *iv = idSort(perm,TRUE);
    373373    idDelete(&perm);
    374     for(int i = pVariables; i > 0; i--) varpermutation[pVariables+1-i] = (*iv)[i-1];
     374    for(int i = (currRing->N); i > 0; i--) varpermutation[(currRing->N)+1-i] = (*iv)[i-1];
    375375    delete iv;
    376376
     
    394394fglmSdata::~fglmSdata()
    395395{
    396     omFreeSize( (ADDRESS)varpermutation, (pVariables+1)*sizeof(int) );
     396    omFreeSize( (ADDRESS)varpermutation, ((currRing->N)+1)*sizeof(int) );
    397397    for ( int k = basisSize; k > 0; k-- )
    398398        pLmDelete( basis + k );  //. rem: basis runs from basis[1]..basis[basisSize]
     
    474474    poly m = basis[basisSize];
    475475    poly newmonom = NULL;
    476     int k = pVariables;
     476    int k = (currRing->N);
    477477    BOOLEAN done = FALSE;
    478478    int state = 0;
     
    585585        poly temp = border[num].monom;
    586586        if ( pDivisibleBy( temp, m ) ) {
    587             var = pVariables;
     587            var = (currRing->N);
    588588            while ( var > 0 ) {
    589589                if ( (pGetExp( m, var ) - pGetExp( temp, var )) == 1 )
     
    692692    monom= m;
    693693    m= NULL;
    694     for ( int k = pVariables; k > 0; k-- )
     694    for ( int k = (currRing->N); k > 0; k-- )
    695695        if ( pGetExp( monom, k ) > 0 )
    696696            insertions++;
     
    797797    perm= (int *)omAlloc( (dimen+1)*sizeof( int ) );
    798798    basis= (polyset)omAlloc( (dimen+1)*sizeof( poly ) );
    799     varpermutation = (int*)omAlloc( (pVariables+1)*sizeof(int) );
     799    varpermutation = (int*)omAlloc( ((currRing->N)+1)*sizeof(int) );
    800800    // Sort ring variables by increasing values (because of weighted orderings)
    801801    ideal perm_id = idMaxIdeal(1);
    802802    intvec *iv = idSort(perm_id,TRUE);
    803803    idDelete(&perm_id);
    804     for(int i = pVariables; i > 0; i--) varpermutation[pVariables+1-i] = (*iv)[i-1];
     804    for(int i = (currRing->N); i > 0; i--) varpermutation[(currRing->N)+1-i] = (*iv)[i-1];
    805805    delete iv;
    806806
     
    831831        pLmDelete( basis[k]);
    832832    omFreeSize( (ADDRESS)basis, (dimen+1)*sizeof( poly ) );
    833     omFreeSize( (ADDRESS)varpermutation, (pVariables+1)*sizeof(int) );
     833    omFreeSize( (ADDRESS)varpermutation, ((currRing->N)+1)*sizeof(int) );
    834834}
    835835
     
    884884    ListIterator<fglmDelem> list = nlist;
    885885    poly newmonom = NULL;
    886     int k = pVariables;
     886    int k = (currRing->N);
    887887    BOOLEAN done = FALSE;
    888888    int state = 0;
     
    11091109    fglmVector v;
    11101110    fglmVector p;
    1111     ideal destIdeal = idInit( pVariables, 1 );
     1111    ideal destIdeal = idInit( (currRing->N), 1 );
    11121112
    11131113    int i;
    11141114    BOOLEAN isZero;
    1115     int *varpermutation = (int*)omAlloc( (pVariables+1)*sizeof(int) );
     1115    int *varpermutation = (int*)omAlloc( ((currRing->N)+1)*sizeof(int) );
    11161116    ideal perm = idMaxIdeal(1);
    11171117    intvec *iv = idSort(perm,TRUE);
    11181118    idDelete(&perm);
    1119     for(i = pVariables; i > 0; i--) varpermutation[pVariables+1-i] = (*iv)[i-1];
     1119    for(i = (currRing->N); i > 0; i--) varpermutation[(currRing->N)+1-i] = (*iv)[i-1];
    11201120    delete iv;
    11211121
    1122     for (i= 1; i <= pVariables; i++ )
     1122    for (i= 1; i <= (currRing->N); i++ )
    11231123    {
    11241124        // main loop
     
    11691169    }
    11701170    STICKYPROT( "\n" );
    1171     omFreeSize( (ADDRESS)varpermutation, (pVariables+1)*sizeof(int) );
     1171    omFreeSize( (ADDRESS)varpermutation, ((currRing->N)+1)*sizeof(int) );
    11721172    return destIdeal;
    11731173}
     
    11851185        currRingHdl=NULL;
    11861186    }
    1187     idealFunctionals L( 100, pVariables );
     1187    idealFunctionals L( 100, (currRing->N) );
    11881188    fglmok = CalculateFunctionals( sourceIdeal, L );
    11891189    if ( deleteIdeal == TRUE )
     
    12061206    fglmVector v;
    12071207
    1208     idealFunctionals L( 100, pVariables );
     1208    idealFunctionals L( 100, (currRing->N) );
    12091209    // STICKYPROT("calculating normal form\n");
    12101210    // poly p = kNF( sourceIdeal, currRing->qideal, quot );
     
    12231223    BOOLEAN fglmok;
    12241224
    1225     idealFunctionals L( 100, pVariables );
     1225    idealFunctionals L( 100, (currRing->N) );
    12261226    fglmok = CalculateFunctionals( source, L );
    12271227    if ( fglmok == TRUE ) {
  • kernel/gfan.cc

    r6ed8c4 r1f637e  
    254254        const int64vec *fIntP = f->getRef2InteriorPoint();
    255255        const int64vec *gIntP = g->getRef2InteriorPoint();
    256         for(int ii=0;ii<pVariables;ii++)
     256        for(int ii=0;ii<(currRing->N);ii++)
    257257        {
    258258                if( (*fIntP)[ii] != (*gIntP)[ii] )
     
    15591559                                n--;                   
    15601560                        }while(exchanged==TRUE && n>=0);
    1561                 }*///if pVariables>2
     1561                }*///if (currRing->N)>2
    15621562//              delete fNormal;         
    15631563                fAct = fAct->next;
     
    23852385{                       
    23862386        int res=0;     
    2387         for (int i=0;i<pVariables;i++)
     2387        for (int i=0;i<(currRing->N);i++)
    23882388        {
    23892389// #ifndef NDEBUG
     
    27832783{
    27842784        bool res=TRUE;
    2785         for(int ii=0;ii<pVariables;ii++)
     2785        for(int ii=0;ii<(currRing->N);ii++)
    27862786        {
    27872787                if(a[ii]!=b[ii])
     
    42394239  {
    42404240    int64vec *ivTmp=iv64Copy(gc->gcRays[ii]);
    4241     for(int jj=0;jj<pVariables;jj++)
     4241    for(int jj=0;jj<(currRing->N);jj++)
    42424242      (*res)[offset+jj]=(int)(*ivTmp)[jj];
    4243     offset += pVariables;
     4243    offset += (currRing->N);
    42444244    delete ivTmp;
    42454245  }
     
    43584358{
    43594359        lists lResList; //this is the object we return 
    4360         gfan::ZFan *zResFan = new gfan::ZFan(pVariables);
     4360        gfan::ZFan *zResFan = new gfan::ZFan((currRing->N));
    43614361       
    43624362        if(rHasGlobalOrdering(currRing))
    43634363        {       
    4364 //              int numvar = pVariables;
     4364//              int numvar = (currRing->N);
    43654365                gfanHeuristic = h;
    43664366               
     
    43824382                        gcone *gcAct;
    43834383                        gcAct = gcRoot;
    4384                         gcone::numVars=pVariables;
    4385                         //gcAct->numVars=pVariables;//NOTE is now static
     4384                        gcone::numVars=(currRing->N);
     4385                        //gcAct->numVars=(currRing->N);//NOTE is now static
    43864386                        gcAct->getGB(inputIdeal);
    43874387                        /*Check whether input is homogeneous
     
    43964396                        else
    43974397                        {
    4398                                 gcone::ivZeroVector = new int64vec(pVariables);
    4399                                 for(int ii=0;ii<pVariables;ii++)
     4398                                gcone::ivZeroVector = new int64vec((currRing->N));
     4399                                for(int ii=0;ii<(currRing->N);ii++)
    44004400                                        (*gcone::ivZeroVector)[ii]=0;
    44014401                        }
     
    44504450//                      for(int jj=0;jj<5;jj++)
    44514451//                      {
    4452 //                              int64vec *iv=new int64vec(pVariables);
     4452//                              int64vec *iv=new int64vec((currRing->N));
    44534453//                              fPtr->setFacetNormal(iv);                               
    44544454//                              delete(iv);
  • kernel/gr_kstd2.cc

    r6ed8c4 r1f637e  
    66*  ABSTRACT -  Kernel: noncomm. alg. of Buchberger
    77*/
    8 
    9 #include <kernel/mod2.h>
     8#define PLURAL_INTERNAL_DECLARATIONS
     9
     10#include "mod2.h"
    1011
    1112#ifdef HAVE_PLURAL
    1213
    13 #define PLURAL_INTERNAL_DECLARATIONS
    1414
    1515#include <omalloc/omalloc.h>
     16#include <misc/options.h>
     17#include <misc/intvec.h>
     18
     19#include <polys/weight.h>
    1620#include <polys/polys.h>
     21
     22#include <polys/nc/nc.h>
     23#include <polys/nc/sca.h>
     24
     25
     26#include <kernel/febase.h>
    1727#include <kernel/ideals.h>
    18 #include <kernel/febase.h>
    19 #include <misc/options.h>
    20 #include <kernel/kutil.h>
    2128#include <kernel/kstd1.h>
    2229#include <kernel/khstd.h>
    23 #include <kernel/kutil.h>
    2430//#include "spolys.h"
    2531//#include "cntrlc.h"
    26 #include <polys/weight.h>
    27 #include <misc/intvec.h>
    28 #include <polys/nc/nc.h>
    29 #include <polys/nc/sca.h>
    3032#include <kernel/ratgring.h>
     33
     34#include <kernel/kutil.h>
    3135
    3236#if 0
     
    10261030  //   else
    10271031    {
    1028       ecartWeights=(short *)omAlloc((pVariables+1)*sizeof(short));
     1032      ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
    10291033      /*uses automatic computation of the ecartWeights to set them*/
    10301034      kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights);
     
    10321036    pFDeg=totaldegreeWecart;
    10331037    pLDeg=maxdegreeWecart;
    1034     for(i=1; i<=pVariables; i++)
     1038    for(i=1; i<=(currRing->N); i++)
    10351039      Print(" %d",ecartWeights[i]);
    10361040    PrintLn();
     
    12831287    if (ecartWeights)
    12841288    {
    1285       omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(short));
     1289      omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
    12861290      ecartWeights=NULL;
    12871291    }
  • kernel/hdegree.cc

    r6ed8c4 r1f637e  
    7575  hexist = hInit(S, Q, &hNexist);
    7676  if (!hNexist)
    77     return pVariables;
     77    return (currRing->N);
    7878  hwork = (scfmon)omAlloc(hNexist * sizeof(scmon));
    79   hvar = (varset)omAlloc((pVariables + 1) * sizeof(int));
    80   hpure = (scmon)omAlloc((1 + (pVariables * pVariables)) * sizeof(int));
     79  hvar = (varset)omAlloc(((currRing->N) + 1) * sizeof(int));
     80  hpure = (scmon)omAlloc((1 + ((currRing->N) * (currRing->N))) * sizeof(int));
    8181  mc = hisModule;
    8282  if (!mc)
     
    8787  else
    8888    hrad = (scfmon)omAlloc(hNexist * sizeof(scmon));
    89   radmem = hCreate(pVariables - 1);
    90   hCo = pVariables + 1;
     89  radmem = hCreate((currRing->N) - 1);
     90  hCo = (currRing->N) + 1;
    9191  loop
    9292  {
     
    9595    if (hNrad)
    9696    {
    97       hNvar = pVariables;
     97      hNvar = (currRing->N);
    9898      hRadical(hrad, &hNrad, hNvar);
    9999      hSupp(hrad, hNrad, hvar, &hNvar);
    100100      if (hNvar)
    101101      {
    102         memset(hpure, 0, (pVariables + 1) * sizeof(int));
     102        memset(hpure, 0, ((currRing->N) + 1) * sizeof(int));
    103103        hPure(hrad, 0, &hNrad, hvar, hNvar, hpure, &hNpure);
    104104        hLexR(hrad, hNrad, hvar, hNvar);
     
    115115      break;
    116116  }
    117   hKill(radmem, pVariables - 1);
    118   omFreeSize((ADDRESS)hpure, (1 + (pVariables * pVariables)) * sizeof(int));
    119   omFreeSize((ADDRESS)hvar, (pVariables + 1) * sizeof(int));
     117  hKill(radmem, (currRing->N) - 1);
     118  omFreeSize((ADDRESS)hpure, (1 + ((currRing->N) * (currRing->N))) * sizeof(int));
     119  omFreeSize((ADDRESS)hvar, ((currRing->N) + 1) * sizeof(int));
    120120  omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon));
    121121  hDelete(hexist, hNexist);
    122122  if (hisModule)
    123123    omFreeSize((ADDRESS)hrad, hNexist * sizeof(scmon));
    124   return pVariables - hCo;
     124  return (currRing->N) - hCo;
    125125}
    126126
     
    140140    {
    141141      hCo = dn;
    142       for (iv=pVariables; iv; iv--)
     142      for (iv=(currRing->N); iv; iv--)
    143143      {
    144144        if (pure[iv])
     
    196196  {
    197197    hCo = Npure + 1;
    198     for (x=pVariables; x; x--)
     198    for (x=(currRing->N); x; x--)
    199199    {
    200200      if (pure[x])
     
    209209intvec * scIndIntvec(ideal S, ideal Q)
    210210{
    211   intvec *Set=new intvec(pVariables);
     211  intvec *Set=new intvec((currRing->N));
    212212  int  mc,i;
    213213  hexist = hInit(S, Q, &hNexist);
    214214  if (hNexist==0)
    215215  {
    216     for(i=0; i<pVariables; i++)
     216    for(i=0; i<(currRing->N); i++)
    217217      (*Set)[i]=1;
    218218    return Set;
    219219  }
    220220  hwork = (scfmon)omAlloc(hNexist * sizeof(scmon));
    221   hvar = (varset)omAlloc((pVariables + 1) * sizeof(int));
    222   hpure = (scmon)omAlloc((1 + (pVariables * pVariables)) * sizeof(int));
    223   hInd = (scmon)omAlloc((1 + pVariables) * sizeof(int));
     221  hvar = (varset)omAlloc(((currRing->N) + 1) * sizeof(int));
     222  hpure = (scmon)omAlloc((1 + ((currRing->N) * (currRing->N))) * sizeof(int));
     223  hInd = (scmon)omAlloc((1 + (currRing->N)) * sizeof(int));
    224224  mc = hisModule;
    225225  if (mc==0)
     
    230230  else
    231231    hrad = (scfmon)omAlloc(hNexist * sizeof(scmon));
    232   radmem = hCreate(pVariables - 1);
    233   hCo = pVariables + 1;
     232  radmem = hCreate((currRing->N) - 1);
     233  hCo = (currRing->N) + 1;
    234234  loop
    235235  {
     
    238238    if (hNrad!=0)
    239239    {
    240       hNvar = pVariables;
     240      hNvar = (currRing->N);
    241241      hRadical(hrad, &hNrad, hNvar);
    242242      hSupp(hrad, hNrad, hvar, &hNvar);
    243243      if (hNvar!=0)
    244244      {
    245         memset(hpure, 0, (pVariables + 1) * sizeof(int));
     245        memset(hpure, 0, ((currRing->N) + 1) * sizeof(int));
    246246        hPure(hrad, 0, &hNrad, hvar, hNvar, hpure, &hNpure);
    247247        hLexR(hrad, hNrad, hvar, hNvar);
     
    258258      break;
    259259  }
    260   for(i=0; i<pVariables; i++)
     260  for(i=0; i<(currRing->N); i++)
    261261    (*Set)[i] = hInd[i+1];
    262   hKill(radmem, pVariables - 1);
    263   omFreeSize((ADDRESS)hpure, (1 + (pVariables * pVariables)) * sizeof(int));
    264   omFreeSize((ADDRESS)hInd, (1 + pVariables) * sizeof(int));
    265   omFreeSize((ADDRESS)hvar, (pVariables + 1) * sizeof(int));
     262  hKill(radmem, (currRing->N) - 1);
     263  omFreeSize((ADDRESS)hpure, (1 + ((currRing->N) * (currRing->N))) * sizeof(int));
     264  omFreeSize((ADDRESS)hInd, (1 + (currRing->N)) * sizeof(int));
     265  omFreeSize((ADDRESS)hvar, ((currRing->N) + 1) * sizeof(int));
    266266  omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon));
    267267  hDelete(hexist, hNexist);
     
    293293  intvec *Set;
    294294
    295   Set = ISet->set = new intvec(pVariables);
    296   for (iv=pVariables; iv!=0 ; iv--)
     295  Set = ISet->set = new intvec((currRing->N));
     296  for (iv=(currRing->N); iv!=0 ; iv--)
    297297  {
    298298    if (pure[iv])
     
    393393  {
    394394    Set = sm->set;
    395     iv=pVariables;
     395    iv=(currRing->N);
    396396    loop
    397397    {
     
    420420  {
    421421    Set = sm->set;
    422     iv=pVariables;
     422    iv=(currRing->N);
    423423    loop
    424424    {
     
    453453  {
    454454    hMu2++;
    455     sm->set = new intvec(pVariables);
     455    sm->set = new intvec((currRing->N));
    456456    sm->nx = (indset)omAlloc0Bin(indlist_bin);
    457457    return sm;
     
    477477        return;
    478478      Set = res->set;
    479       for (iv=pVariables; iv; iv--)
     479      for (iv=(currRing->N); iv; iv--)
    480480      {
    481481        if (pure[iv])
     
    595595  int  i, i0, k;
    596596  i0 = 0;
    597   for (i = 1; i <= pVariables; i++)
     597  for (i = 1; i <= (currRing->N); i++)
    598598  {
    599599    if (pure[i])
     
    608608  if ((i0 > 2) && (i > 10))
    609609    hOrdSupp(hwork, i, sel, i0);
    610   memset(hpur0, 0, (pVariables + 1) * sizeof(int));
     610  memset(hpur0, 0, ((currRing->N) + 1) * sizeof(int));
    611611  hPure(hwork, 0, &i, sel, i0, hpur0, &k);
    612612  hLexS(hwork, i, sel, i0);
     
    703703  //hWeight();
    704704  hwork = (scfmon)omAlloc(hNexist * sizeof(scmon));
    705   hvar = (varset)omAlloc((pVariables + 1) * sizeof(int));
    706   hsel = (varset)omAlloc((pVariables + 1) * sizeof(int));
    707   hpure = (scmon)omAlloc((1 + (pVariables * pVariables)) * sizeof(int));
    708   hpur0 = (scmon)omAlloc((1 + (pVariables * pVariables)) * sizeof(int));
     705  hvar = (varset)omAlloc(((currRing->N) + 1) * sizeof(int));
     706  hsel = (varset)omAlloc(((currRing->N) + 1) * sizeof(int));
     707  hpure = (scmon)omAlloc((1 + ((currRing->N) * (currRing->N))) * sizeof(int));
     708  hpur0 = (scmon)omAlloc((1 + ((currRing->N) * (currRing->N))) * sizeof(int));
    709709  mc = hisModule;
    710710  hrad = (scfmon)omAlloc(hNexist * sizeof(scmon));
     
    717717  else
    718718    hstc = (scfmon)omAlloc(hNexist * sizeof(scmon));
    719   radmem = hCreate(pVariables - 1);
    720   stcmem = hCreate(pVariables - 1);
    721   hCo = pVariables + 1;
     719  radmem = hCreate((currRing->N) - 1);
     720  stcmem = hCreate((currRing->N) - 1);
     721  hCo = (currRing->N) + 1;
    722722  di = hCo + 1;
    723723  loop
     
    731731    if (hNrad)
    732732    {
    733       hNvar = pVariables;
     733      hNvar = (currRing->N);
    734734      hRadical(hrad, &hNrad, hNvar);
    735735      hSupp(hrad, hNrad, hvar, &hNvar);
     
    737737      {
    738738        hCo = hNvar;
    739         memset(hpure, 0, (pVariables + 1) * sizeof(int));
     739        memset(hpure, 0, ((currRing->N) + 1) * sizeof(int));
    740740        hPure(hrad, 0, &hNrad, hvar, hNvar, hpure, &hNpure);
    741741        hLexR(hrad, hNrad, hvar, hNvar);
     
    755755    if (hNvar && (hCo == di))
    756756    {
    757       if (di && (di < pVariables))
     757      if (di && (di < (currRing->N)))
    758758        hDimMult(hpure, hNpure, hrad, hNrad, hvar, hNvar);
    759759      else if (!di)
     
    764764        if ((hNvar > 2) && (hNstc > 10))
    765765          hOrdSupp(hstc, hNstc, hvar, hNvar);
    766         memset(hpur0, 0, (pVariables + 1) * sizeof(int));
     766        memset(hpur0, 0, ((currRing->N) + 1) * sizeof(int));
    767767        hPure(hstc, 0, &hNstc, hvar, hNvar, hpur0, &hNpure);
    768768        hLexS(hstc, hNstc, hvar, hNvar);
     
    775775  }
    776776  hCo = di;
    777   hKill(stcmem, pVariables - 1);
    778   hKill(radmem, pVariables - 1);
    779   omFreeSize((ADDRESS)hpur0, (1 + (pVariables * pVariables)) * sizeof(int));
    780   omFreeSize((ADDRESS)hpure, (1 + (pVariables * pVariables)) * sizeof(int));
    781   omFreeSize((ADDRESS)hsel, (pVariables + 1) * sizeof(int));
    782   omFreeSize((ADDRESS)hvar, (pVariables + 1) * sizeof(int));
     777  hKill(stcmem, (currRing->N) - 1);
     778  hKill(radmem, (currRing->N) - 1);
     779  omFreeSize((ADDRESS)hpur0, (1 + ((currRing->N) * (currRing->N))) * sizeof(int));
     780  omFreeSize((ADDRESS)hpure, (1 + ((currRing->N) * (currRing->N))) * sizeof(int));
     781  omFreeSize((ADDRESS)hsel, ((currRing->N) + 1) * sizeof(int));
     782  omFreeSize((ADDRESS)hvar, ((currRing->N) + 1) * sizeof(int));
    783783  omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon));
    784784  omFreeSize((ADDRESS)hrad, hNexist * sizeof(scmon));
     
    796796void scPrintDegree(int co, int mu)
    797797{
    798   int di = pVariables-co;
     798  int di = (currRing->N)-co;
    799799  if (pOrdSgn == 1)
    800800  {
     
    820820  hDegreeSeries(hseries1, hseries2, &co, &mu);
    821821  if ((l == 1) &&(mu == 0))
    822     scPrintDegree(pVariables+1, 0);
     822    scPrintDegree((currRing->N)+1, 0);
    823823  else
    824824    scPrintDegree(co, mu);
     
    840840    hMu = 0;
    841841  hwork = (scfmon)omAlloc(hNexist * sizeof(scmon));
    842   hvar = (varset)omAlloc((pVariables + 1) * sizeof(int));
    843   hpur0 = (scmon)omAlloc((1 + (pVariables * pVariables)) * sizeof(int));
     842  hvar = (varset)omAlloc(((currRing->N) + 1) * sizeof(int));
     843  hpur0 = (scmon)omAlloc((1 + ((currRing->N) * (currRing->N))) * sizeof(int));
    844844  mc = hisModule;
    845845  if (!mc)
     
    850850  else
    851851    hstc = (scfmon)omAlloc(hNexist * sizeof(scmon));
    852   stcmem = hCreate(pVariables - 1);
     852  stcmem = hCreate((currRing->N) - 1);
    853853  loop
    854854  {
     
    862862      }
    863863    }
    864     hNvar = pVariables;
     864    hNvar = (currRing->N);
    865865    for (int i = hNvar; i; i--)
    866866      hvar[i] = i;
    867867    hStaircase(hstc, &hNstc, hvar, hNvar);
    868868    hSupp(hstc, hNstc, hvar, &hNvar);
    869     if ((hNvar == pVariables) && (hNstc >= pVariables))
     869    if ((hNvar == (currRing->N)) && (hNstc >= (currRing->N)))
    870870    {
    871871      if ((hNvar > 2) && (hNstc > 10))
    872872        hOrdSupp(hstc, hNstc, hvar, hNvar);
    873       memset(hpur0, 0, (pVariables + 1) * sizeof(int));
     873      memset(hpur0, 0, ((currRing->N) + 1) * sizeof(int));
    874874      hPure(hstc, 0, &hNstc, hvar, hNvar, hpur0, &hNpure);
    875875      if (hNpure == hNvar)
     
    887887      break;
    888888  }
    889   hKill(stcmem, pVariables - 1);
    890   omFreeSize((ADDRESS)hpur0, (1 + (pVariables * pVariables)) * sizeof(int));
    891   omFreeSize((ADDRESS)hvar, (pVariables + 1) * sizeof(int));
     889  hKill(stcmem, (currRing->N) - 1);
     890  omFreeSize((ADDRESS)hpur0, (1 + ((currRing->N) * (currRing->N))) * sizeof(int));
     891  omFreeSize((ADDRESS)hvar, ((currRing->N) + 1) * sizeof(int));
    892892  omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon));
    893893  hDelete(hexist, hNexist);
     
    983983  int  i;
    984984  int  k = ak;
    985   hNvar = pVariables;
     985  hNvar = (currRing->N);
    986986  hexist = hInit(S, Q, &hNexist, tailRing);
    987987  if (k!=0)
     
    13111311    }
    13121312  }
    1313   stcmem = hCreate(pVariables - 1);
     1313  stcmem = hCreate((currRing->N) - 1);
    13141314  hexist = hInit(s, Q, &hNexist);
    13151315  p = last = pInit();
    13161316  /*pNext(p) = NULL;*/
    1317   act = (scmon)omAlloc((pVariables + 1) * sizeof(int));
     1317  act = (scmon)omAlloc(((currRing->N) + 1) * sizeof(int));
    13181318  *act = 0;
    13191319  if (!hNexist)
    13201320  {
    1321     scAll(pVariables, deg);
     1321    scAll((currRing->N), deg);
    13221322    goto ende;
    13231323  }
    13241324  if (!hisModule)
    13251325  {
    1326     if (deg < 0) scInKbase(hexist, hNexist, pVariables);
    1327     else scDegKbase(hexist, hNexist, pVariables, deg);
     1326    if (deg < 0) scInKbase(hexist, hNexist, (currRing->N));
     1327    else scDegKbase(hexist, hNexist, (currRing->N), deg);
    13281328  }
    13291329  else
     
    13401340        if (hNstc)
    13411341        {
    1342           if (deg < 0) scInKbase(hstc, hNstc, pVariables);
    1343           else scDegKbase(hstc, hNstc, pVariables, deg_ei);
     1342          if (deg < 0) scInKbase(hstc, hNstc, (currRing->N));
     1343          else scDegKbase(hstc, hNstc, (currRing->N), deg_ei);
    13441344        }
    13451345        else
    1346           scAll(pVariables, deg_ei);
     1346          scAll((currRing->N), deg_ei);
    13471347      }
    13481348    }
     
    13511351ende:
    13521352  hDelete(hexist, hNexist);
    1353   omFreeSize((ADDRESS)act, (pVariables + 1) * sizeof(int));
    1354   hKill(stcmem, pVariables - 1);
     1353  omFreeSize((ADDRESS)act, ((currRing->N) + 1) * sizeof(int));
     1354  hKill(stcmem, (currRing->N) - 1);
    13551355  pLmDelete(&p);
    13561356  if (p == NULL)
     
    13801380  }
    13811381  di = scDimInt(s, Q);
    1382   stcmem = hCreate(pVariables - 1);
     1382  stcmem = hCreate((currRing->N) - 1);
    13831383  hexist = hInit(s, Q, &hNexist);
    13841384  p = last = pInit();
    13851385  /*pNext(p) = NULL;*/
    1386   act = (scmon)omAlloc((pVariables + 1) * sizeof(int));
     1386  act = (scmon)omAlloc(((currRing->N) + 1) * sizeof(int));
    13871387  *act = 0;
    13881388  if (!hNexist)
    13891389  {
    1390     scAll(pVariables, -1);
     1390    scAll((currRing->N), -1);
    13911391    goto ende;
    13921392  }
    13931393  if (!hisModule)
    13941394  {
    1395     scInKbase(hexist, hNexist, pVariables);
     1395    scInKbase(hexist, hNexist, (currRing->N));
    13961396  }
    13971397  else
     
    14041404      if (hNstc)
    14051405      {
    1406         scInKbase(hstc, hNstc, pVariables);
     1406        scInKbase(hstc, hNstc, (currRing->N));
    14071407      }
    14081408      else
    1409         scAll(pVariables, -1);
     1409        scAll((currRing->N), -1);
    14101410    }
    14111411    omFreeSize((ADDRESS)hstc, hNexist * sizeof(scmon));
     
    14131413ende:
    14141414  hDelete(hexist, hNexist);
    1415   omFreeSize((ADDRESS)act, (pVariables + 1) * sizeof(int));
    1416   hKill(stcmem, pVariables - 1);
     1415  omFreeSize((ADDRESS)act, ((currRing->N) + 1) * sizeof(int));
     1416  hKill(stcmem, (currRing->N) - 1);
    14171417  pDeleteLm(&p);
    14181418  idDelete(&s);
     
    14371437    nDelete(&pGetCoeff(hEdge));
    14381438    pGetCoeff(hEdge)=NULL;
    1439     for(i=pVariables;i>0;i--)
     1439    for(i=(currRing->N);i>0;i--)
    14401440      pIncrExp(hEdge,i);
    14411441    pSetm(hEdge);
  • kernel/hilb.cc

    r6ed8c4 r1f637e  
    199199  int x;
    200200
    201   for (i=pVariables; i; i--)
     201  for (i=(currRing->N); i; i--)
    202202  {
    203203    x = (*wdegree)[i-1];
     
    239239  p0 = 1;
    240240  hwork = (scfmon)omAlloc(hNexist * sizeof(scmon));
    241   hvar = (varset)omAlloc((pVariables + 1) * sizeof(int));
    242   hpure = (scmon)omAlloc((1 + (pVariables * pVariables)) * sizeof(int));
    243   stcmem = hCreate(pVariables - 1);
    244   Qpol = (int **)omAlloc((pVariables + 1) * sizeof(int *));
    245   Ql = (int *)omAlloc0((pVariables + 1) * sizeof(int));
    246   Q0 = (int *)omAlloc((pVariables + 1) * sizeof(int));
     241  hvar = (varset)omAlloc(((currRing->N) + 1) * sizeof(int));
     242  hpure = (scmon)omAlloc((1 + ((currRing->N) * (currRing->N))) * sizeof(int));
     243  stcmem = hCreate((currRing->N) - 1);
     244  Qpol = (int **)omAlloc(((currRing->N) + 1) * sizeof(int *));
     245  Ql = (int *)omAlloc0(((currRing->N) + 1) * sizeof(int));
     246  Q0 = (int *)omAlloc(((currRing->N) + 1) * sizeof(int));
    247247  *Qpol = NULL;
    248248  hLength = k = j = 0;
     
    269269    if (hNstc!=0)
    270270    {
    271       hNvar = pVariables;
     271      hNvar = (currRing->N);
    272272      for (i = hNvar; i>=0; i--)
    273273        hvar[i] = i;
     
    280280          hOrdSupp(hstc, hNstc, hvar, hNvar);
    281281        hHilbEst(hstc, hNstc, hvar, hNvar);
    282         memset(hpure, 0, (pVariables + 1) * sizeof(int));
     282        memset(hpure, 0, ((currRing->N) + 1) * sizeof(int));
    283283        hPure(hstc, 0, &hNstc, hvar, hNvar, hpure, &hNpure);
    284284        hLexS(hstc, hNstc, hvar, hNvar);
     
    347347    (*hseries1)[l-1] = mw;
    348348  }
    349   for (i = 0; i <= pVariables; i++)
     349  for (i = 0; i <= (currRing->N); i++)
    350350  {
    351351    if (Ql[i]!=0)
    352352      omFreeSize((ADDRESS)Qpol[i], Ql[i] * sizeof(int));
    353353  }
    354   omFreeSize((ADDRESS)Q0, (pVariables + 1) * sizeof(int));
    355   omFreeSize((ADDRESS)Ql, (pVariables + 1) * sizeof(int));
    356   omFreeSize((ADDRESS)Qpol, (pVariables + 1) * sizeof(int *));
    357   hKill(stcmem, pVariables - 1);
    358   omFreeSize((ADDRESS)hpure, (1 + (pVariables * pVariables)) * sizeof(int));
    359   omFreeSize((ADDRESS)hvar, (pVariables + 1) * sizeof(int));
     354  omFreeSize((ADDRESS)Q0, ((currRing->N) + 1) * sizeof(int));
     355  omFreeSize((ADDRESS)Ql, ((currRing->N) + 1) * sizeof(int));
     356  omFreeSize((ADDRESS)Qpol, ((currRing->N) + 1) * sizeof(int *));
     357  hKill(stcmem, (currRing->N) - 1);
     358  omFreeSize((ADDRESS)hpure, (1 + ((currRing->N) * (currRing->N))) * sizeof(int));
     359  omFreeSize((ADDRESS)hvar, ((currRing->N) + 1) * sizeof(int));
    360360  omFreeSize((ADDRESS)hwork, hNexist * sizeof(scmon));
    361361  hDelete(hexist, hNexist);
     
    462462  hPrintHilb(hseries2);
    463463  if ((l == 1) &&(mu == 0))
    464     scPrintDegree(pVariables+1, 0);
     464    scPrintDegree((currRing->N)+1, 0);
    465465  else
    466466    scPrintDegree(co, mu);
  • kernel/hutil.cc

    r6ed8c4 r1f637e  
    8989    if (*si!=NULL)
    9090    {
    91       *ek = (scmon) omAlloc((pVariables+1)*sizeof(int));
     91      *ek = (scmon) omAlloc(((currRing->N)+1)*sizeof(int));
    9292      pGetExpV(*si, *ek);
    9393      ek++;
     
    9999    if (*qi!=NULL)
    100100    {
    101       *ek = (scmon) omAlloc((pVariables+1)*sizeof(int));
     101      *ek = (scmon) omAlloc(((currRing->N)+1)*sizeof(int));
    102102      pGetExpV(*qi, *ek);
    103103      ek++;
     
    115115  int x;
    116116
    117   i = pVariables;
     117  i = (currRing->N);
    118118  loop
    119119  {
     
    122122    if (i == 0) return;
    123123  }
    124   for (i=pVariables; i>0; i--)
     124  for (i=(currRing->N); i>0; i--)
    125125  {
    126126    x = pWeight(i);
     
    143143  {
    144144    for (i=ev_length-1;i>=0;i--)
    145       omFreeSize(hsecure[i],(pVariables+1)*sizeof(int));
     145      omFreeSize(hsecure[i],((currRing->N)+1)*sizeof(int));
    146146    omFreeSize(hsecure, ev_length*sizeof(scmon));
    147147    omFreeSize(ev,  ev_length*sizeof(scmon));
     
    10391039*  scmon p1, pn;
    10401040*  p1 = p + 1;
    1041 *  pn = p1 + pVariables;
    1042 *  memcpy(pn, p1, pVariables * sizeof(int));
     1041*  pn = p1 + (currRing->N);
     1042*  memcpy(pn, p1, (currRing->N) * sizeof(int));
    10431043*  return pn - 1;
    10441044*}
     
    10501050  p1++;
    10511051  pn = p1;
    1052   pn += pVariables;
    1053   memcpy(pn, p1, pVariables * sizeof(int));
     1052  pn += (currRing->N);
     1053  memcpy(pn, p1, (currRing->N) * sizeof(int));
    10541054  return pn - 1;
    10551055}
  • kernel/ideals.cc

    r6ed8c4 r1f637e  
    3232#include <polys/prCopy.h>
    3333#include <polys/nc/nc.h>
     34
    3435
    3536#include <kernel/ideals.h>
     
    149150    l = 1;
    150151    lex = pGetExp(p,l);
    151     while ((l < pVariables) && (lex == 0))
     152    while ((l < (currRing->N)) && (lex == 0))
    152153    {
    153154      l++;
     
    193194      pIter(qresult);
    194195    }
    195     for (j=pVariables-1; j>0; j--)
     196    for (j=(currRing->N)-1; j>0; j--)
    196197    {
    197198      lex = pGetExp(qp,j);
     
    16151616  {
    16161617    block0[1] = 1;
    1617     block1[1] = pVariables;
     1618    block1[1] = (currRing->N);
    16181619    if (origR->OrdSgn==1) ord[1] = ringorder_wp;
    16191620    else                  ord[1] = ringorder_ws;
    1620     wv[1]=(int*)omAlloc0(pVariables*sizeof(int));
    1621     double wNsqr = (double)2.0 / (double)pVariables;
     1621    wv[1]=(int*)omAlloc0((currRing->N)*sizeof(int));
     1622    double wNsqr = (double)2.0 / (double)(currRing->N);
    16221623    wFunctional = wFunctionalBuch;
    1623     int  *x= (int * )omAlloc(2 * (pVariables + 1) * sizeof(int));
     1624    int  *x= (int * )omAlloc(2 * ((currRing->N) + 1) * sizeof(int));
    16241625    int sl=IDELEMS(h1) - 1;
    16251626    wCall(h1->m, sl, x, wNsqr);
    1626     for (sl = pVariables; sl!=0; sl--)
    1627       wv[1][sl-1] = x[sl + pVariables + 1];
    1628     omFreeSize((ADDRESS)x, 2 * (pVariables + 1) * sizeof(int));
     1627    for (sl = (currRing->N); sl!=0; sl--)
     1628      wv[1][sl-1] = x[sl + (currRing->N) + 1];
     1629    omFreeSize((ADDRESS)x, 2 * ((currRing->N) + 1) * sizeof(int));
    16291630
    16301631    ord[2]=ringorder_C;
     
    17351736#endif
    17361737  // change into the new ring
    1737   //pChangeRing(pVariables,currRing->OrdSgn,ord,block0,block1,wv);
     1738  //pChangeRing((currRing->N),currRing->OrdSgn,ord,block0,block1,wv);
    17381739  rChangeCurrRing(tmpR);
    17391740
     
    17741775  for (k=0; k<=i; k++)
    17751776  {
    1776     l=pVariables;
     1777    l=(currRing->N);
    17771778    while ((l>0) && (p_GetExp( hh->m[k],l,tmpR)*pGetExp(delVar,l)==0)) l--;
    17781779    if (l==0)
     
    23742375  while ((j>0) && (kbase->m[j-1]==NULL)) j--;
    23752376  if (j==0) return -1;
    2376   int i=pVariables;
     2377  int i=(currRing->N);
    23772378  while (i>0)
    23782379  {
     
    24092410  poly coeff=pOne(), base=pOne();
    24102411
    2411   for (i=1;i<=pVariables;i++)
     2412  for (i=1;i<=(currRing->N);i++)
    24122413  {
    24132414    if (pGetExp(how,i)>0)
  • kernel/kpolys.cc

    r6ed8c4 r1f637e  
    1414  if (lcm==NULL) return FALSE;
    1515
    16   for (j=pVariables; j; j--)
     16  for (j=(currRing->N); j; j--)
    1717    if ( pGetExp(p,j) >  pGetExp(lcm,j)) return FALSE;
    1818  if ( pGetComp(p) !=  pGetComp(lcm)) return FALSE;
    19   for (j=pVariables; j; j--)
     19  for (j=(currRing->N); j; j--)
    2020  {
    2121    if (pGetExp(p1,j)!=pGetExp(lcm,j))
     
    2323      if (pGetExp(p,j)!=pGetExp(lcm,j))
    2424      {
    25         for (k=pVariables; k>j; k--)
     25        for (k=(currRing->N); k>j; k--)
    2626        {
    2727          if ((pGetExp(p,k)!=pGetExp(lcm,k))
     
    4242      if (pGetExp(p,j)!=pGetExp(lcm,j))
    4343      {
    44         for (k=pVariables; k>j; k--)
     44        for (k=(currRing->N); k>j; k--)
    4545        {
    4646          if ((pGetExp(p,k)!=pGetExp(lcm,k))
     
    7676      if (pGetExp(p,j)!=pGetExp(lcm,j))
    7777      {
    78         for (k=pVariables; k>j; k--)
     78        for (k=(currRing->N); k>j; k--)
    7979        for (k=currRing->real_var_end; k>j; k--)
    8080        {
  • kernel/kspoly.cc

    r6ed8c4 r1f637e  
    395395      m2=p_Init(currRing);
    396396x2:
    397       for (i = pVariables; i; i--)
     397      for (i = (currRing->N); i; i--)
    398398      {
    399399        c = p_GetExpDiff(p1, p2,i, currRing);
     
    447447    m1=p_Init(currRing);
    448448x1:
    449     for (i = pVariables; i; i--)
     449    for (i = (currRing->N); i; i--)
    450450    {
    451451      c = p_GetExpDiff(p2, p1,i,currRing);
     
    485485  loop
    486486  {
    487     for (i = pVariables; i; i--)
     487    for (i = (currRing->N); i; i--)
    488488    {
    489489      c = p_GetExpDiff(p1, p2,i,currRing);
  • kernel/kstd1.cc

    r6ed8c4 r1f637e  
    642642
    643643/*2
    644 *looks whether exactly pVariables-1 axis are used
     644*looks whether exactly (currRing->N)-1 axis are used
    645645*returns last != 0 in this case
    646646*last is the (first) unused axis
     
    657657    {
    658658      i++;
    659       if (i > pVariables) break;
     659      if (i > (currRing->N)) break;
    660660      if (strat->NotUsedAxis[i])
    661661      {
     
    942942      if (ecartWeights)
    943943      {
    944         omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(short));
     944        omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
    945945        ecartWeights=NULL;
    946946      }
     
    10881088    //else
    10891089    {
    1090       ecartWeights=(short *)omAlloc((pVariables+1)*sizeof(short));
     1090      ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
    10911091      /*uses automatic computation of the ecartWeights to set them*/
    10921092      kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights);
     
    10951095    if (TEST_OPT_PROT)
    10961096    {
    1097       for(i=1; i<=pVariables; i++)
     1097      for(i=1; i<=(currRing->N); i++)
    10981098        Print(" %d",ecartWeights[i]);
    10991099      PrintLn();
     
    11081108  idhdl h;
    11091109
    1110   strat->NotUsedAxis = (BOOLEAN *)omAlloc((pVariables+1)*sizeof(BOOLEAN));
    1111   for (j=pVariables; j>0; j--) strat->NotUsedAxis[j] = TRUE;
     1110  strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN));
     1111  for (j=(currRing->N); j>0; j--) strat->NotUsedAxis[j] = TRUE;
    11121112  strat->enterS = enterSMora;
    11131113  strat->initEcartPair = initEcartPairMora; /*- ecart approximation -*/
     
    11461146    //else
    11471147    {
    1148       ecartWeights=(short *)omAlloc((pVariables+1)*sizeof(short));
     1148      ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
    11491149      /*uses automatic computation of the ecartWeights to set them*/
    11501150      kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights);
     
    11541154    if (TEST_OPT_PROT)
    11551155    {
    1156       for(i=1; i<=pVariables; i++)
     1156      for(i=1; i<=(currRing->N); i++)
    11571157        Print(" %d",ecartWeights[i]);
    11581158      PrintLn();
     
    14001400  strat->lastAxis = 0; //???
    14011401  pDelete(&strat->kNoether);
    1402   omFreeSize((ADDRESS)strat->NotUsedAxis,(pVariables+1)*sizeof(BOOLEAN));
     1402  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
    14031403  if (TEST_OPT_PROT) messageStat(srmax,lrmax,hilbcount,strat);
    14041404  if (TEST_OPT_WEIGHTM)
     
    14071407    if (ecartWeights)
    14081408    {
    1409       omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(short));
     1409      omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
    14101410      ecartWeights=NULL;
    14111411    }
     
    15171517  omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
    15181518  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
    1519   omFreeSize((ADDRESS)strat->NotUsedAxis,(pVariables+1)*sizeof(BOOLEAN));
     1519  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
    15201520  omfree(strat->sevT);
    15211521  omfree(strat->S_2_R);
     
    15351535    if (ecartWeights)
    15361536    {
    1537       omFreeSize((ADDRESS *)&ecartWeights,(pVariables+1)*sizeof(short));
     1537      omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
    15381538      ecartWeights=NULL;
    15391539    }
     
    16561656  omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
    16571657  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
    1658   omFreeSize((ADDRESS)strat->NotUsedAxis,(pVariables+1)*sizeof(BOOLEAN));
     1658  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
    16591659  omfree(strat->sevT);
    16601660  omfree(strat->S_2_R);
     
    16741674    if (ecartWeights)
    16751675    {
    1676       omFreeSize((ADDRESS *)&ecartWeights,(pVariables+1)*sizeof(short));
     1676      omFreeSize((ADDRESS *)&ecartWeights,((currRing->N)+1)*sizeof(short));
    16771677      ecartWeights=NULL;
    16781678    }
     
    22052205  strat->ak = idRankFreeModule(tempF);
    22062206  initBuchMoraCrit(strat);
    2207   strat->NotUsedAxis = (BOOLEAN *)omAlloc((pVariables+1)*sizeof(BOOLEAN));
    2208   for (j=pVariables; j>0; j--) strat->NotUsedAxis[j] = TRUE;
     2207  strat->NotUsedAxis = (BOOLEAN *)omAlloc(((currRing->N)+1)*sizeof(BOOLEAN));
     2208  for (j=(currRing->N); j>0; j--) strat->NotUsedAxis[j] = TRUE;
    22092209  strat->enterS      = enterSBba;
    22102210  strat->posInT      = posInT17;
     
    22282228  omFreeSize((ADDRESS)strat->ecartS,IDELEMS(strat->Shdl)*sizeof(int));
    22292229  omFreeSize((ADDRESS)strat->sevS,IDELEMS(strat->Shdl)*sizeof(unsigned long));
    2230   omFreeSize((ADDRESS)strat->NotUsedAxis,(pVariables+1)*sizeof(BOOLEAN));
     2230  omFreeSize((ADDRESS)strat->NotUsedAxis,((currRing->N)+1)*sizeof(BOOLEAN));
    22312231  omfree(strat->sevT);
    22322232  omfree(strat->S_2_R);
     
    25072507    if (ecartWeights)
    25082508    {
    2509       omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(short));
     2509      omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
    25102510      ecartWeights=NULL;
    25112511    }
  • kernel/kstd2.cc

    r6ed8c4 r1f637e  
    12841284    if (ecartWeights)
    12851285    {
    1286       omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(short));
     1286      omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
    12871287      ecartWeights=NULL;
    12881288    }
     
    17961796    if (ecartWeights)
    17971797    {
    1798       omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(short));
     1798      omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
    17991799      ecartWeights=NULL;
    18001800    }
     
    19991999    //else
    20002000    {
    2001       ecartWeights=(short *)omAlloc((pVariables+1)*sizeof(short));
     2001      ecartWeights=(short *)omAlloc(((currRing->N)+1)*sizeof(short));
    20022002      /*uses automatic computation of the ecartWeights to set them*/
    20032003      kEcartWeights(F->m,IDELEMS(F)-1,ecartWeights);
     
    20062006    if (TEST_OPT_PROT)
    20072007    {
    2008       for(i=1; i<=pVariables; i++)
     2008      for(i=1; i<=(currRing->N); i++)
    20092009        Print(" %d",ecartWeights[i]);
    20102010      PrintLn();
  • kernel/kstdfac.cc

    r6ed8c4 r1f637e  
    887887    if (ecartWeights)
    888888    {
    889       omFreeSize((ADDRESS)ecartWeights,(pVariables+1)*sizeof(short));
     889      omFreeSize((ADDRESS)ecartWeights,((currRing->N)+1)*sizeof(short));
    890890      ecartWeights=NULL;
    891891    }
  • kernel/kutil.cc

    r6ed8c4 r1f637e  
    407407  if (p!=0) strat->NotUsedAxis[p] = FALSE;
    408408  /*- the leading term of pp is a power of the p-th variable -*/
    409   for (j=pVariables;j>0; j--)
     409  for (j=(currRing->N);j>0; j--)
    410410  {
    411411    if (strat->NotUsedAxis[j])
     
    62426242  newNoether = pLmInit(strat->kHEdge);
    62436243  j = pFDeg(newNoether,currRing);
    6244   for (i=1; i<=pVariables; i++)
     6244  for (i=1; i<=(currRing->N); i++)
    62456245  {
    62466246    if (pGetExp(newNoether, i) > 0) pDecrExp(newNoether,i);
  • kernel/kutil.h

    r6ed8c4 r1f637e  
    640640KINLINE void clearS (poly p, unsigned long p_sev, int* at, int* k,
    641641  kStrategy strat);
    642 #include <kernel/kInline.cc>
     642
     643//// #include <kernel/kInline.cc> // This is really ugly!!!
    643644
    644645/* shiftgb stuff */
  • kernel/ratgring.cc

    r6ed8c4 r1f637e  
    3131  /* rat_shift is the last exp one should count with */
    3232  int i;
    33   for (i=pVariables; i>=rat_shift; i--)
     33  for (i=(currRing->N); i>=rat_shift; i--)
    3434  {
    3535    pSetExp(m,i, si_max( pGetExp(a,i), pGetExp(b,i)));
     
    4848          p_Init(r);
    4949
    50   const int pVariables = r->N;
    51 
    52   //  for (int i = pVariables; i>=r->real_var_start; i--)
     50  const int (currRing->N) = r->N;
     51
     52  //  for (int i = (currRing->N); i>=r->real_var_start; i--)
    5353  for (int i = r->real_var_end; i>=r->real_var_start; i--)
    5454  {
     
    7070//   /* shift is the exp of rational elements */
    7171//   int i;
    72 //   for (i=pVariables; i; i--)
     72//   for (i=(currRing->N); i; i--)
    7373//   {
    7474//     if (!pGetExp(pshift,i))
  • kernel/stairc.h

    r6ed8c4 r1f637e  
    1717
    1818intvec * scIndIntvec(ideal S, ideal Q=NULL);
    19 lists scIndIndset(ideal S, BOOLEAN all, ideal Q=NULL);
     19
     20// lists scIndIndset(ideal S, BOOLEAN all, ideal Q=NULL); // TODO: move to Singular/
     21
    2022int scDimInt(ideal  s,ideal Q=NULL);
    2123int scMultInt(ideal  s,ideal Q=NULL);
  • kernel/syz.h

    r6ed8c4 r1f637e  
    107107syStrategy syCopy(syStrategy syzstr);
    108108void syPrint(syStrategy syzstr);
    109 lists syConvRes(syStrategy syzstr,BOOLEAN toDel=FALSE,int add_row_shift=0);
    110 syStrategy syConvList(lists li,BOOLEAN toDel=FALSE);
    111 syStrategy syForceMin(lists li);
     109
     110// lists syConvRes(syStrategy syzstr,BOOLEAN toDel=FALSE,int add_row_shift=0); // TODO: move to Singular/
     111// syStrategy syConvList(lists li,BOOLEAN toDel=FALSE); // TODO: move to Singular/
     112// syStrategy syForceMin(lists li); // TODO: move to Singular/
     113
    112114syStrategy syMinimize(syStrategy syzstr);
    113115void syKillEmptyEntres(resolvente res,int length);
  • kernel/syz0.cc

    r6ed8c4 r1f637e  
    9090      if (mW!=NULL)
    9191      {
    92         for(jj=1;jj<=pVariables;jj++)
     92        for(jj=1;jj<=(currRing->N);jj++)
    9393          pSetExp(q,jj,pGetExp(q,jj) -pGetExp(mW->m[pGetComp(q)-1],jj));
    9494        pSetm(q);
     
    9797      if (mW!=NULL)
    9898      {
    99         for(jj=1;jj<=pVariables;jj++)
     99        for(jj=1;jj<=(currRing->N);jj++)
    100100          pSetExp(p,jj,pGetExp(p,jj) +pGetExp(mW->m[pGetComp(p)-1],jj));
    101101        pSetm(p);
     
    470470  if (mW!=NULL)
    471471  {
    472     for(j=1;j<=pVariables;j++)
     472    for(j=1;j<=(currRing->N);j++)
    473473      pSetExp(p,j,pGetExp(p,j) -pGetExp(mW->m[pGetComp(p)-1],j));
    474474  }
     
    484484      if (mW!=NULL)
    485485      {
    486         for(j=1;j<=pVariables;j++)
     486        for(j=1;j<=(currRing->N);j++)
    487487          pSetExp(p,j,pGetExp(p,j) -pGetExp(mW->m[pGetComp(p)-1],j));
    488488      }
     
    749749        if (res[syzIndex-1]->m[pGetComp(p)-1]!=NULL)
    750750        {
    751           for(j=1;j<=pVariables;j++)
     751          for(j=1;j<=(currRing->N);j++)
    752752          {
    753753            pSetExp(p,j,pGetExp(p,j)
     
    782782        {
    783783          qq = p;
    784           for(j=1;j<=pVariables;j++)
     784          for(j=1;j<=(currRing->N);j++)
    785785          {
    786786            pSetExp(p,j,pGetExp(p,j)
     
    796796            }
    797797            pp = pNext(p);
    798             for(j=1;j<=pVariables;j++)
     798            for(j=1;j<=(currRing->N);j++)
    799799            {
    800800              pSetExp(pp,j,pGetExp(pp,j)
  • kernel/syz1.cc

    r6ed8c4 r1f637e  
    207207  //if (o1>0)
    208208  {
    209     int i = pVariables;
     209    int i = (currRing->N);
    210210    while ((i>1) && (pGetExp(p1,i)==pGetExp(p2,i)))
    211211      i--;
    212     //(*orderingdepth)[pVariables-i]++;
     212    //(*orderingdepth)[(currRing->N)-i]++;
    213213    if (i>1)
    214214    {
     
    17071707//            pWrite(tq);
    17081708            pTest(tq);
    1709             for (l=pVariables;l>0;l--)
     1709            for (l=(currRing->N);l>0;l--)
    17101710            {
    17111711              if (origR!=NULL)
     
    21322132        {
    21332133          tq = pInit();
    2134           for(j=pVariables; j>0; j--)
     2134          for(j=(currRing->N); j>0; j--)
    21352135            pSetExp(tq,j, pGetExp(p,j)-pGetExp(pisN,j));
    21362136          pSetComp(tq, 0);
     
    24602460  //euler = -1;
    24612461  redpol = pInit();
    2462   syzstr->length = *length = pVariables+2;
     2462  syzstr->length = *length = (currRing->N)+2;
    24632463
    24642464  // Creare dp,S ring and change to it
     
    25982598
    25992599  if( maxlength > 0 )
    2600     syzstr->length = maxlength; //  = pVariables+2;
     2600    syzstr->length = maxlength; //  = (currRing->N)+2;
    26012601  else
    2602     syzstr->length = maxlength = pVariables+2;
     2602    syzstr->length = maxlength = (currRing->N)+2;
    26032603
    26042604  // Creare dp,S ring and change to it
  • kernel/syz2.cc

    r6ed8c4 r1f637e  
    77*/
    88
    9 #include <kernel/mod2.h>
    10 #include <omalloc/mylimits.h>
     9#include "mod2.h"
     10
     11#include <omalloc/omalloc.h>
     12
     13#include <misc/mylimits.h>
    1114#include <misc/options.h>
    12 #include <omalloc/omalloc.h>
    13 #include <kernel/syz.h>
     15#include <misc/intvec.h>
     16//#include "cntrlc.h"
     17
     18#include <coeffs/coeffs.h>
     19#include <coeffs/numbers.h>
     20
     21#include <polys/monomials/ring.h>
     22#include <polys/kbuckets.h>
     23#include <polys/prCopy.h>
     24
    1425#include <polys/polys.h>
     26
     27// #include <kernel/modulop.h>
     28
    1529#include <kernel/febase.h>
    1630#include <kernel/kstd1.h>
    1731#include <kernel/kutil.h>
    1832#include <kernel/stairc.h>
    19 //#include "cntrlc.h"
    20 #include <misc/intvec.h>
    21 #include <coeffs/numbers.h>
    22 #include <kernel/modulop.h>
     33
     34#include <kernel/syz.h>
    2335#include <kernel/ideals.h>
    24 #include <misc/intvec.h>
    25 #include <polys/monomials/ring.h>
    26 #include <polys/kbuckets.h>
    27 #include <polys/prCopy.h>
     36
     37
     38
     39
    2840
    2941//#define SHOW_PROT
     
    142154                {
    143155                  poly p1,p2;
    144                   int ip=pVariables;
     156                  int ip= currRing->N;
    145157                  p1 = pDivide(p,(syzstr->resPairs[index])[i].p);
    146158                  p2 = pDivide(nP->m[j],(syzstr->resPairs[index])[j].p);
     
    983995  crit_fails = 0;
    984996#endif
    985   syzstr->length = *length = pVariables+2;
     997  syzstr->length = *length = currRing->N+2;
    986998  syzstr->Tl = new intvec(*length+1);
    987999  temp = idInit(IDELEMS(arg),arg->rank);
  • kernel/syz3.cc

    r6ed8c4 r1f637e  
    281281        if (res[syzIndex-1]->m[pGetComp(p)-1]!=NULL)
    282282        {
    283           for(j=1;j<=pVariables;j++)
     283          for(j=1;j<=(currRing->N);j++)
    284284          {
    285285            pSetExp(p,j,pGetExp(p,j)
     
    386386            {
    387387              poly p1,p2;
    388               int ip=pVariables;
     388              int ip=(currRing->N);
    389389              p1 = pDivide(p,old_generators->m[jj]);
    390390              p2 = pDivide(prs[j1],old_generators->m[j1]);
     
    10851085            {
    10861086              poly p1,p2;
    1087               int ip=pVariables;
     1087              int ip=(currRing->N);
    10881088              p1 = pDivide(p,add_generators->m[j]);
    10891089              p2 = pDivide(prs[j1],add_generators->m[j1]);
     
    12111211      {
    12121212        assume(pp1!=NULL);
    1213         for(i=(int)pVariables; i; i--)
     1213        for(i=(int)(currRing->N); i; i--)
    12141214          pSetExp(pp1,i, pGetExp(pp1,i)- pGetExp(deg_soc,i));
    12151215        pSetComp(pp1, 0);
     
    12211221      {
    12221222        assume(pp2!=NULL);
    1223         for(i=(int)pVariables; i; i--)
     1223        for(i=(int)(currRing->N); i; i--)
    12241224          pSetExp(pp2,i, pGetExp(pp2,i)- pGetExp(deg_soc,i));
    12251225        pSetComp(pp2, 0);
     
    17681768  syzstr->syRing = rCurrRingAssure_C_dp();
    17691769/*--- initializes the data structures---------------*/
    1770   syzstr->length = *length = pVariables+2;
     1770  syzstr->length = *length = (currRing->N)+2;
    17711771  syzstr->regularity = -1;
    17721772  if (origR!=syzstr->syRing)
  • kernel/tgb.cc

    r6ed8c4 r1f637e  
    379379  if(p_GetComp (p, r) != 0)
    380380    return FALSE;
    381   if(c->lastDpBlockStart <= pVariables)
     381  if(c->lastDpBlockStart <= (currRing->N))
    382382  {
    383383    int i;
     
    407407  if(p_GetComp (p, r) != 0)
    408408    return FALSE;
    409   if(c->lastDpBlockStart <= pVariables)
     409  if(c->lastDpBlockStart <= (currRing->N))
    410410  {
    411411    int i;
     
    446446  if(r->order[last_block] == ringorder_dp)
    447447    return r->block0[last_block];
    448   return pVariables + 1;
     448  return (currRing->N) + 1;
    449449}
    450450
     
    827827      if(pGetExp (p1, i) + pGetExp (p2, i) > pGetExp (bound, i))
    828828        return FALSE;
    829       if(i == pVariables)
     829      if(i == (currRing->N))
    830830      {
    831831        //PrintS("trivial");
     
    845845        return FALSE;
    846846      }
    847       if(i == pVariables)
     847      if(i == (currRing->N))
    848848      {
    849849        pDelete (&m);
     
    15521552                                    ~(c->short_Exps[j]), c->r));
    15531553
    1554       if(_p_GetComp (c->S->m[i], c->r) != _p_GetComp (c->S->m[j], c->r))
     1554      if(__p_GetComp (c->S->m[i], c->r) != __p_GetComp (c->S->m[j], c->r))
    15551555      {
    15561556        //c->states[i][j]=UNCALCULATED;
     
    17351735      p_Test (nodes[lower]->lcm_of_lm, c->r);
    17361736      nodes[lower]->lcm_of_lm = pCopy (nodes[lower]->lcm_of_lm);
    1737       assume (_p_GetComp (c->S->m[nodes[lower]->i], c->r) ==
    1738               _p_GetComp (c->S->m[nodes[lower]->j], c->r));
     1737      assume (__p_GetComp (c->S->m[nodes[lower]->i], c->r) ==
     1738              __p_GetComp (c->S->m[nodes[lower]->j], c->r));
    17391739      nodes_final[spc_final] =
    17401740        (sorted_pair_node *) omalloc (sizeof (sorted_pair_node));
     
    22462246  if(node == NULL)
    22472247    return;
    2248   if(level < pVariables)
     2248  if(level < (currRing->N))
    22492249  {
    22502250    int i, sum;
     
    33553355              && (!(eliminationProblem)) && (npPrimeM <= 32003));
    33563356  use_noro_last_block = false;
    3357   if((!(use_noro)) && (lastDpBlockStart <= pVariables))
     3357  if((!(use_noro)) && (lastDpBlockStart <= (currRing->N)))
    33583358  {
    33593359    use_noro_last_block = ((!(nc)) && (S->rank <= 1) && (rField_is_Zp (r))
     
    37123712  int i;
    37133713  int n = 0;
    3714   for(i = pVariables; i; i--)
     3714  for(i = (currRing->N); i; i--)
    37153715  {
    37163716    n += si_max (pGetExp (a, i), pGetExp (b, i));
     
    40344034  poly m = pOne ();
    40354035  poly t;
    4036   for(i = pVariables; i; i--)
     4036  for(i = (currRing->N); i; i--)
    40374037  {
    40384038    pSetExp (m, i, pGetExp (p, i));
     
    40784078       && (pGetExp (p2, i) - pGetExp (m, i) > 0))
    40794079      return FALSE;
    4080     if(i == pVariables)
     4080    if(i == (currRing->N))
    40814081      return TRUE;
    40824082    i++;
     
    49874987    pSetCoeff (m, nInit (1));
    49884988    pSetComp (m, 0);
    4989     for(int i = 1; i <= pVariables; i++)
     4989    for(int i = 1; i <= (currRing->N); i++)
    49904990      pSetExp (m, i, (pGetExp (r[erg.to_reduce_l].p, i) - pGetExp (red, i)));
    49914991    pSetm (m);
  • kernel/tgb_internal.h

    r6ed8c4 r1f637e  
    729729    int i;
    730730    nReducibleMonomials++;
    731     int nvars=pVariables;
     731    int nvars=(currRing->N);
    732732    NoroCacheNode* parent=&root;
    733733    for(i=1;i<nvars;i++)
     
    742742    int i;
    743743    nReducibleMonomials++;
    744     int nvars=pVariables;
     744    int nvars=(currRing->N);
    745745    NoroCacheNode* parent=&root;
    746746    for(i=1;i<nvars;i++)
     
    754754  {
    755755    int i;
    756     int nvars=pVariables;
     756    int nvars=(currRing->N);
    757757    NoroCacheNode* parent=&root;
    758758    for(i=1;i<nvars;i++)
     
    18871887  assume(level>=0);
    18881888  if (node==NULL) return;
    1889   if (level<pVariables)
     1889  if (level<(currRing->N))
    18901890  {
    18911891    int i;
     
    19081908  int i;
    19091909  NoroCacheNode* parent=&root;
    1910   for(i=1;i<pVariables;i++){
     1910  for(i=1;i<(currRing->N);i++){
    19111911    parent=parent->getBranch(p_GetExp(term,i,currRing));
    19121912    if (!(parent)){
     
    19201920  int i;
    19211921  NoroCacheNode* parent=&root;
    1922   for(i=1;i<pVariables;i++){
     1922  for(i=1;i<(currRing->N);i++){
    19231923    parent=parent->getBranch(p_GetExp(term,i,currRing));
    19241924    if (!(parent)){
  • kernel/walkProc.cc

    r6ed8c4 r1f637e  
    4444//    and order as parameters of the other
    4545// 7) none of the rings are qrings
    46 // vperm must be a vector of length pVariables+1, initialized by 0.
     46// vperm must be a vector of length (currRing->N)+1, initialized by 0.
    4747// If both rings are compatible, it stores the permutation of the
    4848// variables if mapped from sringHdl to dringHdl.
     
    200200//    and order as parameters of the other
    201201// 7) none of the rings are qrings
    202 // vperm must be a vector of length pVariables+1, initialized by 0.
     202// vperm must be a vector of length (currRing->N)+1, initialized by 0.
    203203// If both rings are compatible, it stores the permutation of the
    204204// variables if mapped from sringHdl to dringHdl.
  • libpolys/polys/polys.h

    r6ed8c4 r1f637e  
    1212
    1313extern ring currRing;
     14extern void rChangeCurrRing(ring r);
     15
    1416/***************************************************************
    1517 *
     
    2628
    2729// Component
    28 #define pGetComp(p)         _p_GetComp(p, currRing)
     30#define pGetComp(p)         __p_GetComp(p, currRing)
    2931#define pSetComp(p,v)       p_SetComp(p,v, currRing)
    3032
     
    242244 *
    243245 ***************************************************************/
    244 #define pWeight(c) p_Weight(c,currRing)
     246inline int pWeight(int i, const ring R = currRing){ return p_Weight(i,R); }
     247
    245248#define pDeg(p)    p_Deg(p,currRing)
    246249static inline long pTotaldegree(poly p) { return p_Totaldegree(p,currRing); }
Note: See TracChangeset for help on using the changeset viewer.