source: git/libpolys/polys/operations/pShallowCopyDelete.cc @ ba5e9e

spielwiese
Last change on this file since ba5e9e was ba5e9e, checked in by Oleksandr Motsak <motsak@…>, 11 years ago
Changed configure-scripts to generate individual public config files for each package: resources, libpolys, singular (main) fix: sources should include correct corresponding config headers.
  • 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 *******************************************************************/
10#ifdef HAVE_CONFIG_H
11#include "libpolysconfig.h"
12#endif /* HAVE_CONFIG_H */
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{
52  return pShallowCopyDelete_General;
53}
Note: See TracBrowser for help on using the repository browser.