source: git/polys/p_ShallowCopyDelete__T.cc @ a98f56

spielwiese
Last change on this file since a98f56 was a98f56, checked in by Hans Schoenemann <hannes@…>, 14 years ago
selection of operations on polys
  • Property mode set to 100644
File size: 1.0 KB
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/***************************************************************
5 *  File:    p_ShallowCopyDelete__Template.cc
6 *  Purpose: template for p_ShallowCopyDelete
7 *  Author:  obachman (Olaf Bachmann)
8 *  Created: 8/00
9 *  Version: $Id$
10 *******************************************************************/
11
12/***************************************************************
13 *
14 * Destroys: p
15 * Assumes:  Monoms of p are from
16 * Returns:
17 ***************************************************************/
18LINKAGE poly p_ShallowCopyDelete(poly s_p, const ring r, omBin d_bin)
19{
20  spolyrec dp;
21  poly d_p = &dp;
22  poly h;
23
24  DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
25
26  while (s_p != NULL)
27  {
28    p_AllocBin(d_p->next, d_bin, r);
29    pIter(d_p);
30    pSetCoeff0(d_p, pGetCoeff(s_p));
31    h = s_p;
32    s_p =  pNext(s_p);
33    p_MemCopy(d_p->exp, h->exp, length);
34    p_FreeBinAddr(h, r);
35  }
36  pNext(d_p) = NULL;
37  return dp.next;
38}
39
Note: See TracBrowser for help on using the repository browser.