source: git/libpolys/polys/templates/p_Copy__T.cc @ 825fb7

fieker-DuValspielwiese
Last change on this file since 825fb7 was 6ce030f, checked in by Oleksandr Motsak <motsak@…>, 12 years ago
removal of the $Id$ svn tag from everywhere NOTE: the git SHA1 may be used instead (only on special places) NOTE: the libraries Singular/LIB/*.lib still contain the marker due to our current use of svn
  • Property mode set to 100644
File size: 985 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 *******************************************************************/
10
11LINKAGE poly p_Copy__T(poly s_p, const ring r)
12{
13  // let's not do tests here -- but instead allow
14  // to be sloppy
15  spolyrec dp;
16  poly d_p = &dp;
17  omBin bin = r->PolyBin;
18  poly h;
19
20  DECLARE_LENGTH(const unsigned long length = r->ExpL_Size);
21
22  while (s_p != NULL)
23  {
24    p_AllocBin(pNext(d_p), bin, r);
25    pIter(d_p);
26    pSetCoeff0(d_p, n_Copy__T(pGetCoeff(s_p), r));
27    // it is better to iter here,
28    // for MemCopy advances goes from low to high addresses
29    h = s_p;
30    s_p = pNext(s_p);
31    p_MemCopy__T(d_p->exp, h->exp, length);
32  }
33  pNext(d_p) = NULL;
34
35  return dp.next;
36}
37
Note: See TracBrowser for help on using the repository browser.