My Project
Loading...
Searching...
No Matches
ipid.h
Go to the documentation of this file.
1#ifndef IPID_H
2#define IPID_H
3/****************************************
4* Computer Algebra System SINGULAR *
5****************************************/
6
7/*
8* ABSTRACT: identfier handling
9*/
10#include "misc/options.h"
11#include "Singular/idrec.h"
12#include "Singular/subexpr.h"
13#include "Singular/lists.h"
14
17EXTERN_VAR package currPack;
18EXTERN_VAR package basePack;
19#define IDROOT (currPack->idroot)
20
21struct sip_command;
22typedef struct sip_command ip_command;
23typedef ip_command * command;
24
26{
27 sleftv arg1; /*arg1 to build_in, proc to proc_call*/
28 sleftv arg2; /*NULL or arg2 to build_in, args to proc_call*/
29 sleftv arg3; /*NULL or arg3*/
30 short argc; /*0,1,2,3 to build_in, -1 otherwise*/
31 short op; /* build_in or PROC_CMD*/
32};
33
35{
36 idhdl idroot; /* local objects */
37 char *libname;
38 short ref;
41 void *handle;
42};
43
44inline package paCopy(package pack)
45{
46 pack->ref++;
47 return pack;
48}
49
50inline void paKill(package pack)
51{
52 pack->ref--;
53}
54
56{
57 public:
60 package cPack;
61 char * name;
62 proclevel() { memset(this,0,sizeof(*this)); }
63 void push(char *);
64 void pop();
65};
67
68typedef struct
69{
70 int (*iiAddCproc)(const char *libname, const char *procname, BOOLEAN pstatic,
71 BOOLEAN(*func)(leftv res, leftv v));
72 int (*iiArithAddCmd)(const char *szName, short nAlias, short nTokval,
73 short nToktype, short nPos);
74
76
77
79/* ================================================================== */
80/* module support */
82BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init);
83void module_help_main(const char *newlib,const char *help);
84void module_help_proc(const char *newlib,const char *p, const char *help);
85
86/* ================================================================== */
87
88/*extern ring currRing; in ring.h */
89
90idhdl enterid(const char * a, int lev, int t, idhdl* root, BOOLEAN init=TRUE, BOOLEAN search=TRUE);
91idhdl ggetid(const char *n);
92//idhdl ggetid(const char *n, idhdl *packhdl);
93void killid(const char * a, idhdl * i);
94void killhdl(idhdl h, package prooti=currPack);
95void killhdl2(idhdl h, idhdl * ih, ring r);
97lists ipNameListLev(idhdl root, int lev);
98void ipMoveId(idhdl h);
101poly jj_NormalizeQRingP(poly p, const ring r);
103#define jjNormalizeQRingP(p) jj_NormalizeQRingP(p,currRing)
104void *idrecDataInit(int t);
105
106#define FLAG_STD 0 // is a SB wrt. currRing ("isSB")
107#define FLAG_TWOSTD 3 // is a 2-sided SB wrt. currRing (" 2SB")
108#define FLAG_QRING 4 // is normalized wrt. qring ("qringNF")
109#define FLAG_QRING_DEF 5 // is a qring to be defined
110#define FLAG_OTHER_RING 6 // mark newstruct parts as "write-only"
111#define FLAG_RING 7 // mark newstruct parts as "ring dep."
112#define hasFlag(A,F) Sy_inset((F),(A)->flag)
113#define setFlag(A,F) (A)->flag|=Sy_bit(F)
114#define resetFlag(A,F) (A)->flag&=~Sy_bit(F)
115void ipListFlag(idhdl h);
116
117
118#define IDNEXT(a) ((a)->next)
119#define IDTYP(a) ((a)->typ)
120#define IDFLAG(a) ((a)->flag)
121#define IDLEV(a) ((a)->lev)
122#define IDID(a) ((a)->id)
123#define IDATTR(a) ((a)->attribute)
124
125#define IDINT(a) ((int)(long)((a)->data.ustring))
126#define IDDATA(a) ((a)->data.ustring)
127#define IDRING(a) ((a)->data.uring)
128#define IDINTVEC(a) ((a)->data.iv)
129#define IDBIMAT(a) ((a)->data.bim)
130#define IDPOLY(a) ((a)->data.p)
131#define IDBIGINT(a) ((a)->data.n)
132#define IDNUMBER(a) ((a)->data.n)
133#define IDIDEAL(a) ((a)->data.uideal)
134#define IDMATRIX(a) ((a)->data.umatrix)
135#define IDMAP(a) ((a)->data.umap)
136#define IDSTRING(a) ((a)->data.ustring)
137#define IDLIST(a) ((a)->data.l)
138#define IDLINK(a) ((a)->data.li)
139#define IDPACKAGE(a) ((a)->data.pack)
140#define IDPROC(a) ((a)->data.pinf)
141
146
148
149/* options */
151{
152 const char * name;
153 unsigned setval;
154 unsigned resetval;
155};
156
157extern const struct soptionStruct optionStruct[];
158extern const struct soptionStruct verboseStruct[];
159
160#endif
161
162
int BOOLEAN
Definition: auxiliary.h:87
#define TRUE
Definition: auxiliary.h:100
int i
Definition: cfEzgcd.cc:132
int p
Definition: cfModGcd.cc:4078
Definition: idrec.h:35
Definition: ipid.h:56
char * name
Definition: ipid.h:61
proclevel * next
Definition: ipid.h:58
idhdl cPackHdl
Definition: ipid.h:59
proclevel()
Definition: ipid.h:62
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Definition: lists.h:24
CanonicalForm res
Definition: facAbsFact.cc:60
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:39
int search(const CFArray &A, const CanonicalForm &F, int i, int j)
search for F in A between index i and j
#define EXTERN_VAR
Definition: globaldefs.h:6
int iiArithAddCmd(const char *szName, short nAlias, short nTokval, short nToktype, short nPos=-1)
Definition: iparith.cc:9868
void jjNormalizeQRingId(leftv I)
Definition: ipassign.cc:2318
poly jj_NormalizeQRingP(poly p, const ring r)
Definition: ipassign.cc:2353
VAR omBin sip_command_bin
Definition: ipid.cc:45
lists ipNameListLev(idhdl root, int lev)
Definition: ipid.cc:650
VAR omBin sip_package_bin
Definition: ipid.cc:46
void killid(const char *id, idhdl *ih)
Definition: ipid.cc:387
idhdl ggetid(const char *n)
Definition: ipid.cc:581
void killhdl2(idhdl h, idhdl *ih, ring r)
Definition: ipid.cc:445
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition: ipid.cc:279
VAR omBin idrec_bin
Definition: ipid.cc:48
void ipListFlag(idhdl h)
Definition: ipid.cc:619
VAR proclevel * procstack
Definition: ipid.cc:52
VAR idhdl currRingHdl
Definition: ipid.cc:59
VAR package currPack
Definition: ipid.cc:57
void killhdl(idhdl h, package proot)
Definition: ipid.cc:414
void * idrecDataInit(int t)
Definition: ipid.cc:140
idhdl packFindHdl(package r)
Definition: ipid.cc:831
lists ipNameList(idhdl root)
Definition: ipid.cc:627
void ipMoveId(idhdl tomove)
Definition: ipid.cc:704
VAR coeffs coeffs_BIGINT
Definition: ipid.cc:50
idhdl idroot
Definition: ipid.h:36
sleftv arg1
Definition: ipid.h:27
void * handle
Definition: ipid.h:41
EXTERN_VAR omBin sleftv_bin
Definition: ipid.h:145
sleftv arg2
Definition: ipid.h:28
ip_command * command
Definition: ipid.h:23
language_defs language
Definition: ipid.h:39
const struct soptionStruct verboseStruct[]
Definition: misc_ip.cc:538
char * libname
Definition: ipid.h:37
short ref
Definition: ipid.h:38
EXTERN_VAR idhdl currPackHdl
Definition: ipid.h:15
BOOLEAN loaded
Definition: ipid.h:40
BOOLEAN checkPackage(package pack)
short op
Definition: ipid.h:31
BOOLEAN load_builtin(const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
Definition: iplib.cc:1294
unsigned resetval
Definition: ipid.h:154
void module_help_main(const char *newlib, const char *help)
Definition: iplib.cc:1347
unsigned setval
Definition: ipid.h:153
EXTERN_VAR idhdl basePackHdl
Definition: ipid.h:16
int(* SModulFunc_t)(SModulFunctions *)
Definition: ipid.h:81
void paKill(package pack)
Definition: ipid.h:50
void module_help_proc(const char *newlib, const char *p, const char *help)
Definition: iplib.cc:1362
const struct soptionStruct optionStruct[]
Definition: misc_ip.cc:507
sleftv arg3
Definition: ipid.h:29
short argc
Definition: ipid.h:30
const char * name
Definition: ipid.h:152
int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition: iplib.cc:1063
STATIC_VAR Poly * h
Definition: janet.cc:971
#define help
Definition: libparse.cc:1230
The main handler for Singular numbers which are suitable for Singular polynomials.
omBin_t * omBin
Definition: omStructs.h:12
ip_package * package
Definition: structs.h:43
language_defs
Definition: subexpr.h:22