fieker-DuValspielwiese
Last change
on this file since 0224c8 was
4e6cf2,
checked in by Olaf Bachmann <obachman@…>, 24 years ago
|
* clean up
git-svn-id: file:///usr/local/Singular/svn/trunk@4681 2c84dea3-7e68-4137-9b89-c4e89433aadc
|
-
Property mode set to
100644
|
File size:
1.0 KB
|
Rev | Line | |
---|
[9d72fe] | 1 | /**************************************** |
---|
| 2 | * Computer Algebra System SINGULAR * |
---|
| 3 | ****************************************/ |
---|
| 4 | /*************************************************************** |
---|
| 5 | * File: p_Copy__Template.cc |
---|
| 6 | * Purpose: template for p_Copy |
---|
| 7 | * Author: obachman (Olaf Bachmann) |
---|
| 8 | * Created: 8/00 |
---|
[4e6cf2] | 9 | * Version: $Id: p_Copy__Template.cc,v 1.4 2000-10-30 13:40:22 obachman Exp $ |
---|
[9d72fe] | 10 | *******************************************************************/ |
---|
| 11 | |
---|
| 12 | poly p_Copy(poly s_p, const ring r) |
---|
| 13 | { |
---|
[512a2b] | 14 | // let's not do tests here -- but instead allow |
---|
| 15 | // to be sloppy |
---|
[9d72fe] | 16 | spolyrec dp; |
---|
| 17 | poly d_p = &dp; |
---|
| 18 | omBin bin = r->PolyBin; |
---|
| 19 | poly h; |
---|
| 20 | |
---|
[4e6cf2] | 21 | DECLARE_LENGTH(const unsigned long length = r->ExpL_Size); |
---|
[9d72fe] | 22 | |
---|
| 23 | while (s_p != NULL) |
---|
| 24 | { |
---|
[512a2b] | 25 | p_AllocBin(pNext(d_p), bin, r); |
---|
[9d72fe] | 26 | pIter(d_p); |
---|
[512a2b] | 27 | pSetCoeff0(d_p, n_Copy(pGetCoeff(s_p), r)); |
---|
[9d72fe] | 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); |
---|
[a6a239] | 32 | p_MemCopy(d_p->exp, h->exp, length); |
---|
[9d72fe] | 33 | } |
---|
| 34 | pNext(d_p) = NULL; |
---|
| 35 | |
---|
| 36 | return dp.next; |
---|
| 37 | } |
---|
| 38 | |
---|
Note: See
TracBrowser
for help on using the repository browser.