source: git/libpolys/polys/operations/pShallowCopyDelete.cc @ 975db18

spielwiese
Last change on this file since 975db18 was aa2b525, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
ADD/FIX: use omSizeWOfBin(bin_ptr) instead of ((bin_ptr)->sizeW) (due to xalloc)
  • 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 "config.h"
12#include "pShallowCopyDelete.h"
13
14// a simple implementations
15poly pShallowCopyDelete_General(poly s_p, ring s_r, ring d_r, omBin d_bin)
16{
17  p_CheckPolyRing(s_p, s_r);
18  p_CheckRing(d_r);
19  assume(d_bin != NULL);
20  assume(d_bin == d_r->PolyBin || omSizeWOfBin(d_bin) == omSizeWOfBin(d_r->PolyBin));
21  assume(s_r->N == d_r->N);
22
23  spolyrec dp;
24  poly d_p = &dp;
25  int N = d_r->N;
26  int i;
27
28
29  while (s_p != NULL)
30  {
31    d_p->next = p_Init(d_r, d_bin);
32    pIter(d_p);
33
34    pSetCoeff0(d_p, pGetCoeff(s_p));
35    for (i=1; i<= N; i++)
36      p_SetExp(d_p, i, p_GetExp(s_p, i, s_r), d_r);
37
38    if (rRing_has_Comp(d_r))
39      p_SetComp(d_p, p_GetComp(s_p, s_r), d_r);
40    p_Setm(d_p, d_r);
41
42    s_p = p_LmFreeAndNext(s_p, s_r);
43  }
44  pNext(d_p) = NULL;
45
46  return dp.next;
47}
48
49pShallowCopyDeleteProc pGetShallowCopyDeleteProc(ring source_r, ring dest_r)
50{
51  return pShallowCopyDelete_General;
52}
Note: See TracBrowser for help on using the repository browser.