12#include "factory/factory.h"
101 poly q,
const int lq,
102 const int copy,
const ring r)
127 if (rn ==
NULL)
goto Smaller;
157 if (qq ==
NULL)
goto Finish;
244 if (rn ==
NULL)
goto Smaller;
268 if (qq ==
NULL)
goto Finish;
304#define MIN_LENGTH_FACTORY 200
305#define MIN_LENGTH_FACTORY_QQ 60
306#define MIN_FLINT_QQ 10
307#define MIN_FLINT_Zp 20
308#define MIN_FLINT_Z 10
337 #if __FLINT_RELEASE >= 20503
340 fmpq_mpoly_ctx_t ctx;
341 if (pure_polys &&
rField_is_Q(r) && !convSingRFlintR(ctx,r))
344 poly
res=Flint_Mult_MP(
p,
lq,q,
lq,ctx,r);
355 nmod_mpoly_ctx_t ctx;
356 if (pure_polys &&
rField_is_Zp(r) && !convSingRFlintR(ctx,r))
359 poly
res=Flint_Mult_MP(
p,
lq,q,
lq,ctx,r);
370 fmpz_mpoly_ctx_t ctx;
371 if (pure_polys &&
rField_is_Z(r) && !convSingRFlintR(ctx,r))
374 poly
res=Flint_Mult_MP(
p,
lq,q,
lq,ctx,r);
388 && ((r->cf->extRing==
NULL)||(r->cf->extRing->qideal!=
NULL))
poly singclap_pmult(poly f, poly g, const ring r)
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
static FORCE_INLINE BOOLEAN nCoeff_is_Domain(const coeffs r)
returns TRUE, if r is a field or r has no zero divisors (i.e is a domain)
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
CFArray copy(const CFList &list)
write elements of list into an array
static int min(int a, int b)
static BOOLEAN Equal(number a, number b, const coeffs)
This file is work in progress and currently not part of the official Singular.
static bool Greater(mono_type m1, mono_type m2)
void kBucketClear(kBucket_pt bucket, poly *p, int *length)
void kBucketDestroy(kBucket_pt *bucket_pt)
void kBucketInit(kBucket_pt bucket, poly lm, int length)
poly kBucketExtractLm(kBucket_pt bucket)
kBucket_pt kBucketCreate(const ring bucket_ring)
Creation/Destruction of buckets.
void kBucket_Plus_mm_Mult_pp(kBucket_pt bucket, poly m, poly p, int l)
Bpoly == Bpoly + m*p; where m is a monom Does not destroy p and m assume (l <= 0 || pLength(p) == l)
void kBucketSetLm(kBucket_pt bucket, poly lm)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
CanonicalForm ndConvSingNFactoryN(number, BOOLEAN, const coeffs)
#define TEST_OPT_NOT_BUCKETS
static void pqLengthApprox(poly p, poly q, int &lp, int &lq, const int min)
#define MIN_LENGTH_FACTORY
poly _p_Mult_q(poly p, poly q, const int copy, const ring r)
Returns: p * q, Destroys: if !copy then p, q Assumes: pLength(p) >= 2 pLength(q) >=2,...
BOOLEAN pqLength(poly p, poly q, int &lp, int &lq, const int min)
return TRUE and lp == pLength(p), lq == pLength(q), if min(pLength(p), pLength(q)) >= min FALSE if mi...
static poly _p_Mult_q_Normal(poly p, poly q, const int copy, const ring r)
#define MIN_LENGTH_FACTORY_QQ
static poly _p_Mult_q_Bucket(poly p, const int lp, poly q, const int lq, const int copy, const ring r)
static poly _p_Mult_q_Normal_ZeroDiv(poly p, poly q, const int copy, const ring r)
#define MIN_LENGTH_BUCKET
static int pLength(poly a)
static poly pp_Mult_mm(poly p, poly m, const ring r)
#define p_LmCmpAction(p, q, r, actionE, actionG, actionS)
static void p_Delete(poly *p, const ring r)
static poly p_LmFreeAndNext(poly p, ring)
static void p_LmFree(poly p, ring)
static poly p_Plus_mm_Mult_qq(poly p, poly m, poly q, int &lp, int lq, const ring r)
BOOLEAN pHaveCommonMonoms(poly p, poly q)
static BOOLEAN rField_is_Z(const ring r)
static BOOLEAN rField_is_Zp(const ring r)
static BOOLEAN rField_is_Domain(const ring r)
static BOOLEAN rField_is_Q(const ring r)
#define rField_is_Ring(R)