 |
My Project
UNKNOWN_GIT_VERSION
|
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 348 of file modulop.cc.
350 static char npCoeffName_buf[15];
351 snprintf(npCoeffName_buf,14,
"ZZ/%d",
cf->ch);
352 return npCoeffName_buf;
◆ npCoeffsEqual()
Definition at line 324 of file modulop.cc.
327 return (n==
n_Zp) && (r->ch==(int)(
long)parameter);
◆ npCoeffString()
◆ npCoeffWrite()
◆ npConvFactoryNSingN()
◆ npConvSingNFactoryN()
◆ npDBTest()
Definition at line 516 of file modulop.cc.
518 if (((
long)a<0L) || ((
long)a>(
long)r->ch))
520 Print(
"wrong mod p number %ld at %s,%d\n",(
long)a,
f,
l);
◆ npDiv()
Definition at line 150 of file modulop.cc.
160 if ((
long)a==0)
return (number)0L;
163 #ifndef HAVE_GENERIC_MULT
164 int s = r->npLogTable[(long)a] - r->npLogTable[(
long)
b];
165 #ifdef HAVE_GENERIC_ADD
170 s += ((long)
s >> 63) & r->npPminus1M;
172 s += ((long)
s >> 31) & r->npPminus1M;
175 d = (number)(
long)r->npExpTable[
s];
◆ npEati()
◆ npEqual()
◆ npGreater()
Definition at line 217 of file modulop.cc.
223 return ((
long)a) > ((long)
b);
◆ npGreaterZero()
Definition at line 71 of file modulop.cc.
75 int h = (int)((
long)
k);
76 return ((
int)
h !=0) && (
h <= (r->ch>>1));
◆ npInit()
Definition at line 114 of file modulop.cc.
116 long ii=
i % (long)r->ch;
117 if (ii < 0L) ii += (long)r->ch;
119 number c = (number)ii;
◆ npInitChar()
Definition at line 378 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;
◆ npInpMult()
void npInpMult |
( |
number & |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
Definition at line 99 of file modulop.cc.
104 if (((
long)a == 0) || ((
long)
b == 0))
◆ 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);
◆ npInvers()
◆ npIsMOne()
Definition at line 143 of file modulop.cc.
147 return ((r->npPminus1M == (
long)a) &&(1L!=(
long)a));
◆ npIsOne()
◆ npIsZero()
◆ npKillChar()
Definition at line 305 of file modulop.cc.
308 if (r->npInvTable!=
NULL)
310 omFreeSize( (
void *)r->npInvTable, r->ch*
sizeof(
unsigned short) );
314 #ifndef HAVE_GENERIC_MULT
315 if (r->npExpTable!=
NULL)
317 omFreeSize( (
void *)r->npExpTable, r->ch*
sizeof(
unsigned short) );
318 omFreeSize( (
void *)r->npLogTable, r->ch*
sizeof(
unsigned short) );
319 r->npExpTable=
NULL; r->npLogTable=
NULL;
◆ npMapCanonicalForm()
Definition at line 648 of file modulop.cc.
652 return (number) (
f.intval());
◆ npMapGMP()
Definition at line 615 of file modulop.cc.
617 mpz_ptr erg = (mpz_ptr)
omAlloc(
sizeof(mpz_t));
620 mpz_mod_ui(erg, (mpz_ptr) from, dst->ch);
621 number r = (number) mpz_get_si(erg);
◆ npMapLongR()
Definition at line 539 of file modulop.cc.
550 size = (*f)[0]._mp_size;
564 e=(*f)[0]._mp_exp-
size;
576 al = dest->_mp_size =
size;
578 dd = (mp_ptr)
omAlloc(
sizeof(mp_limb_t)*al);
581 nn = (mp_ptr)
omAlloc(
sizeof(mp_limb_t)*bl);
583 for (
i=bl-2;
i>=0;
i--) nn[
i] = 0;
586 ndest->_mp_alloc = ndest->_mp_size = bl;
588 in=mpz_fdiv_ui(ndest,dst_r->ch);
593 al = dest->_mp_size =
size+e;
595 dd = (mp_ptr)
omAlloc(
sizeof(mp_limb_t)*al);
597 for (
i=0;
i<e;
i++) dd[
i] = 0;
602 dest->_mp_alloc = al;
603 iz=mpz_fdiv_ui(dest,dst_r->ch);
606 iz=(long)
npDiv((number)iz,(number)in,dst_r);
◆ npMapMachineInt()
Definition at line 641 of file modulop.cc.
643 long i = (long) (((
unsigned long) from) % dst->ch);
◆ npMapP()
◆ npMapZ()
◆ npMult()
Definition at line 87 of file modulop.cc.
92 if (((
long)a == 0) || ((
long)
b == 0))
◆ npNeg()
Definition at line 200 of file modulop.cc.
204 if ((
long)c==0L)
return c;
◆ npPower()
void npPower |
( |
number |
a, |
|
|
int |
i, |
|
|
number * |
result, |
|
|
const coeffs |
r |
|
) |
| |
◆ npRandom()
◆ npRead()
Definition at line 271 of file modulop.cc.
283 *a = (number)(
long)z;
291 *a =
nvDiv((number)(
long)z,(number)(
long)n,r);
294 *a =
npDiv((number)(
long)z,(number)(
long)n,r);
◆ npReadFd()
Definition at line 365 of file modulop.cc.
370 return (number)(long)dd;
◆ npSetMap()
◆ npWrite()
Definition at line 236 of file modulop.cc.
240 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 53 of file modulop.cc.
58 #define ULONG64 (unsigned long long)(unsigned long)
60 #define ULONG64 (unsigned long)
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 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
@ 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)
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)
@ n_rep_gmp_float
(gmp_float), see
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)
@ n_rep_gap_gmp
(), see rinteger.h, new impl.