My Project
pShallowCopyDelete.cc
Go to the documentation of this file.
1/****************************************
2* Computer Algebra System SINGULAR *
3****************************************/
4/***************************************************************
5 * File: pShallowCopyDelete.cc
6 * Purpose: implementation of pShallowCopyDelete routines
7 * Author: obachman (Olaf Bachmann)
8 * Created: 8/00
9 *******************************************************************/
10
11#include "misc/auxiliary.h"
12
13#include "pShallowCopyDelete.h"
14
15// a simple implementations
16poly pShallowCopyDelete_General(poly s_p, ring s_r, ring d_r, omBin d_bin)
17{
18 p_CheckPolyRing(s_p, s_r);
19 p_CheckRing(d_r);
20 assume(d_bin != NULL);
21 assume(d_bin == d_r->PolyBin || omSizeWOfBin(d_bin) == omSizeWOfBin(d_r->PolyBin));
22 assume(s_r->N == d_r->N);
23
24 spolyrec dp;
25 poly d_p = &dp;
26 int N = d_r->N;
27 int i;
28
29
30 while (s_p != NULL)
31 {
32 d_p->next = p_Init(d_r, d_bin);
33 pIter(d_p);
34
35 pSetCoeff0(d_p, pGetCoeff(s_p));
36 for (i=1; i<= N; i++)
37 p_SetExp(d_p, i, p_GetExp(s_p, i, s_r), d_r);
38
39 if (rRing_has_Comp(d_r))
40 p_SetComp(d_p, p_GetComp(s_p, s_r), d_r);
41 p_Setm(d_p, d_r);
42
43 s_p = p_LmFreeAndNext(s_p, s_r);
44 }
45 pNext(d_p) = NULL;
46
47 return dp.next;
48}
49
50pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring /*source_r*/, ring /*dest_r*/)
51{
53}
All the auxiliary stuff.
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:56
int i
Definition: cfEzgcd.cc:132
#define assume(x)
Definition: mod2.h:389
#define p_GetComp(p, r)
Definition: monomials.h:64
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
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 rRing_has_Comp(r)
Definition: monomials.h:266
#define omSizeWOfBin(bin_ptr)
#define NULL
Definition: omList.c:12
omBin_t * omBin
Definition: omStructs.h:12
poly pShallowCopyDelete_General(poly s_p, ring s_r, ring d_r, omBin d_bin)
pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring, ring)
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition: p_polys.h:486
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition: p_polys.h:245
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:231
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition: p_polys.h:467
BOOLEAN p_CheckRing(ring r)
Definition: pDebug.cc:128
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition: pDebug.cc:112
static poly p_LmFreeAndNext(poly p, ring)
Definition: p_polys.h:709
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1318
poly(* pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r, omBin dest_bin)
returns a poly from dest_r which is a ShallowCopy of s_p from source_r assumes that source_r->N == de...
Definition: ring.h:44