source: git/Singular/ipid.h @ 47faf56

spielwiese
Last change on this file since 47faf56 was 47faf56, checked in by Olaf Bachmann <obachman@…>, 26 years ago
* ring handling: from pChangeRing to rChangeCurrRing was prepared * various fixes towards working COMP_FAST * fixed gcd content problem of factory git-svn-id: file:///usr/local/Singular/svn/trunk@1010 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.7 KB
Line 
1#ifndef IPID_H
2#define IPID_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id: ipid.h,v 1.7 1998-01-12 18:59:49 obachman 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 varibale names */
25  /* extension to the ring structure: */
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#ifdef COMP_FAST
40  short     VarOffset; /* controls indexing of exponents */
41  short     CompIndex; /* index of component in exponent vector */
42#endif   
43
44#ifdef RDEBUG
45  short      no;
46#endif
47};
48
49struct sip_sideal
50{
51  poly*  m;
52  long rank;
53  int nrows;
54  int ncols;
55  #define IDELEMS(i) ((i)->ncols)
56  inline int& idelems(void) { return ncols; }
57};
58
59struct sip_smap
60{
61  poly *m;
62  char *preimage;
63  int nrows;
64  int ncols;
65};
66
67struct sip_command
68{
69  sleftv arg1; /*arg1 to build_in, proc to proc_call*/
70  sleftv arg2; /*NULL or arg2 to build_in, args to proc_call*/
71  sleftv arg3; /*NULL or arg3*/
72  short argc; /*0,1,2,3 to build_in, -1 otherwise*/
73  short op;   /* build_in or PROC_CMD*/
74};
75
76struct sip_package
77{
78  idhdl      idroot; /* local objects */
79};
80
81union uutypes;
82
83union uutypes
84{
85  int           i;
86  ring          uring;
87  poly          p;
88  number        n;
89  ideal         uideal;
90  map           umap;
91  matrix        umatrix;
92  char *        ustring;
93  intvec *      iv;
94  lists         l;
95  si_link       li;
96  package       pack;
97};
98
99class idrec
100{
101  public:
102  /* !! do not change the first 6 entries !! (see subexpr.h: sleftv) */
103  idhdl      next;
104  char *     id;
105  utypes     data;
106  BITSET     flag;
107  attr       attribute;
108  idtyp      typ;
109
110  short      lev;
111
112#define IDNEXT(a)    ((a)->next)
113#define IDTYP(a)     ((a)->typ)
114#define IDFLAG(a)    ((a)->flag)
115#define IDLEV(a)     ((a)->lev)
116#define IDID(a)      ((a)->id)
117#define IDATTR(a)    ((a)->attribute)
118
119#define IDINT(a)    ((a)->data.i)
120#define IDDATA(a)   ((a)->data.ustring)
121#define IDRING(a)   ((a)->data.uring)
122#define IDINTVEC(a) ((a)->data.iv)
123#define IDPOLY(a)   ((a)->data.p)
124#define IDNUMBER(a) ((a)->data.n)
125#define IDIDEAL(a)  (((a)->data).uideal)
126#define IDMATRIX(a) (((a)->data).umatrix)
127#define IDMAP(a)    (((a)->data).umap)
128#define IDSTRING(a) ((a)->data.ustring)
129#define IDLIST(a)   ((a)->data.l)
130#define IDLINK(a)   ((a)->data.li)
131#define IDPACKAGE(a) ((a)->data.pack)
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.