source: git/libpolys/polys/templates/p_Copy__T.cc @ 975db18

spielwiese
Last change on this file since 975db18 was 38500a, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
- further template fix: added "__T" suffix to _all_ labels (incl. func. names!) - todo: finish p_Numbers.h
  • Property mode set to 100644
File size: 1003 bytes
Line 
1/****************************************
2*  Computer Algebra System SINGULAR     *
3****************************************/
4/***************************************************************
5 *  File:    p_Copy__Template.cc
6 *  Purpose: template for p_Copy__T
7 *  Author:  obachman (Olaf Bachmann)
8 *  Created: 8/00
9 *  Version: $Id$
10 *******************************************************************/
11
12LINKAGE poly p_Copy__T(poly s_p, const ring r)
13{
14  // let's not do tests here -- but instead allow
15  // to be sloppy
16  spolyrec dp;
17  poly d_p = &dp;
18  omBin bin = r->PolyBin;
19  poly h;
20
21  DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
22
23  while (s_p != NULL)
24  {
25    p_AllocBin(pNext(d_p), bin, r);
26    pIter(d_p);
27    pSetCoeff0(d_p, n_Copy__T(pGetCoeff(s_p), r));
28    // it is better to iter here,
29    // for MemCopy advances goes from low to high addresses
30    h = s_p;
31    s_p = pNext(s_p);
32    p_MemCopy__T(d_p->exp, h->exp, length);
33  }
34  pNext(d_p) = NULL;
35
36  return dp.next;
37}
38
Note: See TracBrowser for help on using the repository browser.