Loading...
Searching...
No Matches
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.

{
assume(rOrd_is_Comp_dp(r) && r->ExpL_Size > 2);
p_Test(p, r);
if (p == NULL) return NULL;
number n = pGetCoeff(m);
number nc;
pAssume(!n_IsZero__T(n,r->cf));
spolyrec rp;
omBin bin = r->PolyBin;
const unsigned long bitmask = r->divmask;
const unsigned long* m_e = &(m->exp[2]);
DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
DECLARE_LENGTH_2(const unsigned long length_2 = length - 2);
poly ab;
p_AllocBin(ab, bin, r);
unsigned long* ab_e = &(ab->exp[0]);
p_MemDiff__T(ab_e, ((unsigned long*) &(a->exp[0])), ((unsigned long*) &(b->exp[0])),
length);
int Shorter = 0;
poly q = &rp;
do
{
p_MemCmp_Bitmask_2(m_e, &(p->exp[2]), bitmask, length_2,
goto Divisible, goto NotDivisible);
NotDivisible:
pAssume(!p_LmDivisibleByNoComp(m, p, r));
Shorter++;
goto Iter;
Divisible:
pAssume(p_LmDivisibleByNoComp(m, p, r));
p_AllocBin(pNext(q), bin, r);
q = pNext(q);
nc = pGetCoeff(p);
pSetCoeff0(q, n_Mult__T(n, nc, r->cf));
p_MemSum__T(q->exp, p->exp, ab_e, length);
Iter:
pIter(p);
}
while (p != NULL);
pNext(q) = NULL;
p_FreeBinAddr(ab, r);
shorter = Shorter;
p_Test(rp.next, r);
return rp.next;
}
m
int m
Definition cfEzgcd.cc:128
p
int p
Definition cfModGcd.cc:4086
b
CanonicalForm b
Definition cfModGcd.cc:4111
length
static BOOLEAN length(leftv result, leftv arg)
Definition interval.cc:257
assume
#define assume(x)
Definition mod2.h:389
p_FreeBinAddr
#define p_FreeBinAddr(p, r)
Definition monomials.h:217
spolyrec::next
poly next
Definition monomials.h:24
pIter
#define pIter(p)
Definition monomials.h:37
pNext
#define pNext(p)
Definition monomials.h:36
pSetCoeff0
#define pSetCoeff0(p, n)
Definition monomials.h:59
p_AllocBin
#define p_AllocBin(p, bin, r)
Definition monomials.h:210
pGetCoeff
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
pAssume
#define pAssume(cond)
Definition monomials.h:90
spolyrec
Definition monomials.h:23
NULL
#define NULL
Definition omList.c:12
omBin
omBin_t * omBin
Definition omStructs.h:12
p_LmDivisibleByNoComp
static BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, const ring r)
Definition p_polys.h:1898
p_Test
#define p_Test(p, r)
Definition p_polys.h:161
rOrd_is_Comp_dp
static BOOLEAN rOrd_is_Comp_dp(const ring r)
Definition ring.h:784