341{
343 const int c = (int) (
long)
p;
344
346
348
352
353 r->ch = c;
354 r->npPminus1M = c - 1;
355
356
360
368
371 #ifdef HAVE_RINGS
372
373
374
375
376
377 #endif
380
381
382
385
392
393
394
395
396
397
399
400
404#ifdef LDEBUG
405
407#endif
408
409
412
413
415 r->has_simple_Alloc=
TRUE;
416 r->has_simple_Inverse=
TRUE;
417
418
419#ifdef NV_OPS
421#endif
422 {
423#ifdef HAVE_INVTABLE
424 r->npInvTable=(
unsigned short*)
omAlloc0( r->ch*
sizeof(
unsigned short) );
425#endif
426#ifndef HAVE_GENERIC_MULT
427 r->cfParameter=
npPar;
428 r->npExpTable=(
unsigned short *)
omAlloc0( r->ch*
sizeof(
unsigned short) );
429 r->npLogTable=(
unsigned short *)
omAlloc0( r->ch*
sizeof(
unsigned short) );
430 r->npExpTable[0] = 1;
431 r->npLogTable[0] = 0;
432 if (r->ch > 2)
433 {
436 {
437 r->npLogTable[1] = 0;
441 {
443 r->npExpTable[
i] =(int)(((
long)
w * (long)r->npExpTable[
i-1]) % r->ch);
444 r->npLogTable[r->npExpTable[
i]] =
i;
445 if ( r->npExpTable[
i] == 1 )
446 break;
447 }
449 break;
450 }
451 }
452 else
453 {
454 r->npExpTable[1] = 1;
455 r->npLogTable[1] = 0;
456 }
457#endif
458 }
459#ifdef NV_OPS
460 else
461 {
464 r->cfExactDiv =
nvDiv;
467
468
469
470
471
472 }
473#endif
475}
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)
void nvInpMult(number &a, number b, const coeffs r)
number npInvers(number c, const coeffs r)
number nvDiv(number a, number b, const coeffs r)
static number npInitMPZ(mpz_t m, const coeffs r)
BOOLEAN npIsMOne(number a, const coeffs r)
CanonicalForm npConvSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
static void npWriteFd(number n, const ssiInfo *d, const coeffs)
number npNeg(number c, const coeffs r)
nMapFunc npSetMap(const coeffs src, const coeffs dst)
const char * npRead(const char *s, number *a, const coeffs r)
number nvInvers(number c, const coeffs r)
static number npPar(int, coeffs r)
static char * npCoeffName(const coeffs cf)
void npInpMult(number &a, number b, const coeffs r)
BOOLEAN npDBTest(number a, const char *f, const int l, const coeffs r)
void npWrite(number a, const coeffs r)
static number npReadFd(const ssiInfo *d, const coeffs)
BOOLEAN npGreaterZero(number k, const coeffs r)
BOOLEAN npEqual(number a, number b, const coeffs r)
static number npRandom(siRandProc p, number, number, const coeffs cf)
long npInt(number &n, const coeffs r)
number npDiv(number a, number b, const coeffs r)
void npKillChar(coeffs r)
number npConvFactoryNSingN(const CanonicalForm n, const coeffs r)
BOOLEAN npGreater(number a, number b, 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)