source: git/kernel/structs.h @ 9108d3

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