859{
860
862
866 if ((
IsPrime(
p->GFChar)==
p->GFChar)&&(
p->GFDegree==1))
867 {
869 }
870 if(
p->GFChar > (2<<15))
871 {
872#ifndef SING_NDEBUG
873 WarnS(
"illegal characteristic");
874#endif
876 }
877
878 const double check=
log ((
double) (
p->GFChar));
879
880 #define sixteenlog2 11.09035489
882 {
883#ifndef SING_NDEBUG
884 Warn(
"Sorry: illegal size: %u ^ %u",
p->GFChar,
p->GFDegree );
885#endif
887 }
888
892
896
901
902 r->cfExactDiv=
nfDiv;
905
907 #ifdef HAVE_RINGS
908
909
910
911
912
913 #endif
916
917
918
919
922
930
931
932
934
935
937
939
941
942#ifdef LDEBUG
944#endif
945
946
947 const char *
name =
p->GFPar_name;
948
949 r->m_nfCharQ = 0;
950 r->m_nfCharP =
p->GFChar;
951 r->m_nfCharQ1 = 0;
952
953 r->iNumberOfParameters = 1;
955
956 char ** pParameterNames = (
char **)
omAlloc(
sizeof(
char *));
960
961 r->pParameterNames = (const char**)pParameterNames;
962
963 r->m_nfPlus1Table=
NULL;
964
965 if (strlen(
name) > 1)
967 else
969
970 r->has_simple_Alloc=
TRUE;
971 r->has_simple_Inverse=
TRUE;
972
973 int c = (
int)
pow ((
double)
p->GFChar, (
double)
p->GFDegree);
974
976
977 if( r->m_nfPlus1Table ==
NULL )
978 {
979 Werror(
"reading table for field with %d elements failed",c);
981 }
982
983
984 assume (r -> m_nfCharQ > 0);
985
986 r->ch = r->m_nfCharP;
988
990}
Rational pow(const Rational &a, int e)
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
@ n_rep_gf
(int), see ffields.h
Creation data needed for finite fields.
char name(const Variable &v)
static BOOLEAN nfIsMOne(number a, const coeffs r)
static number nfInitMPZ(mpz_t m, const coeffs cf)
static number nfAdd(number a, number b, const coeffs R)
static nMapFunc nfSetMap(const coeffs src, const coeffs dst)
static number nfInit(long i, const coeffs r)
BOOLEAN nfDBTest(number a, const char *f, const int l, const coeffs r)
static void nfKillChar(coeffs r)
static int nfParDeg(number n, const coeffs r)
static long nfInt(number &n, const coeffs r)
static number nfMult(number a, number b, const coeffs r)
static BOOLEAN nfGreaterZero(number k, const coeffs r)
static char * nfCoeffName(const coeffs r)
static void nfWriteShort(number a, const coeffs r)
static number nfSub(number a, number b, const coeffs r)
static number nfRandom(siRandProc p, number, number, const coeffs cf)
static BOOLEAN nfIsOne(number a, const coeffs r)
static void nfCoeffWrite(const coeffs r, BOOLEAN details)
static const char * nfRead(const char *s, number *a, const coeffs r)
static BOOLEAN nfGreater(number a, number b, const coeffs r)
static number nfNeg(number c, const coeffs r)
static BOOLEAN nfIsZero(number a, const coeffs r)
static BOOLEAN nfCoeffIsEqual(const coeffs, n_coeffType, void *)
static BOOLEAN nfEqual(number a, number b, const coeffs r)
static void nfReadTable(const int c, const coeffs r)
static void nfWriteLong(number a, const coeffs r)
static number nfDiv(number a, number b, const coeffs r)
static number nfParameter(int i, const coeffs)
static number nfInvers(number c, const coeffs r)
static void nfPower(number a, int i, number *result, const coeffs r)
BOOLEAN npInitChar(coeffs r, void *p)
gmp_float log(const gmp_float &a)
void Werror(const char *fmt,...)