source: git/libpolys/polys/monomials/ring.h @ 03bf55

spielwiese
Last change on this file since 03bf55 was 03bf55, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
FIX: adaptation of var. name changes for arithmetik rings coauthor: Frank Seelisch
  • Property mode set to 100644
File size: 20.6 KB
Line 
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/* $Id$ */
10
11/* includes */
12#include <omalloc/omalloc.h>
13#include <misc/auxiliary.h>
14#include <coeffs/coeffs.h>
15//#include <polys/monomials/polys-impl.h>
16//
17
18/* constants */
19#define SHORT_REAL_LENGTH 6 // use short reals for real <= 6 digits
20
21/* forward declaration of types */
22class idrec;
23typedef idrec *   idhdl;
24struct  spolyrec;
25typedef struct spolyrec    polyrec;
26typedef polyrec *          poly;
27struct ip_sring;
28typedef struct ip_sring *         ring;
29class intvec;
30struct p_Procs_s;
31typedef struct p_Procs_s p_Procs_s;
32class slists;
33typedef slists *           lists;
34class kBucket;
35typedef kBucket*           kBucket_pt;
36
37struct sip_sideal;
38typedef struct sip_sideal *       ideal;
39
40struct sip_smap;
41typedef struct sip_smap *         map;
42
43
44#if SIZEOF_LONG == 4
45typedef long long int64;
46#elif SIZEOF_LONG == 8
47typedef long int64;
48#else
49#error int64 undefined
50#endif
51
52/* the function pointer types */
53
54typedef long     (*pLDegProc)(poly p, int *length, ring r);
55typedef long     (*pFDegProc)(poly p, ring r);
56typedef void     (*p_SetmProc)(poly p, const ring r);
57
58
59
60typedef enum
61{
62  ro_dp, // ordering is a degree ordering
63  ro_wp, // ordering is a weighted degree ordering
64  ro_wp64, // ordering is a weighted64 degree ordering
65  ro_wp_neg, // ordering is a weighted degree ordering
66             // with possibly negative weights
67  ro_cp,    // ordering duplicates variables
68  ro_syzcomp, // ordering indicates "subset" of component number (ringorder_S)
69  ro_syz, // ordering  with component number >syzcomp is lower (ringorder_s)
70  ro_isTemp, ro_is, // Induced Syzygy (Schreyer) ordering (and prefix data placeholder dummy) (ringorder_IS)
71  ro_none
72}
73ro_typ;
74
75// ordering is a degree ordering
76struct sro_dp
77{
78  short place;  // where degree is stored (in L):
79  short start;  // bounds of ordering (in E):
80  short end;
81};
82typedef struct sro_dp sro_dp;
83
84// ordering is a weighted degree ordering
85struct sro_wp
86{
87  short place;  // where weighted degree is stored (in L)
88  short start;  // bounds of ordering (in E)
89  short end;
90  int *weights; // pointers into wvhdl field
91};
92typedef struct sro_wp sro_wp;
93
94// ordering is a weighted degree ordering
95struct sro_wp64
96{
97    short place;  // where weighted degree is stored (in L)
98    short start;  // bounds of ordering (in E)
99    short end;
100    int64 *weights64; // pointers into wvhdl field
101};
102typedef struct sro_wp64 sro_wp64;
103
104// ordering duplicates variables
105struct sro_cp
106{
107  short place;  // where start is copied to (in E)
108  short start;  // bounds of sources of copied variables (in E)
109  short end;
110};
111typedef struct sro_cp sro_cp;
112
113// ordering indicates "subset" of component number
114struct sro_syzcomp
115{
116  short place;  // where the index is stored (in L)
117  long *ShiftedComponents; // pointer into index field
118  int* Components;
119#ifdef PDEBUG
120  long length;
121#endif
122};
123typedef struct sro_syzcomp sro_syzcomp;
124
125// ordering  with component number >syzcomp is lower
126struct sro_syz
127{
128  short place;       // where the index is stored (in L)
129  int limit;         // syzcomp
130  int* syz_index;    // mapping Component -> SyzIndex for Comp <= limit
131  int  curr_index;   // SyzIndex for Component > limit
132};
133
134typedef struct sro_syz sro_syz;
135// Induced Syzygy (Schreyer) ordering is built inductively as follows:
136// we look for changes made by ordering blocks which are between prefix/suffix markers:
137// that is: which variables where placed by them and where (judging by v)
138
139// due to prefix/suffix nature we need some placeholder:
140// prefix stores here initial state
141// suffix cleares this up
142struct sro_ISTemp
143{
144  short start; // 1st member SHOULD be short "place"
145  int   suffixpos;
146  int*  pVarOffset; // copy!
147};
148
149// So this is the actuall thing!
150// suffix uses last sro_ISTemp (cleares it up afterwards) and
151// creates this block
152struct sro_IS
153{
154  short start, end;  // which part of L we want to want to update...
155  int*  pVarOffset; // same as prefix!
156
157  int limit; // first referenced component
158
159  // reference poly set?? // Should it be owned by ring?!!!
160  ideal F; // reference leading (module)-monomials set. owned by ring...
161  const intvec* componentWeights; // component weights! owned by ring...
162};
163
164typedef struct sro_IS sro_IS;
165typedef struct sro_ISTemp sro_ISTemp;
166
167struct sro_ord
168{
169  ro_typ  ord_typ;
170  int     order_index; // comes from r->order[order_index]
171  union
172  {
173     sro_dp dp;
174     sro_wp wp;
175     sro_wp64 wp64;
176     sro_cp cp;
177     sro_syzcomp syzcomp;
178     sro_syz syz;
179     sro_IS is;
180     sro_ISTemp isTemp;
181  } data;
182};
183
184#ifdef HAVE_PLURAL
185struct nc_struct;
186typedef struct nc_struct   nc_struct;
187#endif
188
189struct ip_sring
190{
191// each entry must have a description and a procedure defining it,
192// general ordering: pointer/structs, long, int, short, BOOLEAN/char/enum
193// general defining procedures: rInit, rComplete, interpreter, ??
194  idhdl      idroot; /* local objects , interpreter*/
195  int*       order;  /* array of orderings, rInit/rSleftvOrdering2Ordering */
196  int*       block0; /* starting pos., rInit/rSleftvOrdering2Ordering*/
197  int*       block1; /* ending pos., rInit/rSleftvOrdering2Ordering*/
198  char**     parameter; /* names of parameters, rInit */
199  number     minpoly;  /* for Q_a/Zp_a, rInit */
200  ideal      minideal;
201  int**      wvhdl;  /* array of weight vectors, rInit/rSleftvOrdering2Ordering */
202  char **    names;  /* array of variable names, rInit */
203
204  // what follows below here should be set by rComplete, _only_
205  long      *ordsgn;  /* array of +/- 1 (or 0) for comparing monomials */
206                       /*  ExpL_Size entries*/
207
208  // is NULL for lp or N == 1, otherwise non-NULL (with OrdSize > 0 entries) */
209  sro_ord*   typ;   /* array of orderings + sizes, OrdSize entries */
210  /* if NegWeightL_Size > 0, then NegWeightL_Offset[0..size_1] is index of longs
211  in ExpVector whose values need an offset due to negative weights */
212  /* array of NegWeigtL_Size indicies */
213  int*      NegWeightL_Offset;
214
215  int*     VarOffset;
216
217  ideal      qideal; /* extension to the ring structure: qring, rInit */
218
219  int*     firstwv;
220
221  omBin    PolyBin; /* Bin from where monoms are allocated */
222  intvec * pModW;   /* std: module weights */
223  poly      ppNoether; /*  variables, set by procedures from hecke/kstd1:
224
225                            the highest monomial below pHEdge */
226// #ifdef HAVE_RINGS
227//   unsigned int  cf->ringtype;  /* cring = 0 => coefficient field, cring = 1 => coeffs from Z/2^m */
228//   int_number    cf->modBase; /* Z/(ringflag^cf->modExponent)=Z/cf->modNumber*/
229//   unsigned long cf->modExponent;
230//   unsigned long cf->modNumber;  /* Z/cf->modNumber */
231//   int_number    cf->modNumber;
232// #endif
233 
234  unsigned long options; /* ring dependent options */
235
236  int        ch;  /* characteristic, rInit */
237  int        ref; /* reference counter to the ring, interpreter */
238
239  short      float_len; /* additional char-flags, rInit */
240  short      float_len2; /* additional char-flags, rInit */
241
242  short      N;      /* number of vars, rInit */
243
244  short      P;      /* number of pars, rInit */
245  short      OrdSgn; /* 1 for polynomial rings, -1 otherwise, rInit */
246
247  short     firstBlockEnds;
248#ifdef HAVE_PLURAL
249  short     real_var_start, real_var_end;
250#endif
251
252#ifdef HAVE_SHIFTBBA
253  short          isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */
254#endif
255
256  BOOLEAN   VectorOut;
257  BOOLEAN   ShortOut;
258  BOOLEAN   CanShortOut;
259  BOOLEAN   LexOrder; // TRUE if the monomial ordering has polynomial and power series blocks
260  BOOLEAN   MixedOrder; // TRUE for global/local mixed orderings, FALSE otherwise
261  BOOLEAN pLexOrder; /* TRUE if the monomial ordering is not compatible with pFDeg */
262
263  BOOLEAN   ComponentOrder; // ???
264
265  // what follows below here should be set by rComplete, _only_
266  // contains component, but no weight fields in E */
267  short      ExpL_Size; // size of exponent vector in long
268  short      CmpL_Size; // portions which need to be compared
269  /* number of long vars in exp vector:
270     long vars are those longs in the exponent vector which are
271     occupied by variables, only */
272  short      VarL_Size;
273  short      BitsPerExp; /* number of bits per exponent */
274  short      ExpPerLong; /* maximal number of Exponents per long */
275  short      pCompIndex; /* p->exp.e[pCompIndex] is the component */
276  short      pOrdIndex; /* p->exp[pOrdIndex] is pGetOrd(p) */
277  short      OrdSize; /* size of ord vector (in sro_ord) */
278
279  /* if >= 0, long vars in exp vector are consecutive and start there
280     if <  0, long vars in exp vector are not consecutive */
281  short     VarL_LowIndex;
282  // number of exponents in r->VarL_Offset[0]
283  // is minimal number of exponents in a long var
284  short     MinExpPerLong;
285
286  short     NegWeightL_Size;
287  /* array of size VarL_Size,
288     VarL_Offset[i] gets i-th long var in exp vector */
289  int*      VarL_Offset;
290
291  /* mask for getting single exponents */
292  unsigned long bitmask;
293  /* mask used for divisiblity tests */
294  unsigned long divmask; // rComplete
295
296  p_Procs_s*    p_Procs; // rComplete/p_ProcsSet
297
298  /* FDeg and LDeg */
299  pFDegProc     pFDeg; // rComplete/rSetDegStuff
300  pLDegProc     pLDeg; // rComplete/rSetDegStuff
301
302  /* as it was determined by rComplete */
303  pFDegProc     pFDegOrig;
304  /* and as it was determined before rOptimizeLDeg */
305  pLDegProc     pLDegOrig;
306
307  p_SetmProc    p_Setm;
308  n_Procs_s*    cf;
309  ring          algring;
310#ifdef HAVE_PLURAL
311  private:
312    nc_struct*    _nc; // private
313  public:
314    inline const nc_struct* GetNC() const { return _nc; }; // public!!!
315    inline nc_struct*& GetNC() { return _nc; }; // public!!!
316#endif
317 public:
318  operator coeffs() const { return cf; }
319};
320
321enum tHomog
322{
323   isNotHomog = FALSE,
324   isHomog    = TRUE,
325   testHomog
326};
327
328////////// DEPRECATED
329/////// void   rChangeCurrRing(ring r);
330//void   rSetHdl(idhdl h);
331//ring   rInit(sleftv* pn, sleftv* rv, sleftv* ord);
332idhdl  rDefault(const char *s);
333ring   rDefault(int ch, int N, char **n);
334ring   rDefault(coeffs cf, int N, char **n);
335ring rDefault(int ch, int N, char **n,int ord_size, int *ord, int *block0, int *block1);
336ring rDefault(coeffs cf, int N, char **n,int ord_size, int *ord, int *block0, int *block1);
337
338// #define rIsRingVar(A) r_IsRingVar(A,currRing)
339int    r_IsRingVar(const char *n, ring r);
340void   rWrite(ring r);
341//void   rKill(idhdl h);
342void   rKill(ring r);
343ring   rCopy(ring r);
344ring   rCopy0(const ring r, BOOLEAN copy_qideal = TRUE, BOOLEAN copy_ordering = TRUE);
345ring   rOpposite(ring r);
346ring   rEnvelope(ring r);
347
348/// we must always have this test!
349static inline bool rIsPluralRing(const ring r)
350{
351  assume(r != NULL);   
352#ifdef HAVE_PLURAL
353  nc_struct *n;
354  return (r != NULL) && ((n=r->GetNC()) != NULL) /*&& (n->type != nc_error)*/;
355#else
356  return false;
357#endif
358}
359
360static inline bool rIsRatGRing(const ring r)
361{
362  assume(r != NULL);
363#ifdef HAVE_PLURAL
364  /* nc_struct *n; */
365  return (r != NULL) /* && ((n=r->GetNC()) != NULL) */
366          && (r->real_var_start>1);
367#else
368  return false;
369#endif
370}
371
372
373
374
375// The following are for LaScala3 only!
376#ifdef PDEBUG
377#define rChangeSComps(c,s,l) rDBChangeSComps(c,s,l)
378#define rGetSComps(c,s,l) rDBGetSComps(c,s,l)
379void rDBChangeSComps(int* currComponents,
380                     long* currShiftedComponents,
381                     int length,
382                     ring r);
383void rDBGetSComps(int** currComponents,
384                  long** currShiftedComponents,
385                  int *length,
386                  ring r);
387#else
388#define rChangeSComps(c,s,l) rNChangeSComps(c,s)
389#define rGetSComps(c,s,l) rNGetSComps(c,s)
390#endif
391
392void rNChangeSComps(int* currComponents, long* currShiftedComponents, ring r);
393void rNGetSComps(int** currComponents, long** currShiftedComponents, ring r);
394
395//idhdl  rFindHdl(ring r, idhdl n, idhdl w);
396//idhdl rSimpleFindHdl(ring r, idhdl root, idhdl n);
397const char * rSimpleOrdStr(int ord);
398int rOrderName(char * ordername);
399char * rOrdStr(ring r);
400char * rVarStr(ring r);
401char * rCharStr(ring r);
402char * rString(ring r);
403int    rChar(ring r);
404#define rPar(r) (r->P)
405#define rVar(r) (r->N)
406char * rParStr(ring r);
407int    rIsExtension(const ring r);
408int    rSum(ring r1, ring r2, ring &sum);
409int rSumInternal(ring r1, ring r2, ring &sum, BOOLEAN vartest, BOOLEAN dp_dp);
410
411BOOLEAN rEqual(ring r1, ring r2, BOOLEAN qr = 1);
412BOOLEAN rSamePolyRep(ring r1, ring r2);
413void   rUnComplete(ring r);
414
415BOOLEAN rRing_is_Homog(ring r);
416BOOLEAN rRing_has_CompLastBlock(ring r);
417
418#ifdef HAVE_RINGS
419static inline BOOLEAN rField_is_Ring_2toM(const ring r)
420{ assume(r != NULL); return ( getCoeffType(r->cf) == n_Z2m && nCoeff_is_Ring_2toM(r->cf) ); }
421
422static inline BOOLEAN rField_is_Ring_ModN(const ring r)
423{ assume(r != NULL); return ( getCoeffType(r->cf) == n_Zn && nCoeff_is_Ring_ModN(r->cf) ); }
424
425static inline BOOLEAN rField_is_Ring_PtoM(const ring r)
426{ assume(r != NULL); return (getCoeffType(r->cf) == n_Zpn && nCoeff_is_Ring_PtoM(r->cf) ); }
427
428static inline BOOLEAN rField_is_Ring_Z(const ring r)
429{ assume(r != NULL); return (getCoeffType(r->cf) == n_Z && nCoeff_is_Ring_Z(r->cf) ); }
430
431static inline BOOLEAN rField_is_Ring(const ring r)
432{ assume(r != NULL); return nCoeff_is_Ring(r->cf); }
433
434static inline BOOLEAN rField_is_Domain(const ring r)
435{ assume(r != NULL); return nCoeff_is_Domain(r->cf); }
436
437static inline BOOLEAN rField_has_Units(const ring r)
438{ assume(r != NULL); return nCoeff_has_Units(r->cf); }
439#else
440#define rField_is_Ring(A) (0)
441#define rField_is_Ring_2toM(A) (0)
442#define rField_is_Ring_ModN(A) (0)
443#define rField_is_Ring_PtoM(A) (0)
444#define rField_is_Ring_Z(A) (0)
445#define rField_is_Domain(A) (1)
446#define rField_has_Units(A) (1)
447#endif
448
449static inline BOOLEAN rField_is_Zp(const ring r)
450{ assume(r != NULL); return (getCoeffType(r->cf) == n_Zp); }
451
452static inline BOOLEAN rField_is_Zp(const ring r, int p)
453{ assume(r != NULL); return (getCoeffType(r->cf) == n_Zp) && (r->ch == p); }
454
455static inline BOOLEAN rField_is_Q(const ring r)
456{ assume(r != NULL); return nCoeff_is_Q(r->cf); }
457
458static inline BOOLEAN rField_is_numeric(const ring r) /* R, long R, long C */
459{ assume(r != NULL); return nCoeff_is_numeric(r->cf); }
460
461static inline BOOLEAN rField_is_R(const ring r)
462{ assume(r != NULL); return nCoeff_is_R(r->cf); }
463
464static inline BOOLEAN rField_is_GF(const ring r)
465{ assume(r != NULL); return nCoeff_is_GF(r->cf); }
466
467static inline BOOLEAN rField_is_GF(const ring r, int q)
468{ assume(r != NULL); return nCoeff_is_GF(r->cf, q); }
469
470static inline BOOLEAN rField_is_Zp_a(const ring r)
471{ assume(r != NULL); return nCoeff_is_Zp_a(r->cf); }
472
473static inline BOOLEAN rField_is_Zp_a(const ring r, int p)
474{ assume(r != NULL); return nCoeff_is_Zp_a(r->cf, p); }
475
476static inline BOOLEAN rField_is_Q_a(const ring r)
477{ assume(r != NULL); return nCoeff_is_Q_a(r->cf); }
478   
479static inline BOOLEAN rField_is_long_R(const ring r)
480{ assume(r != NULL); return nCoeff_is_long_R(r->cf); }
481
482static inline BOOLEAN rField_is_long_C(const ring r)
483{ assume(r != NULL); return nCoeff_is_long_C(r->cf); }
484
485static inline BOOLEAN rField_has_simple_inverse(const ring r)
486{ assume(r != NULL); return nCoeff_has_simple_inverse(r->cf); }
487
488static inline BOOLEAN rField_has_simple_Alloc(const ring r)
489{ assume(r != NULL); return nCoeff_has_simple_Alloc(r->cf); }
490
491/* Z/p, GF(p,n), R: nCopy, nNew, nDelete are dummies*/
492static inline BOOLEAN rField_is_Extension(const ring r)
493{ assume(r != NULL); return nCoeff_is_Extension(r->cf); } /* Z/p(a) and Q(a)*/
494
495n_coeffType rFieldType(const ring r);
496
497/// this needs to be called whenever a new ring is created: new fields
498/// in ring are created (like VarOffset), unless they already exist
499/// with force == 1, new fields are _always_ created (overwritten),
500/// even if they exist
501BOOLEAN rComplete(ring r, int force = 0);
502// use this to free fields created by rComplete //?
503
504static inline int rBlocks(ring r)
505{
506  assume(r != NULL);
507  int i=0;
508  while (r->order[i]!=0) i++;
509  return i+1;
510}
511
512// misc things
513static inline char* rRingVar(short i, const ring r)
514{
515  assume(r != NULL); return r->names[i];
516}
517static inline BOOLEAN rShortOut(const ring r)
518{
519  assume(r != NULL); return (r->ShortOut);
520}
521
522/// order stuff
523typedef enum rRingOrder_t
524{
525  ringorder_no = 0,
526  ringorder_a,
527  ringorder_a64, ///< for int64 weights
528  ringorder_c,
529  ringorder_C,
530  ringorder_M,
531  ringorder_S, ///< S?
532  ringorder_s, ///< s?
533  ringorder_lp,
534  ringorder_dp,
535  ringorder_rp,
536  ringorder_Dp,
537  ringorder_wp,
538  ringorder_Wp,
539  ringorder_ls,
540  ringorder_ds,
541  ringorder_Ds,
542  ringorder_ws,
543  ringorder_Ws,
544  ringorder_L,
545  // the following are only used internally
546  ringorder_aa, ///< for idElimination, like a, except pFDeg, pWeigths ignore it
547  ringorder_rs, ///< ???
548  ringorder_IS, ///< Induced (Schreyer) ordering
549  ringorder_unspec
550} rRingOrder_t;
551
552typedef enum rOrderType_t
553{
554  rOrderType_General = 0, ///< non-simple ordering as specified by currRing
555  rOrderType_CompExp,     ///< simple ordering, component has priority
556  rOrderType_ExpComp,     ///< simple ordering, exponent vector has priority
557                          ///< component not compatible with exp-vector order
558  rOrderType_Exp,         ///< simple ordering, exponent vector has priority
559                          ///< component is compatible with exp-vector order
560  rOrderType_Syz,         ///< syzygy ordering
561  rOrderType_Schreyer,    ///< Schreyer ordering
562  rOrderType_Syz2dpc,     ///< syzcomp2dpc
563  rOrderType_ExpNoComp    ///< simple ordering, differences in component are
564                          ///< not considered
565} rOrderType_t;
566
567static inline BOOLEAN rIsSyzIndexRing(const ring r)
568{ assume(r != NULL); return r->order[0] == ringorder_s;}
569
570static inline int rGetCurrSyzLimit(const ring r)
571{ assume(r != NULL); return (rIsSyzIndexRing(r)? r->typ[0].data.syz.limit : 0);}
572
573// Ring Manipulations
574ring   rAssure_HasComp(const ring r);
575ring   rAssure_SyzComp(const ring r, BOOLEAN complete = TRUE);
576void   rSetSyzComp(int k, const ring r);
577ring   rAssure_dp_S(const ring r);
578ring   rAssure_dp_C(const ring r);
579ring   rAssure_C_dp(const ring r);
580/// makes sure that c/C ordering is last ordering
581ring rAssure_CompLastBlock(const ring r);
582
583/// makes sure that c/C ordering is last ordering and SyzIndex is first
584ring   rAssure_SyzComp_CompLastBlock(const ring r);
585ring rAssure_TDeg(ring r, int start_var, int end_var, int &pos);
586
587/// return the max-comonent wchich has syzIndex i
588/// Assume: i<= syzIndex_limit
589int rGetMaxSyzComp(int i, const ring r);
590
591BOOLEAN rHasSimpleOrder(const ring r);
592
593/// returns TRUE, if simple lp or ls ordering
594BOOLEAN rHasSimpleLexOrder(const ring r);
595
596// return TRUE if p->exp[r->pOrdIndex] holds total degree of p */
597//inline BOOLEAN rHasGlobalOrdering(const ring r)
598//{ return (r->OrdSgn==1); }
599#define rHasGlobalOrdering(R) ((R)->OrdSgn==1)
600// #define rHasGlobalOrdering_currRing() (pOrdSgn==1)
601//inline BOOLEAN rHasLocalOrMixedOrdering(const ring r)
602//{ return (r->OrdSgn==-1); }
603#define rHasLocalOrMixedOrdering(R) ((R)->OrdSgn==-1)
604// #define rHasLocalOrMixedOrdering_currRing() (pOrdSgn==-1)
605BOOLEAN rOrd_is_Totaldegree_Ordering(ring r );
606
607/// return TRUE if p_SetComp requires p_Setm
608BOOLEAN rOrd_SetCompRequiresSetm(ring r);
609rOrderType_t    rGetOrderType(ring r);
610
611/// returns TRUE if var(i) belongs to p-block
612BOOLEAN rIsPolyVar(int i, ring r);
613
614static inline BOOLEAN rOrd_is_Comp_dp(ring r)
615{
616  assume(r != NULL);
617  return ((r->order[0] == ringorder_c || r->order[0] == ringorder_C) &&
618          r->order[1] == ringorder_dp &&
619          r->order[2] == 0);
620}
621
622#ifdef RDEBUG
623#define rTest(r)    rDBTest(r, __FILE__, __LINE__)
624extern BOOLEAN rDBTest(ring r, const char* fn, const int l);
625#else
626#define rTest(r)
627#endif
628
629ring rModifyRing(ring r, BOOLEAN omit_degree,
630                         BOOLEAN omit_comp,
631                         unsigned long exp_limit);
632
633/// construct Wp, C ring
634ring rModifyRing_Wp(ring r, int* weights);
635void rModify_a_to_A(ring r);
636
637void rKillModifiedRing(ring r);
638// also frees weights
639void rKillModified_Wp_Ring(ring r);
640
641ring rModifyRing_Simple(ring r, BOOLEAN omit_degree, BOOLEAN omit_comp, unsigned long exp_limit, BOOLEAN &simple);
642void rKillModifiedRing_Simple(ring r);
643
644#ifdef RDEBUG
645void rDebugPrint(ring r);
646void pDebugPrint(poly p);
647void p_DebugPrint(poly p, const ring r);
648#endif
649
650#ifndef NDEBUG
651/// debug-print at most nTerms (2 by default) terms from poly/vector p,
652/// assuming that lt(p) lives in lmRing and tail(p) lives in tailRing.
653void p_DebugPrint(const poly p, const ring lmRing, const ring tailRing, const int nTerms = 2);
654#endif
655
656int64 * rGetWeightVec(ring r);
657void rSetWeightVec(ring r, int64 *wv);
658
659lists rDecompose(const ring r);
660ring rCompose(const lists  L);
661/////////////////////////////
662// Auxillary functions
663//
664
665BOOLEAN rSetISReference(const ring r, const ideal F, const int i = 0, const int p = 0, const intvec * componentWeights = NULL);
666
667BOOLEAN rCheckIV(intvec *iv);
668int rTypeOfMatrixOrder(intvec * order);
669void rDelete(ring r);
670
671extern omBin sip_sring_bin;
672#endif
Note: See TracBrowser for help on using the repository browser.