 |
My Project
debian-1:4.1.1-p2+ds-4build1
|
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 long | InvMod (long a, const coeffs R) |
|
static number | npInversM (number c, 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, FILE *f, const coeffs) |
|
static number | npReadFd (s_buff f, 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) |
◆ InvMod()
Definition at line 167 of file modulop.cc.
174 XGCD(d,
s, t, a,
R->ch);
177 long u,
v, u0, v0, u1, v1, u2, v2, q, r;
198 #ifdef HAVE_GENERIC_ADD
205 s += (
s >> 63) &
R->ch;
207 s += (
s >> 31) &
R->ch;
◆ npCoeffName()
Definition at line 457 of file modulop.cc.
460 static char npCoeffName_buf[15];
461 snprintf(npCoeffName_buf,14,
"ZZ/%d",
cf->ch);
462 return npCoeffName_buf;
◆ npCoeffsEqual()
Definition at line 432 of file modulop.cc.
436 return (n==
n_Zp) && (r->ch==(int)(
long)parameter);
◆ npCoeffString()
◆ npCoeffWrite()
◆ npConvFactoryNSingN()
◆ npConvSingNFactoryN()
◆ npDBTest()
Definition at line 625 of file modulop.cc.
628 if (((
long)a<0L) || ((
long)a>(
long)r->ch))
630 Print(
"wrong mod p number %ld at %s,%d\n",(
long)a,
f,
l);
◆ npDiv()
Definition at line 244 of file modulop.cc.
255 if ((
long)a==0)
return (number)0L;
258 #ifndef HAVE_GENERIC_MULT
259 int s = r->npLogTable[(long)a] - r->npLogTable[(
long)
b];
260 #ifdef HAVE_GENERIC_ADD
265 s += ((long)
s >> 63) & r->npPminus1M;
267 s += ((long)
s >> 31) & r->npPminus1M;
270 d = (number)(
long)r->npExpTable[
s];
◆ npEati()
Definition at line 360 of file modulop.cc.
363 if (((*
s) >=
'0') && ((*
s) <=
'9'))
372 while (((*
s) >=
'0') && ((*
s) <=
'9'));
373 if (ii >= (
unsigned long)r->ch) ii = ii % r->ch;
◆ npEqual()
◆ npGreater()
Definition at line 311 of file modulop.cc.
318 return ((
long)a) > ((long)
b);
◆ npGreaterZero()
Definition at line 70 of file modulop.cc.
75 int h = (int)((
long)
k);
76 return ((
int)
h !=0) && (
h <= (r->ch>>1));
◆ npInit()
Definition at line 113 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 487 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;
◆ npInpMult()
void npInpMult |
( |
number & |
a, |
|
|
number |
b, |
|
|
const coeffs |
r |
|
) |
| |
Definition at line 98 of file modulop.cc.
104 if (((
long)a == 0) || ((
long)
b == 0))
◆ 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);
◆ npInvers()
◆ npInversM()
Definition at line 212 of file modulop.cc.
216 #ifndef HAVE_GENERIC_MULT
217 #ifndef HAVE_INVTABLE
218 number d = (number)(
long)r->npExpTable[r->npPminus1M - r->npLogTable[(long)c]];
220 long inv=(long)r->npInvTable[(
long)c];
223 inv = (long)r->npExpTable[r->npPminus1M - r->npLogTable[(
long)c]];
224 r->npInvTable[(long)c]=inv;
226 number d = (number)inv;
230 long inv=(long)r->npInvTable[(
long)c];
234 r->npInvTable[(long)c]=inv;
237 long inv=
InvMod((
long)c,r);
239 number d = (number)inv;
◆ npIsMOne()
Definition at line 149 of file modulop.cc.
154 return ((r->npPminus1M == (
long)a) &&(1L!=(
long)a));
◆ npIsOne()
◆ npIsZero()
◆ npKillChar()
Definition at line 413 of file modulop.cc.
417 if (r->npInvTable!=
NULL)
419 omFreeSize( (
void *)r->npInvTable, r->ch*
sizeof(
unsigned short) );
423 #ifndef HAVE_GENERIC_MULT
424 if (r->npExpTable!=
NULL)
426 omFreeSize( (
void *)r->npExpTable, r->ch*
sizeof(
unsigned short) );
427 omFreeSize( (
void *)r->npLogTable, r->ch*
sizeof(
unsigned short) );
428 r->npExpTable=
NULL; r->npLogTable=
NULL;
◆ npMapCanonicalForm()
Definition at line 757 of file modulop.cc.
762 return (number) (
f.intval());
◆ npMapGMP()
Definition at line 724 of file modulop.cc.
727 mpz_ptr erg = (mpz_ptr)
omAlloc(
sizeof(mpz_t));
730 mpz_mod_ui(erg, (mpz_ptr) from, dst->ch);
731 number r = (number) mpz_get_si(erg);
◆ npMapLongR()
Definition at line 648 of file modulop.cc.
660 size = (*f)[0]._mp_size;
674 e=(*f)[0]._mp_exp-
size;
686 al = dest->_mp_size =
size;
688 dd = (mp_ptr)
omAlloc(
sizeof(mp_limb_t)*al);
691 nn = (mp_ptr)
omAlloc(
sizeof(mp_limb_t)*bl);
693 for (
i=bl-2;
i>=0;
i--) nn[
i] = 0;
696 ndest->_mp_alloc = ndest->_mp_size = bl;
698 in=mpz_fdiv_ui(ndest,dst_r->ch);
703 al = dest->_mp_size =
size+e;
705 dd = (mp_ptr)
omAlloc(
sizeof(mp_limb_t)*al);
707 for (
i=0;
i<e;
i++) dd[
i] = 0;
712 dest->_mp_alloc = al;
713 iz=mpz_fdiv_ui(dest,dst_r->ch);
716 iz=(long)
npDiv((number)iz,(number)in,dst_r);
◆ npMapMachineInt()
Definition at line 750 of file modulop.cc.
753 long i = (long) (((
unsigned long) from) % dst->ch);
◆ npMapP()
◆ npMapZ()
◆ npMult()
Definition at line 86 of file modulop.cc.
92 if (((
long)a == 0) || ((
long)
b == 0))
◆ npNeg()
Definition at line 294 of file modulop.cc.
299 if ((
long)c==0L)
return c;
◆ npPower()
void npPower |
( |
number |
a, |
|
|
int |
i, |
|
|
number * |
result, |
|
|
const coeffs |
r |
|
) |
| |
◆ npRandom()
◆ npRead()
Definition at line 379 of file modulop.cc.
392 *a = (number)(
long)z;
400 *a =
nvDiv((number)(
long)z,(number)(
long)n,r);
403 *a =
npDiv((number)(
long)z,(number)(
long)n,r);
◆ npReadFd()
static number npReadFd |
( |
s_buff |
f, |
|
|
const |
coeffs |
|
) |
| |
|
static |
Definition at line 474 of file modulop.cc.
480 return (number)(long)dd;
◆ npSetMap()
◆ npWrite()
Definition at line 330 of file modulop.cc.
335 if ((
long)a>(((
long)r->ch) >>1))
StringAppend(
"-%d",(
int)(((
long)r->ch)-((
long)a)));
◆ npWriteFd()
static void npWriteFd |
( |
number |
n, |
|
|
FILE * |
f, |
|
|
const |
coeffs |
|
) |
| |
|
static |
Definition at line 469 of file modulop.cc.
472 fprintf(
f,
"%d ",(
int)(
long)n);
◆ 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 52 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.
(mpz_ptr), see rmodulon,h
static number npInversM(number c, const coeffs r)
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)
static void npWriteFd(number n, FILE *f, const coeffs)
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)
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 npReadFd(s_buff f, const coeffs)
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)
const char *const nDivBy0
#define omFreeSize(addr, size)
static number npNegM(number a, const coeffs r)
static long InvMod(long 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 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)
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.