15#if __FLINT_RELEASE >= 20500
64#if __FLINT_RELEASE > 20502
75 fmpq_get_mpz_frac(z->z,z->n,
f);
82 fmpq_get_mpz_frac(a,
b,
f);
102#if __FLINT_RELEASE > 20502
120#if __FLINT_RELEASE > 20502
121 if (fmpz_is_one(fmpq_denref(
f)))
123 if (fmpz_fits_si(fmpq_numref(
f)))
125 long i=fmpz_get_si(fmpq_numref(
f));
134 if (fmpz_is_one(fmpq_denref(
f)))
137 fmpz_get_mpz(z->z,fmpq_numref(
f));
143 fmpq_get_mpz_frac(z->z,z->n,
f);
162 fmpz_set_mpz(
f,(mpz_ptr)n);
174 fmpz_set_mpz(fmpq_numref(
f), n->z);
175 fmpz_set_mpz(fmpq_denref(
f), n->n);
180 mpz_init_set_si(one,1);
181 fmpz_set_mpz(fmpq_numref(
f), n->z);
182 fmpz_set_mpz(fmpq_denref(
f), one);
192 number nn=nMap(n,
cf,QQ);
206 fmpz_set_mpz(fmpq_numref(
f), n->z);
207 fmpz_set_mpz(fmpq_denref(
f), n->n);
212 mpz_init_set_si(one,1);
213 fmpz_set_mpz(fmpq_numref(
f), n->z);
214 fmpz_set_mpz(fmpq_denref(
f), one);
232 fmpq_poly_init2(
res,d+1);
233 _fmpq_poly_set_length (
res, d + 1);
248 fmpq_poly_init2(
res,d+1);
249 _fmpq_poly_set_length (
res, d + 1);
264 int d=fmpq_poly_length(
f);
268 for(
int i=0;
i<=d;
i++)
270 fmpq_poly_get_coeff_fmpq(c,
f,
i);
288 fmpz_mat_t
M, Transf;
289 fmpz_mat_init(
M, r, c);
292 fmpz_mat_init(Transf,
T->rows(),
T->rows());
304 fmpz_set(fmpz_mat_entry(
M,
i-1,
j-1), dummy);
310 for(
i=
T->rows();
i>0;
i--)
312 for(
j=
T->rows();
j>0;
j--)
317 fmpz_set(fmpz_mat_entry(Transf,
i-1,
j-1), dummy);
323 fmpz_lll_context_init_default(fl);
325 fmpz_lll(
M, Transf, fl);
327 fmpz_lll(
M,
NULL, fl);
340 for(
i=
T->rows();
i>0;
i--)
342 for(
j=
T->cols();
j>0;
j--)
360 fmpz_mat_init(
M, r, c);
362 fmpz_mat_init(Transf, r, r);
370 fmpz_set(fmpz_mat_entry(
M,
i-1,
j-1), dummy);
376 for(
i=
T->rows();
i>0;
i--)
378 for(
j=
T->rows();
j>0;
j--)
381 fmpz_set(fmpz_mat_entry(Transf,
i-1,
j-1), dummy);
387 fmpz_lll_context_init_default(fl);
389 fmpz_lll(
M, Transf, fl);
391 fmpz_lll(
M,
NULL, fl);
401 for(
i=Transf->r;
i>0;
i--)
403 for(
j=Transf->r;
j>0;
j--)
#define BIMATELEM(M, I, J)
Coefficient rings, fields and other domains suitable for Singular polynomials.
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
@ n_Q
rational (GMP) numbers
static FORCE_INLINE void n_MPZ(mpz_t result, number &n, const coeffs r)
conversion of n to a GMP integer; 0 if not possible
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
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...
static FORCE_INLINE number n_RePart(number i, const coeffs cf)
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
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 number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static FORCE_INLINE number n_ImPart(number i, const coeffs cf)
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
void nKillChar(coeffs r)
undo all initialisations
void WerrorS(const char *s)
This file is work in progress and currently not part of the official Singular.
void convSingPFlintP(fmpq_poly_t res, poly p, const ring r)
void convSingNFlintN(fmpz_t f, mpz_t z)
void convSingNFlintNN(fmpq_t re, fmpq_t im, number n, const coeffs cf)
void convSingIFlintI(fmpz_t f, int p)
void convSingNFlintN_QQ(fmpq_t f, number n)
void convFlintNSingN(mpz_t z, fmpz_t f)
poly convFlintPSingP(fmpq_poly_t f, const ring r)
void convSingImPFlintP(fmpq_poly_t res, poly p, const ring r)
int convFlintISingI(fmpz_t f)
number convFlintNSingN_QQ(fmpq_t f, const coeffs cf)
bigintmat * singflint_LLL(bigintmat *A, bigintmat *T)
#define IMATELEM(M, I, J)
void nlMPZ(mpz_t m, number &n, const coeffs r)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
The main handler for Singular numbers which are suitable for Singular polynomials.
static poly p_Add_q(poly p, poly q, const ring r)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
static void p_Setm(poly p, const ring r)
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
static poly p_Init(const ring r, omBin bin)