source: git/kernel/structs.h @ 445e55

spielwiese
Last change on this file since 445e55 was 445e55, checked in by Hans Schönemann <hannes@…>, 17 years ago
*hannes: faster getid git-svn-id: file:///usr/local/Singular/svn/trunk@9977 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 24.2 KB
Line 
1#ifndef STRUCTS_H
2#define STRUCTS_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: structs.h,v 1.34 2007-04-18 16:15:58 Singular Exp $ */
7/*
8* ABSTRACT
9*/
10
11#include <string.h> /* for memset */
12
13/* standard types */
14typedef unsigned char  uchar;
15typedef unsigned short CARDINAL;
16#if (SIZEOF_LONG == 8)
17typedef int BOOLEAN;
18/* testet on x86_64, gcc 3.4.6: 2 % */
19/* testet on IA64, gcc 3.4.6: 1 % */
20#else
21/* testet on athlon, gcc 2.95.4: 1 % */
22typedef short BOOLEAN;
23#endif
24
25typedef void * Sy_reference;
26#define ADDRESS Sy_reference
27#define BITSET  unsigned int
28
29/* EXPONENT_TYPE is determined by configure und defined in mod2.h */
30/* the following defines should really go into mod2.h,
31   but configure dislikes it */
32
33#define HAVE_IDI 1
34
35#if defined(i386) || defined(x86_64_Linux) || defined(ix86_SunOS)
36  // the following settings seems to be better on i386 and x86_64 processors
37  // define if a*b is with mod instead of tables
38  #define HAVE_MULT_MOD
39  // #define HAVE_GENERIC_ADD
40  // #ifdef HAVE_MULT_MOD
41  // #define HAVE_DIV_MOD
42  // #endif
43#elif defined(IA64_Linux)
44  // the following settings seems to be better on itanium processors
45  // #define HAVE_MULT_MOD
46  #define HAVE_GENERIC_ADD
47  // #ifdef HAVE_MULT_MOD
48  // #define HAVE_DIV_MOD
49  // #endif
50#elif defined(SunOS_5)
51  // #define HAVE_GENERIC_ADD
52  #define HAVE_MULT_MOD
53  #ifdef HAVE_MULT_MOD
54  #define HAVE_DIV_MOD
55  #endif
56#elif defined(ppc_Linux) || defined(ppcMac_darwin)
57  // the following settings seems to be better on ppc processors
58  // testet on: ppc_Linux, 740/750 PowerMac G3, 512k L2 cache
59  #define HAVE_MULT_MOD
60  // #ifdef HAVE_MULT_MOD
61  // #define HAVE_DIV_MOD
62  // #endif
63#endif
64
65#if SIZEOF_LONG == 4
66typedef long long int64;
67#elif SIZEOF_LONG == 8
68typedef long int64;
69#else
70#error int64 undefined
71#endif
72
73
74typedef long Exponent_t;
75typedef long Order_t;
76
77enum tHomog
78{
79   isNotHomog = FALSE,
80   isHomog    = TRUE,
81   testHomog
82};
83enum noeof_t
84{
85  noeof_brace = 1,
86  noeof_asstring,
87  noeof_block,
88  noeof_bracket,
89  noeof_comment,
90  noeof_procname,
91  noeof_string
92};
93
94enum n_coeffType
95{
96  n_unknown=0,
97  n_Zp,
98  n_Q,
99  n_R,
100  n_GF,
101  n_long_R,
102  n_Zp_a,
103  n_Q_a,
104  n_long_C
105};
106
107// #ifdef HAVE_PLURAL
108enum nc_type
109{
110  nc_error = -1, // Something's gone wrong!
111  nc_general = 0, /* yx=q xy+... */
112  nc_skew, /*1*/ /* yx=q xy */
113  nc_comm, /*2*/ /* yx= xy */
114  nc_lie,  /*3*/ /* yx=xy+... */
115  nc_undef, /*4*/  /* for internal reasons */
116
117  nc_exterior /*5*/ // Exterior Algebra(SCA): yx= -xy & (!:) x^2 = 0
118};
119// #endif
120
121typedef enum { LT_NONE, LT_NOTFOUND, LT_SINGULAR, LT_ELF, LT_HPUX, LT_MACH_O} lib_types;
122
123/* C++-part */
124#ifdef __cplusplus
125class ip_smatrix;
126class idrec;
127class intvec;
128class sleftv;
129class slists;
130class sattr;
131class skStrategy;
132class ssyStrategy;
133class procinfo;
134class namerec;
135class kBucket;
136class sBucket;
137#endif
138
139struct n_Procs_s;
140struct sip_sring;
141struct sip_sideal;
142struct sip_link;
143struct spolynom;
144struct _ssubexpr;
145struct _sssym;
146struct snumber;
147struct sip_command;
148struct sip_package;
149struct s_si_link_extension;
150
151typedef struct  n_Procs_s  n_Procs_s;
152
153// #ifdef HAVE_PLURAL
154struct nc_struct;
155typedef struct nc_struct   nc_struct;
156// #endif
157
158typedef struct _ssubexpr   sSubexpr;
159typedef struct _sssym      ssym;
160typedef struct spolyrec    polyrec;
161typedef struct sip_sideal  ip_sideal;
162typedef struct sip_smap    ip_smap;
163typedef struct sip_sring   ip_sring;
164typedef struct sip_link    ip_link;
165typedef struct sip_command ip_command;
166typedef struct sip_package ip_package;
167
168/* the pointer types */
169typedef char *             char_ptr;
170typedef int  *             int_ptr;
171typedef short *            short_ptr;
172typedef void *             void_ptr;
173typedef ip_sring *         ring;
174typedef int                idtyp;
175typedef struct snumber *   number;
176typedef polyrec *          poly;
177typedef poly *             polyset;
178typedef ip_sideal *        ideal;
179typedef ip_smap *          map;
180typedef struct sideal_list *      ideal_list;
181typedef ideal *            resolvente;
182typedef union uutypes      utypes;
183typedef ip_command *       command;
184typedef struct s_si_link_extension *si_link_extension;
185typedef polyrec *   napoly;
186
187#ifdef __cplusplus
188typedef idrec *            idhdl;
189typedef ip_smatrix *       matrix;
190typedef ip_link *          si_link;
191typedef sleftv *           leftv;
192typedef slists *           lists;
193typedef sSubexpr *         Subexpr;
194typedef sattr *            attr;
195typedef skStrategy *       kStrategy;
196typedef ip_package *       package;
197typedef ssyStrategy *      syStrategy;
198typedef procinfo *         procinfov;
199typedef namerec *          namehdl;
200typedef kBucket*           kBucket_pt;
201typedef sBucket*           sBucket_pt;
202typedef struct p_Procs_s p_Procs_s;
203
204// for hdegree.cc
205typedef struct sindlist indlist;
206typedef indlist * indset;
207struct sindlist
208{
209  indset nx;
210  intvec * set;
211};
212
213// for longalg.cc
214struct snaIdeal
215{
216  int anz;
217  napoly *liste;
218};
219typedef struct snaIdeal * naIdeal;
220
221
222// for sparsemat.cc
223typedef struct smprec sm_prec;
224typedef sm_prec * smpoly;
225struct smprec
226{
227  smpoly n;            // the next element
228  int pos;             // position
229  int e;               // level
230  poly m;              // the element
231  float f;             // complexity of the element
232};
233
234struct _scmdnames
235{
236  char *name;
237  short alias;
238  short tokval;
239  short toktype;
240};
241typedef struct _scmdnames cmdnames;
242
243typedef number (*numberfunc)(number a,number b);
244typedef number (*nMapFunc)(number a);
245struct n_Procs_s
246{
247   n_Procs_s* next;
248   // the union stuff
249   // Zp:
250   int npPrimeM;
251   int npPminus1M;
252   #ifdef HAVE_DIV_MOD
253   CARDINAL *npInvTable;
254   #endif
255   #if !defined(HAVE_DIV_MOD) || !defined(HAVE_MULT_MOD)
256   CARDINAL *npExpTable;
257   CARDINAL *npLogTable;
258   #endif
259   // Zp_a, Q_a
260
261   // general stuff
262   numberfunc nMult, nSub ,nAdd ,nDiv, nIntDiv, nIntMod, nExactDiv;
263   void    (*nNew)(number * a);
264   number  (*nInit)(int i);
265   number  (*nPar)(int i);
266   int     (*nParDeg)(number n);
267   int     (*nSize)(number n);
268   int     (*nInt)(number &n);
269   number  (*nNeg)(number a);
270   number  (*nInvers)(number a);
271   number  (*nCopy)(number a);
272   number  (*cfCopy)(number a, const ring r);
273   number  (*nRePart)(number a);
274   number  (*nImPart)(number a);
275   void    (*nWrite)(number &a);
276   char *  (*nRead)(char * s, number * a);
277   void    (*nNormalize)(number &a);
278   BOOLEAN (*nGreater)(number a,number b),
279           (*nEqual)(number a,number b),
280           (*nIsZero)(number a),
281           (*nIsOne)(number a),
282           (*nIsMOne)(number a),
283           (*nGreaterZero)(number a);
284   void    (*nPower)(number a, int i, number * result);
285   number  (*n_GetDenom)(number &n, const ring r);
286   number  (*nGcd)(number a, number b, const ring r);
287   number  (*nLcm)(number a, number b, const ring r);
288   void    (*cfDelete)(number * a, const ring r);
289   nMapFunc (*cfSetMap)(ring src, ring dst);
290   char *  (*nName)(number n);
291   void    (*nInpMult)(number &a, number b, ring r);
292//extern number  (*nMap)(number from);
293
294   number nNULL; /* the 0 as constant */
295   int     char_flag;
296   int     ref;
297   short   nChar;
298   n_coeffType type;
299};
300/* current ring stuff */
301
302extern ring      currRing;
303extern ideal     currQuotient;
304extern idhdl      currRingHdl;
305
306#ifndef HAVE_NS
307extern idhdl      idroot;
308#define IDROOT idroot
309#endif /* ! HAVE_NS */
310
311#ifdef HAVE_NS
312extern idhdl currPackHdl;
313extern idhdl basePackHdl;
314extern package currPack;
315extern package basePack;
316#define IDROOT (currPack->idroot)
317#endif /* HAVE_NS */
318
319/* the function pointer types */
320
321typedef long     (*pLDegProc)(poly p, int *length, ring r);
322typedef long     (*pFDegProc)(poly p, ring r);
323typedef void     (*p_SetmProc)(poly p, const ring r);
324
325typedef enum
326{
327  ro_dp, // ordering is a degree ordering
328  ro_wp, // ordering is a weighted degree ordering
329  ro_wp64, // ordering is a weighted64 degree ordering
330  ro_wp_neg, // ordering is a weighted degree ordering
331             // with possibly negative weights
332  ro_cp,    // ordering duplicates variables
333  ro_syzcomp, // ordering indicates "subset" of component number
334  ro_syz, // ordering  with component number >syzcomp is lower
335  ro_none
336}
337ro_typ;
338
339// ordering is a degree ordering
340struct sro_dp
341{
342  short place;  // where degree is stored (in L):
343  short start;  // bounds of ordering (in E):
344  short end;
345};
346typedef struct sro_dp sro_dp;
347
348// ordering is a weighted degree ordering
349struct sro_wp
350{
351  short place;  // where weighted degree is stored (in L)
352  short start;  // bounds of ordering (in E)
353  short end;
354  int *weights; // pointers into wvhdl field
355};
356typedef struct sro_wp sro_wp;
357
358// ordering is a weighted degree ordering
359struct sro_wp64
360{
361    short place;  // where weighted degree is stored (in L)
362    short start;  // bounds of ordering (in E)
363    short end;
364    int64 *weights64; // pointers into wvhdl field
365};
366typedef struct sro_wp64 sro_wp64;
367
368// ordering duplicates variables
369struct sro_cp
370{
371  short place;  // where start is copied to (in E)
372  short start;  // bounds of sources of copied variables (in E)
373  short end;
374};
375typedef struct sro_cp sro_cp;
376
377// ordering indicates "subset" of component number
378struct sro_syzcomp
379{
380  short place;  // where the index is stored (in L)
381  long *ShiftedComponents; // pointer into index field
382  int* Components;
383#ifdef PDEBUG
384  long length;
385#endif
386};
387typedef struct sro_syzcomp sro_syzcomp;
388
389// ordering  with component number >syzcomp is lower
390struct sro_syz
391{
392  short place;       // where the index is stored (in L)
393  int limit;         // syzcomp
394  int* syz_index;    // mapping Component -> SyzIndex for Comp <= limit
395  int  curr_index;   // SyzIndex for Component > limit
396};
397
398typedef struct sro_syz sro_syz;
399
400#ifndef OM_ALLOC_H
401struct omBin_s;
402#endif
403
404struct sro_ord
405{
406  ro_typ  ord_typ;
407  int     order_index; // comes from r->order[order_index]
408  union
409  {
410     sro_dp dp;
411     sro_wp wp;
412     sro_wp64 wp64;
413     sro_cp cp;
414     sro_syzcomp syzcomp;
415     sro_syz syz;
416  } data;
417};
418
419#ifdef HAVE_PLURAL
420// NC pProcs:
421typedef poly (*mm_Mult_p_Proc_Ptr)(const poly m, poly p, const ring r);
422typedef poly (*mm_Mult_pp_Proc_Ptr)(const poly m, const poly p, const ring r);
423
424typedef ideal (*GB_Proc_Ptr)(const ideal F, const ideal Q, const intvec *w, const intvec *hilb, kStrategy strat);
425
426typedef poly (*SPoly_Proc_Ptr)(const poly p1, const poly p2, const ring r);
427typedef poly (*SPolyReduce_Proc_Ptr)(const poly p1, poly p2, const ring r);
428
429typedef void (*bucket_Proc_Ptr)(kBucket_pt b, poly p, number *c);
430
431struct nc_pProcs
432{
433public:
434  mm_Mult_p_Proc_Ptr                    mm_Mult_p;
435  mm_Mult_pp_Proc_Ptr                   mm_Mult_pp;
436
437  bucket_Proc_Ptr                       BucketPolyRed;
438  bucket_Proc_Ptr                       BucketPolyRed_Z;
439
440  SPoly_Proc_Ptr                        SPoly;
441  SPolyReduce_Proc_Ptr                  ReduceSPoly;
442
443  GB_Proc_Ptr                           GB;
444//                                         GlobalGB, // BBA
445//                                         LocalGB;  // MORA
446};
447
448
449struct nc_struct
450{
451  short ref;
452  nc_type type;
453  ring basering; // the ring C,D,.. live in
454  matrix C;
455  matrix D;
456  matrix *MT;
457  matrix COM;
458  int *MTsize;
459
460  // IsSkewConstantindicates whethere coeffs C_ij are all equal, effective together with nc_type=nc_skew
461  int IsSkewConstant;
462
463  private:
464    // treat variables from iAltVarsStart till iAltVarsEnd as alternating vars.
465    // these variables should have odd degree, though that will not be checked
466    // iAltVarsStart, iAltVarsEnd are only used together with nc_type=nc_exterior
467    // 1 <= iAltVarsStart <= iAltVarsEnd <= r->N
468    unsigned int iFirstAltVar, iLastAltVar; // = 0 by default
469   
470    // for factors of super-commutative algebras we need
471    // the part of general quotient ideal modulo squares!   
472    ideal idSCAQuotient; // = NULL by default.
473
474  public:
475    inline unsigned int& FirstAltVar() { return (iFirstAltVar); };
476    inline unsigned int& LastAltVar () { return (iLastAltVar ); };
477
478    inline unsigned int FirstAltVar() const { return (iFirstAltVar); };
479    inline unsigned int LastAltVar () const { return (iLastAltVar ); };
480
481    inline ideal& SCAQuotient() { return (idSCAQuotient); };
482
483  public:
484    nc_pProcs p_Procs; // NC procedures.
485
486};
487#endif
488#if 0
489struct nc_struct
490{
491  short ref;
492  nc_type type;
493  ring basering; // the ring C,D,.. live in
494  matrix C;
495  matrix D;
496  matrix *MT;
497  matrix COM;
498  int *MTsize;
499  int IsSkewConstant; /* indicates whethere coeffs C_ij are all equal */
500  /* effective together with nc_type=nc_skew */
501};
502#endif
503
504
505struct sip_sring
506{
507  idhdl      idroot; /* local objects */
508  int*       order;  /* array of orderings */
509  int*       block0; /* starting pos.*/
510  int*       block1; /* ending pos.*/
511  char**     parameter; /* names of parameters */
512  number     minpoly;
513  ideal      minideal;
514  int**      wvhdl;  /* array of weight vectors */
515  char **    names;  /* array of variable names */
516
517  unsigned long options; /* ring dependent options */
518
519  // what follows below here should be set by rComplete, _only_
520  long      *ordsgn;  /* array of +/- 1 (or 0) for comparing monomials */
521                       /*  ExpL_Size entries*/
522
523  // is NULL for lp or N == 1, otherwise non-NULL (with OrdSize > 0 entries) */
524  sro_ord*   typ;   /* array of orderings + sizes, OrdSize entries */
525
526  ideal      qideal; /* extension to the ring structure: qring */
527
528
529  int*     VarOffset;
530  int*     firstwv;
531
532  struct omBin_s*   PolyBin; /* Bin from where monoms are allocated */
533  int        ch;     /* characteristic */
534#ifdef HAVE_RING2TOM
535  int        cring;  /* cring = 0 => coefficient field, cring = 1 => coeffs from Z/2^m */
536#endif
537  int        ref; /* reference counter to the ring */
538
539  short      float_len; /* additional char-flags */
540  short      float_len2; /* additional char-flags */
541
542  short      N;      /* number of vars */
543
544  short      P;      /* number of pars */
545  short      OrdSgn; /* 1 for polynomial rings, -1 otherwise */
546
547  short     firstBlockEnds;
548
549
550  BOOLEAN   VectorOut;
551  BOOLEAN   ShortOut;
552  BOOLEAN   CanShortOut;
553  BOOLEAN   LexOrder;
554  // TRUE if the monomial ordering has polynomial and power series blocks
555  BOOLEAN   MixedOrder;
556  // 1 for lex ordering (except ls), -1 otherwise
557  BOOLEAN   ComponentOrder;
558
559
560  // what follows below here should be set by rComplete, _only_
561  // contains component, but no weight fields in E */
562  short      ExpL_Size; // size of exponent vector in long
563  short      CmpL_Size; // portions which need to be compared
564  /* number of long vars in exp vector:
565     long vars are those longs in the exponent vector which are
566     occupied by variables, only */
567  short     VarL_Size;
568
569  short      BitsPerExp; /* number of bits per exponent */
570  short      ExpPerLong; /* maximal number of Exponents per long */
571
572  short      pCompIndex; /* p->exp.e[pCompIndex] is the component */
573  short      pOrdIndex; /* p->exp[pOrdIndex] is pGetOrd(p) */
574
575  short      OrdSize; /* size of ord vector (in sro_ord) */
576
577
578  /* if >= 0, long vars in exp vector are consecutive and start there
579     if <  0, long vars in exp vector are not consecutive */
580  short     VarL_LowIndex;
581  // number of exponents in r->VarL_Offset[0]
582  // is minimal number of exponents in a long var
583  short     MinExpPerLong;
584
585  /* if this is > 0, then NegWeightL_Offset[0..size_1] is index of longs in
586   ExpVector whose values need an offset due to negative weights */
587  short     NegWeightL_Size;
588  /* array of NegWeigtL_Size indicies */
589  int*      NegWeightL_Offset;
590
591  /* array of size VarL_Size,
592     VarL_Offset[i] gets i-th long var in exp vector */
593  int*      VarL_Offset;
594
595  /* mask for getting single exponents */
596  unsigned long bitmask;
597  /* mask used for divisiblity tests */
598  unsigned long divmask;
599
600  p_Procs_s*    p_Procs;
601
602  /* FDeg and LDeg */
603  pFDegProc     pFDeg;
604  pLDegProc     pLDeg;
605
606  /* as it was determined by rComplete */
607  pFDegProc     pFDegOrig;
608  /* and as it was determined before rOptimizeLDeg */
609  pLDegProc     pLDegOrig;
610
611  p_SetmProc    p_Setm;
612  n_Procs_s*    cf;
613  ring          algring;
614#ifdef HAVE_PLURAL
615  nc_struct     *nc;
616#endif
617};
618
619struct sip_sideal
620{
621  poly*  m;
622  long rank;
623  int nrows;
624  int ncols;
625  #define IDELEMS(i) ((i)->ncols)
626  inline int& idelems(void) { return ncols; }
627};
628
629struct sip_smap
630{
631  poly *m;
632  char *preimage;
633  int nrows;
634  int ncols;
635};
636
637struct sideal_list
638{
639  ideal_list next;
640  ideal      d;
641#ifndef NDEBUG
642  int nr;
643#endif
644};
645#endif /* __cplusplus */
646
647
648
649/*
650**  7. runtime procedures/global data
651*/
652
653/* 7.1 C-routines : */
654
655
656#ifdef __cplusplus
657extern "C" {
658#endif
659void  m2_end(int i);
660#ifdef __cplusplus
661}
662#endif
663
664/* 7.2 C++-routines : */
665
666#ifdef __cplusplus
667int   inits(void);
668int   IsPrime(int i);
669#ifdef buildin_rand
670extern int siSeed;
671int siRand();
672#endif
673#endif
674
675/*the general set of std-options --> kutil.cc */
676extern BITSET test;
677/*the general set of verbose-options --> febase.cc */
678#ifdef __cplusplus
679extern "C" BITSET verbose;
680#else
681extern BITSET verbose;
682#endif
683/*debugging the bison grammar --> grammar.cc*/
684#ifdef YYDEBUG
685#if YYDEBUG
686extern int    yydebug;
687#endif
688#endif
689
690extern int      yylineno;
691extern char     my_yylinebuf[80];
692
693#define loop for(;;)
694
695#ifndef ABS
696#define ABS(x) ((x)<0?(-(x)):(x))
697#endif
698
699#if defined(__cplusplus)
700inline int si_max(const int a, const int b)  { return (a>b) ? a : b; }
701inline int si_min(const int a, const int b)  { return (a<b) ? a : b; }
702#if defined(DecAlpha_Linux) || defined(IA64_Linux)
703inline long si_max(const long a, const long b)  { return (a>b) ? a : b; }
704inline long si_min(const long a, const long b)  { return (a<b) ? a : b; }
705#endif
706#else
707#define si_max(A,B) ((A) > (B) ? (A) : (B))
708#define si_min(A,B) ((A) < (B) ? (A) : (B))
709#endif
710
711/*
712**  Set operations (small sets only)
713*/
714
715#define Sy_bit(x)     ((unsigned)1<<(x))
716#define Sy_inset(x,s) ((Sy_bit(x)&(s))?TRUE:FALSE)
717#define BTEST1(a)     Sy_inset((a), test)
718#define BVERBOSE(a)   Sy_inset((a), verbose)
719
720/*
721** defines for BITSETs
722*/
723
724#define V_SHOW_MEM    2
725#define V_YACC        3
726#define V_REDEFINE    4
727#define V_READING     5
728#define V_LOAD_LIB    6
729#define V_DEBUG_LIB   7
730#define V_LOAD_PROC   8
731#define V_DEF_RES     9
732#define V_DEBUG_MEM  10
733#define V_SHOW_USE   11
734#define V_IMAP       12
735#define V_PROMPT     13
736#define V_NSB        14
737#define V_CONTENTSB  15
738#define V_CANCELUNIT 16
739#define V_MODPSOLVSB 17
740#define V_UPTORADICAL 18
741#define V_FINDMONOM  19
742#define V_COEFSTRAT  20
743#define V_IDLIFT     21
744#define V_LENGTH     22
745#define V_DEG_STOP   31
746
747
748#define OPT_PROT           0
749#define OPT_REDSB          1
750#define OPT_NOT_BUCKETS    2
751#define OPT_NOT_SUGAR      3
752#define OPT_INTERRUPT      4
753#define OPT_SUGARCRIT      5
754#define OPT_DEBUG          6
755#define OPT_REDTHROUGH     7
756#define OPT_RETURN_SB      9
757#define OPT_FASTHC        10
758#define OPT_OLDSTD        20
759#define OPT_KEEPVARS      21
760#define OPT_STAIRCASEBOUND 22
761#define OPT_MULTBOUND     23
762#define OPT_DEGBOUND      24
763#define OPT_REDTAIL       25
764#define OPT_INTSTRATEGY   26
765#define OPT_INFREDTAIL    28
766#define OPT_SB_1          29
767#define OPT_NOTREGULARITY 30
768#define OPT_WEIGHTM       31
769
770/* define ring dependent options */
771#define TEST_RINGDEP_OPTS \
772 (Sy_bit(OPT_INTSTRATEGY) | Sy_bit(OPT_REDTHROUGH) | Sy_bit(OPT_REDTAIL))
773
774#define TEST_OPT_PROT              BTEST1(OPT_PROT)
775#define TEST_OPT_REDSB             BTEST1(OPT_REDSB)
776#define TEST_OPT_NOT_BUCKETS       BTEST1(OPT_NOT_BUCKETS)
777#define TEST_OPT_NOT_SUGAR         BTEST1(OPT_NOT_SUGAR)
778#define TEST_OPT_SUGARCRIT         BTEST1(OPT_SUGARCRIT)
779#define TEST_OPT_DEBUG             BTEST1(OPT_DEBUG)
780#define TEST_OPT_FASTHC            BTEST1(OPT_FASTHC)
781#define TEST_OPT_INTSTRATEGY       BTEST1(OPT_INTSTRATEGY)
782#define TEST_OPT_RETURN_SB         BTEST1(OPT_RETURN_SB)
783#define TEST_OPT_KEEPVARS          BTEST1(OPT_KEEPVARS)
784#define TEST_OPT_DEGBOUND          BTEST1(OPT_DEGBOUND)
785#define TEST_OPT_MULTBOUND         BTEST1(OPT_MULTBOUND)
786#define TEST_OPT_STAIRCASEBOUND    BTEST1(OPT_STAIRCASEBOUND)
787#define TEST_OPT_REDTAIL           BTEST1(OPT_REDTAIL)
788#define TEST_OPT_INFREDTAIL        BTEST1(OPT_INFREDTAIL)
789#define TEST_OPT_SB_1              BTEST1(OPT_SB_1)
790#define TEST_OPT_NOTREGULARITY     BTEST1(OPT_NOTREGULARITY)
791#define TEST_OPT_WEIGHTM           BTEST1(OPT_WEIGHTM)
792#define TEST_OPT_REDTHROUGH        BTEST1(OPT_REDTHROUGH)
793#define TEST_OPT_OLDSTD            BTEST1(OPT_OLDSTD)
794#define TEST_OPT_CONTENTSB         BVERBOSE(V_CONTENTSB)
795#define TEST_OPT_CANCELUNIT        BVERBOSE(V_CANCELUNIT)
796#define TEST_OPT_IDLIFT            BVERBOSE(V_IDLIFT)
797#define TEST_OPT_LENGTH            BVERBOSE(V_LENGTH)
798
799#define TEST_VERB_NSB              BVERBOSE(V_NSB)
800#define TEST_V_DEG_STOP            BVERBOSE(V_DEG_STOP)
801#define TEST_V_MODPSOLVSB          BVERBOSE(V_MODPSOLVSB)
802#define TEST_V_COEFSTRAT           BVERBOSE(V_COEFSTRAT)
803#define TEST_V_UPTORADICAL         BVERBOSE(V_UPTORADICAL)
804#define TEST_V_FINDMONOM           BVERBOSE(V_FINDMONOM)
805#ifdef HAVE_LIBPARSER
806#ifdef __cplusplus
807class libstack;
808typedef libstack *  libstackv;
809#endif
810#endif /* HAVE_LIBPARSER */
811
812extern struct omBin_s* MP_INT_bin;
813extern struct omBin_s* char_ptr_bin;
814extern struct omBin_s* ideal_bin;
815extern struct omBin_s* int_bin;
816extern struct omBin_s* poly_bin;
817extern struct omBin_s* void_ptr_bin;
818extern struct omBin_s* indlist_bin;
819extern struct omBin_s* naIdeal_bin;
820extern struct omBin_s* snaIdeal_bin;
821extern struct omBin_s* sm_prec_bin;
822extern struct omBin_s* smprec_bin;
823extern struct omBin_s* sip_sideal_bin;
824extern struct omBin_s* sip_smap_bin;
825extern struct omBin_s* sip_sring_bin;
826extern struct omBin_s* ip_sideal_bin;
827extern struct omBin_s* ip_smap_bin;
828extern struct omBin_s* ip_sring_bin;
829extern struct omBin_s* sleftv_bin;
830
831#ifdef __cplusplus
832union uutypes
833{
834  int           i;
835  ring          uring;
836  poly          p;
837  number        n;
838  ideal         uideal;
839  map           umap;
840  matrix        umatrix;
841  char *        ustring;
842  intvec *      iv;
843  lists         l;
844  si_link       li;
845  package       pack;
846  procinfo *    pinf;
847};
848
849class idrec
850{
851  public:
852  /* !! do not change the first 6 entries !! (see subexpr.h: sleftv) */
853  idhdl      next;
854  char *     id;
855  utypes     data;
856  attr       attribute;
857  BITSET     flag;
858  idtyp      typ;
859
860  short      lev;
861  short      ref;
862#ifdef HAVE_IDI
863  int        id_i;
864#endif
865
866#define IDNEXT(a)    ((a)->next)
867#define IDTYP(a)     ((a)->typ)
868#define IDFLAG(a)    ((a)->flag)
869#define IDLEV(a)     ((a)->lev)
870#define IDID(a)      ((a)->id)
871#define IDATTR(a)    ((a)->attribute)
872
873#define IDINT(a)    ((int)(long)((a)->data.ustring))
874#define IDDATA(a)   ((a)->data.ustring)
875#define IDRING(a)   ((a)->data.uring)
876#define IDINTVEC(a) ((a)->data.iv)
877#define IDPOLY(a)   ((a)->data.p)
878#define IDBIGINT(a) ((a)->data.n)
879#define IDNUMBER(a) ((a)->data.n)
880#define IDIDEAL(a)  (((a)->data).uideal)
881#define IDMATRIX(a) (((a)->data).umatrix)
882#define IDMAP(a)    (((a)->data).umap)
883#define IDSTRING(a) ((a)->data.ustring)
884#define IDLIST(a)   ((a)->data.l)
885#define IDLINK(a)   ((a)->data.li)
886#define IDPACKAGE(a) ((a)->data.pack)
887#define IDPROC(a)   ((a)->data.pinf)
888
889  idrec() { memset(this,0,sizeof(*this)); }
890  idhdl get(const char * s, int lev);
891  idhdl set(char * s, int lev, idtyp t, BOOLEAN init=TRUE);
892  char * String();
893//  ~idrec();
894};
895
896class proc_singular
897{
898public:
899  long   proc_start;       // position where proc is starting
900  long   def_end;          // position where proc header is ending
901  long   help_start;       // position where help is starting
902  long   help_end;         // position where help is starting
903  long   body_start;       // position where proc-body is starting
904  long   body_end;         // position where proc-body is ending
905  long   example_start;    // position where example is starting
906  long   proc_end;         // position where proc is ending
907  int    proc_lineno;
908  int    body_lineno;
909  int    example_lineno;
910  char   *body;
911  long help_chksum;
912};
913
914struct proc_object
915{
916//public:
917  BOOLEAN (*function)(leftv res, leftv v);
918};
919
920union uprocinfodata;
921
922union uprocinfodata
923{
924public:
925  proc_singular  s;        // data of Singular-procedure
926  struct proc_object    o; // pointer to binary-function
927};
928
929typedef union uprocinfodata procinfodata;
930
931typedef enum { LANG_NONE, LANG_TOP, LANG_SINGULAR, LANG_C, LANG_MAX} language_defs;
932// LANG_TOP     : Toplevel package only
933// LANG_SINGULAR:
934// LANG_C       :
935class procinfo
936{
937public:
938  char          *libname;
939  char          *procname;
940#ifdef HAVE_NS
941  package       pack;
942#endif
943  language_defs language;
944  short         ref;
945  char          is_static;        // if set, proc not accessible for user
946  char          trace_flag;
947  procinfodata  data;
948};
949
950#endif
951
952#endif
953
Note: See TracBrowser for help on using the repository browser.