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