My Project  UNKNOWN_GIT_VERSION
Functions
pp_Mult_Coeff_mm_DivSelect__T.cc File Reference

Go to the source code of this file.

Functions

LINKAGE poly pp_Mult_Coeff_mm_DivSelect__T (poly p, const poly m, int &shorter, const ring r)
 

Function Documentation

◆ pp_Mult_Coeff_mm_DivSelect__T()

LINKAGE poly pp_Mult_Coeff_mm_DivSelect__T ( poly  p,
const poly  m,
int &  shorter,
const ring  r 
)

Definition at line 18 of file pp_Mult_Coeff_mm_DivSelect__T.cc.

20 {
21  number n = pGetCoeff(m);
22  pAssume(!n_IsZero__T(n,r->cf));
23  p_Test(p, r);
24  if (p == NULL) return NULL;
25  spolyrec rp;
26  DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
27  int Shorter = 0;
28  poly q = &rp;
29  omBin bin = r->PolyBin;
30 
31  do
32  {
33  if (p_LmDivisibleByNoComp(m, p, r))
34  {
35  p_AllocBin(pNext(q), bin, r);
36  q = pNext(q);
37  number nc = pGetCoeff(p);
38  pSetCoeff0(q, n_Mult__T(n, nc, r->cf));
39  p_MemCopy__T(q->exp, p->exp, length);
40  }
41  else
42  {
43  Shorter++;
44  }
45  pIter(p);
46  }
47  while (p != NULL);
48  pNext(q) = NULL;
49 
50  shorter = Shorter;
51  p_Test(rp.next, r);
52  return rp.next;
53 }
int m
Definition: cfEzgcd.cc:121
int p
Definition: cfModGcd.cc:4019
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
poly next
Definition: monomials.h:25
#define pIter(p)
Definition: monomials.h:38
#define pNext(p)
Definition: monomials.h:37
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:45
#define pSetCoeff0(p, n)
Definition: monomials.h:60
#define p_AllocBin(p, bin, r)
Definition: monomials.h:249
#define pAssume(cond)
Definition: monomials.h:91
#define NULL
Definition: omList.c:10
omBin_t * omBin
Definition: omStructs.h:12
static BOOLEAN p_LmDivisibleByNoComp(poly a, poly b, const ring r)
Definition: p_polys.h:1807
#define p_Test(p, r)
Definition: p_polys.h:164