# source:git/kernel/pShallowCopyDelete.cc@bc669c

fieker-DuValspielwiese
Last change on this file since bc669c was 341696, checked in by Hans Schönemann <hannes@…>, 15 years ago
• Property mode set to `100644`
File size: 1.3 KB
Line
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 *  Version: \$Id\$
10 *******************************************************************/
11#include "mod2.h"
12#include "p_polys.h"
13#include "ring.h"
14#include "pShallowCopyDelete.h"
15
16// a simple implementations
17poly pShallowCopyDelete_General(poly s_p, ring s_r, ring d_r, omBin d_bin)
18{
19  p_CheckPolyRing(s_p, s_r);
20  p_CheckRing(d_r);
21  assume(d_bin != NULL);
22  assume(d_bin == d_r->PolyBin || d_bin->sizeW == d_r->PolyBin->sizeW);
23  assume(s_r->N == d_r->N);
24
25  spolyrec dp;
26  poly d_p = &dp;
27  int N = d_r->N;
28  int i;
29
30
31  while (s_p != NULL)
32  {
33    d_p->next = p_Init(d_r, d_bin);
34    pIter(d_p);
35
36    pSetCoeff0(d_p, pGetCoeff(s_p));
37    for (i=1; i<= N; i++)
38      p_SetExp(d_p, i, p_GetExp(s_p, i, s_r), d_r);
39
40    if (rRing_has_Comp(d_r))
41      p_SetComp(d_p, p_GetComp(s_p, s_r), d_r);
42    p_Setm(d_p, d_r);
43
44    s_p = p_LmFreeAndNext(s_p, s_r);
45  }
46  pNext(d_p) = NULL;
47
48  return dp.next;
49}
50
51pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring source_r, ring dest_r)
52{
53  return pShallowCopyDelete_General;
54}
Note: See TracBrowser for help on using the repository browser.