My Project
Functions
pp_Mult_Coeff_mm_DivSelectMult__T.cc File Reference

Go to the source code of this file.

Functions

LINKAGE poly pp_Mult_Coeff_mm_DivSelectMult__T (poly p, const poly m, const poly a, const poly b, int &shorter, const ring r)
 

Function Documentation

◆ pp_Mult_Coeff_mm_DivSelectMult__T()

LINKAGE poly pp_Mult_Coeff_mm_DivSelectMult__T ( poly  p,
const poly  m,
const poly  a,
const poly  b,
int &  shorter,
const ring  r 
)

Definition at line 20 of file pp_Mult_Coeff_mm_DivSelectMult__T.cc.

21{
22 assume(rOrd_is_Comp_dp(r) && r->ExpL_Size > 2);
23 p_Test(p, r);
24 if (p == NULL) return NULL;
25 number n = pGetCoeff(m);
26 number nc;
27 pAssume(!n_IsZero__T(n,r->cf));
28
29 spolyrec rp;
30 omBin bin = r->PolyBin;
31 const unsigned long bitmask = r->divmask;
32 const unsigned long* m_e = &(m->exp[2]);
33 DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
34 DECLARE_LENGTH_2(const unsigned long length_2 = length - 2);
35
36 poly ab;
37 p_AllocBin(ab, bin, r);
38 unsigned long* ab_e = &(ab->exp[0]);
39
40 p_MemDiff__T(ab_e, ((unsigned long*) &(a->exp[0])), ((unsigned long*) &(b->exp[0])),
41 length);
42
43 int Shorter = 0;
44 poly q = &rp;
45
46 do
47 {
48 p_MemCmp_Bitmask_2(m_e, &(p->exp[2]), bitmask, length_2,
49 goto Divisible, goto NotDivisible);
50
51 NotDivisible:
53 Shorter++;
54 goto Iter;
55
56 Divisible:
58 p_AllocBin(pNext(q), bin, r);
59 q = pNext(q);
60 nc = pGetCoeff(p);
61 pSetCoeff0(q, n_Mult__T(n, nc, r->cf));
62 p_MemSum__T(q->exp, p->exp, ab_e, length);
63
64 Iter:
65 pIter(p);
66 }
67 while (p != NULL);
68
69 pNext(q) = NULL;
70 p_FreeBinAddr(ab, r);
71
72 shorter = Shorter;
73 p_Test(rp.next, r);
74 return rp.next;
75}
int m
Definition: cfEzgcd.cc:128
int p
Definition: cfModGcd.cc:4078
CanonicalForm b
Definition: cfModGcd.cc:4103
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:257
#define assume(x)
Definition: mod2.h:389
#define p_FreeBinAddr(p, r)
Definition: monomials.h:255
poly next
Definition: monomials.h:24
#define pIter(p)
Definition: monomials.h:37
#define pNext(p)
Definition: monomials.h:36
#define pSetCoeff0(p, n)
Definition: monomials.h:59
#define p_AllocBin(p, bin, r)
Definition: monomials.h:248
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:44
#define pAssume(cond)
Definition: monomials.h:90
#define NULL
Definition: omList.c:12
omBin_t * omBin
Definition: omStructs.h:12
static BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, const ring r)
Definition: p_polys.h:1875
#define p_Test(p, r)
Definition: p_polys.h:159
static BOOLEAN rOrd_is_Comp_dp(const ring r)
Definition: ring.h:772