60 lp =
l + 1 + pLength(
p);
101 poly q,
const int lq,
102 const int copy,
const ring r)
111 poly
res = pp_Mult_mm(
p,q,r);
113 poly qn = pp_Mult_mm(qq,
p,r);
127 if (rn ==
NULL)
goto Smaller;
145 pNext(rr) = pp_Mult_mm(
pp, qq, r);
157 if (qq ==
NULL)
goto Finish;
163 n = n_Add(n1, pGetCoeff(qn), r->cf);
164 n_Delete(&n1, r->cf);
165 if (n_IsZero(n, r->cf))
176 n_Delete(&pGetCoeff(qn),r->cf);
177 qn = p_LmFreeAndNext(qn, r);
202 poly
res = pp_Mult_mm(
p,q,r);
207 res = p_Plus_mm_Mult_qq(
res, qq,
p, r);
234 poly
res = pp_Mult_mm(
p,q,r);
236 poly qn = pp_Mult_mm(qq,
p,r);
244 if (rn ==
NULL)
goto Smaller;
261 pNext(rr) = pp_Mult_mm(
pp, qq, r);
264 pNext(rr) = p_Plus_mm_Mult_qq(rn, qq,
pp, r);
268 if (qq ==
NULL)
goto Finish;
274 n = n_Add(n1, pGetCoeff(qn), r->cf);
275 n_Delete(&n1, r->cf);
276 if (n_IsZero(n, r->cf))
279 rn = p_LmFreeAndNext(rn, r);
287 n_Delete(&pGetCoeff(qn),r->cf);
288 qn = p_LmFreeAndNext(qn, r);
301#define MIN_LENGTH_MAX 81
302#define MIN_FLINT_QQ 60
303#define MIN_FLINT_Zp 80
304#define MIN_FLINT_Z 60
317 #if __FLINT_RELEASE >= 20503
333 fmpq_mpoly_ctx_t ctx;
334 if (!convSingRFlintR(ctx,r))
337 poly
res=Flint_Mult_MP(
p,
lq,q,
lq,ctx,r);
348 nmod_mpoly_ctx_t ctx;
349 if (!convSingRFlintR(ctx,r))
352 poly
res=Flint_Mult_MP(
p,
lq,q,
lq,ctx,r);
363 fmpz_mpoly_ctx_t ctx;
364 if (!convSingRFlintR(ctx,r))
367 poly
res=Flint_Mult_MP(
p,
lq,q,
lq,ctx,r);
395 && ((r->cf->extRing==
NULL)||(r->cf->extRing->qideal!=
NULL))
397 && (
lq >= MIN_LENGTH_FACTORY)
poly singclap_pmult(poly f, poly g, const ring r)
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)
CFArray copy(const CFList &list)
write elements of list into an array
factory.h' is the user interface to Factory.
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)
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)
poly _p_Mult_q_Normal(poly p, poly q, const int copy, const ring r)
poly _p_Mult_q_Bucket(poly p, const int lp, poly q, const int lq, const int copy, const ring r)
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...
#define MIN_LENGTH_BUCKET
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,...
poly _p_Mult_q_Normal_ZeroDiv(poly p, poly q, const int copy, const ring r)
#define p_LmCmpAction(p, q, r, actionE, actionG, actionS)
BOOLEAN pHaveCommonMonoms(poly p, poly q)
#define rField_is_Ring(R)