source: git/kernel/structs.h @ 147167f

fieker-DuValspielwiese
Last change on this file since 147167f was 26b68f, checked in by Hans Schönemann <hannes@…>, 14 years ago
removed ref from nc_struct git-svn-id: file:///usr/local/Singular/svn/trunk@12596 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 20.3 KB
Line 
1#ifndef STRUCTS_H
2#define STRUCTS_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id$ */
7/*
8* ABSTRACT
9*/
10
11/* for memset: */
12#include <string.h>
13#ifdef HAVE_RINGS
14#include <si_gmp.h>
15#endif
16
17
18/* standard types */
19#ifdef HAVE_RINGS
20typedef unsigned long NATNUMBER;
21typedef MP_INT *int_number;
22#endif
23#if (SIZEOF_LONG == 8)
24typedef int BOOLEAN;
25/* testet on x86_64, gcc 3.4.6: 2 % */
26/* testet on IA64, gcc 3.4.6: 1 % */
27#else
28/* testet on athlon, gcc 2.95.4: 1 % */
29typedef short BOOLEAN;
30#endif
31
32typedef void * Sy_reference;
33#define ADDRESS Sy_reference
34#define BITSET  unsigned int
35
36#if defined(SI_CPU_I386) || defined(SI_CPU_X86_64)
37  // the following settings seems to be better on i386 and x86_64 processors
38  // define if a*b is with mod instead of tables
39  #define HAVE_MULT_MOD
40  // #define HAVE_GENERIC_ADD
41  // #ifdef HAVE_MULT_MOD
42  // #define HAVE_DIV_MOD
43  // #endif
44#elif defined(SI_CPU_IA64)
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#elif defined(SI_CPU_SPARC)
52  // #define HAVE_GENERIC_ADD
53  #define HAVE_MULT_MOD
54  #ifdef HAVE_MULT_MOD
55  #define HAVE_DIV_MOD
56  #endif
57#elif defined(SI_CPU_PPC)
58  // the following settings seems to be better on ppc processors
59  // testet on: ppc_Linux, 740/750 PowerMac G3, 512k L2 cache
60  #define HAVE_MULT_MOD
61  // #ifdef HAVE_MULT_MOD
62  // #define HAVE_DIV_MOD
63  // #endif
64#endif
65
66#if SIZEOF_LONG == 4
67typedef long long int64;
68#elif SIZEOF_LONG == 8
69typedef long int64;
70#else
71#error int64 undefined
72#endif
73
74
75typedef long Exponent_t;
76
77enum tHomog
78{
79   isNotHomog = FALSE,
80   isHomog    = TRUE,
81   testHomog
82};
83
84enum n_coeffType
85{
86  n_unknown=0,
87  n_Zp,
88  n_Q,
89  n_R,
90  n_GF,
91  n_long_R,
92  n_Zp_a,
93  n_Q_a,
94  n_long_C
95#ifdef HAVE_RINGS
96  ,n_Z,
97  n_Zm,
98  n_Zpn,
99  n_Z2n
100#endif
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
119struct snumber;
120typedef struct snumber *   number;
121typedef number (*numberfunc)(number a,number b);
122typedef number (*nMapFunc)(number a);
123
124/* C++-part */
125#ifdef __cplusplus
126class ip_smatrix;
127class idrec;
128class intvec;
129class sleftv;
130class slists;
131class sattr;
132class skStrategy;
133class ssyStrategy;
134class procinfo;
135class kBucket;
136class sBucket;
137class CPolynomialSummator;
138class CGlobalMultiplier;
139class CFormulaPowerMultiplier;
140#endif
141
142struct n_Procs_s;
143struct sip_sring;
144struct sip_link;
145struct spolynom;
146struct _ssubexpr;
147struct _sssym;
148struct sip_command;
149struct sip_package;
150struct s_si_link_extension;
151
152// forward for ideals.h:
153struct sip_sideal;
154struct sip_smap;
155typedef struct sip_smap *         map;
156typedef struct sip_sideal *       ideal;
157
158
159typedef struct  n_Procs_s  n_Procs_s;
160
161// #ifdef HAVE_PLURAL
162struct nc_struct;
163typedef struct nc_struct   nc_struct;
164// #endif
165
166typedef struct _ssubexpr   sSubexpr;
167typedef struct _sssym      ssym;
168typedef struct spolyrec    polyrec;
169typedef struct sip_sring   ip_sring;
170typedef struct sip_link    ip_link;
171typedef struct sip_command ip_command;
172typedef struct sip_package ip_package;
173
174/* the pointer types */
175typedef char *             char_ptr;
176typedef int  *             int_ptr;
177typedef short *            short_ptr;
178typedef ip_sring *         ring;
179typedef int                idtyp;
180typedef polyrec *          poly;
181typedef poly *             polyset;
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 kBucket*           kBucket_pt;
200typedef sBucket*           sBucket_pt;
201typedef struct p_Procs_s p_Procs_s;
202
203// for sparsemat.cc
204typedef struct smprec sm_prec;
205typedef sm_prec * smpoly;
206struct smprec
207{
208  smpoly n;            // the next element
209  int pos;             // position
210  int e;               // level
211  poly m;              // the element
212  float f;             // complexity of the element
213};
214
215struct n_Procs_s
216{
217   n_Procs_s* next;
218   // the union stuff
219   // Zp:
220   int npPrimeM;
221   int npPminus1M;
222   #ifdef HAVE_DIV_MOD
223   unsigned short *npInvTable;
224   #endif
225   #if !defined(HAVE_DIV_MOD) || !defined(HAVE_MULT_MOD)
226   unsigned short *npExpTable;
227   unsigned short *npLogTable;
228   #endif
229   // Zp_a, Q_a
230
231   // general stuff
232   numberfunc nMult, nSub ,nAdd ,nDiv, nIntDiv, nIntMod, nExactDiv;
233   number  (*cfInit)(int i,const ring r);
234   number  (*nPar)(int i);
235   int     (*nParDeg)(number n);
236   int     (*nSize)(number n);
237   int     (*n_Int)(number &n, const ring r);
238#ifdef HAVE_RINGS
239   int     (*nDivComp)(number a,number b);
240   BOOLEAN (*nIsUnit)(number a);
241   number  (*nGetUnit)(number a);
242   number  (*nExtGcd)(number a, number b, number *s, number *t);
243#endif
244   number  (*nNeg)(number a);
245   number  (*nInvers)(number a);
246   number  (*nCopy)(number a);
247   number  (*cfCopy)(number a, const ring r);
248   number  (*nRePart)(number a);
249   number  (*nImPart)(number a);
250   void    (*cfWrite)(number &a, const ring r);
251   const char *  (*nRead)(const char * s, number * a);
252   void    (*nNormalize)(number &a);
253   BOOLEAN (*nGreater)(number a,number b),
254#ifdef HAVE_RINGS
255           (*nDivBy)(number a, number b),
256#endif
257           (*nEqual)(number a,number b),
258           (*nIsZero)(number a),
259           (*nIsOne)(number a),
260           (*nIsMOne)(number a),
261           (*nGreaterZero)(number a);
262   void    (*nPower)(number a, int i, number * result);
263   number  (*cfGetDenom)(number &n, const ring r);
264   number  (*cfGetNumerator)(number &n, const ring r);
265   number  (*nGcd)(number a, number b, const ring r);
266   number  (*nLcm)(number a, number b, const ring r);
267   void    (*cfDelete)(number * a, const ring r);
268   nMapFunc (*cfSetMap)(const ring src, const ring dst);
269   char *  (*nName)(number n);
270   void    (*nInpMult)(number &a, number b, ring r);
271#ifdef LDEBUG
272   BOOLEAN (*nDBTest)(number a, const char *f,const int l);
273#endif
274
275   number nNULL; /* the 0 as constant */
276   int     char_flag;
277   int     ref;
278   n_coeffType type;
279   short   nChar;
280};
281
282/* the function pointer types */
283
284typedef long     (*pLDegProc)(poly p, int *length, ring r);
285typedef long     (*pFDegProc)(poly p, ring r);
286typedef void     (*p_SetmProc)(poly p, const ring r);
287
288typedef enum
289{
290  ro_dp, // ordering is a degree ordering
291  ro_wp, // ordering is a weighted degree ordering
292  ro_wp64, // ordering is a weighted64 degree ordering
293  ro_wp_neg, // ordering is a weighted degree ordering
294             // with possibly negative weights
295  ro_cp,    // ordering duplicates variables
296  ro_syzcomp, // ordering indicates "subset" of component number (ringorder_S)
297  ro_syz, // ordering  with component number >syzcomp is lower (ringorder_s)
298  ro_isTemp, ro_is, // Induced Syzygy (Schreyer) ordering (and prefix data placeholder dummy) (ringorder_IS)
299  ro_none
300}
301ro_typ;
302
303// ordering is a degree ordering
304struct sro_dp
305{
306  short place;  // where degree is stored (in L):
307  short start;  // bounds of ordering (in E):
308  short end;
309};
310typedef struct sro_dp sro_dp;
311
312// ordering is a weighted degree ordering
313struct sro_wp
314{
315  short place;  // where weighted degree is stored (in L)
316  short start;  // bounds of ordering (in E)
317  short end;
318  int *weights; // pointers into wvhdl field
319};
320typedef struct sro_wp sro_wp;
321
322// ordering is a weighted degree ordering
323struct sro_wp64
324{
325    short place;  // where weighted degree is stored (in L)
326    short start;  // bounds of ordering (in E)
327    short end;
328    int64 *weights64; // pointers into wvhdl field
329};
330typedef struct sro_wp64 sro_wp64;
331
332// ordering duplicates variables
333struct sro_cp
334{
335  short place;  // where start is copied to (in E)
336  short start;  // bounds of sources of copied variables (in E)
337  short end;
338};
339typedef struct sro_cp sro_cp;
340
341// ordering indicates "subset" of component number
342struct sro_syzcomp
343{
344  short place;  // where the index is stored (in L)
345  long *ShiftedComponents; // pointer into index field
346  int* Components;
347#ifdef PDEBUG
348  long length;
349#endif
350};
351typedef struct sro_syzcomp sro_syzcomp;
352
353// ordering  with component number >syzcomp is lower
354struct sro_syz
355{
356  short place;       // where the index is stored (in L)
357  int limit;         // syzcomp
358  int* syz_index;    // mapping Component -> SyzIndex for Comp <= limit
359  int  curr_index;   // SyzIndex for Component > limit
360};
361
362typedef struct sro_syz sro_syz;
363// Induced Syzygy (Schreyer) ordering is built inductively as follows:
364// we look for changes made by ordering blocks which are between prefix/suffix markers:
365// that is: which variables where placed by them and where (judging by v)
366
367// due to prefix/suffix nature we need some placeholder:
368// prefix stores here initial state
369// suffix cleares this up
370struct sro_ISTemp
371{
372  short start; // 1st member SHOULD be short "place"
373  int   suffixpos;
374  int*  pVarOffset; // copy!
375};
376
377// So this is the actuall thing!
378// suffix uses last sro_ISTemp (cleares it up afterwards) and
379// creates this block
380struct sro_IS
381{
382  short start, end;  // which part of L we want to want to update...
383  int*  pVarOffset; // same as prefix!
384
385  int limit; // first referenced component
386
387  // reference poly set?? // Should it be owned by ring?!!!
388  ideal F; // reference leading (module)-monomials set. owned by ring...
389  const intvec* componentWeights; // component weights! owned by ring...
390};
391
392typedef struct sro_IS sro_IS;
393typedef struct sro_ISTemp sro_ISTemp;
394
395#ifndef OM_ALLOC_H
396struct omBin_s;
397#endif
398
399struct sro_ord
400{
401  ro_typ  ord_typ;
402  int     order_index; // comes from r->order[order_index]
403  union
404  {
405     sro_dp dp;
406     sro_wp wp;
407     sro_wp64 wp64;
408     sro_cp cp;
409     sro_syzcomp syzcomp;
410     sro_syz syz;
411     sro_IS is;
412     sro_ISTemp isTemp;
413  } data;
414};
415
416#ifdef HAVE_PLURAL
417// NC pProcs:
418typedef poly (*mm_Mult_p_Proc_Ptr)(const poly m, poly p, const ring r);
419typedef poly (*mm_Mult_pp_Proc_Ptr)(const poly m, const poly p, const ring r);
420
421typedef ideal (*GB_Proc_Ptr)(const ideal F, const ideal Q, const intvec *w, const intvec *hilb, kStrategy strat);
422
423typedef poly (*SPoly_Proc_Ptr)(const poly p1, const poly p2, const ring r);
424typedef poly (*SPolyReduce_Proc_Ptr)(const poly p1, poly p2, const ring r);
425
426typedef void (*bucket_Proc_Ptr)(kBucket_pt b, poly p, number *c);
427
428struct nc_pProcs
429{
430public:
431  mm_Mult_p_Proc_Ptr                    mm_Mult_p;
432  mm_Mult_pp_Proc_Ptr                   mm_Mult_pp;
433
434  bucket_Proc_Ptr                       BucketPolyRed;
435  bucket_Proc_Ptr                       BucketPolyRed_Z;
436
437  SPoly_Proc_Ptr                        SPoly;
438  SPolyReduce_Proc_Ptr                  ReduceSPoly;
439
440  GB_Proc_Ptr                           GB;
441//                                         GlobalGB, // BBA
442//                                         LocalGB;  // MORA
443};
444
445
446struct nc_struct
447{
448  nc_type type;
449  //ring basering; // the ring C,D,.. live in (commutative ring with this NC structure!)
450
451  // initial data: square matrices rVar() x rVar()
452  // logically: upper triangular!!!
453  // TODO: eliminate this waste of memory!!!!
454  matrix C; 
455  matrix D;
456
457  // computed data:
458  matrix *MT; // size 0.. (rVar()*rVar()-1)/2
459  matrix COM;
460  int *MTsize; // size 0.. (rVar()*rVar()-1)/2
461
462  // IsSkewConstant indicates whethere coeffs C_ij are all equal,
463  // effective together with nc_type=nc_skew
464  int IsSkewConstant;
465
466  private:
467    // internal data for different implementations
468    // if dynamic => must be deallocated in destructor (nc_rKill!)
469    union
470    {
471      struct
472      {
473        // treat variables from iAltVarsStart till iAltVarsEnd as alternating vars.
474        // these variables should have odd degree, though that will not be checked
475        // iAltVarsStart, iAltVarsEnd are only used together with nc_type=nc_exterior
476        // 1 <= iAltVarsStart <= iAltVarsEnd <= r->N
477        unsigned int iFirstAltVar, iLastAltVar; // = 0 by default
478
479        // for factors of super-commutative algebras we need
480        // the part of general quotient ideal modulo squares!   
481        ideal idSCAQuotient; // = NULL by default. // must be deleted in Kill!
482      } sca;
483    } data;
484
485    CGlobalMultiplier* m_Multiplier;
486    CFormulaPowerMultiplier* m_PowerMultiplier;
487
488  public:
489   
490    inline nc_type& ncRingType() { return (type); };
491    inline nc_type ncRingType() const { return (type); };
492
493    inline unsigned int& FirstAltVar() 
494        { assume(ncRingType() == nc_exterior); return (data.sca.iFirstAltVar); };
495    inline unsigned int& LastAltVar () 
496        { assume(ncRingType() == nc_exterior); return (data.sca.iLastAltVar ); };
497
498    inline unsigned int FirstAltVar() const 
499        { assume(ncRingType() == nc_exterior); return (data.sca.iFirstAltVar); };
500    inline unsigned int LastAltVar () const 
501        { assume(ncRingType() == nc_exterior); return (data.sca.iLastAltVar ); };
502
503    inline ideal& SCAQuotient() 
504        { assume(ncRingType() == nc_exterior); return (data.sca.idSCAQuotient); };
505
506    inline CGlobalMultiplier* GetGlobalMultiplier() const
507        { assume(ncRingType() != nc_exterior); return (m_Multiplier); };
508
509    inline CGlobalMultiplier*& GetGlobalMultiplier()
510        { assume(ncRingType() != nc_exterior); return (m_Multiplier); };
511
512
513    inline CFormulaPowerMultiplier* GetFormulaPowerMultiplier() const
514        { assume(ncRingType() != nc_exterior); return (m_PowerMultiplier); };
515
516    inline CFormulaPowerMultiplier*& GetFormulaPowerMultiplier()
517        { assume(ncRingType() != nc_exterior); return (m_PowerMultiplier); };
518   
519  public:
520    nc_pProcs p_Procs; // NC procedures.
521
522};
523#endif
524
525struct sip_sring
526{
527// each entry must have a description and a procedure defining it,
528// general ordering: pointer/structs, long, int, short, BOOLEAN/char/enum
529// general defining procedures: rInit, rComplete, interpreter, ??
530  idhdl      idroot; /* local objects , interpreter*/
531  int*       order;  /* array of orderings, rInit/rSleftvOrdering2Ordering */
532  int*       block0; /* starting pos., rInit/rSleftvOrdering2Ordering*/
533  int*       block1; /* ending pos., rInit/rSleftvOrdering2Ordering*/
534  char**     parameter; /* names of parameters, rInit */
535  number     minpoly;  /* for Q_a/Zp_a, rInit */
536  ideal      minideal;
537  int**      wvhdl;  /* array of weight vectors, rInit/rSleftvOrdering2Ordering */
538  char **    names;  /* array of variable names, rInit */
539
540  // what follows below here should be set by rComplete, _only_
541  long      *ordsgn;  /* array of +/- 1 (or 0) for comparing monomials */
542                       /*  ExpL_Size entries*/
543
544  // is NULL for lp or N == 1, otherwise non-NULL (with OrdSize > 0 entries) */
545  sro_ord*   typ;   /* array of orderings + sizes, OrdSize entries */
546  /* if NegWeightL_Size > 0, then NegWeightL_Offset[0..size_1] is index of longs
547  in ExpVector whose values need an offset due to negative weights */
548  /* array of NegWeigtL_Size indicies */
549  int*      NegWeightL_Offset;
550
551  int*     VarOffset;
552
553  ideal      qideal; /* extension to the ring structure: qring, rInit */
554
555  int*     firstwv;
556
557  struct omBin_s*   PolyBin; /* Bin from where monoms are allocated */
558#ifdef HAVE_RINGS
559  unsigned int  ringtype;  /* cring = 0 => coefficient field, cring = 1 => coeffs from Z/2^m */
560  int_number    ringflaga; /* Z/(ringflag^ringflagb)=Z/nrnModul*/
561  unsigned long ringflagb;
562  unsigned long nr2mModul;  /* Z/nr2mModul */
563  int_number    nrnModul;
564#endif
565  unsigned long options; /* ring dependent options */
566
567  int        ch;  /* characteristic, rInit */
568  int        ref; /* reference counter to the ring, interpreter */
569
570  short      float_len; /* additional char-flags, rInit */
571  short      float_len2; /* additional char-flags, rInit */
572
573  short      N;      /* number of vars, rInit */
574
575  short      P;      /* number of pars, rInit */
576  short      OrdSgn; /* 1 for polynomial rings, -1 otherwise, rInit */
577
578  short     firstBlockEnds;
579#ifdef HAVE_PLURAL
580  short     real_var_start, real_var_end;
581#endif
582
583#ifdef HAVE_SHIFTBBA
584  short          isLPring; /* 0 for non-letterplace rings, otherwise the number of LP blocks, at least 1, known also as lV */
585#endif
586
587  BOOLEAN   VectorOut;
588  BOOLEAN   ShortOut;
589  BOOLEAN   CanShortOut;
590  BOOLEAN   LexOrder; // TRUE if the monomial ordering has polynomial and power series blocks
591  BOOLEAN   MixedOrder; // TRUE for global/local mixed orderings, FALSE otherwise
592
593  BOOLEAN   ComponentOrder; // ???
594
595  // what follows below here should be set by rComplete, _only_
596  // contains component, but no weight fields in E */
597  short      ExpL_Size; // size of exponent vector in long
598  short      CmpL_Size; // portions which need to be compared
599  /* number of long vars in exp vector:
600     long vars are those longs in the exponent vector which are
601     occupied by variables, only */
602  short      VarL_Size;
603  short      BitsPerExp; /* number of bits per exponent */
604  short      ExpPerLong; /* maximal number of Exponents per long */
605  short      pCompIndex; /* p->exp.e[pCompIndex] is the component */
606  short      pOrdIndex; /* p->exp[pOrdIndex] is pGetOrd(p) */
607  short      OrdSize; /* size of ord vector (in sro_ord) */
608
609  /* if >= 0, long vars in exp vector are consecutive and start there
610     if <  0, long vars in exp vector are not consecutive */
611  short     VarL_LowIndex;
612  // number of exponents in r->VarL_Offset[0]
613  // is minimal number of exponents in a long var
614  short     MinExpPerLong;
615
616  short     NegWeightL_Size;
617  /* array of size VarL_Size,
618     VarL_Offset[i] gets i-th long var in exp vector */
619  int*      VarL_Offset;
620
621  /* mask for getting single exponents */
622  unsigned long bitmask;
623  /* mask used for divisiblity tests */
624  unsigned long divmask; // rComplete
625
626  p_Procs_s*    p_Procs; // rComplete/p_ProcsSet
627
628  /* FDeg and LDeg */
629  pFDegProc     pFDeg; // rComplete/rSetDegStuff
630  pLDegProc     pLDeg; // rComplete/rSetDegStuff
631
632  /* as it was determined by rComplete */
633  pFDegProc     pFDegOrig;
634  /* and as it was determined before rOptimizeLDeg */
635  pLDegProc     pLDegOrig;
636
637  p_SetmProc    p_Setm;
638  n_Procs_s*    cf;
639  ring          algring;
640#ifdef HAVE_PLURAL
641  private:
642    nc_struct*    _nc; // private
643  public:
644    inline const nc_struct* GetNC() const { return _nc; }; // public!!!
645    inline nc_struct*& GetNC() { return _nc; }; // public!!!
646#endif
647};
648
649#endif /* __cplusplus */
650
651
652
653/*
654**  7. runtime procedures/global data
655*/
656
657/* 7.1 C-routines : */
658
659
660#ifdef __cplusplus
661extern "C" {
662#endif
663void  m2_end(int i) __attribute__((noreturn));
664#ifdef __cplusplus
665}
666#endif
667
668/* 7.2 C++-routines : */
669
670#ifdef __cplusplus
671int   inits(void);
672int   IsPrime(int i);
673#ifdef buildin_rand
674extern int siSeed;
675int siRand();
676#endif
677#endif
678
679#define loop for(;;)
680
681#ifndef ABS
682#define ABS(x) ((x)<0?(-(x)):(x))
683#endif
684
685#if defined(__cplusplus)
686static inline int si_max(const int a, const int b)  { return (a>b) ? a : b; }
687static inline int si_min(const int a, const int b)  { return (a<b) ? a : b; }
688static inline long si_max(const long a, const long b)  { return (a>b) ? a : b; }
689static inline long si_min(const long a, const long b)  { return (a<b) ? a : b; }
690#else
691#define si_max(A,B) ((A) > (B) ? (A) : (B))
692#define si_min(A,B) ((A) < (B) ? (A) : (B))
693#endif
694
695extern struct omBin_s* char_ptr_bin;
696extern struct omBin_s* sleftv_bin;
697
698#ifdef __cplusplus
699union uutypes
700{
701  int           i;
702  ring          uring;
703  poly          p;
704  number        n;
705  ideal         uideal;
706  map           umap;
707  matrix        umatrix;
708  char *        ustring;
709  intvec *      iv;
710  lists         l;
711  si_link       li;
712  package       pack;
713  procinfo *    pinf;
714};
715
716class idrec
717{
718  public:
719  /* !! do not change the first 6 entries !! (see subexpr.h: sleftv) */
720  idhdl      next;
721  const char *id;
722  utypes     data;
723  attr       attribute;
724  BITSET     flag;
725  idtyp      typ;
726
727  short      lev;
728  short      ref;
729  int        id_i;
730
731  idrec() { memset(this,0,sizeof(*this)); }
732  idhdl get(const char * s, int lev);
733  idhdl set(const char * s, int lev, idtyp t, BOOLEAN init=TRUE);
734  char * String();
735//  ~idrec();
736};
737
738#endif
739
740#endif
741
Note: See TracBrowser for help on using the repository browser.