35 const char start[]=
"ZZ/bigint(";
46 while ((*
s!=
'\0') && (*
s!=
')'))
s++;
49 if (((*
s)==
')') && (*(
s+1)==
'^'))
91 return (n==r->type) && (r->modExponent==
info->exp)
106 long ch = r->cfInt(c, r);
115 WerrorS(
"constant in q-ideal is coprime to modulus in ground ring");
116 WerrorS(
"Unable to create qring!");
119 if(r->modExponent == 1)
129 info.base = r->modBase;
174#if SI_INTEGER_VARIANT==2
175#define nrnDelete nrzDelete
176#define nrnSize nrzSize
588 else if (r->is_field)
608 WerrorS(
"Division not possible, even by cancelling zero divisors.");
749#if SI_INTEGER_VARIANT==3
760#elif SI_INTEGER_VARIANT==2
771#elif SI_INTEGER_VARIANT==1
815 && (src->modExponent ==
dst->modExponent))
return ndCopyMap;
919 Warn(
"mod-n: out of range at %s:%d\n",
f,
l);
931 const char * start=
s;
932 if (!(*
s >=
'0' && *
s <=
'9'))
938 while (*
s >=
'0' && *
s <=
'9')
s++;
1051#if SI_INTEGER_VARIANT==2
1059 if ((r->modExponent==1)&&(
mpz_size1(r->modBase)==1))
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE BOOLEAN nCoeff_is_Z(const coeffs r)
number ndCopyMap(number a, const coeffs src, const coeffs dst)
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_PtoM(const coeffs r)
@ n_Znm
only used if HAVE_RINGS is defined
@ n_Zn
only used if HAVE_RINGS is defined
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
static FORCE_INLINE BOOLEAN nCoeff_is_Zn(const coeffs r)
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_2toM(const coeffs r)
@ n_rep_gap_rat
(number), see longrat.h
@ n_rep_gap_gmp
(), see rinteger.h, new impl.
@ n_rep_gmp
(mpz_ptr), see rmodulon,h
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
void WerrorS(const char *s)
void mpz_mul_si(mpz_ptr r, mpz_srcptr s, long int si)
void nlMPZ(mpz_t m, number &n, const coeffs r)
void rem(unsigned long *a, unsigned long *q, unsigned long p, int °a, int degq)
#define FACTORY_MAX_PRIME
The main handler for Singular numbers which are suitable for Singular polynomials.
char * nEati(char *s, int *i, int m)
divide by the first (leading) number and return it, i.e. make monic
char * nEatLong(char *s, mpz_ptr i)
extracts a long integer from s, returns the rest
const char *const nDivBy0
#define omFreeSize(addr, size)
#define omFreeBin(addr, bin)
void StringSetS(const char *st)
void StringAppendS(const char *st)
void PrintS(const char *s)
number nrzReadFd(const ssiInfo *d, const coeffs)
void nrzWriteFd(number n, const ssiInfo *d, const coeffs)
static number nrnMap2toM(number from, const coeffs, const coeffs dst)
static coeffs nrnQuot1(number c, const coeffs r)
static number nrnInit(long i, const coeffs r)
static const char * nlCPEatLongC(char *s, mpz_ptr i)
STATIC_VAR char * nrnCoeffName_buff
static BOOLEAN nrnDBTest(number a, const char *f, const int l, const coeffs r)
static void nrnKillChar(coeffs r)
static BOOLEAN nrnGreater(number a, number b, const coeffs)
STATIC_VAR mpz_ptr nrnMapCoef
static BOOLEAN nrnIsZero(number a, const coeffs)
static CanonicalForm nrnConvSingNFactoryN(number n, BOOLEAN setChar, const coeffs r)
static number nrnExtGcd(number a, number b, number *s, number *t, const coeffs r)
static void nrnMPZ(mpz_t m, number &n, const coeffs)
static BOOLEAN nrnCoeffIsEqual(const coeffs r, n_coeffType n, void *parameter)
static void nrnInpMult(number &a, number b, const coeffs r)
void nrnWrite(number a, const coeffs)
static number nrnMod(number a, number b, const coeffs r)
coeffs nrnInitCfByName(char *s, n_coeffType)
static number nrnMapZ(number from, const coeffs src, const coeffs dst)
static number nrnInitMPZ(mpz_t m, const coeffs r)
static void nrnInitExp(unsigned long m, coeffs r)
static number nrnAnn(number k, const coeffs r)
static BOOLEAN nrnIsUnit(number a, const coeffs r)
nMapFunc nrnSetMap(const coeffs src, const coeffs dst)
static number nrnMapZp(number from, const coeffs, const coeffs dst)
static number nrnInvers(number c, const coeffs r)
static number nrnConvFactoryNSingN(const CanonicalForm n, const coeffs r)
static void nrnSetExp(unsigned long m, coeffs r)
static int nrnDivComp(number a, number b, const coeffs r)
static const char * nrnRead(const char *s, number *a, const coeffs r)
static number nrnXExtGcd(number a, number b, number *s, number *t, number *u, number *v, const coeffs r)
static BOOLEAN nrnEqual(number a, number b, const coeffs)
static number nrnQuotRem(number a, number b, number *rem, const coeffs r)
static long nrnInt(number &n, const coeffs)
static number nrnMapQ(number from, const coeffs src, const coeffs dst)
EXTERN_VAR omBin gmp_nrz_bin
static BOOLEAN nrnIsOne(number a, const coeffs)
static number nrnCopy(number a, const coeffs)
static number nrnSub(number a, number b, const coeffs r)
static number nrnLcm(number a, number b, const coeffs r)
static number nrnMapModN(number from, const coeffs, const coeffs dst)
static void nrnPower(number a, int i, number *result, const coeffs r)
static number nrnMult(number a, number b, const coeffs r)
static number nrnNeg(number c, const coeffs r)
static number nrnGetUnit(number k, const coeffs r)
number nrnMapGMP(number from, const coeffs, const coeffs dst)
static char * nrnCoeffName(const coeffs r)
static number nrnDiv(number a, number b, const coeffs r)
static BOOLEAN nrnIsMOne(number a, const coeffs r)
static BOOLEAN nrnDivBy(number a, number b, const coeffs r)
static BOOLEAN nrnGreaterZero(number k, const coeffs cf)
BOOLEAN nrnInitChar(coeffs r, void *p)
static number nrnAdd(number a, number b, const coeffs r)
static number nrnGcd(number a, number b, const coeffs r)
static void nrnInpAdd(number &a, number b, const coeffs r)