My Project  UNKNOWN_GIT_VERSION
Functions
p_Copy__T.cc File Reference

Go to the source code of this file.

Functions

LINKAGE poly p_Copy__T (poly s_p, const ring r)
 

Function Documentation

◆ p_Copy__T()

LINKAGE poly p_Copy__T ( poly  s_p,
const ring  r 
)

Definition at line 9 of file p_Copy__T.cc.

12 {
13  // let's not do tests here -- but instead allow
14  // to be sloppy
15  spolyrec dp;
16  poly d_p = &dp;
17  omBin bin = r->PolyBin;
18  poly h;
19 
20  DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
21 
22  while (s_p != NULL)
23  {
24  p_AllocBin(pNext(d_p), bin, r);
25  pIter(d_p);
26  number n_p=pGetCoeff(s_p);
27  if (n_p!=NULL) n_p=n_Copy(n_p,r->cf);
28  pSetCoeff0(d_p, n_p);
29  // it is better to iter here,
30  // for MemCopy advances goes from low to high addresses
31  h = s_p;
32  s_p = pNext(s_p);
33  p_MemCopy__T(d_p->exp, h->exp, length);
34  }
35  pNext(d_p) = NULL;
36 
length
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
h
static Poly * h
Definition: janet.cc:972
pIter
#define pIter(p)
Definition: monomials.h:35
spolyrec
Definition: monomials.h:21
omBin
omBin_t * omBin
Definition: omStructs.h:11
pSetCoeff0
#define pSetCoeff0(p, n)
Definition: monomials.h:57
n_Copy
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:450
NULL
#define NULL
Definition: omList.c:9
p_AllocBin
#define p_AllocBin(p, bin, r)
Definition: monomials.h:242
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:42
pNext
#define pNext(p)
Definition: monomials.h:34