My Project
Loading...
Searching...
No Matches
p_ShallowCopyDelete__T.cc
Go to the documentation of this file.
1/****************************************
2* Computer Algebra System SINGULAR *
3****************************************/
4/***************************************************************
5 * File: p_ShallowCopyDelete__Template.cc
6 * Purpose: template for p_ShallowCopyDelete
7 * Author: obachman (Olaf Bachmann)
8 * Created: 8/00
9 *******************************************************************/
10
11/***************************************************************
12 *
13 * Destroys: p
14 * Assumes: Monoms of p are from
15 * Returns:
16 ***************************************************************/
17LINKAGE poly p_ShallowCopyDelete__T(poly s_p, const ring r, omBin d_bin)
18{
19 spolyrec dp;
20 poly d_p = &dp;
21 poly h;
22
23 DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
24
25 while (s_p != NULL)
26 {
27 p_AllocBin(d_p->next, d_bin, r);
28 pIter(d_p);
29 pSetCoeff0(d_p, pGetCoeff(s_p));
30 h = s_p;
31 s_p = pNext(s_p);
32 p_MemCopy__T(d_p->exp, h->exp, length);
33 p_FreeBinAddr(h, r);
34 }
35 pNext(d_p) = NULL;
36 return dp.next;
37}
38
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:257
STATIC_VAR Poly * h
Definition: janet.cc:971
#define LINKAGE
Definition: mod2.h:140
#define p_FreeBinAddr(p, r)
Definition: monomials.h:255
poly next
Definition: monomials.h:24
#define pIter(p)
Definition: monomials.h:37
#define pNext(p)
Definition: monomials.h:36
#define pSetCoeff0(p, n)
Definition: monomials.h:59
#define p_AllocBin(p, bin, r)
Definition: monomials.h:248
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
#define NULL
Definition: omList.c:12
omBin_t * omBin
Definition: omStructs.h:12
LINKAGE poly p_ShallowCopyDelete__T(poly s_p, const ring r, omBin d_bin)