Loading...
Searching...
No Matches
p_Copy__T.cc
Go to the documentation of this file.
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/***************************************************************
* File: p_Copy__Template.cc
* Purpose: template for p_Copy__T
* Author: obachman (Olaf Bachmann)
* Created: 8/00
*******************************************************************/
LINKAGE poly p_Copy__T(poly s_p, const ring r)
{
// let's not do tests here -- but instead allow
// to be sloppy
spolyrec dp;
poly d_p = &dp;
omBin bin = r->PolyBin;
poly h;
DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
while (s_p != NULL)
{
p_AllocBin(pNext(d_p), bin, r);
pIter(d_p);
number n_p=pGetCoeff(s_p);
if (n_p!=NULL) n_p=n_Copy(n_p,r->cf);
pSetCoeff0(d_p, n_p);
// it is better to iter here,
// for MemCopy advances goes from low to high addresses
h = s_p;
s_p = pNext(s_p);
p_MemCopy__T(d_p->exp, h->exp, length);
}
pNext(d_p) = NULL;
return dp.next;
}
n_Copy
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition coeffs.h:457
length
static BOOLEAN length(leftv result, leftv arg)
Definition interval.cc:257
h
STATIC_VAR Poly * h
Definition janet.cc:971
LINKAGE
#define LINKAGE
Definition mod2.h:140
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
spolyrec
Definition monomials.h:23
NULL
#define NULL
Definition omList.c:12
omBin
omBin_t * omBin
Definition omStructs.h:12
p_Copy__T
LINKAGE poly p_Copy__T(poly s_p, const ring r)
Definition p_Copy__T.cc:11