My Project
Loading...
Searching...
No Matches
flintconv.cc
Go to the documentation of this file.
1// emacs edit mode for this file is -*- C++ -*-
2/****************************************
3* Computer Algebra System SINGULAR *
4****************************************/
5/*
6* ABSTRACT: convert data between Singular and Flint
7*/
8
9
10
11#include "misc/auxiliary.h"
12#include "flintconv.h"
13
14#ifdef HAVE_FLINT
15#if __FLINT_RELEASE >= 20500
16
17#include "coeffs/coeffs.h"
18#include "coeffs/longrat.h"
20
21#include "polys/sbuckets.h"
22#include "polys/clapconv.h"
23
24#include "simpleideals.h"
25
26
27int convFlintISingI (fmpz_t f)
28{
29 //return fmpz_get_si(f);
30 return (int)*f;
31}
32
33void convSingIFlintI(fmpz_t f, int p)
34{
35 fmpz_init(f);
36 *f=p;
37 //fmpz_set_si(f,p);
38 return;
39}
40
41void convFlintNSingN (mpz_t z, fmpz_t f)
42{
43 mpz_init(z);
44 fmpz_get_mpz(z,f);
45}
46
47number convFlintNSingN (fmpz_t f)
48{
49 number n;
50 if(COEFF_IS_MPZ(*f))
51 nlMPZ(COEFF_TO_PTR(*f),n,NULL);
52 else
53 {
54 mpz_t z;
55 mpz_init(z);
56 fmpz_get_mpz(z,f);
57 nlMPZ(z,n,NULL);
58 mpz_clear(z);
59 }
60 return n;
61}
62
63number convFlintNSingN (fmpq_t f, const coeffs cf)
64{
65#if __FLINT_RELEASE > 20502
66 number z;
67 if (nCoeff_is_Q(cf))
68 {
69 z=ALLOC_RNUMBER();
70 #if defined(LDEBUG)
71 z->debug=123456;
72 #endif
73 z->s=0;
74 mpz_init(z->z);
75 mpz_init(z->n);
76 fmpq_get_mpz_frac(z->z,z->n,f);
77 }
78 else
79 {
80 mpz_t a,b;
81 mpz_init(a);
82 mpz_init(b);
83 fmpq_get_mpz_frac(a,b,f);
84 number na=n_InitMPZ(a,cf);
85 number nb=n_InitMPZ(b,cf);
86 z=n_Div(na,nb,cf);
87 n_Delete(&na,cf);
88 n_Delete(&nb,cf);
89 mpz_clear(a);
90 mpz_clear(b);
91 }
92 n_Normalize(z,cf);
93 n_Test(z,cf);
94 return z;
95#else
96 WerrorS("not implemented");
97 return NULL;
98#endif
99}
100
101number convFlintNSingN (fmpz_t f, const coeffs cf)
102{
103#if __FLINT_RELEASE > 20502
104 number z;
105 mpz_t a;
106 mpz_init(a);
107 fmpz_get_mpz(a,f);
108 z=n_InitMPZ(a,cf);
109 mpz_clear(a);
110 n_Normalize(z,cf);
111 n_Test(z,cf);
112 return z;
113#else
114 WerrorS("not implemented");
115 return NULL;
116#endif
117}
118
119number convFlintNSingN_QQ (fmpq_t f, const coeffs cf)
120{
121#if __FLINT_RELEASE > 20502
122 if (fmpz_is_one(fmpq_denref(f)))
123 {
124 if (fmpz_fits_si(fmpq_numref(f)))
125 {
126 long i=fmpz_get_si(fmpq_numref(f));
127 return n_Init(i,cf);
128 }
129 }
130 number z=ALLOC_RNUMBER();
131 #if defined(LDEBUG)
132 z->debug=123456;
133 #endif
134 mpz_init(z->z);
135 if (fmpz_is_one(fmpq_denref(f)))
136 {
137 z->s=3;
138 fmpz_get_mpz(z->z,fmpq_numref(f));
139 }
140 else
141 {
142 z->s=0;
143 mpz_init(z->n);
144 fmpq_get_mpz_frac(z->z,z->n,f);
145 }
146 n_Test(z,cf);
147 return z;
148#else
149 WerrorS("not implemented");
150 return NULL;
151#endif
152}
153
154void convSingNFlintN(fmpz_t f, mpz_t n)
155{
156 fmpz_init(f);
157 fmpz_set_mpz(f,n);
158}
159
160void convSingNFlintN(fmpz_t f, number n)
161{
162 fmpz_init(f);
163 fmpz_set_mpz(f,(mpz_ptr)n);
164}
165
166void convSingNFlintN(fmpq_t f, number n, const coeffs cf)
167{
168 if (nCoeff_is_Q(cf))
169 {
170 fmpq_init(f);
171 if (SR_HDL(n)&SR_INT)
172 fmpq_set_si(f,SR_TO_INT(n),1);
173 else if (n->s<3)
174 {
175 fmpz_set_mpz(fmpq_numref(f), n->z);
176 fmpz_set_mpz(fmpq_denref(f), n->n);
177 }
178 else
179 {
180 mpz_t one;
181 mpz_init_set_si(one,1);
182 fmpz_set_mpz(fmpq_numref(f), n->z);
183 fmpz_set_mpz(fmpq_denref(f), one);
184 mpz_clear(one);
185 }
186 }
187 else
188 {
190 nMapFunc nMap=n_SetMap(cf,QQ);
191 if (nMap!=NULL)
192 {
193 number nn=nMap(n,cf,QQ);
194 convSingNFlintN(f,nn,QQ);
195 }
196 nKillChar(QQ);
197 }
198}
199
200void convSingNFlintN_QQ(fmpq_t f, number n)
201{
202 fmpq_init(f);
203 if (SR_HDL(n)&SR_INT)
204 fmpq_set_si(f,SR_TO_INT(n),1);
205 else if (n->s<3)
206 {
207 fmpz_set_mpz(fmpq_numref(f), n->z);
208 fmpz_set_mpz(fmpq_denref(f), n->n);
209 }
210 else
211 {
212 mpz_t one;
213 mpz_init_set_si(one,1);
214 fmpz_set_mpz(fmpq_numref(f), n->z);
215 fmpz_set_mpz(fmpq_denref(f), one);
216 mpz_clear(one);
217 }
218}
219
220void convSingNFlintNN(fmpq_t re, fmpq_t im, number n, const coeffs cf)
221{
222 number n_2=n_RePart(n,cf);
223 convSingNFlintN(re,n_2,cf);
224 n_Delete(&n_2,cf);
225 n_2=n_ImPart(n,cf);
226 convSingNFlintN(im,n_2,cf);
227 n_Delete(&n_2,cf);
228}
229
230void convSingPFlintP(fmpq_poly_t res, poly p, const ring r)
231{
232 int d=p_GetExp(p,1,r);
233 fmpq_poly_init2(res,d+1);
234 _fmpq_poly_set_length (res, d + 1);
235 while(p!=NULL)
236 {
237 number n=pGetCoeff(p);
238 fmpq_t c;
239 convSingNFlintN(c,n,r->cf);
240 fmpq_poly_set_coeff_fmpq(res,p_GetExp(p,1,r),c);
241 fmpq_clear(c);
242 pIter(p);
243 }
244}
245
246void convSingImPFlintP(fmpq_poly_t res, poly p, const ring r)
247{
248 int d=p_GetExp(p,1,r);
249 fmpq_poly_init2(res,d+1);
250 _fmpq_poly_set_length (res, d + 1);
251 while(p!=NULL)
252 {
253 number n=n_ImPart(pGetCoeff(p),r->cf);
254 fmpq_t c;
255 convSingNFlintN(c,n,r->cf);
256 fmpq_poly_set_coeff_fmpq(res,p_GetExp(p,1,r),c);
257 fmpq_clear(c);
258 n_Delete(&n,r->cf);
259 pIter(p);
260 }
261}
262
263poly convFlintPSingP(fmpq_poly_t f, const ring r)
264{
265 int d=fmpq_poly_length(f);
266 poly p=NULL;
267 fmpq_t c;
268 fmpq_init(c);
269 for(int i=0; i<=d; i++)
270 {
271 fmpq_poly_get_coeff_fmpq(c,f,i);
272 number n=convFlintNSingN(c,r->cf);
273 poly pp=p_Init(r);
274 pSetCoeff0(pp,n);
275 p_SetExp(pp,1,i,r);
276 p_Setm(pp,r);
277 p=p_Add_q(p,pp,r);
278 }
279 fmpq_clear(c);
280 p_Test(p,r);
281 return p;
282}
283
284void convSingPFlintnmod_poly_t(nmod_poly_t result, const poly p, const ring r)
285{
286 // assume univariate, r->cf=Z/p
287 nmod_poly_init2 (result,rChar(r),p_Deg(p,r));
288 poly h=p;
289 while(h!=NULL)
290 {
291 if (h==NULL)
292 nmod_poly_set_coeff_ui(result,0,0);
293 else
294 nmod_poly_set_coeff_ui(result,p_GetExp(h,1,r),n_Int(pGetCoeff(h),r->cf)+rChar(r));
295 pIter(h);
296 }
297}
298
299void convSingMFlintFq_nmod_mat(matrix m, fq_nmod_mat_t M, const fq_nmod_ctx_t fq_con, const ring r)
300{
301 fq_nmod_mat_init (M, (long)MATROWS(m), (long) MATCOLS(m), fq_con);
302 int i,j;
303 for(i=MATROWS(m);i>0;i--)
304 {
305 for(j=MATCOLS(m);j>0;j--)
306 {
307 convSingPFlintnmod_poly_t (M->rows[i-1]+j-1, MATELEM(m,i,j),r);
308 }
309 }
310}
311
312poly convFlintFq_nmodSingP(const fq_nmod_t Fp, const fq_nmod_ctx_t ctx, const ring r)
313{
314 poly p=NULL;
315 poly h;
316 for (int i= 0; i < nmod_poly_length (Fp); i++)
317 {
318 ulong coeff= nmod_poly_get_coeff_ui (Fp, i);
319 if (coeff != 0)
320 h=p_NSet(n_Init(coeff,r->cf),r);
321 if (h!=NULL)
322 {
323 p_SetExp(h,1,i,r);
324 p_Setm(h,r);
325 p=p_Add_q(p,h,r);
326 }
327 }
328 return p;
329}
330
331matrix convFlintFq_nmod_matSingM(fq_nmod_mat_t m, const fq_nmod_ctx_t fq_con, const ring r)
332{
333 matrix M=mpNew(fq_nmod_mat_nrows (m, fq_con),fq_nmod_mat_ncols (m, fq_con));
334 int i,j;
335 for(i=MATROWS(M);i>0;i--)
336 {
337 for(j=MATCOLS(M);j>0;j--)
338 {
339 MATELEM(M,i,j)=convFlintFq_nmodSingP(fq_nmod_mat_entry (m, i-1, j-1),
340 fq_con, r);
341 }
342 }
343 return M;
344}
345
346void convSingMFlintNmod_mat(matrix m, nmod_mat_t M, const ring r)
347{
348 nmod_mat_init (M, (long)MATROWS(m), (long) MATCOLS(m), rChar(r));
349 int i,j;
350 for(i=MATROWS(m);i>0;i--)
351 {
352 for(j=MATCOLS(m);j>0;j--)
353 {
354 poly h=MATELEM(m,i,j);
355 if (h==NULL)
356 nmod_mat_entry(M,i-1,j-1)=0;
357 else
358 nmod_mat_entry(M,i-1,j-1)=(long)pGetCoeff(h);
359 }
360 }
361}
362
363matrix convFlintNmod_matSingM(nmod_mat_t m, const ring r)
364{
365 matrix M=mpNew(nmod_mat_nrows (m),nmod_mat_ncols (m));
366 int i,j;
367 for(i=MATROWS(M);i>0;i--)
368 {
369 for(j=MATCOLS(M);j>0;j--)
370 {
371 MATELEM(M,i,j)=p_ISet(nmod_mat_entry (m, i-1, j-1),r);
372 }
373 }
374 return M;
375}
376
377matrix singflint_rref(matrix m, const ring R)
378{
379 int r=m->rows();
380 int c=m->cols();
381 int i,j;
382 matrix M=mpNew(r,c);
383 if (rField_is_Q(R))
384 {
385 fmpq_mat_t FLINTM;
386 fmpq_mat_init(FLINTM,r,c);
387 number n=n_Init(0,R->cf);
388 for(i=r;i>0;i--)
389 {
390 for(j=c;j>0;j--)
391 {
392 poly h=MATELEM(m,i,j);
393 if (h==NULL)
394 convSingNFlintN(fmpq_mat_entry(FLINTM,i-1,j-1),n,R->cf);
395 else if (p_Totaldegree(h,R)==0)
396 convSingNFlintN(fmpq_mat_entry(FLINTM,i-1,j-1),pGetCoeff(h),R->cf);
397 else
398 {
399 WerrorS("matrix for rref is nor constant");
400 return M;
401 }
402 }
403 }
404 n_Delete(&n,R->cf);
405 fmpq_mat_rref(FLINTM,FLINTM);
406 for(i=r;i>0;i--)
407 {
408 for(j=c;j>0;j--)
409 {
410 n=convFlintNSingN(fmpq_mat_entry(FLINTM,i-1,j-1),R->cf);
411 MATELEM(M,i,j)=p_NSet(n,R);
412 }
413 }
414 fmpq_mat_clear(FLINTM);
415 }
416 else if (rField_is_Zp(R))
417 {
418 nmod_mat_t FLINTM;
419 // convert matrix
420 convSingMFlintNmod_mat(M,FLINTM,R);
421 // rank
422 long rk= nmod_mat_rref (FLINTM);
423 M=convFlintNmod_matSingM(FLINTM,R);
424 // clean up
425 nmod_mat_clear(FLINTM);
426 }
427 else
428 {
429 #if 0
430 fmpz_t p;
432 fq_nmod_ctx_init(ctx,p,1,"t");
433 fq_nmod_mat_t FLINTM;
434 // convert matrix
435 convSingMFlintFq_nmod_mat(M,FLINTM,ctx,currRing);
436 // rank
437 long rk= fq_nmod_mat_rref (FLINTM,ctx);
438 res->data=(void*)convFlintFq_nmod_matSingM(FLINTM,ctx,currRing);
439 // clean up
440 fq_nmod_mat_clear (FLINTM,ctx);
442 fmpz_clear(p);
443 #endif
444 WerrorS("not implmented for these coefficients");
445 }
446 return M;
447}
448
450{
451 int r=m->rows();
452 int c=m->cols();
453 bigintmat* res=new bigintmat(r,c,m->basecoeffs());
454 fmpz_mat_t M, Transf;
455 fmpz_mat_init(M, r, c);
456 if(T != NULL)
457 {
458 fmpz_mat_init(Transf, T->rows(), T->rows());
459 }
460 fmpz_t dummy;
461 mpz_t n;
462 int i,j;
463 for(i=r;i>0;i--)
464 {
465 for(j=c;j>0;j--)
466 {
467 n_MPZ(n, BIMATELEM(*m, i, j),m->basecoeffs());
468 convSingNFlintN(dummy,n);
469 mpz_clear(n);
470 fmpz_set(fmpz_mat_entry(M, i-1, j-1), dummy);
471 fmpz_clear(dummy);
472 }
473 }
474 if(T != NULL)
475 {
476 for(i=T->rows();i>0;i--)
477 {
478 for(j=T->rows();j>0;j--)
479 {
480 n_MPZ(n, BIMATELEM(*T, i, j),T->basecoeffs());
481 convSingNFlintN(dummy,n);
482 mpz_clear(n);
483 fmpz_set(fmpz_mat_entry(Transf, i-1, j-1), dummy);
484 fmpz_clear(dummy);
485 }
486 }
487 }
488 fmpz_lll_t fl;
489 fmpz_lll_context_init_default(fl);
490 if(T != NULL)
491 fmpz_lll(M, Transf, fl);
492 else
493 fmpz_lll(M, NULL, fl);
494 for(i=r;i>0;i--)
495 {
496 for(j=c;j>0;j--)
497 {
498 convFlintNSingN(n, fmpz_mat_entry(M, i-1, j-1));
499 n_Delete(&(BIMATELEM(*res,i,j)),res->basecoeffs());
500 BIMATELEM(*res,i,j)=n_InitMPZ(n,res->basecoeffs());
501 mpz_clear(n);
502 }
503 }
504 if(T != NULL)
505 {
506 for(i=T->rows();i>0;i--)
507 {
508 for(j=T->cols();j>0;j--)
509 {
510 convFlintNSingN(n, fmpz_mat_entry(Transf, i-1, j-1));
511 n_Delete(&(BIMATELEM(*T,i,j)),T->basecoeffs());
512 BIMATELEM(*T,i,j)=n_InitMPZ(n,T->basecoeffs());
513 mpz_clear(n);
514 }
515 }
516 }
517 return res;
518}
519
521{
522 int r=m->rows();
523 int c=m->cols();
524 intvec* res = new intvec(r,c,(int)0);
525 fmpz_mat_t M,Transf;
526 fmpz_mat_init(M, r, c);
527 if(T != NULL)
528 fmpz_mat_init(Transf, r, r);
529 fmpz_t dummy;
530 int i,j;
531 for(i=r;i>0;i--)
532 {
533 for(j=c;j>0;j--)
534 {
535 convSingIFlintI(dummy,IMATELEM(*m,i,j));
536 fmpz_set(fmpz_mat_entry(M, i-1, j-1), dummy);
537 fmpz_clear(dummy);
538 }
539 }
540 if(T != NULL)
541 {
542 for(i=T->rows();i>0;i--)
543 {
544 for(j=T->rows();j>0;j--)
545 {
546 convSingIFlintI(dummy,IMATELEM(*T,i,j));
547 fmpz_set(fmpz_mat_entry(Transf, i-1, j-1), dummy);
548 fmpz_clear(dummy);
549 }
550 }
551 }
552 fmpz_lll_t fl;
553 fmpz_lll_context_init_default(fl);
554 if(T != NULL)
555 fmpz_lll(M, Transf, fl);
556 else
557 fmpz_lll(M, NULL, fl);
558 for(i=r;i>0;i--)
559 {
560 for(j=c;j>0;j--)
561 {
562 IMATELEM(*res,i,j)=convFlintISingI(fmpz_mat_entry(M, i-1, j-1));
563 }
564 }
565 if(T != NULL)
566 {
567 for(i=Transf->r;i>0;i--)
568 {
569 for(j=Transf->r;j>0;j--)
570 {
571 IMATELEM(*T,i,j)=convFlintISingI(fmpz_mat_entry(Transf, i-1, j-1));
572 }
573 }
574 }
575 return res;
576}
577#endif
578#endif
All the auxiliary stuff.
#define BIMATELEM(M, I, J)
Definition: bigintmat.h:133
CanonicalForm FACTORY_PUBLIC pp(const CanonicalForm &)
CanonicalForm pp ( const CanonicalForm & f )
Definition: cf_gcd.cc:676
int m
Definition: cfEzgcd.cc:128
int i
Definition: cfEzgcd.cc:132
int p
Definition: cfModGcd.cc:4077
CanonicalForm cf
Definition: cfModGcd.cc:4082
CanonicalForm b
Definition: cfModGcd.cc:4102
FILE * f
Definition: checklibs.c:9
Matrices of numbers.
Definition: bigintmat.h:51
Definition: intvec.h:23
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE long n_Int(number &n, const coeffs r)
conversion of n to an int; 0 if not possible in Z/pZ: the representing int lying in (-p/2 ....
Definition: coeffs.h:547
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
Definition: coeffs.h:712
@ n_Q
rational (GMP) numbers
Definition: coeffs.h:30
static FORCE_INLINE void n_MPZ(mpz_t result, number &n, const coeffs r)
conversion of n to a GMP integer; 0 if not possible
Definition: coeffs.h:551
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:700
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
Definition: coeffs.h:615
static FORCE_INLINE number n_RePart(number i, const coeffs cf)
Definition: coeffs.h:790
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:806
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:354
#define ALLOC_RNUMBER()
Definition: coeffs.h:87
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
static FORCE_INLINE number n_InitMPZ(mpz_t n, const coeffs r)
conversion of a GMP integer to number
Definition: coeffs.h:542
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:538
static FORCE_INLINE number n_ImPart(number i, const coeffs cf)
Definition: coeffs.h:793
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:578
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:522
return result
Definition: facAbsBiFact.cc:75
CanonicalForm res
Definition: facAbsFact.cc:60
fq_nmod_ctx_t fq_con
Definition: facHensel.cc:99
int j
Definition: facHensel.cc:110
fq_nmod_ctx_clear(fq_con)
void WerrorS(const char *s)
Definition: feFopen.cc:24
This file is work in progress and currently not part of the official Singular.
void convSingPFlintP(fmpq_poly_t res, poly p, const ring r)
void convSingNFlintN(fmpz_t f, mpz_t z)
matrix convFlintNmod_matSingM(nmod_mat_t m, const ring r)
void convSingNFlintNN(fmpq_t re, fmpq_t im, number n, const coeffs cf)
void convSingIFlintI(fmpz_t f, int p)
void convSingNFlintN_QQ(fmpq_t f, number n)
void convFlintNSingN(mpz_t z, fmpz_t f)
matrix singflint_rref(matrix m, const ring R)
poly convFlintPSingP(fmpq_poly_t f, const ring r)
void convSingImPFlintP(fmpq_poly_t res, poly p, const ring r)
int convFlintISingI(fmpz_t f)
number convFlintNSingN_QQ(fmpq_t f, const coeffs cf)
bigintmat * singflint_LLL(bigintmat *A, bigintmat *T)
void convSingMFlintNmod_mat(matrix m, nmod_mat_t M, const ring r)
#define IMATELEM(M, I, J)
Definition: intvec.h:85
STATIC_VAR jList * T
Definition: janet.cc:30
STATIC_VAR Poly * h
Definition: janet.cc:971
void nlMPZ(mpz_t m, number &n, const coeffs r)
Definition: longrat.cc:2820
#define SR_INT
Definition: longrat.h:67
#define SR_TO_INT(SR)
Definition: longrat.h:69
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
#define MATROWS(i)
Definition: matpol.h:26
#define MATCOLS(i)
Definition: matpol.h:27
#define pIter(p)
Definition: monomials.h:37
#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
The main handler for Singular numbers which are suitable for Singular polynomials.
#define NULL
Definition: omList.c:12
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1293
poly p_NSet(number n, const ring r)
returns the poly representing the number n, destroys n
Definition: p_polys.cc:1465
long p_Deg(poly a, const ring r)
Definition: p_polys.cc:583
static poly p_Add_q(poly p, poly q, const ring r)
Definition: p_polys.h:908
static unsigned long p_SetExp(poly p, const unsigned long e, const unsigned long iBitmask, const int VarOffset)
set a single variable exponent @Note: VarOffset encodes the position in p->exp
Definition: p_polys.h:488
static void p_Setm(poly p, const ring r)
Definition: p_polys.h:233
static long p_GetExp(const poly p, const unsigned long iBitmask, const int VarOffset)
get a single variable exponent @Note: the integer VarOffset encodes:
Definition: p_polys.h:469
static poly p_Init(const ring r, omBin bin)
Definition: p_polys.h:1292
static long p_Totaldegree(poly p, const ring r)
Definition: p_polys.h:1479
#define p_Test(p, r)
Definition: p_polys.h:162
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:13
int rChar(ring r)
Definition: ring.cc:711
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:501
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:507
#define R
Definition: sirandom.c:27
#define M
Definition: sirandom.c:25
#define SR_HDL(A)
Definition: tgb.cc:35