Changeset d2cf18 in git


Ignore:
Timestamp:
May 19, 2010, 2:16:14 PM (14 years ago)
Author:
Hans Schoenemann <hannes@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
bcfa2000ff3ca226cf5d9db48e56d15b0857ffa3
Parents:
719c71a80093859b748e9f65da9029c763e2f8d6
git-author:
Hans Schoenemann <hannes@mathematik.uni-kl.de>2010-05-19 14:16:14+02:00
git-committer:
Mohamed Barakat <mohamed.barakat@rwth-aachen.de>2011-11-09 11:52:58+01:00
Message:
nit for Zp
Location:
coeffs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • coeffs/modulop.cc

    r719c71 rd2cf18  
    312312}
    313313
     314static BOOLEAN npCoeffsEqual(const coeffs r, n_coeffType n, int parameter)
     315{
     316  /* test, if r is an instance of nInitCoeffs(n,parameter) */
     317  return (n==n_Zp) && (r->ch==parameter);
     318}
     319
    314320void npInitChar(coeffs r, int c)
    315321{
    316322  int i, w;
    317323
    318   if ((c>1) || (c<(-1)))
    319   {
    320     if (c>1) r->npPrimeM = c;
    321     else     r->npPrimeM = -c;
    322     r->npPminus1M = r->npPrimeM - 1;
     324  r->npPrimeM = c;
     325  r->npPminus1M = c /*r->npPrimeM*/ - 1;
     326
     327  //r->cfInitChar=npInitChar;
     328  r->cfKillChar=npKillChar;
     329  r->cfSetChar=npSetChar;
     330  r->nCoeffIsEqual=npCoeffsEqual;
     331
     332  r->nMult  = npMult;
     333  r->nSub   = npSub;
     334  r->nAdd   = npAdd;
     335  r->nDiv   = npDiv;
     336  r->nIntDiv= npDiv;
     337  r->nIntMod= ndIntMod;
     338  r->nExactDiv= npDiv;
     339  r->cfInit = npInit;
     340  r->nPar = ndPar;
     341  r->nParDeg = ndParDeg;
     342  r->nSize  = ndSize;
     343  r->n_Int  = npInt;
     344  #ifdef HAVE_RINGS
     345  r->nDivComp = NULL; // only for ring stuff
     346  r->nIsUnit = NULL; // only for ring stuff
     347  r->nGetUnit = NULL; // only for ring stuff
     348  r->nExtGcd = NULL; // only for ring stuff
     349  #endif
     350  r->nNeg   = npNeg;
     351  r->nInvers= npInvers;
     352  r->cfCopy  = ndCopy;
     353  r->nRePart = ndCopy;
     354  r->nImPart = ndReturn0;
     355  r->cfWrite = npWrite;
     356  r->nRead = npRead;
     357  r->nNormalize=ndNormalize;
     358  r->nGreater = npGreater;
     359  #ifdef HAVE_RINGS
     360  r->nDivBy = NULL; // only for ring stuff
     361  #endif
     362  r->nEqual = npEqual;
     363  r->nIsZero = npIsZero;
     364  r->nIsOne = npIsOne;
     365  r->nIsMOne = npIsMOne;
     366  r->nGreaterZero = npGreaterZero;
     367  r->nPower = npPower;
     368  r->cfGetDenom = ndGetDenom;
     369  r->cfGetNumerator = ndGetNumerator;
     370  r->nGcd  = ndGcd;
     371  r->nLcm  = ndGcd;
     372  r->cfDelete= ndDelete;
     373  r->cfSetMap = npSetMap;
     374  r->nName = ndName;
     375  r->nInpMult=ndInpMult;
     376  r->nInit_bigint= npMap0;
    323377#ifdef NV_OPS
    324     if (r->npPrimeM <=NV_MAX_PRIME)
     378  if (c>NV_MAX_PRIME)
     379  {
     380    r->nMult  = nvMult;
     381    r->nDiv   = nvDiv;
     382    r->nExactDiv= nvDiv;
     383    r->nInvers= nvInvers;
     384    r->nPower= nvPower;
     385  }
     386#endif
     387#ifdef LDEBUG
     388  // debug stuff
     389  r->nDBTest=npDBTest;
     390#endif
     391 
     392  // the variables:
     393  r->nNULL = (number)0;
     394  r->type = n_Zp;
     395  r->ch = c;
     396  r->has_simple_Alloc=TRUE;
     397  r->has_simple_Inverse=TRUE;
     398
     399  // the tables
     400#ifdef NV_OPS
     401  if (r->npPrimeM <=NV_MAX_PRIME)
    325402#endif
    326403    {
     
    361438#endif
    362439    }
    363     r->type=n_Zp;
    364     //r->cfInitChar=npInitChar;
    365     r->cfKillChar=npKillChar;
    366     r->cfSetChar=npSetChar;
    367     npSetChar(r);
    368     // dummy stuff
    369     r->nPar  = ndPar;
    370     r->nParDeg=ndParDeg;
    371     r->cfGetDenom= ndGetDenom;
    372     r->cfGetNumerator= ndGetNumerator;
    373     r->nImPart=ndReturn0;
    374     r->nInpMult=ndInpMult;
    375     r->nIntMod=ndIntMod;
    376     r->nNormalize=ndNormalize;
    377     r->nGcd  = ndGcd;
    378     r->nLcm  = ndGcd; /* tricky, isn't it ?*/
    379     // the real stuff
    380     r->cfInit = npInit;
    381     r->nInit_bigint=npMap0;
    382     r->n_Int  = npInt;
    383     r->nAdd   = npAdd;
    384     r->nSub   = npSub;
    385     r->nMult  = npMult;
    386     r->nDiv   = npDiv;
    387     r->nExactDiv= npDiv;
    388     r->nNeg   = npNeg;
    389     r->nInvers= npInvers;
    390     r->cfCopy  = ndCopy;
    391     r->nGreater = npGreater;
    392     r->nEqual = npEqual;
    393     r->nIsZero = npIsZero;
    394     r->nIsOne = npIsOne;
    395     r->nIsMOne = npIsMOne;
    396     r->nGreaterZero = npGreaterZero;
    397     r->cfWrite = npWrite;
    398     r->nRead = npRead;
    399     r->nPower = npPower;
    400     r->cfSetMap = npSetMap;
    401     r->nName= ndName;
    402     r->nSize  = ndSize;
    403 #ifdef LDEBUG
    404     r->nDBTest=npDBTest;
    405 #endif
    406 #ifdef NV_OPS
    407     if (c>NV_MAX_PRIME)
    408     {
    409       r->nMult  = nvMult;
    410       r->nDiv   = nvDiv;
    411       r->nExactDiv= nvDiv;
    412       r->nInvers= nvInvers;
    413       r->nPower= nvPower;
    414     }
    415 #endif
    416   }
    417   else
    418   {
    419     WarnS("nInitChar failed");
    420   }
    421440}
    422441
  • coeffs/numbers.cc

    r719c71 rd2cf18  
    135135  else if (nField_is_Ring_2toM(r))
    136136  {
    137     nr2mSetExp(c, r);
    138     r->nInit_bigint=nr2mMapQ;
     137  //  nr2mSetExp(c, r);
     138  //  r->nInit_bigint=nr2mMapQ;
    139139  }
    140140  /*----------------------ring Z ----------------*/
    141141  else if (nField_is_Ring_Z(r))
    142142  {
    143     nrzSetExp(c, r);
    144     r->nInit_bigint=nrzMapQ;
     143  //  nrzSetExp(c, r);
     144  //  r->nInit_bigint=nrzMapQ;
    145145  }
    146146  /*----------------------ring Z / n----------------*/
    147147  else if (nField_is_Ring_ModN(r))
    148148  {
    149     nrnSetExp(c, r);
    150     r->nInit_bigint=nrnMapQ;
     149  //  nrnSetExp(c, r);
     150  //  r->nInit_bigint=nrnMapQ;
    151151  }
    152152  /*----------------------ring Z / n----------------*/
    153153  else if (nField_is_Ring_PtoM(r))
    154154  {
    155     nrnSetExp(c, r);
    156     r->nInit_bigint=nrnMapQ;
     155  //  nrnSetExp(c, r);
     156  //  r->nInit_bigint=nrnMapQ;
    157157  }
    158158#endif
     
    160160  else if (nField_is_GF(r))
    161161  {
    162     nfSetChar(c,r->parameter);
    163     r->nInit_bigint=ndReturn0; // not impl.
     162  //  nfSetChar(c,r->parameter);
    164163  }
    165164  /* -------------- R -----------------------*/
     
    167166  else if (nField_is_R(r))
    168167  {
    169     r->nInit_bigint=nrMapQ;
     168  //  r->nInit_bigint=nrMapQ;
    170169  }
    171170  /* -------------- long R -----------------------*/
     
    174173  || (nField_is_long_C(r)))
    175174  {
    176     setGMPFloatDigits(r->float_len,r->float_len2);
    177     if (nField_is_long_R(r)) r->nInit_bigint=ngfMapQ;
    178     else                     r->nInit_bigint=ngcMapQ;
     175   // setGMPFloatDigits(r->float_len,r->float_len2);
     176   // if (nField_is_long_R(r)) r->nInit_bigint=ngfMapQ;
     177   // else                     r->nInit_bigint=ngcMapQ;
    179178  }
    180179#ifdef TEST
     
    356355  else
    357356#endif
    358   if (nField_is_Q(r))
    359   {
    360     r->cfInitChar=nlInitChar;
    361     nlInitChar();
    362   }
    363   else if (nField_is_Zp(r))
     357  if (nField_is_Zp(r))
    364358  /*----------------------char. p----------------*/
    365359  {
     
    403397#endif
    404398    */
    405     r->cfInitChar=npInitChar;
    406     npInitChar(r,c);
     399    //r->cfInitChar=npInitChar;
    407400  }
    408401  /* -------------- GF(p^m) -----------------------*/
Note: See TracChangeset for help on using the changeset viewer.