My Project
Loading...
Searching...
No Matches
Typedefs | Functions
prCopy.h File Reference
#include "polys/monomials/ring.h"

Go to the source code of this file.

Typedefs

typedef number(* nMapFunc) (number a, const coeffs src, const coeffs dst)
 

Functions

poly prMoveR_NoSort (poly &p, ring r, ring dest_r)
 
poly prMoveR (poly &p, ring r, ring dest_r)
 
poly prCopyR_NoSort (poly p, ring r, ring dest_r)
 
poly prCopyR (poly p, ring r, ring dest_r)
 
poly prShallowCopyR_NoSort (poly p, ring r, ring dest_t)
 
poly prShallowCopyR (poly p, ring r, ring dest_t)
 
poly prHeadR (poly p, ring r, ring dest_rg)
 
ideal idrMoveR_NoSort (ideal &id, ring r, ring dest_r)
 
ideal idrMoveR (ideal &id, ring r, ring dest_r)
 
ideal idrCopyR_NoSort (ideal id, ring r, ring dest_r)
 
ideal idrCopyR (ideal id, ring r, ring dest_r)
 
ideal idrShallowCopyR_NoSort (ideal id, ring r, ring dest_r)
 
ideal idrShallowCopyR (ideal id, ring r, ring dest_r)
 
ideal idrHeadR (ideal id, ring r, ring dest_r)
 Copy leading terms of id[i] via prHeeadR into dest_r. More...
 
poly prMapR (poly src, nMapFunc nMap, ring src_r, ring dest_r)
 

Typedef Documentation

◆ nMapFunc

typedef number(* nMapFunc) (number a, const coeffs src, const coeffs dst)

Definition at line 12 of file prCopy.h.

Function Documentation

◆ idrCopyR()

ideal idrCopyR ( ideal  id,
ring  r,
ring  dest_r 
)

Definition at line 192 of file prCopy.cc.

193{
194 assume(src_r->cf==dest_r->cf);
195 ideal res;
196 prCopyProc_t prproc;
197 if (rField_has_simple_Alloc(dest_r))
198 prproc = pr_Copy_NoREqual_NSimple_Sort;
199 else
200 prproc = pr_Copy_NoREqual_NoNSimple_Sort;
201 res = idrCopy(id, src_r, dest_r, prproc);
202 return res;
203}
CanonicalForm res
Definition: facAbsFact.cc:60
#define assume(x)
Definition: mod2.h:389
static ideal idrCopy(ideal id, ring src_r, ring dest_r, prCopyProc_t prproc)
Definition: prCopy.cc:175
poly(* prCopyProc_t)(poly &src_p, ring src_r, ring dest_r)
Definition: prCopy.cc:124
static BOOLEAN rField_has_simple_Alloc(const ring r)
Z/p, GF(p,n), R: nCopy, nNew, nDelete are dummies.
Definition: ring.h:552

◆ idrCopyR_NoSort()

ideal idrCopyR_NoSort ( ideal  id,
ring  r,
ring  dest_r 
)

Definition at line 205 of file prCopy.cc.

206{
207 assume(src_r->cf==dest_r->cf);
208 ideal res;
209 prCopyProc_t prproc;
210 if (rField_has_simple_Alloc(dest_r))
211 prproc = pr_Copy_NoREqual_NSimple_NoSort;
212 else
213 prproc = pr_Copy_NoREqual_NoNSimple_NoSort;
214 res = idrCopy(id, src_r, dest_r, prproc);
215 return res;
216}

◆ idrHeadR()

ideal idrHeadR ( ideal  id,
ring  r,
ring  dest_r 
)

Copy leading terms of id[i] via prHeeadR into dest_r.

Definition at line 156 of file prCopy.cc.

157{
158 if (id == NULL) return NULL;
159
160 prCopyProc_t prproc = pr_Copy_NoREqual_NoNSimple_NoSort;
161 if (rField_has_simple_Alloc(dest_r))
162 prproc = pr_Copy_NoREqual_NSimple_NoSort;
163
164 const int N = IDELEMS(id);
165 ideal res = idInit(N, id->rank);
166
167 for (int i = N - 1; i >= 0; i--)
168 res->m[i] = prHeadR(id->m[i], r, dest_r, prproc); // !!!
169
170 return res;
171}
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:56
int i
Definition: cfEzgcd.cc:132
#define NULL
Definition: omList.c:12
poly prHeadR(poly p, ring src_r, ring dest_r, prCopyProc_t prproc)
Definition: prCopy.cc:126
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
#define IDELEMS(i)
Definition: simpleideals.h:23

◆ idrMoveR()

ideal idrMoveR ( ideal &  id,
ring  r,
ring  dest_r 
)

Definition at line 248 of file prCopy.cc.

249{
250 assume(src_r->cf==dest_r->cf);
251 prCopyProc_t prproc;
252 ideal res;
253 if (rField_has_simple_Alloc(dest_r))
254 prproc = pr_Move_NoREqual_NSimple_Sort;
255 else
256 prproc = pr_Move_NoREqual_NoNSimple_Sort;
257 res = idrMove(id, src_r, dest_r, prproc);
258 return res;
259}
static ideal idrMove(ideal &id, ring src_r, ring dest_r, prCopyProc_t prproc)
Definition: prCopy.cc:233

◆ idrMoveR_NoSort()

ideal idrMoveR_NoSort ( ideal &  id,
ring  r,
ring  dest_r 
)

Definition at line 261 of file prCopy.cc.

262{
263 assume(src_r->cf==dest_r->cf);
264 prCopyProc_t prproc;
265 ideal res;
266 if (rField_has_simple_Alloc(dest_r))
267 prproc = pr_Move_NoREqual_NSimple_NoSort;
268 else
269 prproc = pr_Move_NoREqual_NoNSimple_NoSort;
270 res = idrMove(id, src_r, dest_r, prproc);
271 return res;
272}

◆ idrShallowCopyR()

ideal idrShallowCopyR ( ideal  id,
ring  r,
ring  dest_r 
)

Definition at line 220 of file prCopy.cc.

221{
222 return idrCopy(id, src_r, dest_r, pr_Copy_NoREqual_NSimple_Sort);
223}

◆ idrShallowCopyR_NoSort()

ideal idrShallowCopyR_NoSort ( ideal  id,
ring  r,
ring  dest_r 
)

Definition at line 225 of file prCopy.cc.

226{
227 return idrCopy(id, src_r, dest_r, pr_Copy_NoREqual_NSimple_NoSort);
228}

◆ prCopyR()

poly prCopyR ( poly  p,
ring  r,
ring  dest_r 
)

Definition at line 34 of file prCopy.cc.

35{
36 poly res;
37 if (rField_has_simple_Alloc(dest_r))
38 res = pr_Copy_NoREqual_NSimple_Sort(p, src_r, dest_r);
39 else
40 res = pr_Copy_NoREqual_NoNSimple_Sort(p, src_r, dest_r);
41 p_Test(res, dest_r);
42 return res;
43}
int p
Definition: cfModGcd.cc:4078
#define p_Test(p, r)
Definition: p_polys.h:159

◆ prCopyR_NoSort()

poly prCopyR_NoSort ( poly  p,
ring  r,
ring  dest_r 
)

Definition at line 77 of file prCopy.cc.

78{
79 poly res;
80 if (rField_has_simple_Alloc(dest_r))
81 res = pr_Copy_NoREqual_NSimple_NoSort(p, src_r, dest_r);
82 else
83 res = pr_Copy_NoREqual_NoNSimple_NoSort(p, src_r, dest_r);
84 p_Test(res, dest_r);
85 return res;
86}

◆ prHeadR()

poly prHeadR ( poly  p,
ring  r,
ring  dest_rg 
)

Definition at line 141 of file prCopy.cc.

142{
143 prCopyProc_t prproc;
144 if (rField_has_simple_Alloc(dest_r))
145 prproc = pr_Copy_NoREqual_NSimple_NoSort;
146 else
147 prproc = pr_Copy_NoREqual_NoNSimple_NoSort;
148
149 const poly res = prHeadR(p, src_r, dest_r, prproc);
150 p_Test(res, dest_r);
151 return res;
152}

◆ prMapR()

poly prMapR ( poly  src,
nMapFunc  nMap,
ring  src_r,
ring  dest_r 
)

Definition at line 45 of file prCopy.cc.

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}
static int si_min(const int a, const int b)
Definition: auxiliary.h:125
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff 'n' represents the zero element.
Definition: coeffs.h:461
#define pIter(p)
Definition: monomials.h:37
#define pNext(p)
Definition: monomials.h:36
#define pSetCoeff0(p, n)
Definition: monomials.h:59
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:44
static void p_LmDelete(poly p, const ring r)
Definition: p_polys.h:721
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1318
static poly p_SortAdd(poly p, const ring r, BOOLEAN revert=FALSE)
Definition: p_polys.h:1217
static void prCopyEvector(poly dest, ring dest_r, poly src, ring src_r, int max)
Definition: prCopy.cc:18

◆ prMoveR()

poly prMoveR ( poly &  p,
ring  r,
ring  dest_r 
)

Definition at line 90 of file prCopy.cc.

91{
92 poly res;
93 if (rField_has_simple_Alloc(dest_r))
94 res = pr_Move_NoREqual_NSimple_Sort(p, src_r, dest_r);
95 else
96 res = pr_Move_NoREqual_NoNSimple_Sort(p, src_r, dest_r);
97 p_Test(res, dest_r);
98 return res;
99}

◆ prMoveR_NoSort()

poly prMoveR_NoSort ( poly &  p,
ring  r,
ring  dest_r 
)

Definition at line 101 of file prCopy.cc.

102{
103 poly res;
104 if (rField_has_simple_Alloc(dest_r))
105 res = pr_Move_NoREqual_NSimple_NoSort(p, src_r, dest_r);
106 else
107 res = pr_Move_NoREqual_NoNSimple_NoSort(p, src_r, dest_r);
108 p_Test(res, dest_r);
109 return res;
110}

◆ prShallowCopyR()

poly prShallowCopyR ( poly  p,
ring  r,
ring  dest_t 
)

Definition at line 117 of file prCopy.cc.

118{
119 return pr_Copy_NoREqual_NSimple_Sort(p, r, dest_r);
120}

◆ prShallowCopyR_NoSort()

poly prShallowCopyR_NoSort ( poly  p,
ring  r,
ring  dest_t 
)

Definition at line 112 of file prCopy.cc.

113{
114 return pr_Copy_NoREqual_NSimple_NoSort(p, r, dest_r);
115}