My Project  UNKNOWN_GIT_VERSION
maps_ip.cc
Go to the documentation of this file.
1 /****************************************
2 * Computer Algebra System SINGULAR *
3 ****************************************/
4 /*
5 * ABSTRACT - the mapping of polynomials to other rings
6 */
7 #define TRANSEXT_PRIVATES
8 
9 #include "kernel/mod2.h"
10 #include "omalloc/omalloc.h"
11 
12 #include "coeffs/numbers.h"
13 #include "coeffs/coeffs.h"
14 
15 #include "polys/monomials/ring.h"
16 #include "polys/monomials/maps.h"
17 #include "polys/matpol.h"
18 #include "polys/prCopy.h"
20 
21 //#include "polys/ext_fields/longtrans.h"
22 // #include "kernel/longalg.h"
23 
24 #include "misc/options.h"
25 #include "kernel/GBEngine/kstd1.h"
26 #include "kernel/maps/gen_maps.h"
27 
28 #include "maps_ip.h"
29 #include "ipid.h"
30 
31 
32 #include "lists.h"
33 #include "tok.h"
34 
35 /* debug output: Tok2Cmdname in maApplyFetch*/
36 #include "ipshell.h"
37 
38 /*2
39 * maps the expression w to res,
40 * switch what: MAP_CMD: use theMap for mapping, N for preimage ring
41 * //FETCH_CMD: use pOrdPoly for mapping
42 * IMAP_CMD: use perm for mapping, N for preimage ring
43 * default: map only poly-structures,
44 * use perm and par_perm, N and P,
45 */
46 BOOLEAN maApplyFetch(int what,map theMap,leftv res, leftv w, ring preimage_r,
47  int *perm, int *par_perm, int P, nMapFunc nMap)
48 {
49  BOOLEAN use_mult=FALSE;
50 #ifdef HAVE_PLURAL
51  if ((what==IMAP_CMD)
53  && rIsPluralRing(preimage_r))
54  {
55  assume(perm!=NULL);
56  int i=1;
57  while((i<currRing->N)&&(perm[i]==0)) i++;
58  if (i<currRing->N)
59  {
60  int prev_nonnull=i;
61  i++;
62  for(;i<=currRing->N;i++)
63  {
64  if (perm[prev_nonnull] > perm[i])
65  {
66  if (TEST_V_ALLWARN)
67  {
68  Warn("imap not usable for permuting variables, use map (%s <-> %s)",currRing->names[prev_nonnull-1],currRing->names[i-1]);
69  }
70  use_mult=TRUE;
71  break;
72  }
73  else
74  prev_nonnull=i;
75  }
76  }
77  }
78 #endif
79  int i;
80  int N = preimage_r->N;
81 #if 0
82  Print("N=%d what=%s ",N,Tok2Cmdname(what));
83  if (perm!=NULL) for(i=1;i<=N;i++) Print("%d -> %d ",i,perm[i]);
84  PrintS("\n");
85  Print("P=%d ",P);
86  if (par_perm!=NULL) for(i=0;i<P;i++) Print("%d -> %d ",i,par_perm[i]);
87  PrintS("\n");
88 #endif
89 
90  void *data=w->Data();
91  res->rtyp = w->rtyp;
92  switch (w->rtyp)
93  {
94  case NUMBER_CMD:
95  if (P!=0)
96  {
97 // poly n_PermNumber(const number z, const int *par_perm, const int OldPar, const ring src, const ring dst);
98  res->data= (void *) n_PermNumber((number)data, par_perm, P, preimage_r, currRing);
99  res->rtyp=POLY_CMD;
100  if (nCoeff_is_algExt(currRing->cf))
101  res->data=(void *)p_MinPolyNormalize((poly)res->data, currRing);
102  pTest((poly) res->data);
103  }
104  else
105  {
106  assume( nMap != NULL );
107  number a = nMap((number)data, preimage_r->cf, currRing->cf);
108  if (nCoeff_is_Extension(currRing->cf))
109  {
110  n_Normalize(a, currRing->cf);
111 /*
112  number a = (number)res->data;
113  number one = nInit(1);
114  number product = nMult(a, one );
115  nDelete(&one);
116  nDelete(&a);
117  res->data=(void *)product;
118  */
119  }
120  #ifdef LDEBUG
121  n_Test(a, currRing->cf);
122  #endif
123  res->data=(void *)a;
124 
125  }
126  break;
127  case BUCKET_CMD:
128  if ((what==FETCH_CMD)&& (preimage_r->cf==currRing->cf))
129  res->data=(void *)prCopyR(sBucketPeek((sBucket_pt)data), preimage_r, currRing);
130  else
131  if ( (what==IMAP_CMD) || /*(*/ (what==FETCH_CMD) /*)*/) /* && (nMap!=nCopy)*/
132  res->data=(void *)p_PermPoly(sBucketPeek((sBucket_pt)data),perm,preimage_r,currRing, nMap,par_perm,P,use_mult);
133  else /*if (what==MAP_CMD)*/
134  {
135  matrix s=mpNew(N,maMaxDeg_P(sBucketPeek((sBucket_pt)data), preimage_r));
136  res->data=(void *)maEval(theMap, sBucketPeek((sBucket_pt)data), preimage_r, nMap, (ideal)s, currRing);
137  idDelete((ideal *)&s);
138  }
139  if (nCoeff_is_Extension(currRing->cf))
140  res->data=(void *)p_MinPolyNormalize(sBucketPeek((sBucket_pt)data), currRing);
141  break;
142  case POLY_CMD:
143  case VECTOR_CMD:
144  if ((what==FETCH_CMD)&& (preimage_r->cf==currRing->cf))
145  res->data=(void *)prCopyR( (poly)data, preimage_r, currRing);
146  else
147  if ( (what==IMAP_CMD) || /*(*/ (what==FETCH_CMD) /*)*/) /* && (nMap!=nCopy)*/
148  res->data=(void *)p_PermPoly((poly)data,perm,preimage_r,currRing, nMap,par_perm,P,use_mult);
149  else /*if (what==MAP_CMD)*/
150  {
151  p_Test((poly)data,preimage_r);
152  matrix s=mpNew(N,maMaxDeg_P((poly)data, preimage_r));
153  res->data=(void *)maEval(theMap, (poly)data, preimage_r, nMap, (ideal)s, currRing);
154  idDelete((ideal *)&s);
155  }
156  if (nCoeff_is_Extension(currRing->cf))
157  res->data=(void *)p_MinPolyNormalize((poly)res->data, currRing);
158  pTest((poly)res->data);
159  break;
160  case MODUL_CMD:
161  case MATRIX_CMD:
162  case IDEAL_CMD:
163  case MAP_CMD:
164  {
165  int C=((matrix)data)->cols();
166  int R;
167  if (w->rtyp==MAP_CMD) R=1;
168  else R=((matrix)data)->rows();
169  matrix m=mpNew(R,C);
170  char *tmpR=NULL;
171  if(w->rtyp==MAP_CMD)
172  {
173  tmpR=((map)data)->preimage;
174  ((matrix)data)->rank=((matrix)data)->rows();
175  }
176  if ((what==FETCH_CMD)&& (preimage_r->cf == currRing->cf))
177  {
178  for (i=R*C-1;i>=0;i--)
179  {
180  m->m[i]=prCopyR(((ideal)data)->m[i], preimage_r, currRing);
181  pTest(m->m[i]);
182  }
183  }
184  else if ((what==IMAP_CMD) || (what==FETCH_CMD))
185  {
186  for (i=R*C-1;i>=0;i--)
187  {
188  m->m[i]=p_PermPoly(((ideal)data)->m[i],perm,preimage_r,currRing,
189  nMap,par_perm,P,use_mult);
190  pTest(m->m[i]);
191  }
192  }
193  else /* (what==MAP_CMD) */
194  {
195  assume(what==MAP_CMD);
196  matrix s=mpNew(N,maMaxDeg_Ma((ideal)data,preimage_r));
197  for (i=R*C-1;i>=0;i--)
198  {
199  m->m[i]=maEval(theMap, ((ideal)data)->m[i], preimage_r, nMap, (ideal)s, currRing);
200  pTest(m->m[i]);
201  }
202  idDelete((ideal *)&s);
203  }
204  if (nCoeff_is_algExt(currRing->cf))
205  {
206  for (i=R*C-1;i>=0;i--)
207  {
208  m->m[i]=p_MinPolyNormalize(m->m[i], currRing);
209  pTest(m->m[i]);
210  }
211  }
212  if(w->rtyp==MAP_CMD)
213  {
214  ((map)data)->preimage=tmpR;
215  ((map)m)->preimage=omStrDup(tmpR);
216  }
217  else
218  {
219  m->rank=((matrix)data)->rank;
220  }
221  res->data=(char *)m;
222  idTest((ideal) m);
223  break;
224  }
225 
226  case LIST_CMD:
227  {
228  lists l=(lists)data;
230  ml->Init(l->nr+1);
231  for(i=0;i<=l->nr;i++)
232  {
233  if (((l->m[i].rtyp>BEGIN_RING)&&(l->m[i].rtyp<END_RING))
234  ||(l->m[i].rtyp==LIST_CMD))
235  {
236  if (maApplyFetch(what,theMap,&ml->m[i],&l->m[i],
237  preimage_r,perm,par_perm,P,nMap))
238  {
239  ml->Clean();
241  res->rtyp=0;
242  return TRUE;
243  }
244  }
245  else
246  {
247  ml->m[i].Copy(&l->m[i]);
248  }
249  }
250  res->data=(char *)ml;
251  break;
252  }
253  default:
254  {
255  return TRUE;
256  }
257  }
258  return FALSE;
259 }
260 
261 /*2
262 * substitutes the parameter par (from 1..N) by image,
263 * does not destroy p and image
264 */
265 poly pSubstPar(poly p, int par, poly image)
266 {
267  const ring R = currRing->cf->extRing;
268  ideal theMapI = idInit(rPar(currRing),1);
269  nMapFunc nMap = n_SetMap(R->cf, currRing->cf);
270  int i;
271  for(i = rPar(currRing);i>0;i--)
272  {
273  if (i != par)
274  theMapI->m[i-1]= p_NSet(n_Param(i, currRing), currRing);
275  else
276  theMapI->m[i-1] = p_Copy(image, currRing);
277  p_Test(theMapI->m[i-1],currRing);
278  }
279  //iiWriteMatrix((matrix)theMapI,"map:",1,currRing,0);
280 
281  map theMap=(map)theMapI;
282  theMap->preimage=NULL;
283 
285  sleftv tmpW;
286  poly res=NULL;
287 
289  if (currRing->cf->rep==n_rep_rat_fct )
290  {
291  while (p!=NULL)
292  {
293  memset(v,0,sizeof(sleftv));
294 
295  number d = n_GetDenom(pGetCoeff(p), currRing->cf);
296  p_Test((poly)NUM((fraction)d), R);
297 
298  if ( n_IsOne (d, currRing->cf) )
299  {
300  n_Delete(&d, currRing->cf); d = NULL;
301  }
302  else if (!p_IsConstant((poly)NUM((fraction)d), R))
303  {
304  WarnS("ignoring denominators of coefficients...");
305  n_Delete(&d, currRing->cf); d = NULL;
306  }
307 
308  number num = n_GetNumerator(pGetCoeff(p), currRing->cf);
309  memset(&tmpW,0,sizeof(sleftv));
310  tmpW.rtyp = POLY_CMD;
311  p_Test((poly)NUM((fraction)num), R);
312 
313  tmpW.data = NUM ((fraction)num); // a copy of this poly will be used
314 
315  p_Normalize(NUM((fraction)num),R);
316  if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,R,NULL,NULL,0,nMap))
317  {
318  WerrorS("map failed");
319  v->data=NULL;
320  }
321  n_Delete(&num, currRing->cf);
322  //TODO check for memory leaks
323  poly pp = pHead(p);
324  //PrintS("map:");pWrite(pp);
325  if( d != NULL )
326  {
327  pSetCoeff(pp, n_Invers(d, currRing->cf));
328  n_Delete(&d, currRing->cf); // d = NULL;
329  }
330  else
331  pSetCoeff(pp, nInit(1));
332 
333  //PrintS("->");pWrite((poly)(v->data));
334  poly ppp = pMult((poly)(v->data),pp);
335  //PrintS("->");pWrite(ppp);
336  res=pAdd(res,ppp);
337  pIter(p);
338  }
339  }
340  else if (currRing->cf->rep==n_rep_poly )
341  {
342  while (p!=NULL)
343  {
344  memset(v,0,sizeof(sleftv));
345 
346  number num = n_GetNumerator(pGetCoeff(p), currRing->cf);
347  memset(&tmpW,0,sizeof(sleftv));
348  tmpW.rtyp = POLY_CMD;
349  p_Test((poly)num, R);
350 
351 
352  p_Normalize((poly)num,R);
353  if (num==NULL) num=(number)R->qideal->m[0];
354  tmpW.data = num; // a copy of this poly will be used
355  if (maApplyFetch(MAP_CMD,theMap,v,&tmpW,R,NULL,NULL,0,nMap))
356  {
357  WerrorS("map failed");
358  v->data=NULL;
359  }
360  if (num!=(number)R->qideal->m[0]) n_Delete(&num, currRing->cf);
361  //TODO check for memory leaks
362  poly pp = pHead(p);
363  //PrintS("map:");pWrite(pp);
364  pSetCoeff(pp,n_Init(1,currRing->cf));
365  //PrintS("cf->");pWrite((poly)(v->data));
366  poly ppp = pMult((poly)(v->data),pp);
367  //PrintS("->");pWrite(ppp);
368  res=pAdd(res,ppp);
369  pIter(p);
370  }
371  }
372  else
373  {
374  WerrorS("cannot apply subst for these coeffcients");
375  }
376  idDelete((ideal *)(&theMap));
378  return res;
379 }
380 
381 /*2
382 * substitute the n-th parameter by the poly e in id
383 * does not destroy id and e
384 */
385 ideal idSubstPar(ideal id, int n, poly e)
386 {
387  int k=MATROWS((matrix)id)*MATCOLS((matrix)id);
388  ideal res=(ideal)mpNew(MATROWS((matrix)id),MATCOLS((matrix)id));
389 
390  res->rank = id->rank;
391  for(k--;k>=0;k--)
392  {
393  res->m[k]=pSubstPar(id->m[k],n,e);
394  }
395  return res;
396 }
397 
398 /*2
399 * substitutes the variable var (from 1..N) by image,
400 * does not destroy p and image
401 */
402 poly pSubstPoly(poly p, int var, poly image)
403 {
404  if (p==NULL) return NULL;
405 #ifdef HAVE_PLURAL
406  if (rIsPluralRing(currRing))
407  {
408  return pSubst(pCopy(p),var,image);
409  }
410 #endif
411  return p_SubstPoly(p,var,image,currRing,currRing,ndCopyMap);
412 }
413 
414 /*2
415 * substitute the n-th variable by the poly e in id
416 * does not destroy id and e
417 */
418 ideal idSubstPoly(ideal id, int n, poly e)
419 {
420 
421 #ifdef HAVE_PLURAL
422  if (rIsPluralRing(currRing))
423  {
424  int k=MATROWS((matrix)id)*MATCOLS((matrix)id);
425  ideal res=(ideal)mpNew(MATROWS((matrix)id),MATCOLS((matrix)id));
426  res->rank = id->rank;
427  for(k--;k>=0;k--)
428  {
429  res->m[k]=pSubst(pCopy(id->m[k]),n,e);
430  }
431  return res;
432  }
433 #endif
434  return id_SubstPoly(id,n,e,currRing,currRing,ndCopyMap);
435 }
FALSE
#define FALSE
Definition: auxiliary.h:94
omalloc.h
matrix
ip_smatrix * matrix
Definition: matpol.h:30
IMAP_CMD
Definition: grammar.cc:298
ip_smatrix
Definition: matpol.h:13
p_Normalize
void p_Normalize(poly p, const ring r)
Definition: p_polys.cc:3720
maMaxDeg_Ma
int maMaxDeg_Ma(ideal a, ring preimage_r)
Definition: maps.cc:253
pSubstPar
poly pSubstPar(poly p, int par, poly image)
Definition: maps_ip.cc:264
k
int k
Definition: cfEzgcd.cc:92
idDelete
#define idDelete(H)
delete an ideal
Definition: ideals.h:28
NUMBER_CMD
Definition: grammar.cc:288
pSubstPoly
poly pSubstPoly(poly p, int var, poly image)
Definition: maps_ip.cc:401
LIST_CMD
Definition: tok.h:117
lists.h
ADDRESS
void * ADDRESS
Definition: auxiliary.h:133
n_GetNumerator
static FORCE_INLINE number n_GetNumerator(number &n, const coeffs r)
return the numerator of n (if elements of r are by nature not fractional, result is n)
Definition: coeffs.h:607
MODUL_CMD
Definition: grammar.cc:287
num
CanonicalForm num(const CanonicalForm &f)
Definition: canonicalform.h:330
map
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
Definition: cf_map_ext.cc:400
gen_maps.h
omStrDup
#define omStrDup(s)
Definition: omAllocDecl.h:261
ndCopyMap
number ndCopyMap(number a, const coeffs aRing, const coeffs r)
Definition: numbers.cc:252
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:454
p_Test
#define p_Test(p, r)
Definition: p_polys.h:156
omAllocBin
#define omAllocBin(bin)
Definition: omAllocDecl.h:203
options.h
idTest
#define idTest(id)
Definition: ideals.h:46
N
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:48
n_Param
static FORCE_INLINE number n_Param(const int iParameter, const coeffs r)
return the (iParameter^th) parameter as a NEW number NOTE: parameter numbering: 1....
Definition: coeffs.h:804
n_IsOne
static FORCE_INLINE BOOLEAN n_IsOne(number n, const coeffs r)
TRUE iff 'n' represents the one element.
Definition: coeffs.h:467
sleftv
Class used for (list of) interpreter objects.
Definition: subexpr.h:81
pMult
#define pMult(p, q)
Definition: polys.h:194
w
const CanonicalForm & w
Definition: facAbsFact.cc:55
slists_bin
omBin slists_bin
Definition: lists.cc:22
n_Normalize
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:577
maApplyFetch
BOOLEAN maApplyFetch(int what, map theMap, leftv res, leftv w, ring preimage_r, int *perm, int *par_perm, int P, nMapFunc nMap)
Definition: maps_ip.cc:45
MATRIX_CMD
Definition: grammar.cc:286
leftv
sleftv * leftv
Definition: structs.h:59
rIsPluralRing
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:397
n_PermNumber
poly n_PermNumber(const number z, const int *par_perm, const int, const ring src, const ring dst)
Definition: p_polys.cc:3921
n_rep_rat_fct
(fraction), see transext.h
Definition: coeffs.h:113
p_Copy
static poly p_Copy(poly p, const ring r)
returns a copy of p
Definition: p_polys.h:798
currRing
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
BEGIN_RING
Definition: grammar.cc:282
TRUE
#define TRUE
Definition: auxiliary.h:98
i
int i
Definition: cfEzgcd.cc:125
p_PermPoly
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
Definition: p_polys.cc:4025
res
CanonicalForm res
Definition: facAbsFact.cc:64
prCopy.h
nMapFunc
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:72
matpol.h
sBucketPeek
poly sBucketPeek(sBucket_pt b)
Definition: sbuckets.cc:453
PrintS
void PrintS(const char *s)
Definition: reporter.cc:283
BOOLEAN
int BOOLEAN
Definition: auxiliary.h:85
nCoeff_is_algExt
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition: coeffs.h:931
pTest
#define pTest(p)
Definition: polys.h:396
IDEAL_CMD
Definition: grammar.cc:284
mod2.h
ip_smatrix::m
poly * m
Definition: matpol.h:18
idSubstPar
ideal idSubstPar(ideal id, int n, poly e)
Definition: maps_ip.cc:384
sleftv::data
void * data
Definition: subexpr.h:87
pIter
#define pIter(p)
Definition: monomials.h:35
rPar
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:588
n_Init
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:537
END_RING
Definition: grammar.cc:310
VECTOR_CMD
Definition: grammar.cc:292
pp
CanonicalForm pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:248
maps.h
slists::m
sleftv * m
Definition: lists.h:44
nCoeff_is_Extension
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
Definition: coeffs.h:867
maMaxDeg_P
int maMaxDeg_P(poly p, ring preimage_r)
Definition: maps.cc:291
n_rep_poly
(poly), see algext.h
Definition: coeffs.h:112
mpNew
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:36
pAdd
#define pAdd(p, q)
Definition: polys.h:190
p_MinPolyNormalize
poly p_MinPolyNormalize(poly p, const ring r)
Definition: maps.cc:323
sBucket
Definition: sbuckets.cc:29
pSetCoeff
#define pSetCoeff(p, n)
deletes old coeff before setting the new one
Definition: polys.h:30
slists
Definition: lists.h:21
ring.h
transext.h
kstd1.h
p_SubstPoly
poly p_SubstPoly(poly p, int var, poly image, const ring preimage_r, const ring image_r, const nMapFunc nMap, matrix cache=NULL)
Definition: subst_maps.cc:39
maps_ip.h
n_Invers
static FORCE_INLINE number n_Invers(number a, const coeffs r)
return the multiplicative inverse of 'a'; raise an error if 'a' is not invertible
Definition: coeffs.h:563
BUCKET_CMD
Definition: grammar.cc:283
id_SubstPoly
ideal id_SubstPoly(ideal id, int var, poly image, const ring preimage_r, const ring image_r, const nMapFunc nMap)
Definition: subst_maps.cc:68
Print
#define Print
Definition: emacs.cc:79
p_NSet
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1432
idInit
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:36
tok.h
WerrorS
void WerrorS(const char *s)
Definition: feFopen.cc:24
m
int m
Definition: cfEzgcd.cc:121
MATCOLS
#define MATCOLS(i)
Definition: matpol.h:27
WarnS
#define WarnS
Definition: emacs.cc:77
sleftv::rtyp
int rtyp
Definition: subexpr.h:90
assume
#define assume(x)
Definition: mod2.h:384
FETCH_CMD
Definition: grammar.cc:295
NULL
#define NULL
Definition: omList.c:9
MAP_CMD
Definition: grammar.cc:285
lists
slists * lists
Definition: mpr_numeric.h:145
sleftv::Copy
void Copy(leftv e)
Definition: subexpr.cc:719
idSubstPoly
ideal idSubstPoly(ideal id, int n, poly e)
Definition: maps_ip.cc:417
l
int l
Definition: cfEzgcd.cc:93
R
#define R
Definition: sirandom.c:26
Warn
#define Warn
Definition: emacs.cc:76
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
sleftv_bin
omBin sleftv_bin
Definition: subexpr.cc:46
slists::Init
INLINE_THIS void Init(int l=0)
p
int p
Definition: cfModGcd.cc:4019
p_IsConstant
static BOOLEAN p_IsConstant(const poly p, const ring r)
Definition: p_polys.h:1907
NUM
Definition: readcf.cc:173
s
const CanonicalForm int s
Definition: facAbsFact.cc:55
nInit
#define nInit(i)
Definition: numbers.h:24
POLY_CMD
Definition: grammar.cc:289
Tok2Cmdname
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:139
pCopy
#define pCopy(p)
return a copy of the poly
Definition: polys.h:173
ipshell.h
n_SetMap
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:720
pHead
#define pHead(p)
returns newly allocated copy of Lm(p), coef is copied, next=NULL, p might be NULL
Definition: polys.h:65
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition: monomials.h:42
n_Test
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:737
MATROWS
#define MATROWS(i)
Definition: matpol.h:26
omFreeBin
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:257
TEST_V_ALLWARN
#define TEST_V_ALLWARN
Definition: options.h:139
n_GetDenom
static FORCE_INLINE number n_GetDenom(number &n, const coeffs r)
return the denominator of n (if elements of r are by nature not fractional, result is 1)
Definition: coeffs.h:602
numbers.h
ipid.h
prCopyR
poly prCopyR(poly p, ring src_r, ring dest_r)
Definition: prCopy.cc:35
if
if(yy_init)
Definition: libparse.cc:1417
coeffs.h
pSubst
#define pSubst(p, n, e)
Definition: polys.h:348
maEval
poly maEval(map theMap, poly p, ring preimage_r, nMapFunc nMap, ideal s, const ring dst_r)
Definition: maps.cc:116
slists::Clean
void Clean(ring r=currRing)
Definition: lists.h:24