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