source: git/Singular/structs.h @ a9a7be

fieker-DuValspielwiese
Last change on this file since a9a7be was a9a7be, checked in by Olaf Bachmann <obachman@…>, 25 years ago
* walk stuff git-svn-id: file:///usr/local/Singular/svn/trunk@3682 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 7.4 KB
Line 
1#ifndef STRUCTS_H
2#define STRUCTS_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: structs.h,v 1.23 1999-09-27 15:05:33 obachman Exp $ */
7/*
8* ABSTRACT
9*/
10
11/* standard types */
12typedef unsigned char  uchar ;
13typedef unsigned short CARDINAL;
14typedef short BOOLEAN;
15
16typedef void * Sy_reference;
17#define ADDRESS Sy_reference
18#define BITSET  unsigned int
19
20/* EXPONENT_TYPE is determined by configure und defined in mod2.h */
21typedef EXPONENT_TYPE Exponent_t;
22
23enum tHomog
24{
25   isNotHomog = FALSE,
26   isHomog    = TRUE,
27   testHomog
28};
29enum noeof_t
30{
31  noeof_brace = 1,
32  noeof_asstring,
33  noeof_block,
34  noeof_bracket,
35  noeof_comment,
36  noeof_procname,
37  noeof_string
38};
39
40struct sip_memHeap;
41typedef struct sip_memHeap ip_memHeap;
42typedef ip_memHeap *       memHeap;
43
44/* C++-part */
45#ifdef __cplusplus
46class ip_smatrix;
47class idrec;
48class intvec;
49class sleftv;
50class slists;
51class sattr;
52class skStrategy;
53class ssyStrategy;
54class procinfo;
55class namerec;
56class kBucket;
57#endif
58
59struct  sip_sring;
60struct  sip_sideal;
61struct  sip_link;
62struct  spolynom;
63struct _ssubexpr;
64struct _sssym;
65struct snumber;
66struct sip_command;
67struct sip_package;
68struct s_si_link_extension;
69struct reca;
70
71typedef struct _ssubexpr   sSubexpr;
72typedef struct _sssym      ssym;
73typedef struct spolyrec    polyrec;
74typedef struct snumber     rnumber;
75typedef struct sip_sideal  ip_sideal;
76typedef struct sip_smap    ip_smap;
77typedef struct sip_sring   ip_sring;
78typedef struct sip_link    ip_link;
79typedef struct sip_command ip_command;
80typedef struct sip_package ip_package;
81
82
83/* the pointer types */
84typedef ip_sring *         ring;
85typedef int                idtyp;
86typedef rnumber *          number;
87typedef polyrec *          poly;
88typedef poly *             polyset;
89typedef ip_sideal *        ideal;
90typedef ip_smap *          map;
91typedef ideal *            resolvente;
92typedef union uutypes      utypes;
93typedef ip_command *       command;
94typedef struct s_si_link_extension *si_link_extension;
95typedef struct reca *      alg;
96#ifdef __cplusplus
97typedef idrec *            idhdl;
98typedef ip_smatrix *       matrix;
99typedef ip_link *          si_link;
100typedef sleftv *           leftv;
101typedef slists *           lists;
102typedef sSubexpr *         Subexpr;
103typedef sattr *            attr;
104typedef skStrategy *       kStrategy;
105typedef ip_package *       package;
106typedef ssyStrategy *      syStrategy;
107typedef procinfo *         procinfov;
108typedef namerec *          namehdl;
109typedef kBucket*           kBucket_pt;
110
111struct _scmdnames
112{
113  char *name;
114  short alias;
115  short tokval;
116  short toktype;
117};
118typedef struct _scmdnames cmdnames;
119
120typedef enum
121{
122  ro_dp, // ordering is a degree ordering
123  ro_wp, // ordering is a weighted degree ordering
124  ro_cp, // ordering duplicates variables
125  ro_syzcomp, // ordering indicates "subset" of component number
126  ro_none
127}
128ro_typ;
129
130// ordering is a degree ordering
131struct sro_dp
132{
133  short place;  // where degree is stored (in L):
134  short start;  // bounds of ordering (in E):
135  short end;
136};
137typedef struct sro_dp sro_dp;
138
139// ordering is a weighted degree ordering
140struct sro_wp
141{
142  short place;  // where weighted degree is stored (in L)
143  short start;  // bounds of ordering (in E)
144  short end;
145  int *weights; // pointers into wvhdl field
146};
147typedef struct sro_wp sro_wp;
148
149// ordering duplicates variables
150struct sro_cp
151{
152  short place;  // where start is copied to (in E)
153  short start;  // bounds of sources of copied variables (in E)
154  short end;
155};
156typedef struct sro_cp sro_cp;
157
158// ordering indicates "subset" of component number
159struct sro_syzcomp
160{
161  short place;  // where the index is stored (in L)
162  long *ShiftedComponents; // pointer into index field
163  int* Components;
164#ifdef PDEBUG
165  long length;
166#endif
167};
168typedef struct sro_syzcomp sro_syzcomp;
169
170
171struct sro_ord
172{
173  ro_typ  ord_typ;
174  union
175  {
176     sro_dp dp;
177     sro_wp wp;
178     sro_cp cp;
179     sro_syzcomp syzcomp;
180  } data;
181};
182
183struct sip_sring
184{
185  idhdl      idroot; /* local objects */
186  int*       order;  /* array of orderings */
187  int*       block0; /* starting pos.*/
188  int*       block1; /* ending pos.*/
189  char**     parameter; /* names of parameters */
190  number     minpoly;
191  int**      wvhdl;  /* array of weight vectors */
192  char **    names;  /* array of variable names */
193
194  // what follows below here should be set by rComplete, _only_
195  long      *ordsgn;  /* array of +/- 1 (or 0) for comparing monomials */
196                       /*  ExpLSize entries*/
197
198  // is NULL for lp or N == 1, otherwise non-NULL (with OrdSize > 0 entries) */
199  sro_ord *  typ;   /* array of orderings + sizes, OrdSize entries */
200
201  ideal      qideal; /* extension to the ring structure: qring */
202
203  int      *VarOffset; /* mapping exp. of var(i) -> p->exp.e[VarOffset[i]] */
204
205  memHeap   mm_specHeap; /* Heap from where monoms are allocated */
206#ifdef SDRING
207  short      partN;
208#endif
209  short      ch;     /* characteristic */
210  short      ch_flags; /* additional char-flags */
211
212  short      N;      /* number of vars */
213
214  short      P;      /* number of pars */
215  short      OrdSgn; /* 1 for polynomial rings, -1 otherwise */
216  // what follows below here should be set by rComplete, _only_
217  short      pVarLowIndex;  /* lowest index of a variable */
218  short      pVarHighIndex; /* highest index of a variable */
219                            /* pVarLow to pVarHigh */
220  // contains component, but no weight fields in E */
221  // better: pVarLowIndexE / pVarLowIndexL
222  short      pDivLow;
223  short      pDivHigh; /* the same as pVarLow..pVarHigh, */
224                       /* but as index in the 'long' field */
225
226  short      pCompLowIndex; // better: use pCompareLowIndexL
227  short      pCompHighIndex; /* use p->exp.l[pCompLowIndex..ppCompHighIndex] */
228                             /* for comparing monomials */
229  short      pCompLSize; // pCompHighIndex - pCompLowIndex + 1
230
231  short      pCompIndex; /* p->exp.e[pCompIndex] is the component */
232  short      pOrdIndex; /* p->exp.l[pOrdIndex] is pGetOrd(p) */
233
234  short      ExpESize; /* size of exponent vector in Exponent_t */
235  short      ExpLSize; /* size of exponent vector in long */
236  short      OrdSize; /* size of ord vector (in sro_ord) */
237
238  short      ref; /* reference counter to the ring */
239};
240
241struct sip_sideal
242{
243  poly*  m;
244  long rank;
245  int nrows;
246  int ncols;
247  #define IDELEMS(i) ((i)->ncols)
248  inline int& idelems(void) { return ncols; }
249};
250
251struct sip_smap
252{
253  poly *m;
254  char *preimage;
255  int nrows;
256  int ncols;
257};
258#endif
259
260/* the function pointer types */
261typedef number (*numberfunc)(number a,number b);
262
263typedef void    (*pSetmProc)(poly p);
264typedef int     (*pLDegProc)(poly p, int *length);
265typedef int     (*pFDegProc)(poly p);
266typedef int     (*pCompProc)(poly p1, poly p2);
267
268extern ring      currRing;
269
270/*
271**  7. runtime procedures/global data
272*/
273
274/* 7.1 C-routines : */
275
276#ifdef __cplusplus
277extern "C" {
278#endif
279void  m2_end(short i);
280#ifdef __cplusplus
281}
282#endif
283
284/* 7.2 C++-routines : */
285
286#ifdef __cplusplus
287int   inits(void);
288#ifdef buildin_rand
289extern int siSeed;
290int siRand();
291#endif
292#endif
293
294/*the general set of std-options --> kutil.cc */
295extern BITSET test;
296/*the general set of verbose-options --> febase.cc */
297#ifdef __cplusplus
298extern "C" BITSET verbose;
299#else
300extern BITSET verbose;
301#endif
302/*debugging the bison grammar --> grammar.cc*/
303#ifdef YYDEBUG
304#if YYDEBUG
305extern int    yydebug;
306#endif
307#endif
308
309#ifdef HAVE_LIBPARSER
310#ifdef __cplusplus
311class libstack;
312typedef libstack *  libstackv;
313#endif
314#endif /* HAVE_LIBPARSER */
315
316#endif
317
Note: See TracBrowser for help on using the repository browser.