My Project
Loading...
Searching...
No Matches
ipconv.cc
Go to the documentation of this file.
1/****************************************
2* Computer Algebra System SINGULAR *
3****************************************/
4/*
5* ABSTRACT: automatic type conversions
6*/
7
8
9
10
11#include "kernel/mod2.h"
12#include "Singular/tok.h"
13#include "Singular/ipid.h"
14#include "misc/intvec.h"
15#include "misc/options.h"
16#include "kernel/polys.h"
17#include "kernel/ideals.h"
18#include "Singular/subexpr.h"
19#include "coeffs/numbers.h"
20#include "coeffs/coeffs.h"
21#include "coeffs/bigintmat.h"
22//#include "polys/ext_fields/longalg.h"
23#include "polys/matpol.h"
25#include "kernel/GBEngine/syz.h"
26#include "Singular/attrib.h"
28#include "Singular/ipshell.h"
29#include "Singular/number2.h"
30#include "Singular/ipconv.h"
31
32typedef void * (*iiConvertProc)(void * data);
33typedef void (*iiConvertProcL)(leftv out,leftv in);
34struct sConvertTypes
35{
36 int i_typ;
37 int o_typ;
40};
41
42// all of these static conversion routines work destructive on their input
43
44static void * iiI2P(void *data)
45{
46 poly p=pISet((int)(long)data);
47 return (void *)p;
48}
49
50static void * iiBI2P(void *data)
51{
53 if (nMap==NULL)
54 {
55 Werror("no conversion from bigint to %s", nCoeffName(currRing->cf));
56 return NULL;
57 }
58 number n=nMap((number)data,coeffs_BIGINT,currRing->cf);
59 n_Delete((number *)&data, coeffs_BIGINT);
60 poly p=p_NSet(n, currRing);
61 return (void *)p;
62}
63
64static void iiBu2P(leftv out, leftv in)
65{
67 poly p; int l;
69 out->data=(void*)p;
70}
71
72static void * iiI2V(void *data)
73{
74 poly p=pISet((int)(long)data);
75 if (p!=NULL) pSetComp(p,1);
76 return (void *)p;
77}
78
79static void * iiBI2V(void *data)
80{
82 if (nMap==NULL)
83 {
84 Werror("no conversion from bigint to %s", nCoeffName(currRing->cf));
85 return NULL;
86 }
87 number n=nMap((number)data,coeffs_BIGINT,currRing->cf);
88 n_Delete((number *)&data, coeffs_BIGINT);
89 poly p=p_NSet(n, currRing);
90 if (p!=NULL) pSetComp(p,1);
91 return (void *)p;
92}
93
94static void * iiI2Id(void *data)
95{
96 ideal I=idInit(1,1);
97 I->m[0]=pISet((int)(long)data);
98 return (void *)I;
99}
100
101static void * iiBI2Id(void *data)
102{
103 ideal I=idInit(1,1);
105 if (nMap==NULL)
106 {
107 Werror("no conversion from bigint to %s", nCoeffName(currRing->cf));
108 return NULL;
109 }
110 number n=nMap((number)data,coeffs_BIGINT,currRing->cf);
111 n_Delete((number *)&data,coeffs_BIGINT);
112 poly p=pNSet(n);
113 I->m[0]=p;
114 return (void *)I;
115}
116static void * iiBu2V(void *data)
117{
118 poly p=NULL;
119 if (data!=NULL)
120 {
121 sBucket_pt b=(sBucket_pt)data;
122 int l;
124 if (p!=NULL) pSetCompP(p,1);
125 }
126 return (void *)p;
127}
128
129static void * iiP2V(void *data)
130{
131 poly p=(poly)data;
132 if (p!=NULL) pSetCompP(p,1);
133 return (void *)p;
134}
135
136static void * iiBu2Id(void *data)
137{
138 ideal I=idInit(1,1);
139
140 if (data!=NULL)
141 {
142 sBucket_pt b=(sBucket_pt)data;
143 poly p; int l;
145 I->m[0]=p;
146 }
147 return (void *)I;
148}
149
150static void * iiP2Id(void *data)
151{
152 ideal I=idInit(1,1);
153
154 if (data!=NULL)
155 {
156 poly p=(poly)data;
157 I->m[0]=p;
158 if (pGetComp(p)!=0) I->rank=pMaxComp(p);
159 }
160 return (void *)I;
161}
162
163static void * iiV2Ma(void *data)
164{
165 matrix m=(matrix)idVec2Ideal((poly)data);
166 int h=MATCOLS(m);
167 MATCOLS(m)=MATROWS(m);
168 MATROWS(m)=h;
169 m->rank=h;
170 pDelete((poly *)&data);
171 return (void *)m;
172}
173
174static void * iiN2P(void *data);
175
176static void * iiDummy(void *data)
177{
178 return data;
179}
180
181static void * iiMo2Ma(void *data)
182{
183 void *res=id_Module2Matrix((ideal)data,currRing);
184 return res;
185}
186
187static void * iiMa2Mo(void *data)
188{
189 void *res=id_Matrix2Module((matrix)data,currRing);
190 return res;
191}
192
193static void * iiI2Iv(void *data)
194{
195 int s=(int)(long)data;
196 intvec *iv=new intvec(s,s);
197 return (void *)iv;
198}
199
200static void * iiI2N(void *data)
201{
202 number n=nInit((int)(long)data);
203 return (void *)n;
204}
205
206static void * iiI2BI(void *data)
207{
208 number n=n_Init((int)(long)data, coeffs_BIGINT);
209 return (void *)n;
210}
211
212#ifdef SINGULAR_4_2
213static void * iiI2NN(void *data)
214{
215 if (currRing==NULL)
216 {
217 WerrorS("missing basering while converting int to Number");
218 return NULL;
219 }
220 number n=nInit((int)(long)data);
221 number2 nn=(number2)omAlloc(sizeof(*nn));
222 nn->cf=currRing->cf; nn->cf->ref++;
223 nn->n=n;
224 return (void *)nn;
225}
226static void * iiI2CP(void *data)
227{
228 if (currRing==NULL)
229 {
230 WerrorS("missing basering while converting int to Poly");
231 return NULL;
232 }
233 poly n=pISet((int)(long)data);
234 poly2 nn=(poly2)omAlloc(sizeof(*nn));
235 nn->cf=currRing; nn->cf->ref++;
236 nn->n=n;
237 return (void *)nn;
238}
239#endif
240
241static void * iiBI2N(void *data)
242{
243 if (currRing==NULL) return NULL;
245 if (nMap==NULL)
246 {
247 Werror("no conversion from bigint to %s", nCoeffName(currRing->cf));
248 return NULL;
249 }
250 number n=nMap((number)data,coeffs_BIGINT,currRing->cf);
251 n_Delete((number *)&data, coeffs_BIGINT);
252 return (void*)n;
253}
254
255#ifdef SINGULAR_4_2
256static void * iiBI2NN(void *data)
257{
258 if (currRing==NULL)
259 {
260 WerrorS("missing basering while converting bigint to Number");
261 return NULL;
262 }
264 if (nMap==NULL)
265 {
266 Werror("no conversion from bigint to %s",currRing->cf->cfCoeffName(currRing->cf));
267 return NULL;
268 }
269 number n=nMap((number)data,coeffs_BIGINT,currRing->cf);
270 n_Delete((number *)&data, coeffs_BIGINT);
271 number2 nn=(number2)omAlloc(sizeof(*nn));
272 nn->cf=currRing->cf; nn->cf->ref++;
273 nn->n=n;
274 return (void*)nn;
275}
276static void * iiBI2CP(void *data)
277{
278 if (currRing==NULL)
279 {
280 WerrorS("missing basering while converting bigint to Poly");
281 return NULL;
282 }
284 if (nMap==NULL)
285 {
286 Werror("no conversion from bigint to %s",currRing->cf->cfCoeffName(currRing->cf));
287 return NULL;
288 }
289 number n=nMap((number)data,coeffs_BIGINT,currRing->cf);
290 n_Delete((number *)&data, coeffs_BIGINT);
291 poly2 nn=(poly2)omAlloc(sizeof(*nn));
292 nn->cf=currRing; nn->cf->ref++;
293 nn->n=pNSet(n);
294 return (void*)nn;
295}
296static void * iiP2CP(void *data)
297{
298 poly2 nn=(poly2)omAlloc(sizeof(*nn));
299 nn->cf=currRing; nn->cf->ref++;
300 nn->n=(poly)data;
301 return (void*)nn;
302}
303#endif
304
305#ifdef SINGULAR_4_2
306static void * iiNN2N(void *data)
307{
308 number2 d=(number2)data;
309 if ((currRing==NULL)
310 || (currRing->cf!=d->cf))
311 {
312 WerrorS("cannot convert: incompatible");
313 return NULL;
314 }
315 number n = n_Copy(d->n, d->cf);
316 n2Delete(d);
317 return (void*)n;
318}
319#endif
320
321#ifdef SINGULAR_4_2
322static void * iiNN2P(void *data)
323{
324 number2 d=(number2)data;
325 if ((currRing==NULL)
326 || (currRing->cf!=d->cf))
327 {
328 WerrorS("cannot convert: incompatible");
329 return NULL;
330 }
331 number n = n_Copy(d->n, d->cf);
332 n2Delete(d);
333 return (void*)p_NSet(n,currRing);
334}
335#endif
336
337static void * iiIm2Ma(void *data)
338{
339 int i, j;
340 intvec *iv = (intvec *)data;
341 matrix m = mpNew(iv->rows(), iv->cols());
342
343 for (i=iv->rows(); i>0; i--)
344 {
345 for (j=iv->cols(); j>0; j--)
346 {
347 MATELEM(m, i, j) = pISet(IMATELEM(*iv, i, j));
348 }
349 }
350 delete iv;
351 return (void *)m;
352}
353
354static void * iiIm2Bim(void *data)
355{
356 intvec *iv=(intvec*)data;
357 void *r=(void *)iv2bim(iv,coeffs_BIGINT);
358 delete iv;
359 return r;
360}
361
362static void * iiN2P(void *data)
363{
364 poly p=NULL;
365 if (!nIsZero((number)data))
366 {
367 p=pNSet((number)data);
368 }
369 //else
370 //{
371 // nDelete((number *)&data);
372 //}
373 return (void *)p;
374}
375
376static void * iiN2Ma(void *data)
377{
378 ideal I=idInit(1,1);
379 if (!nIsZero((number)data))
380 {
381 poly p=pNSet((number)data);
382 I->m[0]=p;
383 }
384 //else
385 //{
386 // nDelete((number *)&data);
387 //}
388 return (void *)I;
389}
390
391static void * iiS2Link(void *data)
392{
394 slInit(l, (char *) data);
395 omFree((ADDRESS)data);
396 return (void *)l;
397}
398
399static void iiR2L_l(leftv out, leftv in)
400{
401 int add_row_shift = 0;
402 intvec *weights=(intvec*)atGet(in,"isHomog",INTVEC_CMD);
403 if (weights!=NULL) add_row_shift=weights->min_in();
404
405 syStrategy tmp=(syStrategy)in->CopyD();
406
407 out->data=(void *)syConvRes(tmp,TRUE,add_row_shift);
408}
409
410static void iiL2R(leftv out, leftv in)
411{
412 //int add_row_shift = 0;
413 lists l=(lists)in->Data();
414 intvec *ww=NULL;
415 if (l->nr>=0) ww=(intvec *)atGet(&(l->m[0]),"isHomog",INTVEC_CMD);
416 out->data=(void *)syConvList(l);
417 if (ww!=NULL)
418 {
419 intvec *weights=ivCopy(ww);
420 atSet(out,omStrDup("isHomog"),weights,INTVEC_CMD);
421 }
422}
423
424//
425// automatic conversions:
426//
427#define IPCONV
428#define D(A) A
429#define NULL_VAL NULL
430#include "Singular/table.h"
431/*2
432* try to convert 'input' of type 'inputType' to 'output' of type 'outputType'
433* return FALSE on success
434*/
435BOOLEAN iiConvert (int inputType, int outputType, int index, leftv input, leftv output,const struct sConvertTypes *dConvertTypes)
436{
437 output->Init();
438 if ((inputType==outputType)
439 || (outputType==DEF_CMD)
440 || ((outputType==IDHDL)&&(input->rtyp==IDHDL)))
441 {
442 memcpy(output,input,sizeof(*output));
443 input->Init();
444 return FALSE;
445 }
446 else if (outputType==ANY_TYPE)
447 {
448 output->rtyp=ANY_TYPE;
449 output->data=(char *)(long)input->Typ();
450 /* the name of the object:*/
451 if (input->e==NULL)
452 {
453 if (input->rtyp==IDHDL)
454 /* preserve name: copy it */
455 output->name=omStrDup(IDID((idhdl)(input->data)));
456 else if (input->name!=NULL)
457 {
458 if (input->rtyp==ALIAS_CMD)
459 output->name=omStrDup(input->name);
460 else
461 {
462 output->name=input->name;
463 input->name=NULL;
464 }
465 }
466 else if ((input->rtyp==POLY_CMD) && (input->name==NULL))
467 {
468 if (input->data!=NULL)
469 {
470 int nr=pIsPurePower((poly)input->data);
471 if (nr!=0)
472 {
473 if (pGetExp((poly)input->data,nr)==1)
474 {
475 output->name=omStrDup(currRing->names[nr-1]);
476 }
477 else
478 {
479 char *tmp=(char *)omAlloc(4);
480 sprintf(tmp,"%c%d",*(currRing->names[nr-1]),
481 (int)pGetExp((poly)input->data,nr));
482 output->name=tmp;
483 }
484 }
485 else if(pIsConstant((poly)input->data))
486 {
487 StringSetS("");
488 number n=(pGetCoeff((poly)input->data));
489 n_Write(n, currRing->cf);
490 (pGetCoeff((poly)input->data))=n; // n_Write may have changed n
491 output->name=StringEndS();
492 }
493 }
494 }
495 else if ((input->rtyp==NUMBER_CMD) && (input->name==NULL))
496 {
497 StringSetS("");
498 number n=(number)input->data;
499 n_Write(n, currRing->cf);
500 input->data=(void*)n; // n_Write may have changed n
501 output->name=StringEndS();
502 }
503 else
504 {
505 /* no need to preserve name: use it */
506 output->name=input->name;
507 input->name=NULL;
508 }
509 }
510 output->next=input->next;
511 input->next=NULL;
512 if (!errorreported) input->CleanUp();
513 return errorreported;
514 }
515 if (index!=0) /* iiTestConvert does not returned 'failure' */
516 {
517 index--;
518
519 if((dConvertTypes[index].i_typ==inputType)
520 &&(dConvertTypes[index].o_typ==outputType))
521 {
523 {
524 Print("automatic conversion %s -> %s\n",
525 Tok2Cmdname(inputType),Tok2Cmdname(outputType));
526 }
527 if ((currRing==NULL) && (outputType>BEGIN_RING) && (outputType<END_RING))
528 return TRUE;
529 output->rtyp=outputType;
531 {
532 output->data=dConvertTypes[index].p(input->CopyD());
533 }
534 else
535 {
536 dConvertTypes[index].pl(output,input);
537 }
538 if ((output->data==NULL)
539 && ((outputType!=INT_CMD)
540 &&(outputType!=POLY_CMD)
541 &&(outputType!=VECTOR_CMD)
542 &&(outputType!=NUMBER_CMD)))
543 {
544 return TRUE;
545 }
546 if (errorreported) return TRUE;
547 output->next=input->next;
548 input->next=NULL;
549 if ((input->rtyp!=IDHDL) && (input->attribute!=NULL))
550 {
551 input->attribute->killAll(currRing);
552 input->attribute=NULL;
553 }
554 if (input->e!=NULL)
555 {
556 Subexpr h;
557 while (input->e!=NULL)
558 {
559 h=input->e->next;
561 input->e=h;
562 }
563 }
564 //input->Init(); // seems that input (rtyp?) is still needed
565 return FALSE;
566 }
567 }
568 return TRUE;
569}
570
571/*2
572* try to convert 'inputType' in 'outputType'
573* return 0 on failure, an index (<>0) on success
574*/
575int iiTestConvert (int inputType, int outputType,const struct sConvertTypes *dConvertTypes)
576{
577 if ((inputType==outputType)
578 || (outputType==DEF_CMD)
579 || (outputType==IDHDL)
580 || (outputType==ANY_TYPE))
581 {
582 return -1;
583 }
584 if (inputType==UNKNOWN) return 0;
585
586 if ((currRing==NULL) && (outputType>BEGIN_RING) && (outputType<END_RING))
587 return 0;
588 //if ((currRing==NULL) && (outputType==CNUMBER_CMD))
589 // return 0;
590
591 // search the list
592 int i=0;
593 while (dConvertTypes[i].i_typ!=0)
594 {
595 if((dConvertTypes[i].i_typ==inputType)
596 &&(dConvertTypes[i].o_typ==outputType))
597 {
598 //Print("test convert %d to %d (%s -> %s):%d\n",inputType,outputType,
599 //Tok2Cmdname(inputType), Tok2Cmdname(outputType),i+1);
600 return i+1;
601 }
602 i++;
603 }
604 //Print("test convert %d to %d (%s -> %s):0, tested:%d\n",inputType,outputType,
605 // Tok2Cmdname(inputType), Tok2Cmdname(outputType),i);
606 return 0;
607}
void atSet(idhdl root, char *name, void *data, int typ)
Definition: attrib.cc:153
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:132
int BOOLEAN
Definition: auxiliary.h:87
#define TRUE
Definition: auxiliary.h:100
#define FALSE
Definition: auxiliary.h:96
void * ADDRESS
Definition: auxiliary.h:119
bigintmat * iv2bim(intvec *b, const coeffs C)
Definition: bigintmat.cc:349
int l
Definition: cfEzgcd.cc:100
int m
Definition: cfEzgcd.cc:128
int i
Definition: cfEzgcd.cc:132
int p
Definition: cfModGcd.cc:4078
CanonicalForm b
Definition: cfModGcd.cc:4103
Definition: idrec.h:35
Definition: intvec.h:23
int min_in()
Definition: intvec.h:121
int cols() const
Definition: intvec.h:95
int rows() const
Definition: intvec.h:96
void killAll(const ring r)
Definition: attrib.cc:189
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
void * CopyD(int t)
Definition: subexpr.cc:710
int Typ()
Definition: subexpr.cc:1019
const char * name
Definition: subexpr.h:87
int rtyp
Definition: subexpr.h:91
void * Data()
Definition: subexpr.cc:1162
void Init()
Definition: subexpr.h:107
leftv next
Definition: subexpr.h:86
void * data
Definition: subexpr.h:88
void CleanUp(ring r=currRing)
Definition: subexpr.cc:348
Subexpr e
Definition: subexpr.h:105
attr attribute
Definition: subexpr.h:89
Definition: lists.h:24
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:448
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:697
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:452
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition: coeffs.h:960
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
Definition: coeffs.h:588
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:535
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
#define Print
Definition: emacs.cc:80
const CanonicalForm int s
Definition: facAbsFact.cc:51
CanonicalForm res
Definition: facAbsFact.cc:60
int j
Definition: facHensel.cc:110
VAR short errorreported
Definition: feFopen.cc:23
void WerrorS(const char *s)
Definition: feFopen.cc:24
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:140
@ END_RING
Definition: grammar.cc:310
@ BEGIN_RING
Definition: grammar.cc:282
@ VECTOR_CMD
Definition: grammar.cc:292
@ NUMBER_CMD
Definition: grammar.cc:288
@ POLY_CMD
Definition: grammar.cc:289
static ideal idVec2Ideal(poly vec)
Definition: ideals.h:169
intvec * ivCopy(const intvec *o)
Definition: intvec.h:145
#define IMATELEM(M, I, J)
Definition: intvec.h:85
iiConvertProc p
Definition: ipconv.cc:38
static void * iiBI2V(void *data)
Definition: ipconv.cc:79
static void * iiP2V(void *data)
Definition: ipconv.cc:129
static void iiL2R(leftv out, leftv in)
Definition: ipconv.cc:410
static void * iiIm2Ma(void *data)
Definition: ipconv.cc:337
static void * iiBI2P(void *data)
Definition: ipconv.cc:50
static void iiBu2P(leftv out, leftv in)
Definition: ipconv.cc:64
static void * iiN2Ma(void *data)
Definition: ipconv.cc:376
static void * iiN2P(void *data)
Definition: ipconv.cc:362
static void * iiV2Ma(void *data)
Definition: ipconv.cc:163
static void * iiDummy(void *data)
Definition: ipconv.cc:176
void *(* iiConvertProc)(void *data)
Definition: ipconv.cc:32
static void * iiI2BI(void *data)
Definition: ipconv.cc:206
void(* iiConvertProcL)(leftv out, leftv in)
Definition: ipconv.cc:33
static void * iiP2Id(void *data)
Definition: ipconv.cc:150
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:435
static void * iiMa2Mo(void *data)
Definition: ipconv.cc:187
static void * iiI2Id(void *data)
Definition: ipconv.cc:94
static void * iiS2Link(void *data)
Definition: ipconv.cc:391
static void * iiI2Iv(void *data)
Definition: ipconv.cc:193
static void * iiI2N(void *data)
Definition: ipconv.cc:200
static void * iiMo2Ma(void *data)
Definition: ipconv.cc:181
static void iiR2L_l(leftv out, leftv in)
Definition: ipconv.cc:399
static void * iiI2V(void *data)
Definition: ipconv.cc:72
int iiTestConvert(int inputType, int outputType, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:575
static void * iiIm2Bim(void *data)
Definition: ipconv.cc:354
static void * iiBu2Id(void *data)
Definition: ipconv.cc:136
static void * iiBu2V(void *data)
Definition: ipconv.cc:116
static void * iiBI2Id(void *data)
Definition: ipconv.cc:101
static void * iiI2P(void *data)
Definition: ipconv.cc:44
iiConvertProcL pl
Definition: ipconv.cc:39
static void * iiBI2N(void *data)
Definition: ipconv.cc:241
const struct sConvertTypes dConvertTypes[]
Definition: table.h:1285
VAR coeffs coeffs_BIGINT
Definition: ipid.cc:50
#define IDID(a)
Definition: ipid.h:122
syStrategy syConvList(lists li)
Definition: ipshell.cc:3254
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
Definition: ipshell.cc:3182
STATIC_VAR Poly * h
Definition: janet.cc:971
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:37
#define MATELEM(mat, i, j)
1-based access to matrix
Definition: matpol.h:29
ip_smatrix * matrix
Definition: matpol.h:43
#define MATROWS(i)
Definition: matpol.h:26
#define MATCOLS(i)
Definition: matpol.h:27
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
slists * lists
Definition: mpr_numeric.h:146
#define nIsZero(n)
Definition: numbers.h:19
#define nInit(i)
Definition: numbers.h:24
#define omStrDup(s)
Definition: omAllocDecl.h:263
#define omAlloc(size)
Definition: omAllocDecl.h:210
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define omFree(addr)
Definition: omAllocDecl.h:261
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
#define NULL
Definition: omList.c:12
static int index(p_Length length, p_Ord ord)
Definition: p_Procs_Impl.h:592
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1473
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
Compatibility layer for legacy polynomial operations (over currRing)
#define pDelete(p_ptr)
Definition: polys.h:186
#define pIsConstant(p)
like above, except that Comp must be 0
Definition: polys.h:238
#define pSetCompP(a, i)
Definition: polys.h:303
#define pGetComp(p)
Component.
Definition: polys.h:37
#define pNSet(n)
Definition: polys.h:313
#define pMaxComp(p)
Definition: polys.h:299
#define pSetComp(p, v)
Definition: polys.h:38
#define pGetExp(p, i)
Exponent.
Definition: polys.h:41
#define pIsPurePower(p)
Definition: polys.h:248
#define pISet(i)
Definition: polys.h:312
void StringSetS(const char *st)
Definition: reporter.cc:128
char * StringEndS()
Definition: reporter.cc:151
void Werror(const char *fmt,...)
Definition: reporter.cc:189
EXTERN_VAR int traceit
Definition: reporter.h:24
#define TRACE_CONV
Definition: reporter.h:48
sBucket * sBucket_pt
Definition: sbuckets.h:16
void sBucketDestroyAdd(sBucket_pt bucket, poly *p, int *length)
Definition: sbuckets.h:68
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:35
matrix id_Module2Matrix(ideal mod, const ring R)
ideal id_Matrix2Module(matrix mat, const ring R)
converts mat to module, destroys mat
VAR omBin sSubexpr_bin
Definition: subexpr.cc:40
ssyStrategy * syStrategy
Definition: syz.h:36
#define IDHDL
Definition: tok.h:31
@ ALIAS_CMD
Definition: tok.h:34
@ INTVEC_CMD
Definition: tok.h:101
@ DEF_CMD
Definition: tok.h:58
@ INT_CMD
Definition: tok.h:96
#define UNKNOWN
Definition: tok.h:222
#define ANY_TYPE
Definition: tok.h:30