source: git/Singular/subexpr.h @ 0fb34ba

spielwiese
Last change on this file since 0fb34ba was 0fb34ba, checked in by Hans Schoenemann <hannes@…>, 13 years ago
start with dir Singular: fix includes and makefile
  • Property mode set to 100644
File size: 3.4 KB
RevLine 
[0e1846]1#ifndef SUBEXPR_H
2#define SUBEXPR_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
[341696]6/* $Id$ */
[0e1846]7/*
[6ae4f5]8* ABSTRACT: handling of leftv
[0e1846]9*/
[f6b5f0]10
[0e1846]11#include <string.h>
[599326]12#include <Singular/grammar.h>
13#include <Singular/tok.h>
14#include <kernel/structs.h>
15#include <kernel/febase.h>
[0fb34ba]16#include <polys/monomials/ring.h>
[0e1846]17
18struct _ssubexpr
19{
20  struct _ssubexpr * next;
21  int start;
22};
23
[0e051f]24typedef struct _ssubexpr *Subexpr;
[0e1846]25
26extern const char sNoName[];
27extern BOOLEAN siq;
[85e68dd]28extern const char *iiSleftv2name(leftv v);
[0e1846]29
30class sleftv;
31typedef sleftv * leftv;
32class sleftv
33{
34  public:
35  /* !! do not change the first 6 entries !! (see ipid.h: idrec) */
36    leftv       next;
[85e68dd]37    const char *name;
[0e1846]38    void *      data;
39    attr        attribute;
[472f39]40    BITSET      flag;
[0e1846]41    int         rtyp;
42                 /* the type of the expression, describes the data field
43                  * (E) markes the type field in iparith
44                  * (S) markes the rtyp in sleftv
45                  * ANY_TYPE:   data is int: real type or 0    (E)
46                  * DEF_CMD:    all types, no change in sleftv (E)
47                  * IDHDL: existing variable         (E)
48                  * IDHDL: variable, data is idhdl   (S)
49                  * COMMAND: data is command         (S)
50                  * INT_CMD:      int constant, data is int  (E,S)
51                  * INTVEC_CMD:   intvec constant, data is intvec * (E,S)
52                  * POLY_CMD:     poly constant, data is poly (E,S)
53                  * ....
54                  */
55    Subexpr e;    /* holds the indices for indexed values */
[bd4cb92]56    package     req_packhdl;
[0e1846]57    inline void Init() { memset(this,0,sizeof(*this)); }
58    void Print(leftv store=NULL,int spaces=0);
[16acb0]59    void CleanUp(ring r=currRing);
[a79a128]60    char * String(void *d=NULL, BOOLEAN typed = FALSE, int dim = 1);
[0e1846]61    void Copy(leftv e);
[f879c9]62    attr CopyA();
[0e1846]63    void * CopyD(int t);
[2166ad3]64    void * CopyD() { return CopyD(Typ()); }
[0e1846]65    inline const char * Name()
66    {
67      if ((name!=NULL) && (e==NULL)) return name;
68      else return sNoName;
69    }
[c12cf96]70    inline const char * Fullname()
71    {
72      if ((name!=NULL) && (e==NULL)) return(iiSleftv2name(this));
73      else return sNoName;
74    }
[0e1846]75    int  Typ();
76    int  LTyp(); /* returns LIST_CMD for l[i], otherwise returns Typ() */
77    void * Data();
78    leftv LData(); /* returns &(l[i]) for l[i], otherwise returns this */
79    leftv LHdl();
80    attr * Attribute();
81    inline leftv Next() { return next; }
82    int listLength();
83    int Eval(); /*replace a COMMAND by its result otherwise by CopyD*/
[4cbe5d]84    BOOLEAN RingDependend();
[0e1846]85};
86
[df5fc1]87inline BOOLEAN RingDependend(int t) { return (BEGIN_RING<t)&&(t<END_RING); }
[0e1846]88extern sleftv sLastPrinted;
89
[85e68dd]90void syMake(leftv v,const char * name, idhdl packhdl = NULL);
[0e1846]91BOOLEAN assumeStdFlag(leftv h);
92
[2ba9a6]93inline procinfov piCopy(procinfov pi)
94{
95  pi->ref++;
96  return pi;
97}
[b2a49b]98BOOLEAN piKill(procinfov l);
[85e68dd]99const char *piProcinfo(procinfov pi, const char *request);
[2ba9a6]100void piShowProcinfo(procinfov pi, char *txt);
[6a51ef]101#ifdef HAVE_LIBPARSER
[a48753]102class libstack;
103typedef libstack *  libstackv;
104
[6a51ef]105class libstack
106{
107 public:
108  libstackv next;
109  char      *libname;
110  BOOLEAN   to_be_done;
111  int       cnt;
112  void      push(char *p, char * libname);
113  libstackv pop(char *p);
114  inline char *get() { return(libname); }
115};
116#endif /* HAVE_LIBPARSER */
[cd6b45]117
[020ef9]118extern omBin sSubexpr_bin;
119extern omBin procinfo_bin;
120extern omBin libstack_bin;
[c232af]121
[c4dab4]122void s_internalDelete(const int t,  void *d, const ring r);
123
[0e1846]124#endif
Note: See TracBrowser for help on using the repository browser.