My Project
Loading...
Searching...
No Matches
Functions
p_Mult_mm__T.cc File Reference

Go to the source code of this file.

Functions

LINKAGE poly p_Mult_mm__T (poly p, const poly m, const ring ri)
 

Function Documentation

◆ p_Mult_mm__T()

LINKAGE poly p_Mult_mm__T ( poly  p,
const poly  m,
const ring  ri 
)

Definition at line 18 of file p_Mult_mm__T.cc.

19{
20 p_Test(p, ri);
21 p_LmTest(m, ri);
22 pAssume(m != NULL);
23 assume(p!=NULL);
24 poly q = p;
25 number ln = pGetCoeff(m);
26 number pn;
27 DECLARE_LENGTH(const unsigned long length = ri->ExpL_Size);
28 const unsigned long* m_e = m->exp;
29 pAssume(!n_IsZero__T(ln,ri->cf));
30
31#ifdef HAVE_ZERODIVISORS
32 poly before = p;
33#endif
34 while (p != NULL)
35 {
36 pn = pGetCoeff(p);
37 number tmp = n_Mult__T(ln, pn, ri->cf);
38#ifdef HAVE_ZERODIVISORS
39 if (n_IsZero__T(tmp, ri->cf))
40 {
41 n_Delete__T(&tmp, ri->cf);
42 if (before == p)
43 {
44 p = p_LmDeleteAndNext(p, ri);
45 before = p;
46 q = p;
47 }
48 else
49 {
50 p = p_LmDeleteAndNext(p, ri);
51 pNext(before) = p;
52 }
53 }
54 else
55#endif
56 {
57 pSetCoeff0(p, tmp);
58 n_Delete__T(&pn, ri->cf);
59 p_MemAdd__T(p->exp, m_e, length);
60 p_MemAddAdjust__T(p, ri);
61#ifdef HAVE_ZERODIVISORS
62 before = p;
63#endif
64 p = pNext(p);
65 }
66 }
67 p_Test(q, ri);
68 return q;
69}
int m
Definition: cfEzgcd.cc:128
int p
Definition: cfModGcd.cc:4078
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:257
#define assume(x)
Definition: mod2.h:389
#define pNext(p)
Definition: monomials.h:36
#define pSetCoeff0(p, n)
Definition: monomials.h:59
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
#define n_Delete__T(n, r)
Definition: p_polys.cc:4841
static poly p_LmDeleteAndNext(poly p, const ring r)
Definition: p_polys.h:753
#define p_LmTest(p, r)
Definition: p_polys.h:160
#define p_Test(p, r)
Definition: p_polys.h:159