 |
My Project
debian-1:4.1.2-p1+ds-2
|
Go to the source code of this file.
|
BOOLEAN | npGreaterZero (number k, const coeffs r) |
|
number | npMult (number a, number b, const coeffs r) |
|
number | npInit (long i, const coeffs r) |
|
long | npInt (number &n, const coeffs r) |
|
void | npPower (number a, int i, number *result, const coeffs r) |
|
BOOLEAN | npIsZero (number a, const coeffs r) |
|
BOOLEAN | npIsOne (number a, const coeffs r) |
|
BOOLEAN | npIsMOne (number a, const coeffs r) |
|
number | npDiv (number a, number b, const coeffs r) |
|
number | npNeg (number c, const coeffs r) |
|
number | npInvers (number c, const coeffs r) |
|
BOOLEAN | npGreater (number a, number b, const coeffs r) |
|
BOOLEAN | npEqual (number a, number b, const coeffs r) |
|
void | npWrite (number a, const coeffs r) |
|
void | npCoeffWrite (const coeffs r, BOOLEAN details) |
|
const char * | npRead (const char *s, number *a, const coeffs r) |
|
void | nvInpMult (number &a, number b, const coeffs r) |
|
BOOLEAN | npDBTest (number a, const char *f, const int l, const coeffs r) |
|
nMapFunc | npSetMap (const coeffs src, const coeffs dst) |
|
static number | nvMultM (number a, number b, const coeffs r) |
|
number | nvMult (number a, number b, const coeffs r) |
|
number | nvDiv (number a, number b, const coeffs r) |
|
number | nvInvers (number c, const coeffs r) |
|
void | npInpMult (number &a, number b, const coeffs r) |
|
static const char * | npEati (const char *s, int *i, const coeffs r) |
|
void | npKillChar (coeffs r) |
|
static BOOLEAN | npCoeffsEqual (const coeffs r, n_coeffType n, void *parameter) |
|
CanonicalForm | npConvSingNFactoryN (number n, BOOLEAN setChar, const coeffs r) |
|
number | npConvFactoryNSingN (const CanonicalForm n, const coeffs r) |
|
static char * | npCoeffName (const coeffs cf) |
|
static char * | npCoeffString (const coeffs cf) |
|
static void | npWriteFd (number n, const ssiInfo *d, const coeffs) |
|
static number | npReadFd (const ssiInfo *d, const coeffs) |
|
static number | npRandom (siRandProc p, number, number, const coeffs cf) |
|
BOOLEAN | npInitChar (coeffs r, void *p) |
|
static number | npMapP (number from, const coeffs src, const coeffs dst_r) |
|
static number | npMapLongR (number from, const coeffs, const coeffs dst_r) |
|
static number | npMapGMP (number from, const coeffs, const coeffs dst) |
|
static number | npMapZ (number from, const coeffs src, const coeffs dst) |
|
static number | npMapMachineInt (number from, const coeffs, const coeffs dst) |
|
static number | npMapCanonicalForm (number a, const coeffs, const coeffs dst) |
|
static number | nvInversM (number c, const coeffs r) |
|
◆ ULONG64
#define ULONG64 (unsigned long) |
◆ npCoeffName()
Definition at line 346 of file modulop.cc.
350 snprintf(npCoeffName_buf,14,
"ZZ/%d",
cf->ch);
351 return npCoeffName_buf;
◆ npCoeffsEqual()
Definition at line 322 of file modulop.cc.
326 return (n==
n_Zp) && (r->ch==(int)(
long)parameter);
◆ npCoeffString()
◆ npCoeffWrite()
◆ npConvFactoryNSingN()
◆ npConvSingNFactoryN()
◆ npDBTest()
Definition at line 514 of file modulop.cc.
517 if (((
long)a<0L) || ((
long)a>(
long)r->ch))
519 Print(
"wrong mod p number %ld at %s,%d\n",(
long)a,
f,
l);
◆ npDiv()
Definition at line 148 of file modulop.cc.
159 if ((
long)a==0)
return (number)0L;
162 #ifndef HAVE_GENERIC_MULT
163 int s = r->npLogTable[(long)a] - r->npLogTable[(
long)
b];
164 #ifdef HAVE_GENERIC_ADD
169 s += ((long)
s >> 63) & r->npPminus1M;
171 s += ((long)
s >> 31) & r->npPminus1M;
174 d = (number)(
long)r->npExpTable[
s];
◆ npEati()
◆ npEqual()
◆ npGreater()
Definition at line 215 of file modulop.cc.
222 return ((
long)a) > ((long)
b);
◆ npGreaterZero()
Definition at line 69 of file modulop.cc.
74 int h = (int)((
long)
k);
75 return ((
int)
h !=0) && (
h <= (r->ch>>1));
◆ npInit()
Definition at line 112 of file modulop.cc.
115 long ii=
i % (long)r->ch;
116 if (ii < 0L) ii += (long)r->ch;
118 number c = (number)ii;
◆ 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;
◆ npInpMult()
void npInpMult |
( |
number & |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
Definition at line 97 of file modulop.cc.
103 if (((
long)a == 0) || ((
long)
b == 0))
◆ 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);
◆ npInvers()
◆ npIsMOne()
Definition at line 141 of file modulop.cc.
146 return ((r->npPminus1M == (
long)a) &&(1L!=(
long)a));
◆ npIsOne()
◆ npIsZero()
◆ npKillChar()
Definition at line 303 of file modulop.cc.
307 if (r->npInvTable!=
NULL)
309 omFreeSize( (
void *)r->npInvTable, r->ch*
sizeof(
unsigned short) );
313 #ifndef HAVE_GENERIC_MULT
314 if (r->npExpTable!=
NULL)
316 omFreeSize( (
void *)r->npExpTable, r->ch*
sizeof(
unsigned short) );
317 omFreeSize( (
void *)r->npLogTable, r->ch*
sizeof(
unsigned short) );
318 r->npExpTable=
NULL; r->npLogTable=
NULL;
◆ npMapCanonicalForm()
Definition at line 646 of file modulop.cc.
651 return (number) (
f.intval());
◆ npMapGMP()
Definition at line 613 of file modulop.cc.
616 mpz_ptr erg = (mpz_ptr)
omAlloc(
sizeof(mpz_t));
619 mpz_mod_ui(erg, (mpz_ptr) from, dst->ch);
620 number r = (number) mpz_get_si(erg);
◆ npMapLongR()
Definition at line 537 of file modulop.cc.
549 size = (*f)[0]._mp_size;
563 e=(*f)[0]._mp_exp-
size;
575 al = dest->_mp_size =
size;
577 dd = (mp_ptr)
omAlloc(
sizeof(mp_limb_t)*al);
580 nn = (mp_ptr)
omAlloc(
sizeof(mp_limb_t)*bl);
582 for (
i=bl-2;
i>=0;
i--) nn[
i] = 0;
585 ndest->_mp_alloc = ndest->_mp_size = bl;
587 in=mpz_fdiv_ui(ndest,dst_r->ch);
592 al = dest->_mp_size =
size+e;
594 dd = (mp_ptr)
omAlloc(
sizeof(mp_limb_t)*al);
596 for (
i=0;
i<e;
i++) dd[
i] = 0;
601 dest->_mp_alloc = al;
602 iz=mpz_fdiv_ui(dest,dst_r->ch);
605 iz=(long)
npDiv((number)iz,(number)in,dst_r);
◆ npMapMachineInt()
Definition at line 639 of file modulop.cc.
642 long i = (long) (((
unsigned long) from) % dst->ch);
◆ npMapP()
◆ npMapZ()
◆ npMult()
Definition at line 85 of file modulop.cc.
91 if (((
long)a == 0) || ((
long)
b == 0))
◆ npNeg()
Definition at line 198 of file modulop.cc.
203 if ((
long)c==0L)
return c;
◆ npPower()
void npPower |
( |
number |
a, |
|
|
int |
i, |
|
|
number * |
result, |
|
|
const coeffs |
r |
|
) |
| |
◆ npRandom()
◆ npRead()
Definition at line 269 of file modulop.cc.
282 *a = (number)(
long)z;
290 *a =
nvDiv((number)(
long)z,(number)(
long)n,r);
293 *a =
npDiv((number)(
long)z,(number)(
long)n,r);
◆ npReadFd()
Definition at line 363 of file modulop.cc.
369 return (number)(long)dd;
◆ npSetMap()
◆ npWrite()
Definition at line 234 of file modulop.cc.
239 if ((
long)a>(((
long)r->ch) >>1))
StringAppend(
"-%d",(
int)(((
long)r->ch)-((
long)a)));
◆ npWriteFd()
◆ nvDiv()
◆ nvInpMult()
void nvInpMult |
( |
number & |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
◆ nvInvers()
◆ nvInversM()
◆ nvMult()
◆ nvMultM()
static number nvMultM |
( |
number |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
|
inlinestatic |
Definition at line 51 of file modulop.cc.
57 #define ULONG64 (unsigned long long)(unsigned long)
59 #define ULONG64 (unsigned long)
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)
static number nvMultM(number a, number b, const coeffs r)
nMapFunc npSetMap(const coeffs src, const coeffs dst)
#define npEqualM(A, B, r)
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)
virtual class for internal CanonicalForm's
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)
const char *const nDivBy0
#define omFreeSize(addr, size)
static number npNegM(number a, const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
number npMult(number a, number b, const coeffs r)
static const char * npEati(const char *s, int *i, 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)
static number nvInversM(number c, const coeffs r)
void WerrorS(const char *s)
char * nEati(char *s, int *i, int m)
divide by the first (leading) number and return it, i.e. make monic
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 npInversM(number c, 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.