Loading...
Searching...
No Matches
pShallowCopyDelete.cc
Go to the documentation of this file.
/****************************************
* Computer Algebra System SINGULAR *
****************************************/
/***************************************************************
* File: pShallowCopyDelete.cc
* Purpose: implementation of pShallowCopyDelete routines
* Author: obachman (Olaf Bachmann)
* Created: 8/00
*******************************************************************/
#include "misc/auxiliary.h"
#include "pShallowCopyDelete.h"
// a simple implementations
poly pShallowCopyDelete_General(poly s_p, ring s_r, ring d_r, omBin d_bin)
{
p_CheckPolyRing(s_p, s_r);
p_CheckRing(d_r);
assume(d_bin != NULL);
assume(d_bin == d_r->PolyBin || omSizeWOfBin(d_bin) == omSizeWOfBin(d_r->PolyBin));
assume(s_r->N == d_r->N);
spolyrec dp;
poly d_p = &dp;
int N = d_r->N;
int i;
while (s_p != NULL)
{
d_p->next = p_Init(d_r, d_bin);
pIter(d_p);
pSetCoeff0(d_p, pGetCoeff(s_p));
for (i=1; i<= N; i++)
p_SetExp(d_p, i, p_GetExp(s_p, i, s_r), d_r);
if (rRing_has_Comp(d_r))
p_SetComp(d_p, p_GetComp(s_p, s_r), d_r);
p_Setm(d_p, d_r);
s_p = p_LmFreeAndNext(s_p, s_r);
}
pNext(d_p) = NULL;
return dp.next;
}
pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring /*source_r*/, ring /*dest_r*/)
{
return pShallowCopyDelete_General;
}
auxiliary.h
All the auxiliary stuff.
N
const CanonicalForm CFMap CFMap & N
Definition cfEzgcd.cc:56
i
int i
Definition cfEzgcd.cc:132
assume
#define assume(x)
Definition mod2.h:389
p_GetComp
#define p_GetComp(p, r)
Definition monomials.h:64
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
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
rRing_has_Comp
#define rRing_has_Comp(r)
Definition monomials.h:266
spolyrec
Definition monomials.h:23
omSizeWOfBin
#define omSizeWOfBin(bin_ptr)
Definition omAllocPrivate.h:100
NULL
#define NULL
Definition omList.c:12
omBin
omBin_t * omBin
Definition omStructs.h:12
pShallowCopyDelete_General
poly pShallowCopyDelete_General(poly s_p, ring s_r, ring d_r, omBin d_bin)
Definition pShallowCopyDelete.cc:16
pGetShallowCopyDeleteProc
pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring, ring)
Definition pShallowCopyDelete.cc:50
pShallowCopyDelete.h
p_SetExp
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:490
p_SetComp
static unsigned long p_SetComp(poly p, unsigned long c, ring r)
Definition p_polys.h:249
p_Setm
static void p_Setm(poly p, const ring r)
Definition p_polys.h:235
p_GetExp
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:471
p_CheckRing
BOOLEAN p_CheckRing(ring r)
Definition pDebug.cc:131
p_CheckPolyRing
BOOLEAN p_CheckPolyRing(poly p, ring r)
Definition pDebug.cc:115
p_LmFreeAndNext
static poly p_LmFreeAndNext(poly p, ring)
Definition p_polys.h:713
p_Init
static poly p_Init(const ring r, omBin bin)
Definition p_polys.h:1341
pShallowCopyDeleteProc
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:45