My Project
Toggle main menu visibility
Loading...
Searching...
No Matches
libpolys
polys
templates
pp_Mult_mm_Noether__T.cc
Go to the documentation of this file.
1
/****************************************
2
* Computer Algebra System SINGULAR *
3
****************************************/
4
/***************************************************************
5
* File: pp_Mult_mm__Template.cc
6
* Purpose: template for p_Mult_n
7
* Author: obachman (Olaf Bachmann)
8
* Created: 8/00
9
*******************************************************************/
10
11
/***************************************************************
12
*
13
* Returns: p*m, ll
14
* ll == pLength(p*m) , if on input ll < 0
15
* pLength(p) - pLength(p*m), if on input ll >= 0
16
* Const: p, m
17
*
18
***************************************************************/
19
LINKAGE
poly
pp_Mult_mm_Noether__T
(poly
p
,
const
poly
m
,
const
poly spNoether,
int
&ll,
const
ring ri)
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
}
85
86
l
int l
Definition
cfEzgcd.cc:100
m
int m
Definition
cfEzgcd.cc:128
p
int p
Definition
cfModGcd.cc:4086
length
static BOOLEAN length(leftv result, leftv arg)
Definition
interval.cc:257
assume
#define assume(x)
Definition
mod2.h:389
LINKAGE
#define LINKAGE
Definition
mod2.h:140
p_FreeBinAddr
#define p_FreeBinAddr(p, r)
Definition
monomials.h:217
p_GetComp
#define p_GetComp(p, r)
Definition
monomials.h:64
spolyrec::exp
unsigned long exp[1]
Definition
monomials.h:26
pIter
#define pIter(p)
Definition
monomials.h:37
pNext
#define pNext(p)
Definition
monomials.h:36
pAssume1
#define pAssume1(cond)
Definition
monomials.h:171
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
n_Delete__T
#define n_Delete__T(n, r)
Definition
p_polys.cc:5055
pLength
static int pLength(poly a)
Definition
p_polys.h:190
p_MaxComp
static long p_MaxComp(poly p, ring lmRing, ring tailRing)
Definition
p_polys.h:294
p_LmTest
#define p_LmTest(p, r)
Definition
p_polys.h:162
p_Test
#define p_Test(p, r)
Definition
p_polys.h:161
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
pp_Mult_mm_Noether__T.cc:19
Generated on
for My Project by
doxygen 1.17.0
for
Singular