My Project
Loading...
Searching...
No Matches
Functions
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:4078
#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:159
#define PR_SORT_POLY(p, d_r, s_r)
Definition: prCopyMacros.h:50
#define PR_ALLOC_MONOM(r)
Definition: prCopyMacros.h:30
#define PR_CPY_EVECTOR(dest, dest_r, src, src_r)
Definition: prCopyMacros.h:28
#define PR_NCOPY(n, r)
Definition: prCopyMacros.h:41
#define PR_INIT_EVECTOR_COPY(r_src, r_dest)
Definition: prCopyMacros.h:27
#define PR_DELETE_MONOM(src, r_src)
Definition: prCopyMacros.h:11