 |
My Project
UNKNOWN_GIT_VERSION
|
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 124 of file modulop.h.
127 unsigned long R = (
unsigned long)a + (
unsigned long)
b;
128 return (number)(
R >= r->ch ?
R - r->ch :
R);
◆ npInitChar()
Definition at line 377 of file modulop.cc.
381 const int c = (int) (
long)
p;
392 r->npPminus1M = c - 1;
454 r->has_simple_Alloc=
TRUE;
455 r->has_simple_Inverse=
TRUE;
463 r->npInvTable=(
unsigned short*)
omAlloc0( r->ch*
sizeof(
unsigned short) );
465 #ifndef HAVE_GENERIC_MULT
466 r->npExpTable=(
unsigned short *)
omAlloc0( r->ch*
sizeof(
unsigned short) );
467 r->npLogTable=(
unsigned short *)
omAlloc0( r->ch*
sizeof(
unsigned short) );
468 r->npExpTable[0] = 1;
469 r->npLogTable[0] = 0;
475 r->npLogTable[1] = 0;
481 r->npExpTable[
i] =(int)(((
long)
w * (long)r->npExpTable[
i-1]) % r->ch);
482 r->npLogTable[r->npExpTable[
i]] =
i;
483 if ( r->npExpTable[
i] == 1 )
492 r->npExpTable[1] = 1;
493 r->npLogTable[1] = 0;
502 r->cfExactDiv =
nvDiv;
◆ npInpAddM()
static void npInpAddM |
( |
number & |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 129 of file modulop.h.
132 unsigned long R = (
unsigned long)a + (
unsigned long)
b;
133 a=(number)(
R >= r->ch ?
R - r->ch :
R);
◆ npInpMultM()
static void npInpMultM |
( |
number & |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 86 of file modulop.h.
89 long x = (long)r->npLogTable[(
long)a]+ r->npLogTable[(long)
b];
90 #ifdef HAVE_GENERIC_ADD
91 if (
x>=r->npPminus1M)
x-=r->npPminus1M;
95 x += (
x >> 63) & r->npPminus1M;
97 x += (
x >> 31) & r->npPminus1M;
100 a=(number)(
long)r->npExpTable[
x];
◆ npInt()
Definition at line 127 of file modulop.cc.
132 if ((
long)n > (((
long)r->ch) >>1))
return ((
long)n -((
long)r->ch));
133 else return ((
long)n);
◆ npInversM()
Definition at line 233 of file modulop.h.
237 #ifndef HAVE_GENERIC_MULT
238 #ifndef HAVE_INVTABLE
239 number d = (number)(
long)r->npExpTable[r->npPminus1M - r->npLogTable[(long)c]];
241 long inv=(long)r->npInvTable[(
long)c];
244 inv = (long)r->npExpTable[r->npPminus1M - r->npLogTable[(
long)c]];
245 r->npInvTable[(long)c]=inv;
247 number d = (number)inv;
251 long inv=(long)r->npInvTable[(
long)c];
255 r->npInvTable[(long)c]=inv;
260 number d = (number)inv;
◆ npInvMod()
Definition at line 188 of file modulop.h.
195 XGCD(d,
s, t, a,
R->ch);
198 long u,
v, u0, v0, u1, u2, q, r;
219 #ifdef HAVE_GENERIC_ADD
226 s += (
s >> 63) &
R->ch;
228 s += (
s >> 31) &
R->ch;
◆ npIsOne()
◆ npIsZeroM()
◆ npMult()
Definition at line 86 of file modulop.cc.
92 if (((
long)a == 0) || ((
long)
b == 0))
◆ npMultM()
static number npMultM |
( |
number |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 71 of file modulop.h.
74 long x = (long)r->npLogTable[(
long)a]+ r->npLogTable[(long)
b];
75 #ifdef HAVE_GENERIC_ADD
76 if (
x>=r->npPminus1M)
x-=r->npPminus1M;
80 x += (
x >> 63) & r->npPminus1M;
82 x += (
x >> 31) & r->npPminus1M;
85 return (number)(long)r->npExpTable[
x];
◆ npNegM()
Definition at line 174 of file modulop.h.
177 return (number)((long)(r->ch)-(long)(a));
◆ npSetMap()
◆ npSubM()
static number npSubM |
( |
number |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 134 of file modulop.h.
137 return (number)((long)a<(
long)
b ?
138 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.