source: git/Singular/structs.h @ 907274

spielwiese
Last change on this file since 907274 was ce9c2d, checked in by Hans Schönemann <hannes@…>, 25 years ago
*hannes: aligne structures git-svn-id: file:///usr/local/Singular/svn/trunk@2874 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 5.0 KB
Line 
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 */
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;
56#endif
57
58struct  sip_sring;
59struct  sip_sideal;
60struct  sip_link;
61struct  spolynom;
62struct _ssubexpr;
63struct _sssym;
64struct snumber;
65struct sip_command;
66struct sip_package;
67struct s_si_link_extension;
68struct reca;
69
70typedef struct _ssubexpr   sSubexpr;
71typedef struct _sssym      ssym;
72typedef struct spolyrec    polyrec;
73typedef struct snumber     rnumber;
74typedef struct sip_sideal  ip_sideal;
75typedef struct sip_smap    ip_smap;
76typedef struct sip_sring   ip_sring;
77typedef struct sip_link    ip_link;
78typedef struct sip_command ip_command;
79typedef struct sip_package ip_package;
80
81
82/* the pointer types */
83typedef ip_sring *         ring;
84typedef int                idtyp;
85typedef rnumber *          number;
86typedef polyrec *          poly;
87typedef poly *             polyset;
88typedef ip_sideal *        ideal;
89typedef ip_smap *          map;
90typedef ideal *            resolvente;
91typedef union uutypes      utypes;
92typedef ip_command *       command;
93typedef struct s_si_link_extension *si_link_extension;
94typedef struct reca *      alg;
95#ifdef __cplusplus
96typedef idrec *            idhdl;
97typedef ip_smatrix *       matrix;
98typedef ip_link *          si_link;
99typedef sleftv *           leftv;
100typedef slists *           lists;
101typedef sSubexpr *         Subexpr;
102typedef sattr *            attr;
103typedef skStrategy *       kStrategy;
104typedef ip_package *       package;
105typedef ssyStrategy *      syStrategy;
106typedef procinfo *         procinfov;
107typedef namerec *          namehdl;
108
109struct _scmdnames
110{
111  char *name;
112  short alias;
113  short tokval;
114  short toktype;
115};
116typedef struct _scmdnames cmdnames;
117
118struct 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
152struct 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
162struct sip_smap
163{
164  poly *m;
165  char *preimage;
166  int nrows;
167  int ncols;
168};
169#endif
170
171/* the function pointer types */
172typedef number (*numberfunc)(number a,number b);
173
174typedef void    (*pSetmProc)(poly p);
175typedef int     (*pLDegProc)(poly p, int *length);
176typedef int     (*pFDegProc)(poly p);
177typedef int     (*pCompProc)(poly p1, poly p2);
178
179extern ring      currRing;
180
181/*
182**  7. runtime procedures/global data
183*/
184
185/* 7.1 C-routines : */
186
187#ifdef __cplusplus
188extern "C" {
189#endif
190void  m2_end(short i);
191#ifdef __cplusplus
192}
193#endif
194
195/* 7.2 C++-routines : */
196
197#ifdef __cplusplus
198int   inits(void);
199void  singular_help(char *str, BOOLEAN example);
200#ifdef buildin_help
201int   singular_manual(char *str);
202#endif
203#ifdef buildin_rand
204extern int siSeed;
205int siRand();
206#endif
207#endif
208
209/*the general set of std-options --> kutil.cc */
210extern BITSET test;
211/*the general set of verbose-options --> febase.cc */
212#ifdef __cplusplus
213extern "C" BITSET verbose;
214#else
215extern BITSET verbose;
216#endif
217/*debugging the bison grammar --> grammar.cc*/
218#ifdef YYDEBUG
219#if YYDEBUG
220extern int    yydebug;
221#endif
222#endif
223
224#ifdef HAVE_LIBPARSER
225#ifdef __cplusplus
226class libstack;
227typedef libstack *  libstackv;
228#endif
229#endif /* HAVE_LIBPARSER */
230
231#endif
232
Note: See TracBrowser for help on using the repository browser.