Loading...
Searching...
No Matches
pp_Mult_Coeff_mm_DivSelect__T.cc
Go to the documentation of this file.
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/***************************************************************
* File: pp_Mult_Coeff_mm_DivSelect__Template.cc
* Purpose: template for pp_Mult_Coeff_mm__DivSelect
* Author: obachman (Olaf Bachmann)
* Created: 8/00
*******************************************************************/
/***************************************************************
*
* Returns: p*Coeff(m) for such monomials pm of p, for which
* m is divisible by pm
* Const: p, m
*
***************************************************************/
LINKAGE poly pp_Mult_Coeff_mm_DivSelect__T(poly p, const poly m, int &shorter,
const ring r)
{
number n = pGetCoeff(m);
pAssume(!n_IsZero__T(n,r->cf));
p_Test(p, r);
if (p == NULL) return NULL;
spolyrec rp;
DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
int Shorter = 0;
poly q = &rp;
omBin bin = r->PolyBin;
do
{
if (p_LmDivisibleByNoComp(m, p, r))
{
p_AllocBin(pNext(q), bin, r);
q = pNext(q);
number nc = pGetCoeff(p);
pSetCoeff0(q, n_Mult__T(n, nc, r->cf));
p_MemCopy__T(q->exp, p->exp, length);
}
else
{
Shorter++;
}
pIter(p);
}
while (p != NULL);
pNext(q) = NULL;
shorter = Shorter;
p_Test(rp.next, r);
return rp.next;
}
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
LINKAGE
#define LINKAGE
Definition mod2.h:140
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
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 pp_Mult_Coeff_mm_DivSelect__T.cc:18