source: git/Singular/ipid.h @ 0e1846

spielwiese
Last change on this file since 0e1846 was 0e1846, checked in by Olaf Bachmann <obachman@…>, 27 years ago
This commit was generated by cvs2svn to compensate for changes in r59, which included commits to RCS files with non-trunk default branches. git-svn-id: file:///usr/local/Singular/svn/trunk@60 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 3.5 KB
Line 
1#ifndef IPID_H
2#define IPID_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/*
7* ABSTRACT
8*/
9/* $Log: not supported by cvs2svn $
10*/
11#include <string.h>
12#include "structs.h"
13#include "subexpr.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 RDEBUG
36  short      no;
37#endif
38};
39
40struct sip_sideal
41{
42  poly*  m;
43  long rank;
44  int nrows;
45  int ncols;
46  #define IDELEMS(i) ((i)->ncols)
47  inline int& idelems(void) { return ncols; }
48};
49
50struct sip_smap
51{
52  poly *m;
53  char *preimage;
54  int nrows;
55  int ncols;
56};
57
58struct sip_command
59{
60  sleftv arg1; /*arg1 to build_in, proc to proc_call*/
61  sleftv arg2; /*NULL or arg2 to build_in, args to proc_call*/
62  sleftv arg3; /*NULL or arg3*/
63  short argc; /*0,1,2,3 to build_in, -1 otherwise*/
64  short op;   /* build_in or PROC_CMD*/
65};
66
67struct sip_package
68{
69  idhdl      idroot; /* local objects */
70};
71
72union uutypes;
73
74union uutypes
75{
76  int           i;
77  ring          uring;
78  poly          p;
79  number        n;
80  ideal         uideal;
81  map           umap;
82  matrix        umatrix;
83  char *        ustring;
84  intvec *      iv;
85  lists         l;
86  si_link       li;
87  package       pack;
88};
89
90class idrec
91{
92  public:
93  /* !! do not change the first 6 entries !! (see subexpr.h: sleftv) */
94  idhdl      next;
95  char *     id;
96  utypes     data;
97  BITSET     flag;
98  attr       attribute;
99  idtyp      typ;
100
101  short      lev;
102
103#define IDNEXT(a)    ((a)->next)
104#define IDTYP(a)     ((a)->typ)
105#define IDFLAG(a)    ((a)->flag)
106#define IDLEV(a)     ((a)->lev)
107#define IDID(a)      ((a)->id)
108#define IDATTR(a)    ((a)->attribute)
109
110#define IDINT(a)    ((a)->data.i)
111#define IDDATA(a)   ((a)->data.ustring)
112#define IDRING(a)   ((a)->data.uring)
113#define IDINTVEC(a) ((a)->data.iv)
114#define IDPOLY(a)   ((a)->data.p)
115#define IDNUMBER(a) ((a)->data.n)
116#define IDIDEAL(a)  (((a)->data).uideal)
117#define IDMATRIX(a) (((a)->data).umatrix)
118#define IDMAP(a)    (((a)->data).umap)
119#define IDSTRING(a) ((a)->data.ustring)
120#define IDLIST(a)   ((a)->data.l)
121#define IDLINK(a)   ((a)->data.li)
122#define IDPACKAGE(a) ((a)->data.pack)
123
124  idrec() { memset(this,0,sizeof(*this)); }
125  idhdl get(const char * s, int lev);
126  idhdl set(char * s, int lev, idtyp t, BOOLEAN init=TRUE);
127//  ~idrec();
128};
129
130
131extern idhdl      idroot;
132extern idhdl      currRingHdl;
133/*extern ring     currRing;  in structs.h */
134extern ideal      currQuotient;
135
136idhdl enterid(char * a, int lev, idtyp t, idhdl* root, BOOLEAN init=TRUE);
137idhdl ggetid(const char *n);
138void  killid(char * a, idhdl * i);
139void  killhdl(idhdl h);
140void  killhdl(idhdl h, idhdl * ih);
141lists ipNameList(idhdl root);
142void  ipMoveId(idhdl h);
143
144#define FLAG_STD   0
145#define FLAG_DRING 1
146#define FLAG_DOPERATOR 2
147#define hasFlag(A,F) Sy_inset((F),(A)->flag)
148#define setFlag(A,F) (A)->flag|=Sy_bit(F)
149#define resetFlag(A,F) (A)->flag&=~Sy_bit(F)
150void ipListFlag(idhdl h);
151#endif
Note: See TracBrowser for help on using the repository browser.