 |
My Project
debian-1:4.1.2-p1+ds-2
|
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) |
|
static BOOLEAN | npIsOne (number a, const coeffs) |
|
static long | npInvMod (long a, const coeffs R) |
|
static number | npInversM (number c, const coeffs r) |
|
long | npInt (number &n, const coeffs r) |
|
number | npMult (number a, number b, 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 120 of file modulop.h.
123 unsigned long R = (
unsigned long)a + (
unsigned long)
b;
124 return (number)(
R >= r->ch ?
R - r->ch :
R);
◆ npInitChar()
Definition at line 376 of file modulop.cc.
380 const int c = (int) (
long)
p;
391 r->npPminus1M = c - 1;
453 r->has_simple_Alloc=
TRUE;
454 r->has_simple_Inverse=
TRUE;
462 r->npInvTable=(
unsigned short*)
omAlloc0( r->ch*
sizeof(
unsigned short) );
464 #ifndef HAVE_GENERIC_MULT
465 r->npExpTable=(
unsigned short *)
omAlloc0( r->ch*
sizeof(
unsigned short) );
466 r->npLogTable=(
unsigned short *)
omAlloc0( r->ch*
sizeof(
unsigned short) );
467 r->npExpTable[0] = 1;
468 r->npLogTable[0] = 0;
474 r->npLogTable[1] = 0;
480 r->npExpTable[
i] =(int)(((
long)
w * (long)r->npExpTable[
i-1]) % r->ch);
481 r->npLogTable[r->npExpTable[
i]] =
i;
482 if ( r->npExpTable[
i] == 1 )
491 r->npExpTable[1] = 1;
492 r->npLogTable[1] = 0;
501 r->cfExactDiv =
nvDiv;
◆ npInpAddM()
static void npInpAddM |
( |
number & |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 125 of file modulop.h.
128 unsigned long R = (
unsigned long)a + (
unsigned long)
b;
129 a=(number)(
R >= r->ch ?
R - r->ch :
R);
◆ npInpMultM()
static void npInpMultM |
( |
number & |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 82 of file modulop.h.
85 long x = (long)r->npLogTable[(
long)a]+ r->npLogTable[(long)
b];
86 #ifdef HAVE_GENERIC_ADD
87 if (
x>=r->npPminus1M)
x-=r->npPminus1M;
91 x += (
x >> 63) & r->npPminus1M;
93 x += (
x >> 31) & r->npPminus1M;
96 a=(number)(
long)r->npExpTable[
x];
◆ npInt()
Definition at line 126 of file modulop.cc.
131 if ((
long)n > (((
long)r->ch) >>1))
return ((
long)n -((
long)r->ch));
132 else return ((
long)n);
◆ npInversM()
Definition at line 229 of file modulop.h.
233 #ifndef HAVE_GENERIC_MULT
234 #ifndef HAVE_INVTABLE
235 number d = (number)(
long)r->npExpTable[r->npPminus1M - r->npLogTable[(long)c]];
237 long inv=(long)r->npInvTable[(
long)c];
240 inv = (long)r->npExpTable[r->npPminus1M - r->npLogTable[(
long)c]];
241 r->npInvTable[(long)c]=inv;
243 number d = (number)inv;
247 long inv=(long)r->npInvTable[(
long)c];
251 r->npInvTable[(long)c]=inv;
256 number d = (number)inv;
◆ npInvMod()
Definition at line 184 of file modulop.h.
191 XGCD(d,
s, t, a,
R->ch);
194 long u,
v, u0, v0, u1, u2, q, r;
215 #ifdef HAVE_GENERIC_ADD
222 s += (
s >> 63) &
R->ch;
224 s += (
s >> 31) &
R->ch;
◆ npIsOne()
◆ npIsZeroM()
◆ npMult()
Definition at line 85 of file modulop.cc.
91 if (((
long)a == 0) || ((
long)
b == 0))
◆ npMultM()
static number npMultM |
( |
number |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 67 of file modulop.h.
70 long x = (long)r->npLogTable[(
long)a]+ r->npLogTable[(long)
b];
71 #ifdef HAVE_GENERIC_ADD
72 if (
x>=r->npPminus1M)
x-=r->npPminus1M;
76 x += (
x >> 63) & r->npPminus1M;
78 x += (
x >> 31) & r->npPminus1M;
81 return (number)(long)r->npExpTable[
x];
◆ npNegM()
Definition at line 170 of file modulop.h.
173 return (number)((long)(r->ch)-(long)(a));
◆ npSetMap()
◆ npSubM()
static number npSubM |
( |
number |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 130 of file modulop.h.
133 return (number)((long)a<(
long)
b ?
134 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.
(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)
nMapFunc npSetMap(const coeffs src, const coeffs dst)
static number npMultM(number a, number b, const coeffs r)
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)
static number npReadFd(const ssiInfo *d, const coeffs)
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
number nvInvers(number c, const coeffs r)
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)
static void npWriteFd(number n, const ssiInfo *d, const coeffs)
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 long npInvMod(long a, const coeffs R)
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)
static number npMapLongR(number from, const coeffs, const coeffs dst_r)
const Variable & v
< [in] a sqrfree bivariate poly
static number npRandom(siRandProc p, number, number, const coeffs cf)
const CanonicalForm int s
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)
(), see rinteger.h, new impl.