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;
26 typedef kBucket* kBucket_pt;
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)
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
96 } rRingOrder_t;
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
111 } rOrderType_t;
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
242 typedef skStrategy * kStrategy;
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
BOOLEAN rHasLocalOrMixedOrdering(const ring r)
Definition: ring.h:751
ideal F
Definition: ring.h:213
Definition: ring.h:133
kBucket * kBucket_pt
Definition: ring.h:25
static BOOLEAN rField_has_simple_Alloc(const ring r)
Z/p, GF(p,n), R: nCopy, nNew, nDelete are dummies.
Definition: ring.h:543
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:620
sro_ord * typ
Definition: ring.h:266
BOOLEAN CanShortOut
Definition: ring.h:319
for idElimination, like a, except pFDeg, pWeigths ignore it
Definition: ring.h:92
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:2908
poly(* NF_Proc)(ideal, ideal, poly, int, int, const ring _currRing)
Definition: ring.h:244
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition: coeffs.h:800
const char * rSimpleOrdStr(int ord)
Definition: ring.cc:78
unsigned long bitmask
Definition: ring.h:350
BOOLEAN rRing_is_Homog(ring r)
Definition: ring.cc:5090
ring rAssure_dp_C(const ring r)
Definition: ring.cc:4885
short start
Definition: ring.h:207
ideal(* BBA_Proc)(const ideal, const ideal, const intvec *, const intvec *, kStrategy strat, const ring)
Definition: ring.h:245
int ** wvhdl
Definition: ring.h:258
for int64 weights
Definition: ring.h:72
int * pVarOffset
Definition: ring.h:208
void pISUpdateComponents(ideal F, const intvec *const V, const int MIN, const ring r)
Definition: ring.cc:4258
nc_struct * _nc
Definition: ring.h:369
static FORCE_INLINE BOOLEAN nCoeff_is_numeric(const coeffs r)
Definition: coeffs.h:854
Definition: ring.h:61
int * syz_index
Definition: ring.h:183
BOOLEAN rOrd_is_Totaldegree_Ordering(const ring r)
Definition: ring.cc:1897
short end
Definition: ring.h:162
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:3369
ring rAssure_CompLastBlock(const ring r, BOOLEAN complete=TRUE)
makes sure that c/C ordering is last ordering
Definition: ring.cc:4613
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:437
short OrdSgn
Definition: ring.h:306
static FORCE_INLINE BOOLEAN nCoeff_is_Zp_a(const coeffs r)
Definition: coeffs.h:881
Definition: ring.h:54
non-simple ordering as specified by currRing
Definition: ring.h:100
int order_index
Definition: ring.h:222
simple ordering, exponent vector has priority component is compatible with exp-vector order
Definition: ring.h:104
short firstBlockEnds
Definition: ring.h:308
static BOOLEAN rField_is_Zp_a(const ring r)
Definition: ring.h:520
char ** names
Definition: ring.h:259
p_SetmProc p_Setm
Definition: ring.h:365
short VarL_LowIndex
Definition: ring.h:342
char * rOrdStr(ring r)
Definition: ring.cc:511
int curr_index
Definition: ring.h:184
static BOOLEAN rField_is_Ring_PtoM(const ring r)
Definition: ring.h:472
int sgn(const Rational &a)
Definition: GMPrat.cc:433
#define FALSE
Definition: auxiliary.h:94
omBin sip_sring_bin
Definition: ring.cc:44
int * pVarOffset
Definition: ring.h:199
short pOrdIndex
Definition: ring.h:337
Definition: ring.h:63
int * weights_m
Definition: ring.h:141
opposite of ls
Definition: ring.h:93
void rSetSyzComp(int k, const ring r)
Definition: ring.cc:4991
unsigned long options
Definition: ring.h:299
static int rPar(const ring r)
(r->cf->P)
Definition: ring.h:589
static FORCE_INLINE BOOLEAN nCoeff_is_long_R(const coeffs r)
Definition: coeffs.h:913
short place
Definition: ring.h:116
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
char * rString(ring r)
Definition: ring.cc:646
BOOLEAN pLexOrder
Definition: ring.h:322
static BOOLEAN rIsSyzIndexRing(const ring r)
Definition: ring.h:710
struct p_Procs_s p_Procs_s
Definition: ring.h:24
static BOOLEAN rField_is_R(const ring r)
Definition: ring.h:509
void rUnComplete(ring r)
Definition: ring.cc:3864
unsigned long divmask
Definition: ring.h:352
static int rGetCurrSyzLimit(const ring r)
Definition: ring.h:713
static BOOLEAN rIsRatGRing(const ring r)
Definition: ring.h:419
ring rAssure_c_dp(const ring r)
Definition: ring.cc:4895
omBin PolyBin
Definition: ring.h:286
static FORCE_INLINE BOOLEAN nCoeff_is_R(const coeffs r)
Definition: coeffs.h:858
BOOLEAN VectorOut
Definition: ring.h:317
\F{p < 2^31}
Definition: coeffs.h:30
pLDegProc pLDeg
Definition: ring.h:358
int * VarOffset
Definition: ring.h:272
int ref
Definition: ring.h:302
static BOOLEAN rShortOut(const ring r)
Definition: ring.h:571
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:582
short end
Definition: ring.h:152
int n_IsParam(number m, const ring r)
if m == var(i)/1 => return i,
Definition: ring.cc:5649
short place
Definition: ring.h:169
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
BOOLEAN rDBTest(ring r, const char *fn, const int l)
Definition: ring.cc:1959
long int64
Definition: auxiliary.h:66
p_Procs_s * p_Procs
Definition: ring.h:354
BOOLEAN ShortOut
Definition: ring.h:318
int r_IsRingVar(const char *n, char **names, int N)
Definition: ring.cc:213
static BOOLEAN rField_is_Q_a(const ring r)
Definition: ring.h:530
short ExpL_Size
Definition: ring.h:328
Definition: ring.h:248
#define TRUE
Definition: auxiliary.h:98
short place
Definition: ring.h:181
int limit
Definition: ring.h:182
static BOOLEAN rField_is_Domain(const ring r)
Definition: ring.h:478
short start
Definition: ring.h:117
void rKillModified_Wp_Ring(ring r)
Definition: ring.cc:2983
#define MIN(a, b)
Definition: omDebug.c:102
simple ordering, component has priority
Definition: ring.h:101
BOOLEAN rHas_c_Ordering(const ring r)
Definition: ring.cc:1767
int * weights
Definition: ring.h:128
static BOOLEAN rField_is_Zn(const ring r)
Definition: ring.h:503
ring rCopy0AndAddA(ring r, int64vec *wv64, BOOLEAN copy_qideal=TRUE, BOOLEAN copy_ordering=TRUE)
Definition: ring.cc:1468
int * weights
Definition: ring.h:139
int k
Definition: cfEzgcd.cc:92
static BOOLEAN rField_is_GF(const ring r)
Definition: ring.h:512
static char const ** rParameter(const ring r)
(r->cf->parameter)
Definition: ring.h:615
BOOLEAN ComponentOrder
Definition: ring.h:324
static BOOLEAN rField_is_Z(const ring r)
Definition: ring.h:500
long * currShiftedComponents
Definition: syz1.cc:35
void rDebugPrint(const ring r)
Definition: ring.cc:4016
static FORCE_INLINE BOOLEAN nCoeff_is_Q(const coeffs r)
Definition: coeffs.h:828
static FORCE_INLINE BOOLEAN nCoeff_is_long_C(const coeffs r)
Definition: coeffs.h:916
Definition: ring.h:59
Definition: nc.h:67
short pCompIndex
Definition: ring.h:336
short isLPring
Definition: ring.h:314
Schreyer ordering.
Definition: ring.h:107
int suffixpos
Definition: ring.h:198
short end
Definition: ring.h:137
void rChangeSComps(int *currComponents, long *currShiftedComponents, int length, ring r)
Definition: ring.cc:4337
short place
Definition: ring.h:125
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
static FORCE_INLINE BOOLEAN nCoeff_is_Z(const coeffs r)
Definition: coeffs.h:838
long(* pLDegProc)(poly p, int *length, ring r)
Definition: ring.h:38
static BOOLEAN rCanShortOut(const ring r)
Definition: ring.h:576
static FORCE_INLINE BOOLEAN nCoeff_is_Ring(const coeffs r)
Definition: coeffs.h:752
Definition: ring.h:57
short CmpL_Size
Definition: ring.h:329
int64 * weights64
Definition: ring.h:153
ring rModifyRing_Wp(ring r, int *weights)
construct Wp, C ring
Definition: ring.cc:2860
union sro_ord::@0 data
Definition: idrec.h:34
ring rAssure_InducedSchreyerOrdering(const ring r, BOOLEAN complete=TRUE, int sgn=1)
Definition: ring.cc:4769
static FORCE_INLINE BOOLEAN nCoeff_is_Q_a(const coeffs r)
Definition: coeffs.h:907
void rKillModifiedRing(ring r)
Definition: ring.cc:2973
long * ShiftedComponents
Definition: ring.h:170
rRingOrder_t * order
Definition: ring.h:254
pFDegProc pFDegOrig
Definition: ring.h:361
simple ordering, exponent vector has priority component not compatible with exp-vector order
Definition: ring.h:102
static BOOLEAN rField_has_simple_inverse(const ring r)
Definition: ring.h:539
ring rEnvelope(ring r)
Definition: ring.cc:5524
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition: coeffs.h:796
syzygy ordering
Definition: ring.h:106
ring rAssure_HasComp(const ring r)
Definition: ring.cc:4558
n_coeffType rFieldType(const ring r)
Definition: ring.cc:5119
short real_var_start
Definition: ring.h:310
pLDegProc pLDegOrig
Definition: ring.h:363
ro_typ ord_typ
Definition: ring.h:221
short start
Definition: ring.h:197
static int rBlocks(ring r)
Definition: ring.h:558
skStrategy * kStrategy
Definition: ring.h:241
static BOOLEAN rMinpolyIsNULL(const ring r)
Tests whether '(r->cf->minpoly) == NULL'.
Definition: ring.h:689
Coefficient rings, fields and other domains suitable for Singular polynomials.
ring rAssure_dp_S(const ring r)
Definition: ring.cc:4880
Definition: ring.h:179
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition: coeffs.h:932
poly ppNoether
Definition: ring.h:288
Definition: intvec.h:17
void rGetSComps(int **currComponents, long **currShiftedComponents, int *length, ring r)
Definition: ring.cc:4346
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:48
short end
Definition: ring.h:127
ring rAssure_SyzOrder(const ring r, BOOLEAN complete)
Definition: ring.cc:4362
#define assume(x)
Definition: mod2.h:390
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:398
ring rModifyRing(ring r, BOOLEAN omit_degree, BOOLEAN omit_comp, unsigned long exp_limit)
Definition: ring.cc:2613
The main handler for Singular numbers which are suitable for Singular polynomials.
n_Procs_s * cf
Definition: ring.h:366
BOOLEAN rCheckIV(const intvec *iv)
Definition: ring.cc:176
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
ring rCopy(ring r)
Definition: ring.cc:1620
short place
Definition: ring.h:160
const nc_struct * GetNC() const
Definition: ring.h:371
ring rAssure_SyzComp_CompLastBlock(const ring r)
makes sure that c/C ordering is last ordering and SyzIndex is first
Definition: ring.cc:4668
BOOLEAN LexOrder
Definition: ring.h:320
BOOLEAN MixedOrder
Definition: ring.h:321
static FORCE_INLINE BOOLEAN nCoeff_has_simple_Alloc(const coeffs r)
TRUE if n_Delete/n_New are empty operations.
Definition: coeffs.h:928
void * ext_ref
Definition: ring.h:290
short start
Definition: ring.h:151
int * block0
Definition: ring.h:255
rRingOrder_t
order stuff
Definition: ring.h:68
short start
Definition: ring.h:161
Definition: ring.h:219
All the auxiliary stuff.
int rChar(ring r)
Definition: ring.cc:686
int m
Definition: cfEzgcd.cc:121
int64 * rGetWeightVec(const ring r)
Definition: ring.cc:5138
BOOLEAN rHasSimpleLexOrder(const ring r)
returns TRUE, if simple lp or ls ordering
Definition: ring.cc:1803
static FORCE_INLINE BOOLEAN nCoeff_is_Ring_PtoM(const coeffs r)
Definition: coeffs.h:749
idrec * idhdl
Definition: ring.h:22
int rSum(ring r1, ring r2, ring &sum)
Definition: ring.cc:1321
int i
Definition: cfEzgcd.cc:125
Induced (Schreyer) ordering.
Definition: ring.h:94
static char * rRingVar(short i, const ring r)
Definition: ring.h:567
void(* p_SetmProc)(poly p, const ring r)
Definition: ring.h:40
static BOOLEAN rField_is_Q(const ring r)
Definition: ring.h:497
Definition: qr.h:45
S?
Definition: ring.h:76
Definition: ring.h:148
BOOLEAN rOrd_SetCompRequiresSetm(const ring r)
return TRUE if p_SetComp requires p_Setm
Definition: ring.cc:1877
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
Definition: coeffs.h:861
ring rAssure_TDeg(const ring r, int &pos)
Definition: ring.cc:4463
static FORCE_INLINE n_coeffType getCoeffType(const coeffs r)
Returns the type of coeffs domain.
Definition: coeffs.h:421
BOOLEAN rHasMixedOrdering(const ring r)
Definition: ring.h:752
Definition: ring.h:62
int * VarL_Offset
Definition: ring.h:347
syzcomp2dpc
Definition: ring.h:108
static BOOLEAN rField_is_long_C(const ring r)
Definition: ring.h:536
short place
Definition: ring.h:135
Definition: ring.h:62
ring rOpposite(ring r)
Definition: ring.cc:5194
static BOOLEAN rField_is_Zp(const ring r)
Definition: ring.h:491
rOrderType_t
Definition: ring.h:98
pFDegProc pFDeg
Definition: ring.h:357
ring rAssure_SyzComp(const ring r, BOOLEAN complete=TRUE)
Definition: ring.cc:4367
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
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:469
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:475
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
#define NULL
Definition: omList.c:10
ring rDefault(int ch, int N, char **n)
Definition: ring.cc:156
short N
Definition: ring.h:304
short BitsPerExp
Definition: ring.h:334
BOOLEAN rHasGlobalOrdering(const ring r)
Definition: ring.h:750
long(* pFDegProc)(poly p, ring r)
Definition: ring.h:39
short real_var_end
Definition: ring.h:310
static BOOLEAN rField_is_long_R(const ring r)
Definition: ring.h:533
rOrderType_t rGetOrderType(ring r)
Definition: ring.cc:1724
static BOOLEAN length(leftv result, leftv arg)
Definition: interval.cc:263
int limit
Definition: ring.h:210
int * firstwv
Definition: ring.h:284
char * rVarStr(ring r)
Definition: ring.cc:596
unsigned long rGetExpSize(unsigned long bitmask, int &bits, int N)
Definition: ring.cc:2573
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
Definition: ring.h:56
BOOLEAN rHasSimpleOrder(const ring r)
Definition: ring.cc:1771
void rSetWeightVec(ring r, int64 *wv)
Definition: ring.cc:5148
ring rAssure_C_dp(const ring r)
Definition: ring.cc:4890
Definition: ring.h:53
BOOLEAN rIsPolyVar(int i, const ring r)
returns TRUE if var(i) belongs to p-block
Definition: ring.cc:1920
short end
Definition: ring.h:118
idhdl idroot
Definition: ring.h:253
Definition: ring.h:205
poly rGetVar(const int varIndex, const ring r)
Definition: ring.cc:5639
long length
Definition: ring.h:173
void rModify_a_to_A(ring r)
Definition: ring.cc:5616
static int rInternalChar(const ring r)
Definition: ring.h:679
short place
Definition: ring.h:150
char * rParStr(ring r)
Definition: ring.cc:622
#define const
Definition: fegetopt.c:41
BOOLEAN rRing_has_CompLastBlock(ring r)
Definition: ring.cc:5112
Definition: ring.h:55
short end
Definition: ring.h:207
short len_gen
Definition: ring.h:138
BOOLEAN rHasTDeg(const ring r)
Definition: ring.cc:4445
int rGetMaxSyzComp(int i, const ring r)
return the max-comonent wchich has syzIndex i Assume: i<= syzIndex_limit
Definition: ring.cc:5063
int p
Definition: cfModGcd.cc:4019
int * NegWeightL_Offset
Definition: ring.h:270
void p_DebugPrint(poly p, const ring r)
Definition: ring.cc:4221
short start
Definition: ring.h:136
static BOOLEAN rField_has_Units(const ring r)
Definition: ring.h:481
short VarL_Size
Definition: ring.h:333
ideal qideal
extension to the ring structure: qring, rInit, OR for Q_a/Zp_a, rInit (replaces minideal!...
Definition: ring.h:276
static BOOLEAN rOrd_is_Comp_dp(const ring r)
Definition: ring.h:766
int rTypeOfMatrixOrder(const intvec *order)
Definition: ring.cc:186
simple ordering, differences in component are not considered
Definition: ring.h:109
int * Components
Definition: ring.h:171
static Poly * h
Definition: janet.cc:972
int BOOLEAN
Definition: auxiliary.h:85
s?
Definition: ring.h:77
static BOOLEAN rIsNCRing(const ring r)
Definition: ring.h:409
BOOLEAN idIs0(ideal h)
returns true if h is the zero ideal
short OrdSize
Definition: ring.h:338
static FORCE_INLINE BOOLEAN nCoeff_is_Zn(const coeffs r)
Definition: coeffs.h:848
rRingOrder_t rOrderName(char *ordername)
Definition: ring.cc:497
void p_SetGlobals(const ring r, BOOLEAN complete=TRUE)
set all properties of a new ring - also called by rComplete
Definition: ring.cc:3334
static BOOLEAN rField_is_numeric(const ring r)
Definition: ring.h:506
short start
Definition: ring.h:126
short ExpPerLong
Definition: ring.h:335
long * ordsgn
Definition: ring.h:262
Definition: ring.h:123
short NegWeightL_Size
Definition: ring.h:344
int l
Definition: cfEzgcd.cc:93
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
Definition: ring.h:158
Definition: ring.h:114
int * block1
Definition: ring.h:256
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
void rWrite(ring r, BOOLEAN details=FALSE)
Definition: ring.cc:227
nc_struct *& GetNC()
Definition: ring.h:372
ro_typ
Definition: ring.h:51
ring rCopy0(const ring r, BOOLEAN copy_qideal=TRUE, BOOLEAN copy_ordering=TRUE)
Definition: ring.cc:1340
intvec * pModW
Definition: ring.h:287