352{
354 const int c = (int) (
long)
p;
355
357
359
363
364 r->ch = c;
365 r->npPminus1M = c - 1;
366
367
371
379
382
383
384
385
386
389
390
391
394
401
402
403
404
405
406
408
409
413#ifdef LDEBUG
414
416#endif
417
418
423
424
426 r->has_simple_Alloc=
TRUE;
427 r->has_simple_Inverse=
TRUE;
428
429
430#ifdef NV_OPS
432#endif
433 {
434#ifdef HAVE_INVTABLE
435 r->npInvTable=(
unsigned short*)
omAlloc0( r->ch*
sizeof(
unsigned short) );
436#endif
437#ifndef HAVE_GENERIC_MULT
438 r->cfParameter=
npPar;
439 r->npExpTable=(
unsigned short *)
omAlloc0( r->ch*
sizeof(
unsigned short) );
440 r->npLogTable=(
unsigned short *)
omAlloc0( r->ch*
sizeof(
unsigned short) );
441 r->npExpTable[0] = 1;
442 r->npLogTable[0] = 0;
443 if (r->ch > 2)
444 {
447 {
448 r->npLogTable[1] = 0;
452 {
454 r->npExpTable[
i] =(int)(((
long)
w * (
long)r->npExpTable[
i-1]) % r->ch);
455 r->npLogTable[r->npExpTable[
i]] =
i;
456 if ( r->npExpTable[
i] == 1 )
457 break;
458 }
460 break;
461 }
462 }
463 else
464 {
465 r->npExpTable[1] = 1;
466 r->npLogTable[1] = 0;
467 }
468#endif
469 }
470#ifdef NV_OPS
471 else
472 {
475 r->cfExactDiv =
nvDiv;
478
479
480
481
482
483 }
484#endif
486}
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)
static number npReadFd_S(char **s, const coeffs)
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 npWriteFd_S(number n, 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)