 |
My Project
debian-1:4.1.1-p2+ds-4build3
|
Go to the source code of this file.
|
BOOLEAN | npInitChar (coeffs r, void *p) |
|
static number | npMultM (number a, number b, const coeffs r) |
|
static void | npInpMultM (number &a, number b, const coeffs r) |
|
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 | npNegM (number a, const coeffs r) |
|
static BOOLEAN | npIsZeroM (number a, const coeffs) |
|
long | npInt (number &n, const coeffs r) |
|
nMapFunc | npSetMap (const coeffs src, const coeffs dst) |
|
◆ FACTORY_MAX_PRIME
#define FACTORY_MAX_PRIME 536870909 |
◆ npEqualM
#define npEqualM |
( |
|
A, |
|
|
|
B, |
|
|
|
r |
|
) |
| ((A)==(B)) |
◆ NV_MAX_PRIME
#define NV_MAX_PRIME 32749 |
◆ NV_OPS
◆ npAddM()
static number npAddM |
( |
number |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 116 of file modulop.h.
118 unsigned long R = (
unsigned long)a + (
unsigned long)
b;
119 return (number)(
R >= r->ch ?
R - r->ch :
R);
◆ npInitChar()
Definition at line 488 of file modulop.cc.
491 const int c = (int) (
long)
p;
502 r->npPminus1M = c - 1;
564 r->has_simple_Alloc=
TRUE;
565 r->has_simple_Inverse=
TRUE;
573 r->npInvTable=(
unsigned short*)
omAlloc0( r->ch*
sizeof(
unsigned short) );
575 #ifndef HAVE_GENERIC_MULT
576 r->npExpTable=(
unsigned short *)
omAlloc0( r->ch*
sizeof(
unsigned short) );
577 r->npLogTable=(
unsigned short *)
omAlloc0( r->ch*
sizeof(
unsigned short) );
578 r->npExpTable[0] = 1;
579 r->npLogTable[0] = 0;
585 r->npLogTable[1] = 0;
591 r->npExpTable[
i] =(int)(((
long)
w * (long)r->npExpTable[
i-1]) % r->ch);
592 r->npLogTable[r->npExpTable[
i]] =
i;
593 if ( r->npExpTable[
i] == 1 )
602 r->npExpTable[1] = 1;
603 r->npLogTable[1] = 0;
612 r->cfExactDiv =
nvDiv;
◆ npInpAddM()
static void npInpAddM |
( |
number & |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 121 of file modulop.h.
123 unsigned long R = (
unsigned long)a + (
unsigned long)
b;
124 a=(number)(
R >= r->ch ?
R - r->ch :
R);
◆ npInpMultM()
static void npInpMultM |
( |
number & |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 78 of file modulop.h.
80 long x = (long)r->npLogTable[(
long)a]+ r->npLogTable[(long)
b];
81 #ifdef HAVE_GENERIC_ADD
82 if (
x>r->npPminus1M)
x-=r->npPminus1M;
86 x += (
x >> 63) & r->npPminus1M;
88 x += (
x >> 31) & r->npPminus1M;
91 a=(number)(
long)r->npExpTable[
x];
◆ npInt()
Definition at line 128 of file modulop.cc.
132 if ((
long)n > (((
long)r->ch) >>1))
return ((
long)n -((
long)r->ch));
133 else return ((
long)n);
◆ npIsZeroM()
◆ npMultM()
static number npMultM |
( |
number |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 63 of file modulop.h.
65 long x = (long)r->npLogTable[(
long)a]+ r->npLogTable[(long)
b];
66 #ifdef HAVE_GENERIC_ADD
67 if (
x>r->npPminus1M)
x-=r->npPminus1M;
71 x += (
x >> 63) & r->npPminus1M;
73 x += (
x >> 31) & r->npPminus1M;
76 return (number)(long)r->npExpTable[
x];
◆ npNegM()
Definition at line 166 of file modulop.h.
168 return (number)((long)(r->ch)-(long)(a));
◆ npSetMap()
◆ npSubM()
static number npSubM |
( |
number |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 126 of file modulop.h.
128 return (number)((long)a<(
long)
b ?
129 r->ch-(long)
b+(
long)a : (long)a-(
long)
b);
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
@ n_rep_gap_rat
(number), see longrat.h
@ n_rep_gmp
(mpz_ptr), see rmodulon,h
number nvMult(number a, number b, const coeffs r)
void npWrite(number a, const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_2toM(const coeffs r)
static void npWriteFd(number n, FILE *f, const coeffs)
nMapFunc npSetMap(const coeffs src, const coeffs dst)
static FORCE_INLINE int n_GetChar(const coeffs r)
Return the characteristic of the coeff. domain.
static char * npCoeffString(const coeffs cf)
BOOLEAN npIsOne(number a, const coeffs r)
const char * npRead(const char *s, number *a, const coeffs r)
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
number nvInvers(number c, const coeffs r)
static number npReadFd(s_buff f, const coeffs)
@ n_rep_int
(int), see modulop.h
static number npMapCanonicalForm(number a, const coeffs, const coeffs dst)
number npInit(long i, const coeffs r)
void npCoeffWrite(const coeffs r, BOOLEAN details)
number npInvers(number c, const coeffs r)
static number npMapZ(number from, const coeffs src, const coeffs dst)
number nvDiv(number a, number b, const coeffs r)
static char * npCoeffName(const coeffs cf)
BOOLEAN npEqual(number a, number b, const coeffs r)
static number npAddM(number a, number b, const coeffs r)
static number npSubM(number a, number b, const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
number npMult(number a, number b, const coeffs r)
number nlModP(number q, const coeffs, const coeffs Zp)
static FORCE_INLINE BOOLEAN nCoeff_is_CF(const coeffs r)
static void npInpAddM(number &a, number b, const coeffs r)
void npInpMult(number &a, number b, const coeffs r)
BOOLEAN npGreaterZero(number k, const coeffs r)
number npDiv(number a, number b, const coeffs r)
BOOLEAN npIsMOne(number a, const coeffs r)
static BOOLEAN npCoeffsEqual(const coeffs r, n_coeffType n, void *parameter)
long npInt(number &n, const coeffs r)
static number npMapP(number from, const coeffs src, const coeffs dst_r)
static number npMapGMP(number from, const coeffs, const coeffs dst)
void npKillChar(coeffs r)
@ n_rep_gmp_float
(gmp_float), see
static number npMapLongR(number from, const coeffs, const coeffs dst_r)
static number npRandom(siRandProc p, number, number, const coeffs cf)
CanonicalForm npConvSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
BOOLEAN npDBTest(number a, const char *f, const int l, const coeffs r)
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
number npNeg(number c, const coeffs r)
BOOLEAN npIsZero(number a, const coeffs r)
number npConvFactoryNSingN(const CanonicalForm n, const coeffs r)
void nvInpMult(number &a, number b, const coeffs r)
static number npMapMachineInt(number from, const coeffs, const coeffs dst)
BOOLEAN npGreater(number a, number b, const coeffs r)
@ n_rep_gap_gmp
(), see rinteger.h, new impl.