source: git/Singular/ipid.h @ 82716e

spielwiese
Last change on this file since 82716e was 8d12f5, checked in by Hans Schönemann <hannes@…>, 26 years ago
* hannes; fiexed typo in ring definition git-svn-id: file:///usr/local/Singular/svn/trunk@1592 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.8 KB
Line 
1#ifndef IPID_H
2#define IPID_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: ipid.h,v 1.12 1998-05-04 14:11:38 Singular Exp $ */
7/*
8* ABSTRACT: identfier handling
9*/
10#include <string.h>
11#include "structs.h"
12#include "subexpr.h"
13//#include "polys-impl.h"
14
15struct sip_sring
16{
17  idhdl      idroot; /* local objects */
18  int*       order;  /* array of orderings */
19  int*       block0; /* starting pos.*/
20  int*       block1; /* ending pos.*/
21  char**     parameter; /* names of parameters */
22  number     minpoly;
23  short**    wvhdl;  /* array of weight vectors */
24  char **    names;  /* array of variable names */
25  /* extension to the ring structure: qring */
26  ideal      qideal;
27#ifdef SDRING
28  short      partN;
29#endif
30  short      ch;     /* characteristic */
31  short      N;      /* number of vars */
32
33  short      P;      /* number of pars */
34  short      OrdSgn; /* 1 for polynomial rings, -1 otherwise */
35
36  short      ref;
37
38  // what follows below here should be set by rComplete, _only_
39  short     VarOffset; /* controls indexing of exponents */
40  short     VarCompIndex; /* controls locations of component in exp vector */
41
42#ifdef RDEBUG
43  short      no; /* unique id for rings */
44#endif 
45};
46
47struct sip_sideal
48{
49  poly*  m;
50  long rank;
51  int nrows;
52  int ncols;
53  #define IDELEMS(i) ((i)->ncols)
54  inline int& idelems(void) { return ncols; }
55};
56
57struct sip_smap
58{
59  poly *m;
60  char *preimage;
61  int nrows;
62  int ncols;
63};
64
65struct sip_command
66{
67  sleftv arg1; /*arg1 to build_in, proc to proc_call*/
68  sleftv arg2; /*NULL or arg2 to build_in, args to proc_call*/
69  sleftv arg3; /*NULL or arg3*/
70  short argc; /*0,1,2,3 to build_in, -1 otherwise*/
71  short op;   /* build_in or PROC_CMD*/
72};
73
74struct sip_package
75{
76  idhdl      idroot; /* local objects */
77};
78
79union uutypes;
80
81union uutypes
82{
83  int           i;
84  ring          uring;
85  poly          p;
86  number        n;
87  ideal         uideal;
88  map           umap;
89  matrix        umatrix;
90  char *        ustring;
91  intvec *      iv;
92  lists         l;
93  si_link       li;
94  package       pack;
95  procinfo *    pinf;
96};
97
98class idrec
99{
100  public:
101  /* !! do not change the first 6 entries !! (see subexpr.h: sleftv) */
102  idhdl      next;
103  char *     id;
104  utypes     data;
105  BITSET     flag;
106  attr       attribute;
107  idtyp      typ;
108
109  short      lev;
110
111#define IDNEXT(a)    ((a)->next)
112#define IDTYP(a)     ((a)->typ)
113#define IDFLAG(a)    ((a)->flag)
114#define IDLEV(a)     ((a)->lev)
115#define IDID(a)      ((a)->id)
116#define IDATTR(a)    ((a)->attribute)
117
118#define IDINT(a)    ((a)->data.i)
119#define IDDATA(a)   ((a)->data.ustring)
120#define IDRING(a)   ((a)->data.uring)
121#define IDINTVEC(a) ((a)->data.iv)
122#define IDPOLY(a)   ((a)->data.p)
123#define IDNUMBER(a) ((a)->data.n)
124#define IDIDEAL(a)  (((a)->data).uideal)
125#define IDMATRIX(a) (((a)->data).umatrix)
126#define IDMAP(a)    (((a)->data).umap)
127#define IDSTRING(a) ((a)->data.ustring)
128#define IDLIST(a)   ((a)->data.l)
129#define IDLINK(a)   ((a)->data.li)
130#define IDPACKAGE(a) ((a)->data.pack)
131#define IDPROC(a)   ((a)->data.pinf)
132
133  idrec() { memset(this,0,sizeof(*this)); }
134  idhdl get(const char * s, int lev);
135  idhdl set(char * s, int lev, idtyp t, BOOLEAN init=TRUE);
136//  ~idrec();
137};
138
139
140extern idhdl      idroot;
141extern idhdl      currRingHdl;
142/*extern ring     currRing;  in structs.h */
143extern ideal      currQuotient;
144
145idhdl enterid(char * a, int lev, idtyp t, idhdl* root, BOOLEAN init=TRUE);
146idhdl ggetid(const char *n);
147void  killid(char * a, idhdl * i);
148void  killhdl(idhdl h);
149void  killhdl(idhdl h, idhdl * ih);
150lists ipNameList(idhdl root);
151void  ipMoveId(idhdl h);
152
153#define FLAG_STD   0
154#define FLAG_DRING 1
155#define FLAG_DOPERATOR 2
156#define hasFlag(A,F) Sy_inset((F),(A)->flag)
157#define setFlag(A,F) (A)->flag|=Sy_bit(F)
158#define resetFlag(A,F) (A)->flag&=~Sy_bit(F)
159void ipListFlag(idhdl h);
160#endif
161
162
Note: See TracBrowser for help on using the repository browser.