Changeset 17e692 in git


Ignore:
Timestamp:
Mar 8, 1999, 7:11:50 PM (25 years ago)
Author:
Hans Schönemann <hannes@…>
Branches:
(u'spielwiese', '8e0ad00ce244dfd0756200662572aef8402f13d5')
Children:
2a10547f349f40ba3e6a890b93b03d6cb4b37f52
Parents:
be0d84532eb45d49b654745e810a1a7a534d71ff
Message:
*hannes: use rPar if possible


git-svn-id: file:///usr/local/Singular/svn/trunk@2891 2c84dea3-7e68-4137-9b89-c4e89433aadc
Location:
Singular
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • Singular/fglm.cc

    rbe0d84 r17e692  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglm.cc,v 1.15 1999-03-08 17:30:32 Singular Exp $
     2// $Id: fglm.cc,v 1.16 1999-03-08 18:11:39 Singular Exp $
    33
    44/****************************************
     
    124124        state= FglmIncompatibleRings;
    125125    }
    126     if ( sring->N != dring->N ) {
     126    if ( sring->N != dring->N )
     127    {
    127128        WerrorS( "rings must have same number of variables" );
    128129        state= FglmIncompatibleRings;
    129130    }
    130     if ( sring->P != dring->P ) {
     131    if ( rPar(sring) != rPar(dring) )
     132    {
    131133        WerrorS( "rings must have same number of parameters" );
    132134        state= FglmIncompatibleRings;
     
    136138    // check if the names of the variables resp. parameters do agree:
    137139    int nvar = sring->N;
    138     int npar = sring->P;
     140    int npar = rPar(sring);
    139141    int * pperm;
    140142    if ( npar > 0 )
  • Singular/fglmzero.cc

    rbe0d84 r17e692  
    11// emacs edit mode for this file is -*- C++ -*-
    2 // $Id: fglmzero.cc,v 1.20 1999-03-08 17:30:33 Singular Exp $
     2// $Id: fglmzero.cc,v 1.21 1999-03-08 18:11:41 Singular Exp $
    33
    44/****************************************
     
    141141    maFindPerm( source->names, source->N, NULL, 0, currRing->names, currRing->N, NULL, 0, perm, NULL );
    142142    nSetMap( rInternalChar(source), source->parameter,
    143        source->P, source->minpoly );
     143       rPar(source), source->minpoly );
    144144
    145145    matHeader ** temp = (matHeader **)Alloc( _nfunc*sizeof( matHeader * ));
     
    147147        for ( col= 0, colp= func[var]; col < _size; col++, colp++ ) {
    148148            if ( colp->owner == TRUE ) {
    149                 for ( row= colp->size-1, elemp= colp->elems; row >= 0; row--, elemp++ ) {
     149                for ( row= colp->size-1, elemp= colp->elems; row >= 0;
     150                  row--, elemp++ )
     151                {
    150152                    newelem= nMap( elemp->elem );
    151153                    nDelete( & elemp->elem );
  • Singular/iparith.cc

    rbe0d84 r17e692  
    14881488    if (iiOp==IMAP_CMD)
    14891489    {
    1490       if (!nSetMap(rInternalChar(r),r->parameter,r->P,r->minpoly))
     1490      if (!nSetMap(rInternalChar(r),r->parameter,rPar(r),r->minpoly))
    14911491      {
    14921492        if (iiOp!=IMAP_CMD)
     
    15081508        }
    15091509        BITSET save_test=test;
    1510         naSetChar(rInternalChar(r),TRUE,r->parameter,r->P);
    1511         nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,currRing->P);
     1510        naSetChar(rInternalChar(r),TRUE,r->parameter,rPar(r));
     1511        nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
     1512          rPar(currRing));
    15121513        test=save_test;
    15131514      }
     
    15151516      if (par_perm_size!=0)
    15161517        par_perm=(int *)Alloc0(par_perm_size*sizeof(int));
    1517       maFindPerm(r->names,       r->N,       r->parameter,        r->P,
    1518                  currRing->names,currRing->N,currRing->parameter, currRing->P,
     1518      maFindPerm(r->names,       r->N,       
     1519                      r->parameter,        rPar(r),
     1520                 currRing->names,currRing->N,
     1521                      currRing->parameter, rPar(currRing),
    15191522                 perm,par_perm);
    15201523    }
     
    28842887static BOOLEAN jjRPAR(leftv res, leftv v)
    28852888{
    2886   res->data = (char *)((ring)v->Data())->P;
     2889  res->data = (char *)rPar(((ring)v->Data()));
    28872890  return FALSE;
    28882891}
  • Singular/ipassign.cc

    rbe0d84 r17e692  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipassign.cc,v 1.45 1999-03-08 17:30:36 Singular Exp $ */
     4/* $Id: ipassign.cc,v 1.46 1999-03-08 18:11:45 Singular Exp $ */
    55
    66/*
     
    117117{
    118118  if ((currRing->parameter!=NULL)
    119   && ((currRing->P>1)
     119  && ((rPar(currRing)>1)
    120120    || (rField_is_GF())))
    121121  {
  • Singular/ipshell.cc

    rbe0d84 r17e692  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ipshell.cc,v 1.34 1999-03-08 17:30:37 Singular Exp $ */
     4/* $Id: ipshell.cc,v 1.35 1999-03-08 18:11:46 Singular Exp $ */
    55/*
    66* ABSTRACT:
     
    571571    if (!nSetMap(rInternalChar(IDRING(r)),
    572572                 IDRING(r)->parameter,
    573                  IDRING(r)->P,
     573                 rPar(IDRING(r)),
    574574                 IDRING(r)->minpoly))
    575575    {
  • Singular/longalg.cc

    rbe0d84 r17e692  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: longalg.cc,v 1.29 1999-03-08 17:30:40 Singular Exp $ */
     4/* $Id: longalg.cc,v 1.30 1999-03-08 18:11:47 Singular Exp $ */
    55/*
    66* ABSTRACT:   algebraic numbers
     
    23892389      for(i=0;i<nop;i++)
    23902390      {
    2391         if ((i>=currRing->P)
     2391        if ((i>=rPar(currRing))
    23922392        ||(strcmp(par[i],currRing->parameter[i])!=0))
    23932393           return FALSE;
     
    24432443      for(i=0;i<nop;i++)
    24442444      {
    2445         if ((i>=currRing->P)
     2445        if ((i>=rPar(currRing))
    24462446        ||(strcmp(par[i],currRing->parameter[i])!=0))
    24472447           return FALSE;
  • Singular/maps.cc

    rbe0d84 r17e692  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: maps.cc,v 1.12 1999-03-08 17:30:41 Singular Exp $ */
     4/* $Id: maps.cc,v 1.13 1999-03-08 18:11:48 Singular Exp $ */
    55/*
    66* ABSTRACT - the mapping of polynomials to other rings
     
    351351  /* the simplest case:*/
    352352  if(r==currRing) return pCopy(p);
    353   nSetMap(rInternalChar(r),r->parameter,r->P,r->minpoly);
     353  nSetMap(rInternalChar(r),r->parameter,rPar(r),r->minpoly);
    354354  int *perm=(int *)Alloc0((r->N+1)*sizeof(int));
    355355  //int *par_perm=(int *)Alloc0(rPar(r)*sizeof(int));
    356   maFindPerm(r->names,r->N, r->parameter, r->P,
    357              currRing->names,currRing->N,currRing->parameter, currRing->P,
     356  maFindPerm(r->names,r->N, r->parameter, rPar(r),
     357             currRing->names,currRing->N,currRing->parameter, rPar(currRing),
    358358             perm,NULL/*par_perm*/);
    359359  poly res=pPermPoly(p,perm,r/*,par_perm,rPar(r)*/);
  • Singular/mpsr.h

    rbe0d84 r17e692  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr.h,v 1.13 1999-03-08 17:30:43 Singular Exp $ */
     4/* $Id: mpsr.h,v 1.14 1999-03-08 18:11:48 Singular Exp $ */
    55/***************************************************************
    66 *
     
    100100  {
    101101#ifdef PDEBUG
    102     nSetChar(rInternalChar(rg), TRUE, rg->parameter,rg->P);
     102    nSetChar(rInternalChar(rg), TRUE, rg->parameter,rPar(rg));
    103103#else
    104     nSetChar(rInternalChar(rg), complete, rg->parameter,rg->P);
     104    nSetChar(rInternalChar(rg), complete, rg->parameter,rPar(rg));
    105105#endif
    106106    pChangeRing(rg->N, rg->OrdSgn, rg->order, rg->block0, rg->block1,
  • Singular/mpsr_GetMisc.cc

    rbe0d84 r17e692  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: mpsr_GetMisc.cc,v 1.12 1999-03-08 17:30:46 Singular Exp $ */
     4/* $Id: mpsr_GetMisc.cc,v 1.13 1999-03-08 18:11:49 Singular Exp $ */
    55
    66/***************************************************************
     
    113113  // orig: r1->ch == r2->ch ???
    114114  || (r1->N != r2->N) || (r1->OrdSgn != r2->OrdSgn)
    115       || (r1->P != r2->P))
     115      || (rPar(r1) != rPar(r2)))
    116116    return 0;
    117117
     
    186186  if (r2 == NULL) return 0;
    187187
    188   if ((r1->N > r2->N) || (r1->OrdSgn != r2->OrdSgn) || (r1->P > r2->P))
     188  if ((r1->N > r2->N) || (r1->OrdSgn != r2->OrdSgn) || (rPar(r1) > rPar(r2)))
    189189    return 0;
    190190
     
    202202    return 0;
    203203 
    204   for (i=0; i<r1->P;i++)
     204  for (i=0; i<rPar(r1);i++)
    205205  {
    206206      if (strcmp(r1->parameter[i], r2->parameter[i])!=0)
     
    341341          number nn = (number) l->data;
    342342          mpsr_SetCurrRing(to_ring, TRUE);
    343           nSetMap(rInternalChar(from_ring), from_ring->parameter, from_ring->P, from_ring->minpoly);
     343          nSetMap(rInternalChar(from_ring), from_ring->parameter,
     344            rPar(from_ring), from_ring->minpoly);
    344345          l->data = (void *) nMap(nn);
    345346          mpsr_SetCurrRing(from_ring, FALSE);
  • Singular/ring.cc

    rbe0d84 r17e692  
    22*  Computer Algebra System SINGULAR     *
    33****************************************/
    4 /* $Id: ring.cc,v 1.43 1999-02-10 16:00:04 Singular Exp $ */
     4/* $Id: ring.cc,v 1.44 1999-03-08 18:11:50 Singular Exp $ */
    55
    66/*
     
    6767
    6868    /*------------ global variables related to coefficients ------------*/
    69     nSetChar(r->ch, complete, r->parameter, r->P);
     69    nSetChar(r->ch, complete, r->parameter, rPar(r));
    7070
    7171    /*------------ global variables related to polys -------------------*/
     
    161161      if ((rg->parameter!=NULL) && (rg->ch<2))
    162162      {
    163         for (i=0;i<rg->P;i++)
     163        for (i=0;i<rPar(rg);i++)
    164164        {
    165165          if(strlen(rg->parameter[i])>1)
     
    731731
    732732
    733   if ((r->parameter!=NULL)&&(r->ch>1))
     733  if (rField_is_GF(r))
    734734    PrintS("//   # ground field : ");
    735735  else
    736736    PrintS("//   characteristic : ");
    737   if (r->ch==-1)     PrintS("0 (real)\n");  /* R */
    738   else if (r->ch<0)  Print ("%d\n",-r->ch); /* Fp(a) */
    739   else if (r->ch==1) PrintS("0\n");         /* Q(a)  */
    740   else               Print ("%d\n",r->ch);  /* Fq, Fp, Q */
     737  if ( rField_is_R(r) )        PrintS("0 (real)\n");  /* R */
     738  else Print ("%d\n",rChar(r)); /* Fp(a) */
    741739  if (r->parameter!=NULL)
    742740  {
     
    746744      char **sp=r->parameter;
    747745      int nop=0;
    748       while (nop<r->P)
     746      while (nop<rPar(r))
    749747      {
    750748        PrintS(*sp);
     
    926924        int len=0;
    927925        char **s=r->parameter;
    928         while (len<r->P)
     926        while (len<rPar(r))
    929927        {
    930928          FreeL((ADDRESS)*s);
     
    932930          len++;
    933931        }
    934         Free((ADDRESS)r->parameter,r->P*sizeof(char *));
     932        Free((ADDRESS)r->parameter,rPar(r)*sizeof(char *));
    935933      }
    936934      Free((ADDRESS)r->VarOffset, (r->N +1)*sizeof(int));
     
    12061204  }
    12071205  int l=0;
    1208   for(i=0; i<r->P;i++)
     1206  for(i=0; i<rPar(r);i++)
    12091207  {
    12101208    l+=(strlen(r->parameter[i])+1);
     
    12221220  tt[0]=',';
    12231221  tt[1]='\0';
    1224   for(i=0; i<r->P;i++)
     1222  for(i=0; i<rPar(r);i++)
    12251223  {
    12261224    strcat(s,tt);
     
    12371235  int l=2;
    12381236
    1239   for (i=0; i<r->P; i++)
     1237  for (i=0; i<rPar(r); i++)
    12401238  {
    12411239    l+=strlen(r->parameter[i])+1;
     
    12431241  char *s=(char *)AllocL(l);
    12441242  s[0]='\0';
    1245   for (i=0; i<r->P-1; i++)
     1243  for (i=0; i<rPar(r)-1; i++)
    12461244  {
    12471245    strcat(s,r->parameter[i]);
     
    13131311  memset(&tmpR,0,sizeof(tmpR));
    13141312  /* check coeff. field =====================================================*/
    1315   if (r1->ch==r2->ch)
    1316   {
    1317     tmpR.ch=r1->ch;
    1318     if ((r1->ch==0)||(r1->ch>=2)) /* Q, Z/p, GF(p,n) */
     1313  if (rInternalChar(r1)==rInternalChar(r2))
     1314  {
     1315    tmpR.ch=rInternalChar(r1);
     1316    if (rField_is_Q(r1)||rField_is_Zp(r1)||rField_is_GF(r1)) /*Q, Z/p, GF(p,n)*/
    13191317    {
    13201318      if (r1->parameter!=NULL)
     
    13391337        if (r2->minpoly!=NULL)
    13401338        {
    1341           nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
     1339          nSetChar(rInternalChar(r1),TRUE,r1->parameter,rPar(r1));
    13421340          if ((strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */
    13431341              && naEqual(r1->minpoly,r2->minpoly))
     
    13471345            tmpR.minpoly=naCopy(r1->minpoly);
    13481346            tmpR.P=1;
    1349             nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1347            nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
     1348              rPar(currRing));
    13501349          }
    13511350          else
    13521351          {
    1353             nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1352            nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
     1353              rPar(currRing));
    13541354            WerrorS("different minpolys");
    13551355            return -1;
     
    13591359        {
    13601360          if ((strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */
    1361               && (r2->P==1))
     1361              && (rPar(r2)==1))
    13621362          {
    13631363            tmpR.parameter=(char **)Alloc0(sizeof(char *));
    13641364            tmpR.parameter[0]=mstrdup(r1->parameter[0]);
    13651365            tmpR.P=1;
    1366             nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
     1366            nSetChar(rInternalChar(r1),TRUE,r1->parameter,rPar(r1));
    13671367            tmpR.minpoly=naCopy(r1->minpoly);
    1368             nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1368            nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
     1369              rPar(currRing));
    13691370          }
    13701371          else
     
    13801381        {
    13811382          if ((strcmp(r1->parameter[0],r2->parameter[0])==0) /* 1 char */
    1382               && (r1->P==1))
     1383              && (rPar(r1)==1))
    13831384          {
    13841385            tmpR.parameter=(char **)Alloc(sizeof(char *));
    13851386            tmpR.parameter[0]=mstrdup(r1->parameter[0]);
    13861387            tmpR.P=1;
    1387             nSetChar(r2->ch,TRUE,r2->parameter,r2->P);
     1388            nSetChar(rInternalChar(r2),TRUE,r2->parameter,rPar(r2));
    13881389            tmpR.minpoly=naCopy(r2->minpoly);
    1389             nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1390            nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
     1391              rPar(currRing));
    13901392          }
    13911393          else
     
    14001402          tmpR.parameter=(char **)Alloc(len*sizeof(char *));
    14011403          int i;
    1402           for (i=0;i<r1->P;i++)
     1404          for (i=0;i<rPar(r1);i++)
    14031405          {
    14041406            tmpR.parameter[i]=mstrdup(r1->parameter[i]);
    14051407          }
    14061408          int j,l;
    1407           for(j=0;j<r2->P;j++)
     1409          for(j=0;j<rPar(r2);j++)
    14081410          {
    14091411            for(l=0;l<i;l++)
     
    14331435          || (r2->ch==-r1->ch)) /* Z/p */
    14341436      {
    1435         tmpR.ch=r1->ch;
     1437        tmpR.ch=rInternalChar(r1);
    14361438        tmpR.parameter=(char **)Alloc(rPar(r1)*sizeof(char *));
    1437         tmpR.P=r1->P;
     1439        tmpR.P=rPar(r1);
    14381440        memcpy(tmpR.parameter,r1->parameter,rPar(r1)*sizeof(char *));
    14391441        if (r1->minpoly!=NULL)
    14401442        {
    1441           nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
     1443          nSetChar(rInternalChar(r1),TRUE,r1->parameter,rPar(r1));
    14421444          tmpR.minpoly=naCopy(r1->minpoly);
    1443           nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1445          nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
     1446            rPar(currRing));
    14441447        }
    14451448      }
     
    14591462      if ((r2->ch<-1)||(r2->ch==1)) /* Z/p(a),Q(a) */
    14601463      {
    1461         tmpR.ch=r2->ch;
    1462         tmpR.P=r2->P;
     1464        tmpR.ch=rInternalChar(r2);
     1465        tmpR.P=rPar(r2);
    14631466        tmpR.parameter=(char **)Alloc(rPar(r2)*sizeof(char *));
    14641467        memcpy(tmpR.parameter,r2->parameter,rPar(r2)*sizeof(char *));
    14651468        if (r2->minpoly!=NULL)
    14661469        {
    1467           nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
     1470          nSetChar(rInternalChar(r1),TRUE,r1->parameter,rPar(r1));
    14681471          tmpR.minpoly=naCopy(r2->minpoly);
    1469           nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1472          nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
     1473            rPar(currRing));
    14701474        }
    14711475      }
     
    14901494      if (r2->ch==0) /* Q */
    14911495      {
    1492         tmpR.ch=r1->ch;
     1496        tmpR.ch=rInternalChar(r1);
    14931497        tmpR.P=rPar(r1);
    14941498        tmpR.parameter=(char **)Alloc0(rPar(r1)*sizeof(char *));
    14951499        int i;
    1496         for(i=0;i<r1->P;i++)
     1500        for(i=0;i<rPar(r1);i++)
    14971501        {
    14981502          tmpR.parameter[i]=mstrdup(r1->parameter[i]);
     
    15001504        if (r1->minpoly!=NULL)
    15011505        {
    1502           nSetChar(r1->ch,TRUE,r1->parameter,r1->P);
     1506          nSetChar(rInternalChar(r1),TRUE,r1->parameter,rPar(r1));
    15031507          tmpR.minpoly=naCopy(r1->minpoly);
    1504           nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1508          nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
     1509            rPar(currRing));
    15051510        }
    15061511      }
     
    15191524      else if (r2->ch==-r1->ch) /* Z/p(a) */
    15201525      {
    1521         tmpR.ch=r2->ch;
     1526        tmpR.ch=rInternalChar(r2);
    15221527        tmpR.P=rPar(r2);
    15231528        tmpR.parameter=(char **)Alloc(rPar(r2)*sizeof(char *));
    15241529        int i;
    1525         for(i=0;i<r2->P;i++)
     1530        for(i=0;i<rPar(r2);i++)
    15261531        {
    15271532          tmpR.parameter[i]=mstrdup(r2->parameter[i]);
     
    15291534        if (r2->minpoly!=NULL)
    15301535        {
    1531           nSetChar(r2->ch,TRUE,r2->parameter,r2->P);
     1536          nSetChar(rInternalChar(r2),TRUE,r2->parameter,rPar(r2));
    15321537          tmpR.minpoly=naCopy(r2->minpoly);
    1533           nSetChar(currRing->ch,TRUE,currRing->parameter,currRing->P);
     1538          nSetChar(rInternalChar(currRing),TRUE,currRing->parameter,
     1539            rPar(currRing));
    15341540        }
    15351541      }
     
    15571563    else if ((r2->parameter!=NULL) && (strlen(r1->names[i])==1))
    15581564    {
    1559       for(j=0;j<r2->P;j++)
     1565      for(j=0;j<rPar(r2);j++)
    15601566      {
    15611567        if (strcmp(r1->names[i],r2->parameter[j])==0)
     
    15861592    else if ((r1->parameter!=NULL) && (strlen(r2->names[i])==1))
    15871593    {
    1588       for(j=0;j<r1->P;j++)
     1594      for(j=0;j<rPar(r1);j++)
    15891595      {
    15901596        if (strcmp(r2->names[i],r1->parameter[j])==0)
     
    17601766    res->parameter=(char **)Alloc(l*sizeof(char *));
    17611767    int i;
    1762     for(i=0;i<r->P;i++)
     1768    for(i=0;i<rPar(r);i++)
    17631769    {
    17641770      res->parameter[i]=mstrdup(r->parameter[i]);
Note: See TracChangeset for help on using the changeset viewer.