ring.h
Go to the documentation of this file.
1 #ifndef RING_H
2 #define RING_H
3 /****************************************
4 * Computer Algebra System SINGULAR *
5 ****************************************/
6 /*
7 * ABSTRACT - the interpreter related ring operations
8 */
9 
10 /* includes */
11 #include <omalloc/omalloc.h>
12 #include <misc/auxiliary.h>
13 #include <coeffs/coeffs.h>
14 //#include <polys/monomials/polys-impl.h>
15 //
16 
17 /* forward declaration of types */
18 class idrec; typedef idrec * idhdl; // _only_ for idhdl ip_sring::idroot
19 struct spolyrec;
20 typedef struct spolyrec polyrec;
21 typedef struct spolyrec * poly;
22 typedef struct spolyrec const * const_poly;
23 struct ip_sring;
24 typedef struct ip_sring * ring;
25 typedef struct ip_sring const * const_ring;
26 class intvec;
27 class int64vec;
28 struct p_Procs_s;
29 typedef struct p_Procs_s p_Procs_s;
30 //class slists;
31 //typedef slists * lists;
32 class kBucket;
33 typedef kBucket* kBucket_pt;
34 
35 struct sip_sideal;
36 typedef struct sip_sideal * ideal;
37 typedef struct sip_sideal const * const_ideal;
38 
39 struct sip_smap;
40 typedef struct sip_smap * map;
41 typedef struct sip_smap const * const_map;
42 
43 /* the function pointer types */
44 
45 typedef long (*pLDegProc)(poly p, int *length, ring r);
46 typedef long (*pFDegProc)(poly p, ring r);
47 typedef void (*p_SetmProc)(poly p, const ring r);
48 
49 
50 /// returns a poly from dest_r which is a ShallowCopy of s_p from source_r
51 /// assumes that source_r->N == dest_r->N and that orderings are the same
52 typedef poly (*pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r,
53  omBin dest_bin);
54 
55 // ro_typ describes what to store at the corresping "data" place in p->exp
56 // none of the directly corresponds to a ring ordering (ringorder_*)
57 // as each ringorder_* blocks corrsponds to 0..2 sro-blocks
58 typedef enum
59 {
60  ro_dp, // total degree with weights 1
61  ro_wp, // total weighted degree with weights>0 in wvhdl
62  ro_am, // weights for vars + weights for gen
63  ro_wp64, // weighted64 degree weights in wvhdl
64  ro_wp_neg, // total weighted degree with weights in Z in wvhdl
65  // (with possibly negative weights)
66  ro_cp, // ??ordering duplicates variables
67  ro_syzcomp, // ??ordering indicates "subset" of component number (ringorder_S)
68  ro_syz, // component number if <=syzcomp else 0 (ringorder_s)
69  ro_isTemp, ro_is, // ??Induced Syzygy (Schreyer) ordering (and prefix data placeholder dummy) (ringorder_IS)
71 }
72 ro_typ;
73 
74 // ordering is a degree ordering
75 struct sro_dp
76 {
77  short place; // where degree is stored (in L):
78  short start; // bounds of ordering (in E):
79  short end;
80 };
81 typedef struct sro_dp sro_dp;
82 
83 // ordering is a weighted degree ordering
84 struct sro_wp
85 {
86  short place; // where weighted degree is stored (in L)
87  short start; // bounds of ordering (in E)
88  short end;
89  int *weights; // pointers into wvhdl field
90 };
91 typedef struct sro_wp sro_wp;
92 
93 // ordering is a weighted degree ordering
94 struct sro_am
95 {
96  short place; // where weighted degree is stored (in L)
97  short start; // bounds of ordering (in E)
98  short end;
99  short len_gen; // i>len_gen: weight(gen(i)):=0
100  int *weights; // pointers into wvhdl field of length (end-start+1) + len_gen + 1
101  // contents w_{start},... w_{end}, len, mod_w_1, .. mod_w_len, 0
102  int *weights_m; // pointers into wvhdl field of length len_gen + 1
103  // len_gen, mod_w_1, .. mod_w_len, 0
104 
105 };
106 typedef struct sro_am sro_am;
107 
108 // ordering is a weighted degree ordering
109 struct sro_wp64
110 {
111  short place; // where weighted degree is stored (in L)
112  short start; // bounds of ordering (in E)
113  short end;
114  int64 *weights64; // pointers into wvhdl field
115 };
116 typedef struct sro_wp64 sro_wp64;
117 
118 // ordering duplicates variables
119 struct sro_cp
120 {
121  short place; // where start is copied to (in E)
122  short start; // bounds of sources of copied variables (in E)
123  short end;
124 };
125 typedef struct sro_cp sro_cp;
126 
127 // ordering indicates "subset" of component number
129 {
130  short place; // where the index is stored (in L)
131  long *ShiftedComponents; // pointer into index field
133 #ifdef PDEBUG
134  long length;
135 #endif
136 };
137 typedef struct sro_syzcomp sro_syzcomp;
138 
139 // ordering with component number >syzcomp is lower
140 struct sro_syz
141 {
142  short place; // where the index is stored (in L)
143  int limit; // syzcomp
144  int* syz_index; // mapping Component -> SyzIndex for Comp <= limit
145  int curr_index; // SyzIndex for Component > limit
146 };
147 
148 typedef struct sro_syz sro_syz;
149 // Induced Syzygy (Schreyer) ordering is built inductively as follows:
150 // we look for changes made by ordering blocks which are between prefix/suffix markers:
151 // that is: which variables where placed by them and where (judging by v)
152 
153 // due to prefix/suffix nature we need some placeholder:
154 // prefix stores here initial state
155 // suffix cleares this up
157 {
158  short start; // 1st member SHOULD be short "place"
160  int* pVarOffset; // copy!
161 };
162 
163 // So this is the actuall thing!
164 // suffix uses last sro_ISTemp (cleares it up afterwards) and
165 // creates this block
166 struct sro_IS
167 {
168  short start, end; // which part of L we want to want to update...
169  int* pVarOffset; // same as prefix!
170 
171  int limit; // first referenced component
172 
173  // reference poly set?? // Should it be owned by ring?!!!
174  ideal F; // reference leading (module)-monomials set. owned by ring...
175 };
176 
177 typedef struct sro_IS sro_IS;
178 typedef struct sro_ISTemp sro_ISTemp;
179 
180 struct sro_ord
181 {
183  int order_index; // comes from r->order[order_index]
184  union
185  {
186  sro_dp dp;
187  sro_wp wp;
188  sro_am am;
189  sro_wp64 wp64;
190  sro_cp cp;
191  sro_syzcomp syzcomp;
192  sro_syz syz;
193  sro_IS is;
194  sro_ISTemp isTemp;
195  } data;
196 };
197 
198 #ifdef HAVE_PLURAL
199 struct nc_struct;
200 typedef struct nc_struct nc_struct;
201 #endif
203 typedef skStrategy * kStrategy;
204 
205 typedef poly (*NF_Proc)(ideal, ideal, poly, int, int, const ring _currRing);
206 typedef ideal (*BBA_Proc) (const ideal, const ideal, const intvec *, const intvec *, kStrategy strat, const ring);
207 
208 
209 struct ip_sring
210 {
211 // each entry must have a description and a procedure defining it,
212 // general ordering: pointer/structs, long, int, short, BOOLEAN/char/enum
213 // general defining procedures: rInit, rComplete, interpreter, ??
214  idhdl idroot; /* local objects , interpreter*/
215  int* order; /* array of orderings, rInit/rSleftvOrdering2Ordering */
216  int* block0; /* starting pos., rInit/rSleftvOrdering2Ordering*/
217  int* block1; /* ending pos., rInit/rSleftvOrdering2Ordering*/
218 // char** parameter; /* names of parameters, rInit */
219  int** wvhdl; /* array of weight vectors, rInit/rSleftvOrdering2Ordering */
220  char ** names; /* array of variable names, rInit */
221 
222  // what follows below here should be set by rComplete, _only_
223  long *ordsgn; /* array of +/- 1 (or 0) for comparing monomials */
224  /* ExpL_Size entries*/
225 
226  // is NULL for lp or N == 1, otherwise non-NULL (with OrdSize > 0 entries) */
227  sro_ord* typ; /* array of orderings + sizes, OrdSize entries */
228  /* if NegWeightL_Size > 0, then NegWeightL_Offset[0..size_1] is index of longs
229  in ExpVector whose values need an offset due to negative weights */
230  /* array of NegWeigtL_Size indicies */
232 
233  int* VarOffset;
234 
235 // ideal minideal;
236 // number minpoly; /* replaced by minideal->m[0] */
237  ideal qideal; /**< extension to the ring structure: qring, rInit, OR
238  for Q_a/Zp_a, rInit (replaces minideal!);
239  for a start, we assume that there is either no
240  or exactly one generator in minideal, playing
241  the role of the former minpoly; minideal may
242  also be NULL which coincides with the
243  no-generator-case **/
244 
245  int* firstwv;
246 
247  omBin PolyBin; /* Bin from where monoms are allocated */
248  intvec * pModW; /* std: module weights */
249  poly ppNoether; /* variables, set by procedures from hecke/kstd1:
250  the highest monomial below pHEdge */
251  void * ext_ref; /* libsing GAP object */
252 // #ifdef HAVE_RINGS
253 // unsigned int cf->ringtype; /* cring = 0 => coefficient field, cring = 1 => coeffs from Z/2^m */
254 // mpz_ptr cf->modBase; /* Z/(ringflag^cf->modExponent)=Z/cf->modNumber*/
255 // unsigned long cf->modExponent;
256 // unsigned long cf->modNumber; /* Z/cf->modNumber */
257 // mpz_ptr cf->modNumber;
258 // #endif
259 
260  unsigned long options; /* ring dependent options */
261 
262 // int ch; /* characteristic, rInit */
263  int ref; /* reference counter to the ring, interpreter */
264 
265  short N; /* number of vars, rInit */
266 
267  short OrdSgn; /* 1 for polynomial rings, -1 otherwise, rInit */
268 
270 #ifdef HAVE_PLURAL
271  short real_var_start, real_var_end;
272 #endif
273 
274 #ifdef HAVE_SHIFTBBA
275  short isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */
276 #endif
277 
281  BOOLEAN LexOrder; // TRUE if the monomial ordering has polynomial and power series blocks
282  BOOLEAN MixedOrder; // TRUE for global/local mixed orderings, FALSE otherwise
283  BOOLEAN pLexOrder; /* TRUE if the monomial ordering is not compatible with pFDeg */
284 
286 
287  // what follows below here should be set by rComplete, _only_
288  // contains component, but no weight fields in E */
289  short ExpL_Size; // size of exponent vector in long
290  short CmpL_Size; // portions which need to be compared
291  /* number of long vars in exp vector:
292  long vars are those longs in the exponent vector which are
293  occupied by variables, only */
294  short VarL_Size;
295  short BitsPerExp; /* number of bits per exponent */
296  short ExpPerLong; /* maximal number of Exponents per long */
297  short pCompIndex; /* p->exp.e[pCompIndex] is the component */
298  short pOrdIndex; /* p->exp[pOrdIndex] is pGetOrd(p) */
299  short OrdSize; /* size of ord vector (in sro_ord) */
300 
301  /* if >= 0, long vars in exp vector are consecutive and start there
302  if < 0, long vars in exp vector are not consecutive */
304  // number of exponents in r->VarL_Offset[0]
305  // is minimal number of exponents in a long var
307 
309  /* array of size VarL_Size,
310  VarL_Offset[i] gets i-th long var in exp vector */
312 
313  /* mask for getting single exponents */
314  unsigned long bitmask;
315  /* mask used for divisiblity tests */
316  unsigned long divmask; // rComplete
317 
318  p_Procs_s* p_Procs; // rComplete/p_ProcsSet
319 
320  /* FDeg and LDeg */
321  pFDegProc pFDeg; // rComplete/rSetDegStuff
322  pLDegProc pLDeg; // rComplete/rSetDegStuff
323 
324  /* as it was determined by rComplete */
326  /* and as it was determined before rOptimizeLDeg */
328 
331 #ifdef HAVE_PLURAL
332  private:
333  nc_struct* _nc; // private
334  public:
335  inline const nc_struct* GetNC() const { return _nc; }; // public!!!
336  inline nc_struct*& GetNC() { return _nc; }; // public!!!
337 #endif
338  public:
339  operator coeffs() const { return cf; }
340 };
341 
342 ////////// DEPRECATED
343 /////// void rChangeCurrRing(ring r);
344 
345 ring rDefault(int ch, int N, char **n);
346 ring rDefault(const coeffs cf, int N, char **n);
347 ring rDefault(int ch, int N, char **n,int ord_size, int *ord, int *block0, int *block1, int **wvhdl=NULL);
348 ring rDefault(const coeffs cf, int N, char **n,int ord_size, int *ord, int *block0, int *block1, int **wvhdl=NULL);
349 
350 // #define rIsRingVar(A) r_IsRingVar(A,currRing)
351 int r_IsRingVar(const char *n, char**names, int N);
352 void rWrite(ring r, BOOLEAN details = FALSE);
353 ring rCopy(ring r);
354 ring rCopy0(const ring r, BOOLEAN copy_qideal = TRUE, BOOLEAN copy_ordering = TRUE);
355 ring rCopy0AndAddA(ring r, int64vec *wv64, BOOLEAN copy_qideal = TRUE,
356  BOOLEAN copy_ordering = TRUE);
357 ring rOpposite(ring r);
358 ring rEnvelope(ring r);
359 
360 /// we must always have this test!
361 static inline BOOLEAN rIsPluralRing(const ring r)
362 {
363  assume(r != NULL); assume(r->cf != NULL);
364 #ifdef HAVE_PLURAL
365  nc_struct *n;
366  return (r != NULL) && ((n=r->GetNC()) != NULL) /*&& (n->type != nc_error)*/;
367 #else
368  return FALSE;
369 #endif
370 }
371 
372 static inline BOOLEAN rIsRatGRing(const ring r)
373 {
374  assume(r != NULL);
375 #ifdef HAVE_PLURAL
376  /* nc_struct *n; */
377  return (r != NULL) /* && ((n=r->GetNC()) != NULL) */
378  && (r->real_var_start>1);
379 #else
380  return FALSE;
381 #endif
382 }
383 
384 // The following are for LaScala3 only!
385 void rChangeSComps(int* currComponents, long* currShiftedComponents, int length, ring r);
386 void rGetSComps(int** currComponents, long** currShiftedComponents, int *length, ring r);
387 
388 
389 
390 const char * rSimpleOrdStr(int ord);
391 int rOrderName(char * ordername);
392 char * rOrdStr(ring r);
393 char * rVarStr(ring r);
394 char * rCharStr(ring r);
395 char * rString(ring r);
396 int rChar(ring r);
397 
398 char * rParStr(ring r);
399 
400 int rSum(ring r1, ring r2, ring &sum);
401 /// returns -1 for not compatible, 1 for compatible (and sum)
402 /// dp_dp:0: block ordering, 1: dp,dp, 2: aa(...),dp
403 /// vartest: check for name conflicts
404 int rSumInternal(ring r1, ring r2, ring &sum, BOOLEAN vartest, BOOLEAN dp_dp);
405 
406 /// returns TRUE, if r1 equals r2 FALSE, otherwise Equality is
407 /// determined componentwise, if qr == 1, then qrideal equality is
408 /// tested, as well
409 BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr = TRUE);
410 
411 /// returns TRUE, if r1 and r2 represents the monomials in the same way
412 /// FALSE, otherwise
413 /// this is an analogue to rEqual but not so strict
414 BOOLEAN rSamePolyRep(ring r1, ring r2);
415 
416 void rUnComplete(ring r);
417 
418 BOOLEAN rRing_is_Homog(ring r);
420 
421 #ifdef HAVE_RINGS
422 static inline BOOLEAN rField_is_Ring_2toM(const ring r)
423 { assume(r != NULL); assume(r->cf != NULL); return ( nCoeff_is_Ring_2toM(r->cf) ); }
424 
425 static inline BOOLEAN rField_is_Ring_ModN(const ring r)
426 { assume(r != NULL); assume(r->cf != NULL); return ( nCoeff_is_Ring_ModN(r->cf) ); }
427 
428 static inline BOOLEAN rField_is_Ring_PtoM(const ring r)
429 { assume(r != NULL); assume(r->cf != NULL); return ( nCoeff_is_Ring_PtoM(r->cf) ); }
430 
431 static inline BOOLEAN rField_is_Ring_Z(const ring r)
432 { assume(r != NULL); assume(r->cf != NULL); return ( nCoeff_is_Ring_Z(r->cf) ); }
433 
434 static inline BOOLEAN rField_is_Ring(const ring r)
435 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Ring(r->cf); }
436 
437 static inline BOOLEAN rField_is_Domain(const ring r)
438 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Domain(r->cf); }
439 
440 static inline BOOLEAN rField_has_Units(const ring r)
441 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_has_Units(r->cf); }
442 #else
443 #define rField_is_Ring(A) (0)
444 #define rField_is_Ring_2toM(A) (0)
445 #define rField_is_Ring_ModN(A) (0)
446 #define rField_is_Ring_PtoM(A) (0)
447 #define rField_is_Ring_Z(A) (0)
448 #define rField_is_Domain(A) (1)
449 #define rField_has_Units(A) (1)
450 #endif
451 
452 static inline BOOLEAN rField_is_Zp(const ring r)
453 { assume(r != NULL); assume(r->cf != NULL); return (getCoeffType(r->cf) == n_Zp); }
454 
455 static inline BOOLEAN rField_is_Zp(const ring r, int p)
456 { assume(r != NULL); assume(r->cf != NULL); return (getCoeffType(r->cf) == n_Zp) && (r->cf->ch == p); }
457 
458 static inline BOOLEAN rField_is_Q(const ring r)
459 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Q(r->cf); }
460 
461 static inline BOOLEAN rField_is_numeric(const ring r) /* R, long R, long C */
462 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_numeric(r->cf); }
463 
464 static inline BOOLEAN rField_is_R(const ring r)
465 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_R(r->cf); }
466 
467 static inline BOOLEAN rField_is_GF(const ring r)
468 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_GF(r->cf); }
469 
470 static inline BOOLEAN rField_is_GF(const ring r, int q)
471 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_GF(r->cf, q); }
472 
473 /* DO NOT USE; just here for compatibility reasons towards
474  the SINGULAR svn trunk */
475 static inline BOOLEAN rField_is_Zp_a(const ring r)
476 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Zp_a(r->cf); }
477 
478 /* DO NOT USE; just here for compatibility reasons towards
479  the SINGULAR svn trunk */
480 static inline BOOLEAN rField_is_Zp_a(const ring r, int p)
481 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Zp_a(r->cf, p); }
482 
483 /* DO NOT USE; just here for compatibility reasons towards
484  the SINGULAR svn trunk */
485 static inline BOOLEAN rField_is_Q_a(const ring r)
486 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_Q_a(r->cf); }
487 
488 static inline BOOLEAN rField_is_long_R(const ring r)
489 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_long_R(r->cf); }
490 
491 static inline BOOLEAN rField_is_long_C(const ring r)
492 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_is_long_C(r->cf); }
493 
494 static inline BOOLEAN rField_has_simple_inverse(const ring r)
495 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_has_simple_inverse(r->cf); }
496 
497 /// Z/p, GF(p,n), R: nCopy, nNew, nDelete are dummies
498 static inline BOOLEAN rField_has_simple_Alloc(const ring r)
499 { assume(r != NULL); assume(r->cf != NULL); return nCoeff_has_simple_Alloc(r->cf); }
500 
501 n_coeffType rFieldType(const ring r);
502 
503 /// this needs to be called whenever a new ring is created: new fields
504 /// in ring are created (like VarOffset), unless they already exist
505 /// with force == 1, new fields are _always_ created (overwritten),
506 /// even if they exist
507 BOOLEAN rComplete(ring r, int force = 0);
508 // use this to free fields created by rComplete //?
509 
510 /// set all properties of a new ring - also called by rComplete
511 void p_SetGlobals(const ring r, BOOLEAN complete = TRUE);
512 
513 static inline int rBlocks(ring r)
514 {
515  assume(r != NULL);
516  int i=0;
517  while (r->order[i]!=0) i++;
518  return i+1;
519 }
520 
521 // misc things
522 static inline char* rRingVar(short i, const ring r)
523 {
524  assume(r != NULL); assume(r->cf != NULL); return r->names[i];
525 }
526 static inline BOOLEAN rShortOut(const ring r)
527 {
528  assume(r != NULL); return (r->ShortOut);
529 }
530 
531 static inline BOOLEAN rCanShortOut(const ring r)
532 {
533  assume(r != NULL); return (r->CanShortOut);
534 }
535 
536 /// #define rVar(r) (r->N)
537 static inline short rVar(const ring r)
538 {
539  assume(r != NULL);
540  return r->N;
541 }
542 
543 /// (r->cf->P)
544 static inline int rPar(const ring r)
545 {
546  assume(r != NULL);
547  const coeffs C = r->cf;
548  assume(C != NULL);
549 
550  return n_NumberOfParameters(C);
551 // if( nCoeff_is_Extension(C) )
552 // {
553 // const ring R = C->extRing;
554 // assume( R != NULL );
555 // return rVar( R );
556 // }
557 // else if (nCoeff_is_GF(C))
558 // {
559 // return 1;
560 // }
561 // else if (nCoeff_is_long_C(C))
562 // {
563 // return 1;
564 // }
565 // return 0;
566 }
567 
568 
569 /// (r->cf->parameter)
570 static inline char const ** rParameter(const ring r)
571 {
572  assume(r != NULL);
573  const coeffs C = r->cf;
574  assume(C != NULL);
575 
576  return n_ParameterNames(C);
577 // if( nCoeff_is_Extension(C) ) // only alg / trans. exts...
578 // {
579 // const ring R = C->extRing;
580 // assume( R != NULL );
581 // return R->names;
582 // }
583 // else if (nCoeff_is_GF(C))
584 // {
585 // return &(C->m_nfParameter);
586 // }
587 // else if (nCoeff_is_long_C(C))
588 // {
589 // return &(C->complex_parameter);
590 // }
591 // return NULL;
592 }
593 
594 /// return the specified parameter as a (new!) number in the given
595 /// polynomial ring, or NULL if invalid
596 /// parameters (as variables) begin with 1!
597 static inline number n_Param(const short iParameter, const ring r)
598 {
599  assume(r != NULL);
600  const coeffs C = r->cf;
601  assume(C != NULL);
602  return n_Param(iParameter, C);
603 // const n_coeffType _filed_type = getCoeffType(C);
604 //
605 // if ( iParameter <= 0 || iParameter > rPar(r) )
606 // // Wrong parameter
607 // return NULL;
608 //
609 // if( _filed_type == n_algExt )
610 // return naParameter(iParameter, C);
611 //
612 // if( _filed_type == n_transExt )
613 // return ntParameter(iParameter, C);
614 //
615 // if (_filed_type == n_GF)// if (nCoeff_is_GF(C))
616 // {
617 // number nfPar (int i, const coeffs);
618 // return nfPar(iParameter, C);
619 // }
620 //
621 // if (_filed_type == n_long_C) // if (nCoeff_is_long_C(C))
622 // {
623 // number ngcPar(int i, const coeffs r);
624 // return ngcPar(iParameter, C);
625 // }
626 //
627 // return NULL;
628 }
629 
630 /// if m == var(i)/1 => return i,
631 int n_IsParam(number m, const ring r);
632 
633 //#define rInternalChar(r) ((r)->cf->ch)
634 static inline int rInternalChar(const ring r)
635 {
636  assume(r != NULL);
637  const coeffs C = r->cf;
638  assume(C != NULL);
639  return C->ch;
640 }
641 
642 
643 /// Tests whether '(r->cf->minpoly) == NULL'
644 static inline BOOLEAN rMinpolyIsNULL(const ring r)
645 {
646  assume(r != NULL);
647  const coeffs C = r->cf;
648  assume(C != NULL);
649 
650  const BOOLEAN ret = nCoeff_is_algExt(C); // || nCoeff_is_GF(C) || nCoeff_is_long_C(C);
651 
652  if( ret )
653  {
654  assume( (C->extRing) != NULL );
655  BOOLEAN idIs0 (ideal h);
656  assume((!((C->extRing)->qideal==NULL)) && (!idIs0((C->extRing)->qideal)));
657  }
658 
659  // TODO: this leads to test fails (due to rDecompose?)
660  return !ret;
661 }
662 
663 
664 
665 /// order stuff
666 typedef enum rRingOrder_t
667 {
670  ringorder_a64, ///< for int64 weights
674  ringorder_S, ///< S?
675  ringorder_s, ///< s?
689  // the following are only used internally
690  ringorder_aa, ///< for idElimination, like a, except pFDeg, pWeigths ignore it
691  ringorder_rs, ///< opposite of ls
692  ringorder_IS, ///< Induced (Schreyer) ordering
694 } rRingOrder_t;
695 
696 typedef enum rOrderType_t
697 {
698  rOrderType_General = 0, ///< non-simple ordering as specified by currRing
699  rOrderType_CompExp, ///< simple ordering, component has priority
700  rOrderType_ExpComp, ///< simple ordering, exponent vector has priority
701  ///< component not compatible with exp-vector order
702  rOrderType_Exp, ///< simple ordering, exponent vector has priority
703  ///< component is compatible with exp-vector order
704  rOrderType_Syz, ///< syzygy ordering
705  rOrderType_Schreyer, ///< Schreyer ordering
706  rOrderType_Syz2dpc, ///< syzcomp2dpc
707  rOrderType_ExpNoComp ///< simple ordering, differences in component are
708  ///< not considered
709 } rOrderType_t;
710 
711 static inline BOOLEAN rIsSyzIndexRing(const ring r)
712 { assume(r != NULL); assume(r->cf != NULL); return r->order[0] == ringorder_s;}
713 
714 static inline int rGetCurrSyzLimit(const ring r)
715 { assume(r != NULL); assume(r->cf != NULL); return (rIsSyzIndexRing(r)? r->typ[0].data.syz.limit : 0);}
716 
717 void rSetSyzComp(int k, const ring r);
718 
719 // Ring Manipulations
720 ring rAssure_HasComp(const ring r);
721 ring rAssure_SyzOrder(const ring r, BOOLEAN complete);
722 ring rAssure_SyzComp(const ring r, BOOLEAN complete = TRUE);
723 
724 ring rAssure_dp_S(const ring r);
725 ring rAssure_dp_C(const ring r);
726 ring rAssure_C_dp(const ring r);
727 ring rAssure_c_dp(const ring r);
728 
729 /// makes sure that c/C ordering is last ordering
730 ring rAssure_CompLastBlock(const ring r, BOOLEAN complete = TRUE);
731 
732 /// makes sure that c/C ordering is last ordering and SyzIndex is first
733 ring rAssure_SyzComp_CompLastBlock(const ring r, BOOLEAN complete = TRUE);
734 ring rAssure_TDeg(const ring r, int start_var, int end_var, int &pos);
735 
736 /// return the max-comonent wchich has syzIndex i
737 /// Assume: i<= syzIndex_limit
738 int rGetMaxSyzComp(int i, const ring r);
739 
740 BOOLEAN rHasSimpleOrder(const ring r);
741 BOOLEAN rHas_c_Ordering(const ring r);
742 
743 /// returns TRUE, if simple lp or ls ordering
744 BOOLEAN rHasSimpleLexOrder(const ring r);
745 
746 //???? return TRUE if p->exp[r->pOrdIndex] holds total degree of p ???
747 
748 
749 inline BOOLEAN rHasGlobalOrdering(const ring r){ return (r->OrdSgn==1); }
750 inline BOOLEAN rHasLocalOrMixedOrdering(const ring r){ return (r->OrdSgn==-1); }
751 inline BOOLEAN rHasMixedOrdering(const ring r) { return (r->MixedOrder); }
752 
753 // #define rHasGlobalOrdering(R) ((R)->OrdSgn==1)
754 // #define rHasLocalOrMixedOrdering(R) ((R)->OrdSgn==-1)
755 
756 #define rHasGlobalOrdering_currRing() rHasGlobalOrdering(currRing)
757 #define rHasLocalOrMixedOrdering_currRing() rHasLocalOrMixedOrdering(currRing)
758 
760 
761 /// return TRUE if p_SetComp requires p_Setm
764 
765 /// returns TRUE if var(i) belongs to p-block
766 BOOLEAN rIsPolyVar(int i, const ring r);
767 
768 static inline BOOLEAN rOrd_is_Comp_dp(const ring r)
769 {
770  assume(r != NULL);
771  assume(r->cf != NULL);
772  return ((r->order[0] == ringorder_c || r->order[0] == ringorder_C) &&
773  r->order[1] == ringorder_dp &&
774  r->order[2] == 0);
775 }
776 
777 #ifdef RDEBUG
778 #define rTest(r) rDBTest(r, __FILE__, __LINE__)
779 extern BOOLEAN rDBTest(ring r, const char* fn, const int l);
780 #else
781 #define rTest(r) (TRUE)
782 #endif
783 
784 ring rModifyRing(ring r, BOOLEAN omit_degree,
785  BOOLEAN omit_comp,
786  unsigned long exp_limit);
787 
788 /// construct Wp, C ring
789 ring rModifyRing_Wp(ring r, int* weights);
790 void rModify_a_to_A(ring r);
791 
792 void rKillModifiedRing(ring r);
793 // also frees weights
794 void rKillModified_Wp_Ring(ring r);
795 
796 ring rModifyRing_Simple(ring r, BOOLEAN omit_degree, BOOLEAN omit_comp, unsigned long exp_limit, BOOLEAN &simple);
797 void rKillModifiedRing_Simple(ring r);
798 
799 #ifdef RDEBUG
800 void rDebugPrint(const ring r);
801 // void pDebugPrint(poly p);
802 void p_DebugPrint(poly p, const ring r);
803 #endif
804 
805 int64 * rGetWeightVec(const ring r);
806 void rSetWeightVec(ring r, int64 *wv);
807 
808 /////////////////////////////
809 // Auxillary functions
810 //
811 
812 /* return the varIndex-th ring variable as a poly;
813  varIndex starts at index 1 */
814 poly rGetVar(const int varIndex, const ring r);
815 
816 BOOLEAN rSetISReference(const ring r, const ideal F, const int i = 0, const int p = 0);
817 
818 /// return the position of the p^th IS block order block in r->typ[]...
819 int rGetISPos(const int p, const ring r);
820 
821 BOOLEAN rCheckIV(const intvec *iv);
822 int rTypeOfMatrixOrder(const intvec *order);
823 
824 void rDelete(ring r); // To be used instead of rKill!
825 
826 extern omBin sip_sring_bin;
827 #endif
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:750
short N
Definition: ring.h:265
ideal F
Definition: ring.h:174
Definition: ring.h:94
kBucket * kBucket_pt
Definition: ring.h:32
static BOOLEAN rField_has_simple_Alloc(const ring r)
Z/p, GF(p,n), R: nCopy, nNew, nDelete are dummies.
Definition: ring.h:498
BOOLEAN rSetISReference(const ring r, const ideal F, const int i=0, const int p=0)
Changes r by setting induced ordering parameters: limit and reference leading terms F belong to r...
Definition: ring.cc:4937
char * rCharStr(ring r)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar...
Definition: ring.cc:618
BOOLEAN VectorOut
Definition: ring.h:278
for idElimination, like a, except pFDeg, pWeigths ignore it
Definition: ring.h:690
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
ring rModifyRing_Simple(ring r, BOOLEAN omit_degree, BOOLEAN omit_comp, unsigned long exp_limit, BOOLEAN &simple)
Definition: ring.cc:2891
poly(* NF_Proc)(ideal, ideal, poly, int, int, const ring _currRing)
Definition: ring.h:205
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition: coeffs.h:801
const char * rSimpleOrdStr(int ord)
Definition: ring.cc:88
BOOLEAN rRing_is_Homog(ring r)
Definition: ring.cc:5083
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_ModN(const coeffs r)
Definition: coeffs.h:749
pFDegProc pFDegOrig
Definition: ring.h:325
ring rAssure_dp_C(const ring r)
Definition: ring.cc:4885
short start
Definition: ring.h:168
ideal(* BBA_Proc)(const ideal, const ideal, const intvec *, const intvec *, kStrategy strat, const ring)
Definition: ring.h:206
for int64 weights
Definition: ring.h:670
int * pVarOffset
Definition: ring.h:169
pFDegProc pFDeg
Definition: ring.h:321
static FORCE_INLINE BOOLEAN nCoeff_is_numeric(const coeffs r)
Definition: coeffs.h:835
short CmpL_Size
Definition: ring.h:290
n_Procs_s * cf
Definition: ring.h:330
Definition: ring.h:68
int * syz_index
Definition: ring.h:144
BOOLEAN rOrd_is_Totaldegree_Ordering(const ring r)
Definition: ring.cc:1895
short end
Definition: ring.h:123
omBin_t * omBin
Definition: omStructs.h:12
BOOLEAN rComplete(ring r, int force=0)
this needs to be called whenever a new ring is created: new fields in ring are created (like VarOffse...
Definition: ring.cc:3436
ring rAssure_CompLastBlock(const ring r, BOOLEAN complete=TRUE)
makes sure that c/C ordering is last ordering
Definition: ring.cc:4614
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a(const coeffs r)
Definition: coeffs.h:862
Definition: ring.h:61
non-simple ordering as specified by currRing
Definition: ring.h:698
int order_index
Definition: ring.h:183
simple ordering, exponent vector has priority < component is compatible with exp-vector order ...
Definition: ring.h:702
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:475
char * rOrdStr(ring r)
Definition: ring.cc:522
int curr_index
Definition: ring.h:145
static BOOLEAN rField_is_Ring_PtoM(const ring r)
Definition: ring.h:428
#define FALSE
Definition: auxiliary.h:140
omBin sip_sring_bin
Definition: ring.cc:54
int * pVarOffset
Definition: ring.h:160
idhdl idroot
Definition: ring.h:214
Definition: ring.h:70
int * weights_m
Definition: ring.h:102
return P p
Definition: myNF.cc:203
opposite of ls
Definition: ring.h:691
void rSetSyzComp(int k, const ring r)
Definition: ring.cc:4991
pLDegProc pLDeg
Definition: ring.h:322
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:544
static BOOLEAN rField_is_Ring_ModN(const ring r)
Definition: ring.h:425
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
Definition: coeffs.h:894
short place
Definition: ring.h:77
BOOLEAN rSamePolyRep(ring r1, ring r2)
returns TRUE, if r1 and r2 represents the monomials in the same way FALSE, otherwise this is an analo...
Definition: ring.cc:1681
char * rString(ring r)
Definition: ring.cc:644
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:711
struct p_Procs_s p_Procs_s
Definition: ring.h:29
static BOOLEAN rField_is_R(const ring r)
Definition: ring.h:464
void rUnComplete(ring r)
Definition: ring.cc:3882
pLDegProc pLDegOrig
Definition: ring.h:327
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:714
intvec * pModW
Definition: ring.h:248
static BOOLEAN rIsRatGRing(const ring r)
Definition: ring.h:372
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_Z(const coeffs r)
Definition: coeffs.h:755
ring rAssure_c_dp(const ring r)
Definition: ring.cc:4895
static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
Definition: coeffs.h:839
{p < 2^31}
Definition: coeffs.h:30
static BOOLEAN rShortOut(const ring r)
Definition: ring.h:526
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_2toM(const coeffs r)
Definition: coeffs.h:746
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:537
short end
Definition: ring.h:113
int n_IsParam(number m, const ring r)
if m == var(i)/1 => return i,
Definition: ring.cc:5642
short place
Definition: ring.h:130
static FORCE_INLINE BOOLEAN nCoeff_has_simple_inverse(const coeffs r)
TRUE, if the computation of the inverse is fast, i.e. prefer leading coeff. 1 over content...
Definition: coeffs.h:905
BOOLEAN rDBTest(ring r, const char *fn, const int l)
Definition: ring.cc:1956
ring rAssure_SyzComp_CompLastBlock(const ring r, BOOLEAN complete=TRUE)
makes sure that c/C ordering is last ordering and SyzIndex is first
Definition: ring.cc:4669
long int64
Definition: auxiliary.h:112
int r_IsRingVar(const char *n, char **names, int N)
Definition: ring.cc:222
static BOOLEAN rField_is_Q_a(const ring r)
Definition: ring.h:485
Definition: ring.h:209
#define TRUE
Definition: auxiliary.h:144
const nc_struct * GetNC() const
Definition: ring.h:335
short place
Definition: ring.h:142
int limit
Definition: ring.h:143
unsigned long divmask
Definition: ring.h:316
static BOOLEAN rField_is_Domain(const ring r)
Definition: ring.h:437
short start
Definition: ring.h:78
void rKillModified_Wp_Ring(ring r)
Definition: ring.cc:2972
simple ordering, component has priority
Definition: ring.h:699
BOOLEAN rHas_c_Ordering(const ring r)
Definition: ring.cc:1765
int * weights
Definition: ring.h:89
ring rCopy0AndAddA(ring r, int64vec *wv64, BOOLEAN copy_qideal=TRUE, BOOLEAN copy_ordering=TRUE)
Definition: ring.cc:1461
int * weights
Definition: ring.h:100
int k
Definition: cfEzgcd.cc:93
static BOOLEAN rField_is_GF(const ring r)
Definition: ring.h:467
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition: ring.h:570
long * currShiftedComponents
Definition: syz1.cc:40
short firstBlockEnds
Definition: ring.h:269
void rDebugPrint(const ring r)
Definition: ring.cc:4035
short ExpL_Size
Definition: ring.h:289
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:829
BOOLEAN CanShortOut
Definition: ring.h:280
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
Definition: coeffs.h:897
Definition: ring.h:66
Definition: nc.h:83
short VarL_Size
Definition: ring.h:294
Schreyer ordering.
Definition: ring.h:705
int suffixpos
Definition: ring.h:159
short end
Definition: ring.h:98
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4356
short place
Definition: ring.h:86
int rGetISPos(const int p, const ring r)
return the position of the p^th IS block order block in r->typ[]...
Definition: ring.cc:4905
long(* pLDegProc)(poly p, int *length, ring r)
Definition: ring.h:45
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:531
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
Definition: coeffs.h:758
Definition: ring.h:64
int64 * weights64
Definition: ring.h:114
ring rModifyRing_Wp(ring r, int *weights)
construct Wp, C ring
Definition: ring.cc:2843
Definition: idrec.h:34
static FORCE_INLINE BOOLEAN nCoeff_is_Q_a(const coeffs r)
Definition: coeffs.h:888
void rKillModifiedRing(ring r)
Definition: ring.cc:2962
long * ShiftedComponents
Definition: ring.h:131
omBin PolyBin
Definition: ring.h:247
simple ordering, exponent vector has priority < component not compatible with exp-vector order ...
Definition: ring.h:700
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:494
short MinExpPerLong
Definition: ring.h:306
int * block0
Definition: ring.h:216
ring rEnvelope(ring r)
Definition: ring.cc:5517
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition: coeffs.h:797
syzygy ordering
Definition: ring.h:704
ring rAssure_HasComp(const ring r)
Definition: ring.cc:4559
n_coeffType rFieldType(const ring r)
Definition: ring.cc:5112
p_SetmProc p_Setm
Definition: ring.h:329
int ref
Definition: ring.h:263
ro_typ ord_typ
Definition: ring.h:182
short start
Definition: ring.h:158
short real_var_start
Definition: ring.h:271
short pOrdIndex
Definition: ring.h:298
static int rBlocks(ring r)
Definition: ring.h:513
skStrategy * kStrategy
Definition: ring.h:202
sro_ord * typ
Definition: ring.h:227
const ring r
Definition: syzextra.cc:208
static BOOLEAN rMinpolyIsNULL(const ring r)
Tests whether &#39;(r->cf->minpoly) == NULL&#39;.
Definition: ring.h:644
Coefficient rings, fields and other domains suitable for Singular polynomials.
ring rAssure_dp_S(const ring r)
Definition: ring.cc:4880
Definition: ring.h:140
short ExpPerLong
Definition: ring.h:296
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition: coeffs.h:913
Definition: intvec.h:14
void rGetSComps(int **currComponents, long **currShiftedComponents, int *length, ring r)
Definition: ring.cc:4365
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:49
int * order
Definition: ring.h:215
short end
Definition: ring.h:88
ring rAssure_SyzOrder(const ring r, BOOLEAN complete)
Definition: ring.cc:4381
#define assume(x)
Definition: mod2.h:405
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:361
ring rModifyRing(ring r, BOOLEAN omit_degree, BOOLEAN omit_comp, unsigned long exp_limit)
Definition: ring.cc:2596
The main handler for Singular numbers which are suitable for Singular polynomials.
BOOLEAN rCheckIV(const intvec *iv)
Definition: ring.cc:185
static FORCE_INLINE BOOLEAN nCoeff_has_Units(const coeffs r)
returns TRUE, if r is not a field and r has non-trivial units
Definition: coeffs.h:820
ring rCopy(ring r)
Definition: ring.cc:1618
short place
Definition: ring.h:121
static FORCE_INLINE BOOLEAN nCoeff_has_simple_Alloc(const coeffs r)
TRUE if n_Delete/n_New are empty operations.
Definition: coeffs.h:909
short start
Definition: ring.h:112
rRingOrder_t
order stuff
Definition: ring.h:666
short start
Definition: ring.h:122
short isLPring
Definition: ring.h:275
BOOLEAN LexOrder
Definition: ring.h:281
Definition: ring.h:180
All the auxiliary stuff.
int rChar(ring r)
Definition: ring.cc:684
int m
Definition: cfEzgcd.cc:119
int64 * rGetWeightVec(const ring r)
Definition: ring.cc:5133
BOOLEAN rHasSimpleLexOrder(const ring r)
returns TRUE, if simple lp or ls ordering
Definition: ring.cc:1801
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_PtoM(const coeffs r)
Definition: coeffs.h:752
short NegWeightL_Size
Definition: ring.h:308
idrec * idhdl
Definition: ring.h:18
int rSum(ring r1, ring r2, ring &sum)
Definition: ring.cc:1302
BOOLEAN ShortOut
Definition: ring.h:279
int i
Definition: cfEzgcd.cc:123
Induced (Schreyer) ordering.
Definition: ring.h:692
static char * rRingVar(short i, const ring r)
Definition: ring.h:522
void(* p_SetmProc)(poly p, const ring r)
Definition: ring.h:47
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:458
short BitsPerExp
Definition: ring.h:295
short OrdSize
Definition: ring.h:299
S?
Definition: ring.h:674
ring rAssure_TDeg(const ring r, int start_var, int end_var, int &pos)
Definition: ring.cc:4467
Definition: ring.h:109
BOOLEAN rOrd_SetCompRequiresSetm(const ring r)
return TRUE if p_SetComp requires p_Setm
Definition: ring.cc:1875
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
Definition: coeffs.h:842
short OrdSgn
Definition: ring.h:267
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:422
BOOLEAN rHasMixedOrdering(const ring r)
Definition: ring.h:751
Definition: ring.h:69
syzcomp2dpc
Definition: ring.h:706
static BOOLEAN rField_is_long_C(const ring r)
Definition: ring.h:491
short place
Definition: ring.h:96
Definition: ring.h:69
ring rOpposite(ring r)
Definition: ring.cc:5189
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:452
rOrderType_t
Definition: ring.h:696
int int kStrategy strat
Definition: myNF.cc:68
ring rAssure_SyzComp(const ring r, BOOLEAN complete=TRUE)
Definition: ring.cc:4386
poly(* pShallowCopyDeleteProc)(poly s_p, ring source_r, ring dest_r, omBin dest_bin)
returns a poly from dest_r which is a ShallowCopy of s_p from source_r assumes that source_r->N == de...
Definition: ring.h:52
poly ppNoether
Definition: ring.h:249
n_coeffType
Definition: coeffs.h:27
CanonicalForm cf
Definition: cfModGcd.cc:4024
The following sip_sideal structure has many different uses thoughout Singular. Basic use-cases for it...
Definition: simpleideals.h:18
static BOOLEAN rField_is_Ring_2toM(const ring r)
Definition: ring.h:422
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:434
void rKillModifiedRing_Simple(ring r)
Definition: ring.cc:2956
static FORCE_INLINE BOOLEAN nCoeff_is_Domain(const coeffs r)
returns TRUE, if r is a field or r has no zero divisors (i.e is a domain)
Definition: coeffs.h:762
#define NULL
Definition: omList.c:10
int * VarOffset
Definition: ring.h:233
ring rDefault(int ch, int N, char **n)
Definition: ring.cc:165
int * firstwv
Definition: ring.h:245
int * block1
Definition: ring.h:217
BOOLEAN rHasGlobalOrdering(const ring r)
Definition: ring.h:749
nc_struct * _nc
Definition: ring.h:333
long(* pFDegProc)(poly p, ring r)
Definition: ring.h:46
char ** names
Definition: ring.h:220
static BOOLEAN rField_is_Ring_Z(const ring r)
Definition: ring.h:431
static BOOLEAN rField_is_long_R(const ring r)
Definition: ring.h:488
rOrderType_t rGetOrderType(ring r)
Definition: ring.cc:1722
ideal qideal
extension to the ring structure: qring, rInit, OR for Q_a/Zp_a, rInit (replaces minideal!); for a sta...
Definition: ring.h:237
long * ordsgn
Definition: ring.h:223
int limit
Definition: ring.h:171
char * rVarStr(ring r)
Definition: ring.cc:594
int rSumInternal(ring r1, ring r2, ring &sum, BOOLEAN vartest, BOOLEAN dp_dp)
returns -1 for not compatible, 1 for compatible (and sum) dp_dp:0: block ordering, 1: dp,dp, 2: aa(...),dp vartest: check for name conflicts
Definition: ring.cc:722
Definition: ring.h:63
BOOLEAN rHasSimpleOrder(const ring r)
Definition: ring.cc:1769
void rSetWeightVec(ring r, int64 *wv)
Definition: ring.cc:5143
ring rAssure_C_dp(const ring r)
Definition: ring.cc:4890
Definition: ring.h:60
p_Procs_s * p_Procs
Definition: ring.h:318
BOOLEAN rIsPolyVar(int i, const ring r)
returns TRUE if var(i) belongs to p-block
Definition: ring.cc:1917
short end
Definition: ring.h:79
Definition: ring.h:166
poly rGetVar(const int varIndex, const ring r)
Definition: ring.cc:5632
BOOLEAN ComponentOrder
Definition: ring.h:285
long length
Definition: ring.h:134
void rModify_a_to_A(ring r)
Definition: ring.cc:5609
static int rInternalChar(const ring r)
Definition: ring.h:634
short place
Definition: ring.h:111
char * rParStr(ring r)
Definition: ring.cc:620
BOOLEAN MixedOrder
Definition: ring.h:282
BOOLEAN pLexOrder
Definition: ring.h:283
#define const
Definition: fegetopt.c:41
BOOLEAN rRing_has_CompLastBlock(ring r)
Definition: ring.cc:5105
Definition: ring.h:62
short len_gen
Definition: ring.h:99
int * VarL_Offset
Definition: ring.h:311
nc_struct *& GetNC()
Definition: ring.h:336
int rGetMaxSyzComp(int i, const ring r)
return the max-comonent wchich has syzIndex i Assume: i<= syzIndex_limit
Definition: ring.cc:5059
void p_DebugPrint(poly p, const ring r)
Definition: ring.cc:4240
short start
Definition: ring.h:97
polyrec * poly
Definition: hilb.h:10
static BOOLEAN rField_has_Units(const ring r)
Definition: ring.h:440
int ** wvhdl
Definition: ring.h:219
static BOOLEAN rOrd_is_Comp_dp(const ring r)
Definition: ring.h:768
int rOrderName(char *ordername)
Definition: ring.cc:508
int rTypeOfMatrixOrder(const intvec *order)
Definition: ring.cc:195
simple ordering, differences in component are < not considered
Definition: ring.h:707
int * Components
Definition: ring.h:132
static Poly * h
Definition: janet.cc:978
short VarL_LowIndex
Definition: ring.h:303
s?
Definition: ring.h:675
int BOOLEAN
Definition: auxiliary.h:131
int * NegWeightL_Offset
Definition: ring.h:231
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
void p_SetGlobals(const ring r, BOOLEAN complete=TRUE)
set all properties of a new ring - also called by rComplete
Definition: ring.cc:3401
static BOOLEAN rField_is_numeric(const ring r)
Definition: ring.h:461
short start
Definition: ring.h:87
void * ext_ref
Definition: ring.h:251
unsigned long options
Definition: ring.h:260
Definition: ring.h:84
int l
Definition: cfEzgcd.cc:94
static number n_Param(const short iParameter, const ring r)
return the specified parameter as a (new!) number in the given polynomial ring, or NULL if invalid pa...
Definition: ring.h:597
short pCompIndex
Definition: ring.h:297
Definition: ring.h:119
Definition: ring.h:75
BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr=TRUE)
returns TRUE, if r1 equals r2 FALSE, otherwise Equality is determined componentwise, if qr == 1, then qrideal equality is tested, as well
Definition: ring.cc:1633
void rWrite(ring r, BOOLEAN details=FALSE)
Definition: ring.cc:236
ro_typ
Definition: ring.h:58
ring rCopy0(const ring r, BOOLEAN copy_qideal=TRUE, BOOLEAN copy_ordering=TRUE)
Definition: ring.cc:1318
unsigned long bitmask
Definition: ring.h:314