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

Go to the source code of this file.

## Functions

static poly | PR_NAME (poly &src, const ring r_src, const ring r_dest)

## Function Documentation

## PR_NAME()

poly PR_NAME | ( | poly & | src,
|  | const ring | r_src,
|  | const ring | r_dest )

static

Definition at line 9 of file prCopyTemplate.cc.

{
if (src==NULL) return NULL;
/* PrintS("src: "); p_Write(src, r_src); PrintLn(); */
// p_Test(src, r_src); // may fail due to wrong monomial order
spolyrec dest_s;
poly dest = &dest_s;
PR_INIT_EVECTOR_COPY(r_src, r_dest);
poly p = src; src = NULL;
while (p != NULL)
{
pNext(dest) = (poly) PR_ALLOC_MONOM(r_dest); pIter(dest);
p_SetCoeff0(dest, PR_NCOPY(p_GetCoeff(p, r_src), r_src), r_dest);
PR_CPY_EVECTOR(dest, r_dest, p, r_src);
{ poly tmp = pNext(p); PR_DELETE_MONOM(p, r_src); p = tmp; }
}
pNext(dest) = NULL;
dest = pNext(&dest_s);
PR_SORT_POLY(dest, r_dest, r_src);
p_Test(dest, r_dest);
return dest;
}
p
int p
Definition cfModGcd.cc:4086
p_SetCoeff0
#define p_SetCoeff0(p, n, r)
Definition monomials.h:60
pIter
#define pIter(p)
Definition monomials.h:37
pNext
#define pNext(p)
Definition monomials.h:36
p_GetCoeff
#define p_GetCoeff(p, r)
Definition monomials.h:50
spolyrec
Definition monomials.h:23
NULL
#define NULL
Definition omList.c:12
p_Test
#define p_Test(p, r)
Definition p_polys.h:161
PR_SORT_POLY
#define PR_SORT_POLY(p, d_r, s_r)
Definition prCopyMacros.h:50
PR_ALLOC_MONOM
#define PR_ALLOC_MONOM(r)
Definition prCopyMacros.h:30
PR_CPY_EVECTOR
#define PR_CPY_EVECTOR(dest, dest_r, src, src_r)
Definition prCopyMacros.h:28
PR_NCOPY
#define PR_NCOPY(n, r)
Definition prCopyMacros.h:41
PR_INIT_EVECTOR_COPY
#define PR_INIT_EVECTOR_COPY(r_src, r_dest)
Definition prCopyMacros.h:27
PR_DELETE_MONOM
#define PR_DELETE_MONOM(src, r_src)
Definition prCopyMacros.h:11