Loading...
Searching...
No Matches
pp_Mult_nn__T.cc File Reference

Go to the source code of this file.

## Functions

LINKAGE poly | pp_Mult_nn__T (poly p, const number n, const ring r)

## Function Documentation

## pp_Mult_nn__T()

LINKAGE poly pp_Mult_nn__T | ( | poly | p,
|  | const number | n,
|  | const ring | r )

Definition at line 17 of file pp_Mult_nn__T.cc.

{
pAssume(!n_IsZero__T(n,r->cf));
p_Test(p, r);
if (p == NULL) return NULL;
spolyrec rp;
#ifdef HAVE_ZERODIVISORS
rp.next = NULL;
#endif
poly q = &rp;
omBin bin = r->PolyBin;
DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
do
{
#ifndef HAVE_ZERODIVISORS
p_AllocBin(pNext(q), bin, r);
pIter(q);
number nc = pGetCoeff(p);
pSetCoeff0(q, n_Mult__T(n, nc, r->cf));
p_MemCopy__T(q->exp, p->exp, length);
#else
number nc = pGetCoeff(p);
number tmp = n_Mult__T(n, nc, r->cf);
if (! n_IsZero__T(tmp,r->cf))
{
p_AllocBin(pNext(q), bin, r);
pIter(q);
pSetCoeff0(q, tmp);
p_MemCopy__T(q->exp, p->exp, length);
}
else
n_Delete__T(&tmp,r->cf);
#endif
pIter(p);
}
while (p != NULL);
pNext(q) = NULL;
p_Test(rp.next, r);
return rp.next;
}
p
int p
Definition cfModGcd.cc:4086
length
static BOOLEAN length(leftv result, leftv arg)
Definition interval.cc:257
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
n_Delete__T
#define n_Delete__T(n, r)
Definition p_polys.cc:5042
p_Test
#define p_Test(p, r)
Definition p_polys.h:161