Changeset d2cf18 in git
- Timestamp:
- May 19, 2010, 2:16:14 PM (14 years ago)
- 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
- Location:
- coeffs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
coeffs/modulop.cc
r719c71 rd2cf18 312 312 } 313 313 314 static 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 314 320 void npInitChar(coeffs r, int c) 315 321 { 316 322 int i, w; 317 323 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; 323 377 #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) 325 402 #endif 326 403 { … … 361 438 #endif 362 439 } 363 r->type=n_Zp;364 //r->cfInitChar=npInitChar;365 r->cfKillChar=npKillChar;366 r->cfSetChar=npSetChar;367 npSetChar(r);368 // dummy stuff369 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 stuff380 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 LDEBUG404 r->nDBTest=npDBTest;405 #endif406 #ifdef NV_OPS407 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 #endif416 }417 else418 {419 WarnS("nInitChar failed");420 }421 440 } 422 441 -
coeffs/numbers.cc
r719c71 rd2cf18 135 135 else if (nField_is_Ring_2toM(r)) 136 136 { 137 nr2mSetExp(c, r);138 r->nInit_bigint=nr2mMapQ;137 // nr2mSetExp(c, r); 138 // r->nInit_bigint=nr2mMapQ; 139 139 } 140 140 /*----------------------ring Z ----------------*/ 141 141 else if (nField_is_Ring_Z(r)) 142 142 { 143 nrzSetExp(c, r);144 r->nInit_bigint=nrzMapQ;143 // nrzSetExp(c, r); 144 // r->nInit_bigint=nrzMapQ; 145 145 } 146 146 /*----------------------ring Z / n----------------*/ 147 147 else if (nField_is_Ring_ModN(r)) 148 148 { 149 nrnSetExp(c, r);150 r->nInit_bigint=nrnMapQ;149 // nrnSetExp(c, r); 150 // r->nInit_bigint=nrnMapQ; 151 151 } 152 152 /*----------------------ring Z / n----------------*/ 153 153 else if (nField_is_Ring_PtoM(r)) 154 154 { 155 nrnSetExp(c, r);156 r->nInit_bigint=nrnMapQ;155 // nrnSetExp(c, r); 156 // r->nInit_bigint=nrnMapQ; 157 157 } 158 158 #endif … … 160 160 else if (nField_is_GF(r)) 161 161 { 162 nfSetChar(c,r->parameter); 163 r->nInit_bigint=ndReturn0; // not impl. 162 // nfSetChar(c,r->parameter); 164 163 } 165 164 /* -------------- R -----------------------*/ … … 167 166 else if (nField_is_R(r)) 168 167 { 169 r->nInit_bigint=nrMapQ;168 // r->nInit_bigint=nrMapQ; 170 169 } 171 170 /* -------------- long R -----------------------*/ … … 174 173 || (nField_is_long_C(r))) 175 174 { 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; 179 178 } 180 179 #ifdef TEST … … 356 355 else 357 356 #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)) 364 358 /*----------------------char. p----------------*/ 365 359 { … … 403 397 #endif 404 398 */ 405 r->cfInitChar=npInitChar; 406 npInitChar(r,c); 399 //r->cfInitChar=npInitChar; 407 400 } 408 401 /* -------------- GF(p^m) -----------------------*/
Note: See TracChangeset
for help on using the changeset viewer.