339{
341 const int c = (int) (
long)
p;
342
344
346
350
351 r->ch = c;
352 r->npPminus1M = c - 1;
353
354
358
366
369 #ifdef HAVE_RINGS
370
371
372
373
374
375 #endif
378
379
380
383
390
391
392
393
394
395
397
398
402#ifdef LDEBUG
403
405#endif
406
407
410
411
413 r->has_simple_Alloc=
TRUE;
414 r->has_simple_Inverse=
TRUE;
415
416
417#ifdef NV_OPS
419#endif
420 {
421#ifdef HAVE_INVTABLE
422 r->npInvTable=(
unsigned short*)
omAlloc0( r->ch*
sizeof(
unsigned short) );
423#endif
424#ifndef HAVE_GENERIC_MULT
425 r->cfParameter=
npPar;
426 r->npExpTable=(
unsigned short *)
omAlloc0( r->ch*
sizeof(
unsigned short) );
427 r->npLogTable=(
unsigned short *)
omAlloc0( r->ch*
sizeof(
unsigned short) );
428 r->npExpTable[0] = 1;
429 r->npLogTable[0] = 0;
430 if (r->ch > 2)
431 {
434 {
435 r->npLogTable[1] = 0;
439 {
441 r->npExpTable[
i] =(int)(((
long)
w * (long)r->npExpTable[
i-1]) % r->ch);
442 r->npLogTable[r->npExpTable[
i]] =
i;
443 if ( r->npExpTable[
i] == 1 )
444 break;
445 }
447 break;
448 }
449 }
450 else
451 {
452 r->npExpTable[1] = 1;
453 r->npLogTable[1] = 0;
454 }
455#endif
456 }
457#ifdef NV_OPS
458 else
459 {
462 r->cfExactDiv =
nvDiv;
465
466
467
468
469
470 }
471#endif
473}
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
@ n_rep_int
(int), see modulop.h
static BOOLEAN npCoeffsEqual(const coeffs r, n_coeffType n, void *parameter)
static const char * npRead(const char *s, number *a, const coeffs r)
static number npInitMPZ(mpz_t m, const coeffs r)
static void npWrite(number a, const coeffs r)
CanonicalForm npConvSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
static void npWriteFd(number n, const ssiInfo *d, const coeffs)
static number nvDiv(number a, number b, const coeffs r)
static number npDiv(number a, number b, const coeffs r)
number nvInvers(number c, const coeffs r)
static number npPar(int, coeffs r)
static number npInvers(number c, const coeffs r)
static BOOLEAN npEqual(number a, number b, const coeffs r)
static char * npCoeffName(const coeffs cf)
static number npNeg(number c, const coeffs r)
static BOOLEAN npGreater(number a, number b, const coeffs r)
void npInpMult(number &a, number b, const coeffs r)
static BOOLEAN npIsMOne(number a, const coeffs r)
static BOOLEAN npGreaterZero(number k, const coeffs r)
static BOOLEAN npDBTest(number a, const char *f, const int l, const coeffs r)
static nMapFunc npSetMap(const coeffs src, const coeffs dst)
static number npReadFd(const ssiInfo *d, const coeffs)
static void nvInpMult(number &a, number b, const coeffs r)
static number npRandom(siRandProc p, number, number, const coeffs cf)
long npInt(number &n, const coeffs r)
void npKillChar(coeffs r)
number npConvFactoryNSingN(const CanonicalForm n, const coeffs r)
static BOOLEAN npIsOne(number a, const coeffs)
static number npAddM(number a, number b, const coeffs r)
static void npInpAddM(number &a, number b, const coeffs r)
static number npSubM(number a, number b, const coeffs r)
static number npInit(long i, const coeffs r)
static number nvMult(number a, number b, const coeffs r)
static number npMult(number a, number b, const coeffs r)
static BOOLEAN npIsZero(number a, const coeffs r)