1 | #ifndef STRUCTS_H |
---|
2 | #define STRUCTS_H |
---|
3 | /**************************************** |
---|
4 | * Computer Algebra System SINGULAR * |
---|
5 | ****************************************/ |
---|
6 | /* $Id: structs.h,v 1.18 1999-02-26 15:32:06 Singular Exp $ */ |
---|
7 | /* |
---|
8 | * ABSTRACT |
---|
9 | */ |
---|
10 | |
---|
11 | /* standard types */ |
---|
12 | typedef unsigned char uchar ; |
---|
13 | typedef unsigned short CARDINAL; |
---|
14 | typedef short BOOLEAN; |
---|
15 | |
---|
16 | typedef 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 */ |
---|
21 | typedef EXPONENT_TYPE Exponent_t; |
---|
22 | |
---|
23 | enum tHomog |
---|
24 | { |
---|
25 | isNotHomog = FALSE, |
---|
26 | isHomog = TRUE, |
---|
27 | testHomog |
---|
28 | }; |
---|
29 | enum 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 | |
---|
40 | struct sip_memHeap; |
---|
41 | typedef struct sip_memHeap ip_memHeap; |
---|
42 | typedef ip_memHeap * memHeap; |
---|
43 | |
---|
44 | /* C++-part */ |
---|
45 | #ifdef __cplusplus |
---|
46 | class ip_smatrix; |
---|
47 | class idrec; |
---|
48 | class intvec; |
---|
49 | class sleftv; |
---|
50 | class slists; |
---|
51 | class sattr; |
---|
52 | class skStrategy; |
---|
53 | class ssyStrategy; |
---|
54 | class procinfo; |
---|
55 | class namerec; |
---|
56 | #endif |
---|
57 | |
---|
58 | struct sip_sring; |
---|
59 | struct sip_sideal; |
---|
60 | struct sip_link; |
---|
61 | struct spolynom; |
---|
62 | struct _ssubexpr; |
---|
63 | struct _sssym; |
---|
64 | struct snumber; |
---|
65 | struct sip_command; |
---|
66 | struct sip_package; |
---|
67 | struct s_si_link_extension; |
---|
68 | struct reca; |
---|
69 | |
---|
70 | typedef struct _ssubexpr sSubexpr; |
---|
71 | typedef struct _sssym ssym; |
---|
72 | typedef struct spolyrec polyrec; |
---|
73 | typedef struct snumber rnumber; |
---|
74 | typedef struct sip_sideal ip_sideal; |
---|
75 | typedef struct sip_smap ip_smap; |
---|
76 | typedef struct sip_sring ip_sring; |
---|
77 | typedef struct sip_link ip_link; |
---|
78 | typedef struct sip_command ip_command; |
---|
79 | typedef struct sip_package ip_package; |
---|
80 | |
---|
81 | |
---|
82 | /* the pointer types */ |
---|
83 | typedef ip_sring * ring; |
---|
84 | typedef int idtyp; |
---|
85 | typedef rnumber * number; |
---|
86 | typedef polyrec * poly; |
---|
87 | typedef poly * polyset; |
---|
88 | typedef ip_sideal * ideal; |
---|
89 | typedef ip_smap * map; |
---|
90 | typedef ideal * resolvente; |
---|
91 | typedef union uutypes utypes; |
---|
92 | typedef ip_command * command; |
---|
93 | typedef struct s_si_link_extension *si_link_extension; |
---|
94 | typedef struct reca * alg; |
---|
95 | #ifdef __cplusplus |
---|
96 | typedef idrec * idhdl; |
---|
97 | typedef ip_smatrix * matrix; |
---|
98 | typedef ip_link * si_link; |
---|
99 | typedef sleftv * leftv; |
---|
100 | typedef slists * lists; |
---|
101 | typedef sSubexpr * Subexpr; |
---|
102 | typedef sattr * attr; |
---|
103 | typedef skStrategy * kStrategy; |
---|
104 | typedef ip_package * package; |
---|
105 | typedef ssyStrategy * syStrategy; |
---|
106 | typedef procinfo * procinfov; |
---|
107 | typedef namerec * namehdl; |
---|
108 | |
---|
109 | struct _scmdnames |
---|
110 | { |
---|
111 | char *name; |
---|
112 | short alias; |
---|
113 | short tokval; |
---|
114 | short toktype; |
---|
115 | }; |
---|
116 | typedef struct _scmdnames cmdnames; |
---|
117 | |
---|
118 | struct sip_sring |
---|
119 | { |
---|
120 | idhdl idroot; /* local objects */ |
---|
121 | int* order; /* array of orderings */ |
---|
122 | int* block0; /* starting pos.*/ |
---|
123 | int* block1; /* ending pos.*/ |
---|
124 | char** parameter; /* names of parameters */ |
---|
125 | number minpoly; |
---|
126 | short** wvhdl; /* array of weight vectors */ |
---|
127 | char ** names; /* array of variable names */ |
---|
128 | /* extension to the ring structure: qring */ |
---|
129 | ideal qideal; |
---|
130 | #ifdef SDRING |
---|
131 | short partN; |
---|
132 | #endif |
---|
133 | short ch; /* characteristic */ |
---|
134 | short N; /* number of vars */ |
---|
135 | |
---|
136 | short P; /* number of pars */ |
---|
137 | short OrdSgn; /* 1 for polynomial rings, -1 otherwise */ |
---|
138 | |
---|
139 | short ref; |
---|
140 | |
---|
141 | // what follows below here should be set by rComplete, _only_ |
---|
142 | int *VarOffset; /* controls indexing of exponents */ |
---|
143 | short VarCompIndex; /* location of component in exp vector */ |
---|
144 | short VarLowIndex; /* lowest index of an exponent */ |
---|
145 | short VarHighIndex; /* Highest index of an expoentn */ |
---|
146 | |
---|
147 | #ifdef RDEBUG |
---|
148 | short no; /* unique id for rings */ |
---|
149 | #endif |
---|
150 | }; |
---|
151 | |
---|
152 | struct sip_sideal |
---|
153 | { |
---|
154 | poly* m; |
---|
155 | long rank; |
---|
156 | int nrows; |
---|
157 | int ncols; |
---|
158 | #define IDELEMS(i) ((i)->ncols) |
---|
159 | inline int& idelems(void) { return ncols; } |
---|
160 | }; |
---|
161 | |
---|
162 | struct sip_smap |
---|
163 | { |
---|
164 | poly *m; |
---|
165 | char *preimage; |
---|
166 | int nrows; |
---|
167 | int ncols; |
---|
168 | }; |
---|
169 | #endif |
---|
170 | |
---|
171 | /* the function pointer types */ |
---|
172 | typedef number (*numberfunc)(number a,number b); |
---|
173 | |
---|
174 | typedef void (*pSetmProc)(poly p); |
---|
175 | typedef int (*pLDegProc)(poly p, int *length); |
---|
176 | typedef int (*pFDegProc)(poly p); |
---|
177 | typedef int (*pCompProc)(poly p1, poly p2); |
---|
178 | |
---|
179 | extern ring currRing; |
---|
180 | |
---|
181 | /* |
---|
182 | ** 7. runtime procedures/global data |
---|
183 | */ |
---|
184 | |
---|
185 | /* 7.1 C-routines : */ |
---|
186 | |
---|
187 | #ifdef __cplusplus |
---|
188 | extern "C" { |
---|
189 | #endif |
---|
190 | void m2_end(short i); |
---|
191 | #ifdef __cplusplus |
---|
192 | } |
---|
193 | #endif |
---|
194 | |
---|
195 | /* 7.2 C++-routines : */ |
---|
196 | |
---|
197 | #ifdef __cplusplus |
---|
198 | int inits(void); |
---|
199 | void singular_help(char *str, BOOLEAN example); |
---|
200 | #ifdef buildin_help |
---|
201 | int singular_manual(char *str); |
---|
202 | #endif |
---|
203 | #ifdef buildin_rand |
---|
204 | extern int siSeed; |
---|
205 | int siRand(); |
---|
206 | #endif |
---|
207 | #endif |
---|
208 | |
---|
209 | /*the general set of std-options --> kutil.cc */ |
---|
210 | extern BITSET test; |
---|
211 | /*the general set of verbose-options --> febase.cc */ |
---|
212 | #ifdef __cplusplus |
---|
213 | extern "C" BITSET verbose; |
---|
214 | #else |
---|
215 | extern BITSET verbose; |
---|
216 | #endif |
---|
217 | /*debugging the bison grammar --> grammar.cc*/ |
---|
218 | #ifdef YYDEBUG |
---|
219 | #if YYDEBUG |
---|
220 | extern int yydebug; |
---|
221 | #endif |
---|
222 | #endif |
---|
223 | |
---|
224 | #ifdef HAVE_LIBPARSER |
---|
225 | #ifdef __cplusplus |
---|
226 | class libstack; |
---|
227 | typedef libstack * libstackv; |
---|
228 | #endif |
---|
229 | #endif /* HAVE_LIBPARSER */ |
---|
230 | |
---|
231 | #endif |
---|
232 | |
---|