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

Go to the source code of this file.

Functions

LINKAGE poly pp_Mult_mm_Noether__T (poly p, const poly m, const poly spNoether, int &ll, const ring ri)
 

Function Documentation

◆ pp_Mult_mm_Noether__T()

LINKAGE poly pp_Mult_mm_Noether__T ( poly  p,
const poly  m,
const poly  spNoether,
int &  ll,
const ring  ri 
)

Definition at line 19 of file pp_Mult_mm_Noether__T.cc.

20{
21 p_Test(p, ri);
22 p_LmTest(m, ri);
23 assume(spNoether != NULL);
24 if (p == NULL)
25 {
26 ll = 0;
27 return NULL;
28 }
29 spolyrec rp;
30 poly q = &rp, r;
31 number n;
32 const unsigned long *spNoether_exp = spNoether->exp;
33 number ln = pGetCoeff(m);
34 omBin bin = ri->PolyBin;
35 DECLARE_LENGTH(const unsigned long length = ri->ExpL_Size);
36 DECLARE_ORDSGN(const long* ordsgn = ri->ordsgn);
37 const unsigned long* m_e = m->exp;
38 pAssume(!n_IsZero__T(ln,ri->cf));
39 pAssume1(p_GetComp(m, ri) == 0 || p_MaxComp(p, ri) == 0);
40 int l = 0;
41
42 do
43 {
44 p_AllocBin(r, bin, ri);
45 p_MemSum__T(r->exp, p->exp, m_e, length);
46 p_MemAddAdjust__T(r, ri);
47
48 p_MemCmp__T(r->exp, spNoether_exp, length, ordsgn, goto Continue, goto Continue, goto Break);
49
50 Break:
51 p_FreeBinAddr(r, ri);
52 break;
53
54 Continue:
55
56 n = n_Mult__T(ln, pGetCoeff(p), ri->cf);
57
58 #ifdef HAVE_RINGS
59 if(n_IsZero__T(n, ri->cf))
60 {
61 n_Delete__T(&n, ri->cf);
62 p_FreeBinAddr(r, ri);
63 } else
64 #endif
65 {
66 l++;
67 q = pNext(q) = r;
68 pSetCoeff0(q, n);
69 }
70
71 pIter(p);
72
73 } while (p != NULL);
74
75 if (ll < 0)
76 ll = l;
77 else
78 ll = pLength(p);
79
80 pNext(q) = NULL;
81
82 p_Test(pNext(&rp), ri);
83 return pNext(&rp);
84}
int l
Definition: cfEzgcd.cc:100
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 p_FreeBinAddr(p, r)
Definition: monomials.h:255
#define p_GetComp(p, r)
Definition: monomials.h:64
unsigned long exp[1]
Definition: monomials.h:26
#define pIter(p)
Definition: monomials.h:37
#define pNext(p)
Definition: monomials.h:36
#define pAssume1(cond)
Definition: monomials.h:171
#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
#define n_Delete__T(n, r)
Definition: p_polys.cc:4841
static int pLength(poly a)
Definition: p_polys.h:188
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
Definition: p_polys.h:290
#define p_LmTest(p, r)
Definition: p_polys.h:160
#define p_Test(p, r)
Definition: p_polys.h:159