source: git/Singular/ipid.h @ cd6b45

spielwiese
Last change on this file since cd6b45 was cd6b45, checked in by Kai Krüger <krueger@…>, 25 years ago
Makefile.in configure configure.in extra.cc grammar.h iparith.cc ipid.cc ipid.h iplib.cc misc.cc mod2.h.in subexpr.h pcv.cc * Added support for dynamic-modules on linux-plattforms * pcv compile as module if dynamic-loading is enabled. git-svn-id: file:///usr/local/Singular/svn/trunk@2679 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 5.0 KB
Line 
1#ifndef IPID_H
2#define IPID_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: ipid.h,v 1.21 1998-11-19 14:04:35 krueger Exp $ */
7/*
8* ABSTRACT: identfier handling
9*/
10#include <string.h>
11#include "structs.h"
12#include "subexpr.h"
13
14struct sip_sring
15{
16  idhdl      idroot; /* local objects */
17  int*       order;  /* array of orderings */
18  int*       block0; /* starting pos.*/
19  int*       block1; /* ending pos.*/
20  char**     parameter; /* names of parameters */
21  number     minpoly;
22  short**    wvhdl;  /* array of weight vectors */
23  char **    names;  /* array of variable names */
24  /* extension to the ring structure: qring */
25  ideal      qideal;
26#ifdef SDRING
27  short      partN;
28#endif
29  short      ch;     /* characteristic */
30  short      N;      /* number of vars */
31
32  short      P;      /* number of pars */
33  short      OrdSgn; /* 1 for polynomial rings, -1 otherwise */
34
35  short      ref;
36
37  // what follows below here should be set by rComplete, _only_
38  int       *VarOffset;   /* controls indexing of exponents */
39  short     VarCompIndex; /* location of component in exp vector */
40  short     VarLowIndex;  /* lowest index of an exponent */
41  short     VarHighIndex; /* Highest index of an expoentn */
42 
43#ifdef RDEBUG
44  short      no; /* unique id for rings */
45#endif
46};
47
48struct sip_sideal
49{
50  poly*  m;
51  long rank;
52  int nrows;
53  int ncols;
54  #define IDELEMS(i) ((i)->ncols)
55  inline int& idelems(void) { return ncols; }
56};
57
58struct sip_smap
59{
60  poly *m;
61  char *preimage;
62  int nrows;
63  int ncols;
64};
65
66struct sip_command
67{
68  sleftv arg1; /*arg1 to build_in, proc to proc_call*/
69  sleftv arg2; /*NULL or arg2 to build_in, args to proc_call*/
70  sleftv arg3; /*NULL or arg3*/
71  short argc; /*0,1,2,3 to build_in, -1 otherwise*/
72  short op;   /* build_in or PROC_CMD*/
73};
74
75struct sip_package
76{
77  idhdl         idroot; /* local objects */
78  char          *libname;
79  short         ref;
80  language_defs language;
81  void          *handle;
82};
83
84inline package paCopy(package pack)
85{
86  pack->ref++;
87  return pack;
88}
89
90union uutypes;
91
92union uutypes
93{
94  int           i;
95  ring          uring;
96  poly          p;
97  number        n;
98  ideal         uideal;
99  map           umap;
100  matrix        umatrix;
101  char *        ustring;
102  intvec *      iv;
103  lists         l;
104  si_link       li;
105  package       pack;
106  procinfo *    pinf;
107};
108
109class idrec
110{
111  public:
112  /* !! do not change the first 6 entries !! (see subexpr.h: sleftv) */
113  idhdl      next;
114  char *     id;
115  utypes     data;
116  BITSET     flag;
117  attr       attribute;
118  idtyp      typ;
119
120  short      lev;
121  short      ref;
122
123#define IDNEXT(a)    ((a)->next)
124#define IDTYP(a)     ((a)->typ)
125#define IDFLAG(a)    ((a)->flag)
126#define IDLEV(a)     ((a)->lev)
127#define IDID(a)      ((a)->id)
128#define IDATTR(a)    ((a)->attribute)
129
130#define IDINT(a)    ((a)->data.i)
131#define IDDATA(a)   ((a)->data.ustring)
132#define IDRING(a)   ((a)->data.uring)
133#define IDINTVEC(a) ((a)->data.iv)
134#define IDPOLY(a)   ((a)->data.p)
135#define IDNUMBER(a) ((a)->data.n)
136#define IDIDEAL(a)  (((a)->data).uideal)
137#define IDMATRIX(a) (((a)->data).umatrix)
138#define IDMAP(a)    (((a)->data).umap)
139#define IDSTRING(a) ((a)->data.ustring)
140#define IDLIST(a)   ((a)->data.l)
141#define IDLINK(a)   ((a)->data.li)
142#define IDPACKAGE(a) ((a)->data.pack)
143#define IDPROC(a)   ((a)->data.pinf)
144
145  idrec() { memset(this,0,sizeof(*this)); }
146  idhdl get(const char * s, int lev);
147  idhdl set(char * s, int lev, idtyp t, BOOLEAN init=TRUE);
148//  ~idrec();
149};
150
151class namerec {
152  public:
153  namehdl    next;
154  namehdl    root;
155  package    pack;
156  char *     name;
157  int        lev;
158  BOOLEAN    isroot;
159#define NSROOT(a) ((a)->pack->idroot)
160#define NSPACK(a) ((a)->pack)
161
162  int        myynest;
163  idhdl      currRingHdl;
164  ring       currRing;
165
166 namerec()  { memset(this,0,sizeof(*this)); }
167  //namehdl    Set(idhdl root);
168  namehdl    pop(BOOLEAN change_nesting=FALSE);
169  namehdl    push(package pack, char *name, int nesting=-1, BOOLEAN init=FALSE);
170  idhdl      get(const char * s, int lev, BOOLEAN root=FALSE);
171};
172
173extern namehdl namespaceroot;
174#ifdef HAVE_NAMESPACES
175#  define IDROOT (NSROOT(namespaceroot))
176#else /* HAVE_NAMESPACES */
177extern idhdl      idroot;
178#  define IDROOT idroot
179#endif /* HAVE_NAMESPACES */
180
181extern idhdl      currRingHdl;
182/*extern ring     currRing;  in structs.h */
183extern ideal      currQuotient;
184
185char *idhdl2id(idhdl pck, idhdl h);
186void  iiname2hdl(char *name, idhdl *pck, idhdl *id);
187idhdl enterid(char * a, int lev, idtyp t, idhdl* root, BOOLEAN init=TRUE);
188idhdl ggetid(const char *n, BOOLEAN local = FALSE);
189idhdl ggetid(const char *n, BOOLEAN local, idhdl *packhdl);
190void  killid(char * a, idhdl * i);
191void  killhdl(idhdl h);
192void  killhdl(idhdl h, idhdl * ih);
193lists ipNameList(idhdl root);
194void  ipMoveId(idhdl h);
195BOOLEAN checkPackage(package pack);
196
197#define FLAG_STD   0
198#define FLAG_DRING 1
199#define FLAG_DOPERATOR 2
200#define hasFlag(A,F) Sy_inset((F),(A)->flag)
201#define setFlag(A,F) (A)->flag|=Sy_bit(F)
202#define resetFlag(A,F) (A)->flag&=~Sy_bit(F)
203void ipListFlag(idhdl h);
204#endif
205
206
Note: See TracBrowser for help on using the repository browser.