source: git/Singular/ipid.h @ e78cce

spielwiese
Last change on this file since e78cce was e78cce, checked in by Olaf Bachmann <obachman@…>, 26 years ago
Mon Dec 15 23:31:56 1997 Olaf Bachmann <obachman@mathematik.uni-kl.de> * polys-impl.h: Various small bug - fixes and changes in preparation of COMP_FAST merge: hilbert series, maps are ok; sres and syz are still buggy; small things still need to be checked; git-svn-id: file:///usr/local/Singular/svn/trunk@978 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.5 1997-12-15 22:46:28 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  short      P;      /* number of pars */
33  short      OrdSgn; /* 1 for polynomial rings, -1 otherwise */
34  short      ref;
35#ifdef COMP_FAST
36  short     VarOffset; /* controls indexing of exponents */
37  short     CompIndex; /* index of component in exponent vector */
38#endif   
39#ifdef RDEBUG
40  short      no;
41#endif
42};
43
44struct sip_sideal
45{
46  poly*  m;
47  long rank;
48  int nrows;
49  int ncols;
50  #define IDELEMS(i) ((i)->ncols)
51  inline int& idelems(void) { return ncols; }
52};
53
54struct sip_smap
55{
56  poly *m;
57  char *preimage;
58  int nrows;
59  int ncols;
60};
61
62struct sip_command
63{
64  sleftv arg1; /*arg1 to build_in, proc to proc_call*/
65  sleftv arg2; /*NULL or arg2 to build_in, args to proc_call*/
66  sleftv arg3; /*NULL or arg3*/
67  short argc; /*0,1,2,3 to build_in, -1 otherwise*/
68  short op;   /* build_in or PROC_CMD*/
69};
70
71struct sip_package
72{
73  idhdl      idroot; /* local objects */
74};
75
76union uutypes;
77
78union uutypes
79{
80  int           i;
81  ring          uring;
82  poly          p;
83  number        n;
84  ideal         uideal;
85  map           umap;
86  matrix        umatrix;
87  char *        ustring;
88  intvec *      iv;
89  lists         l;
90  si_link       li;
91  package       pack;
92};
93
94class idrec
95{
96  public:
97  /* !! do not change the first 6 entries !! (see subexpr.h: sleftv) */
98  idhdl      next;
99  char *     id;
100  utypes     data;
101  BITSET     flag;
102  attr       attribute;
103  idtyp      typ;
104
105  short      lev;
106
107#define IDNEXT(a)    ((a)->next)
108#define IDTYP(a)     ((a)->typ)
109#define IDFLAG(a)    ((a)->flag)
110#define IDLEV(a)     ((a)->lev)
111#define IDID(a)      ((a)->id)
112#define IDATTR(a)    ((a)->attribute)
113
114#define IDINT(a)    ((a)->data.i)
115#define IDDATA(a)   ((a)->data.ustring)
116#define IDRING(a)   ((a)->data.uring)
117#define IDINTVEC(a) ((a)->data.iv)
118#define IDPOLY(a)   ((a)->data.p)
119#define IDNUMBER(a) ((a)->data.n)
120#define IDIDEAL(a)  (((a)->data).uideal)
121#define IDMATRIX(a) (((a)->data).umatrix)
122#define IDMAP(a)    (((a)->data).umap)
123#define IDSTRING(a) ((a)->data.ustring)
124#define IDLIST(a)   ((a)->data.l)
125#define IDLINK(a)   ((a)->data.li)
126#define IDPACKAGE(a) ((a)->data.pack)
127
128  idrec() { memset(this,0,sizeof(*this)); }
129  idhdl get(const char * s, int lev);
130  idhdl set(char * s, int lev, idtyp t, BOOLEAN init=TRUE);
131//  ~idrec();
132};
133
134
135extern idhdl      idroot;
136extern idhdl      currRingHdl;
137/*extern ring     currRing;  in structs.h */
138extern ideal      currQuotient;
139
140idhdl enterid(char * a, int lev, idtyp t, idhdl* root, BOOLEAN init=TRUE);
141idhdl ggetid(const char *n);
142void  killid(char * a, idhdl * i);
143void  killhdl(idhdl h);
144void  killhdl(idhdl h, idhdl * ih);
145lists ipNameList(idhdl root);
146void  ipMoveId(idhdl h);
147
148#define FLAG_STD   0
149#define FLAG_DRING 1
150#define FLAG_DOPERATOR 2
151#define hasFlag(A,F) Sy_inset((F),(A)->flag)
152#define setFlag(A,F) (A)->flag|=Sy_bit(F)
153#define resetFlag(A,F) (A)->flag&=~Sy_bit(F)
154void ipListFlag(idhdl h);
155#endif
Note: See TracBrowser for help on using the repository browser.