14#include "flint/flint.h"
15#if __FLINT_RELEASE >= 20503
23#define TRANSEXT_PRIVATES
43 const char * start =
s;
45 while (*
s >=
'0' && *
s <=
'9')
s++;
102 if (
par->N != c->iNumberOfParameters)
return FALSE;
314 res->p=
n_Sub(
x->p,
y->p, ((data_ptr)c->data)->C);
436 res->p=
n_Add(
x->p,
y->p, ((data_ptr)c->data)->C);
524 res->p=
n_Div(
x->p,
y->p, ((data_ptr)c->data)->C);
612 fmpq_div(r,
x->num->content,
x->den->content);
633 fmpq_div(r,
x->num->content,
x->den->content);
816 for (
j = 0;
j < c->iNumberOfParameters;
j++)
1018 char *
s = (
char *)
st;
1051 strlen(c->pParameterNames[
j])) == 0)
1055 s +=
strlen(c->pParameterNames[
j]);
1095 n_Delete(&(
x->p),((data_ptr)c->data)->C);
1186 WerrorS(
"not a Euclidean ring: ExtGcd");
1288 WerrorS(
"not yet: ChineseRemainder");
1430 WerrorS(
"not yet: ConvFactoryNSingN");
1438 WerrorS(
"not yet: ConvSingNFactoryN");
1447 for(
int i=1;
i<c->iNumberOfParameters;
i++)
1459 const char start[] =
"flintQ(";
1469 while((*
p!=
',')&&(*
p!=
')')&&(*
p!=
'\0'))
p++;
1470 if (*
p==
',') {
p++;
N++;}
1471 else if (*
p==
')') {
p++;
N++;
break;}
1472 else if (*
p==
'\0') {
break;}
1480 while((*
p!=
',')&&(*
p!=
')')&&(*
p!=
'\0'))
p++;
1481 if ((*
p==
',')||(*
p=
')'))
1492 if (*
p==
'\0')
break;
1574 for(
int i=0;
i<
cf->iNumberOfParameters;
i++)
1593 cf->cfExactDiv =
Div;
1646 cf->iNumberOfParameters =
pp->N;
1648 for(
int i=0;
i<
pp->N;
i++)
1652 cf->pParameterNames = (
const char **)
pn;
1653 cf->has_simple_Inverse =
FALSE;
const CanonicalForm CFMap CFMap & N
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
static FORCE_INLINE number n_NormalizeHelper(number a, number b, const coeffs r)
assume that r is a quotient field (otherwise, return 1) for arguments (a1/a2,b1/b2) return (lcm(a1,...
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
number ndCopyMap(number a, const coeffs src, const coeffs dst)
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of 'a'; raise an error if 'a' is not invertible
static FORCE_INLINE number n_ExactDiv(number a, number b, const coeffs r)
assume that there is a canonical subring in cf and we know that division is possible for these a and ...
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of 'a' and 'b', i.e., a-b
static FORCE_INLINE BOOLEAN nCoeff_is_Q_or_BI(const coeffs r)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE number n_InitMPZ(mpz_t n, const coeffs r)
conversion of a GMP integer to number
static FORCE_INLINE BOOLEAN nCoeff_is_Zp(const coeffs r)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
@ n_rep_gap_rat
(number), see longrat.h
@ n_rep_gap_gmp
(), see rinteger.h, new impl.
static FORCE_INLINE number n_SubringGcd(number a, number b, const coeffs r)
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
static BOOLEAN gd(leftv res, leftv args)
const CanonicalForm int s
const CanonicalForm int const CFList const Variable & y
‘factory.h’ is the user interface to Factory.
void WerrorS(const char *s)
static number ExtGcd(number a, number b, number *s, number *t, const coeffs)
static void WriteShort(number a, const coeffs r)
static number Copy(number a, const coeffs)
static number ChineseRemainder(number *, number *, int, BOOLEAN, CFArray &, const coeffs)
static nMapFunc SetMap(const coeffs, const coeffs)
static number Farey(number, number, const coeffs)
static number GetDenom(number &n, const coeffs)
static const char * Read(const char *st, number *a, const coeffs r)
static BOOLEAN IsOne(number a, const coeffs)
static number ConvFactoryNSingN(const CanonicalForm, const coeffs)
static number InitMPZ(mpz_t i, const coeffs)
static int Size(number n, const coeffs)
static number Add(number a, number b, const coeffs)
static number Div(number a, number b, const coeffs)
static void WriteFd(number a, const ssiInfo *d, const coeffs)
static void Delete(number *a, const coeffs)
static number Parameter(const int, const coeffs)
static BOOLEAN DBTest(number, const char *, const int, const coeffs)
static void KillChar(coeffs cf)
static CanonicalForm ConvSingNFactoryN(number, BOOLEAN, const coeffs)
static number Init(long i, const coeffs)
static void MPZ(mpz_t result, number &n, const coeffs)
static number ReadFd(const ssiInfo *d, const coeffs)
static number ExactDiv(number a, number b, const coeffs)
static void Power(number a, int i, number *result, const coeffs)
static BOOLEAN IsMOne(number k, const coeffs)
static number Sub(number a, number b, const coeffs)
static number GetNumerator(number &n, const coeffs)
static BOOLEAN GreaterZero(number, const coeffs)
static BOOLEAN CoeffIsEqual(const coeffs r, n_coeffType n, void *)
static number Mult(number a, number b, const coeffs)
static number Invers(number a, const coeffs)
static number Lcm(number, number, const coeffs)
static int ParDeg(number x, const coeffs)
static BOOLEAN IsZero(number a, const coeffs)
static number Neg(number a, const coeffs)
static BOOLEAN Equal(number a, number b, const coeffs)
static long Int(number &n, const coeffs)
static char * nlEatLong(char *s, mpz_ptr i)
BOOLEAN flintQrat_InitChar(coeffs cf, void *infoStruct)
coeffs flintQratInitCfByName(char *s, n_coeffType n)
static number Init_bigint(number i, const coeffs dummy, const coeffs dst)
static bool Greater(mono_type m1, mono_type m2)
int dReportError(const char *fmt,...)
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
const char *const nDivBy0
#define omFreeSize(addr, size)
BOOLEAN p_EqualPolys(poly p1, poly p2, const ring r)
void p_Write(poly p, ring lmRing, ring tailRing)
void StringAppendS(const char *st)
void PrintS(const char *s)