MCPcopy Create free account
hub / github.com/Singular/Singular / prMapR

Function prMapR

libpolys/polys/prCopy.cc:45–75  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43}
44
45poly prMapR(poly src, nMapFunc nMap, ring src_r, ring dest_r)
46{
47 if (src==NULL) return NULL;
48 int _min = si_min(dest_r->N, src_r->N);
49
50 spolyrec dest_s;
51
52 poly dest = &dest_s;
53
54 poly prev;
55 while (src != NULL)
56 {
57 pNext(dest) = (poly) p_Init(dest_r);
58 prev = dest;
59 pIter(dest);
60
61 pSetCoeff0(dest, nMap(pGetCoeff(src),src_r->cf,dest_r->cf));
62 prCopyEvector(dest, dest_r, src, src_r, _min);
63 if (n_IsZero(pGetCoeff(dest),dest_r->cf))
64 {
65 p_LmDelete(&pNext(prev),dest_r);
66 dest=prev;
67 }
68 pIter(src);
69 }
70 pNext(dest) = NULL;
71 dest = pNext(&dest_s);
72 dest=p_SortAdd(dest, dest_r);
73 p_Test(dest, dest_r);
74 return dest;
75}
76
77poly prCopyR_NoSort(poly p, ring src_r, ring dest_r)
78{

Callers 5

naGenMapFunction · 0.85
naGenTrans2AlgExtFunction · 0.85
ntGenMapFunction · 0.85
ntGenAlgFunction · 0.85
preIntegerCheckFunction · 0.85

Calls 6

si_minFunction · 0.85
p_InitFunction · 0.85
prCopyEvectorFunction · 0.85
n_IsZeroFunction · 0.85
p_LmDeleteFunction · 0.85
p_SortAddFunction · 0.85

Tested by

no test coverage detected