My Project
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()

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

Definition at line 9 of file prCopyTemplate.cc.

11{
12 if (src==NULL) return NULL;
13
14 /* PrintS("src: "); p_Write(src, r_src); PrintLn(); */
15
16 // p_Test(src, r_src); // may fail due to wrong monomial order
17 spolyrec dest_s;
18
19 poly dest = &dest_s;
20 PR_INIT_EVECTOR_COPY(r_src, r_dest);
21
22 poly p = src; src = NULL;
23 while (p != NULL)
24 {
25 pNext(dest) = (poly) PR_ALLOC_MONOM(r_dest); pIter(dest);
26
27 p_SetCoeff0(dest, PR_NCOPY(p_GetCoeff(p, r_src), r_src), r_dest);
28 PR_CPY_EVECTOR(dest, r_dest, p, r_src);
29
30 { poly tmp = pNext(p); PR_DELETE_MONOM(p, r_src); p = tmp; }
31 }
32 pNext(dest) = NULL;
33 dest = pNext(&dest_s);
34 PR_SORT_POLY(dest, r_dest, r_src);
35 p_Test(dest, r_dest);
36 return dest;
37}
int p
Definition cfModGcd.cc:4086
#define p_SetCoeff0(p, n, r)
Definition monomials.h:60
#define pIter(p)
Definition monomials.h:37
#define pNext(p)
Definition monomials.h:36
#define p_GetCoeff(p, r)
Definition monomials.h:50
#define NULL
Definition omList.c:12
#define p_Test(p, r)
Definition p_polys.h:161
#define PR_SORT_POLY(p, d_r, s_r)
#define PR_ALLOC_MONOM(r)
#define PR_CPY_EVECTOR(dest, dest_r, src, src_r)
#define PR_NCOPY(n, r)
#define PR_INIT_EVECTOR_COPY(r_src, r_dest)
#define PR_DELETE_MONOM(src, r_src)