My Project
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions | Variables
ipid.h File Reference
#include "misc/options.h"
#include "Singular/idrec.h"
#include "Singular/subexpr.h"
#include "Singular/lists.h"

Go to the source code of this file.

Data Structures

struct  ip_command
 
struct  ip_package
 
class  proclevel
 
struct  SModulFunctions
 
struct  soptionStruct
 

Macros

#define IDROOT   (currPack->idroot)
 
#define jjNormalizeQRingP(p)   jj_NormalizeQRingP(p,currRing)
 
#define FLAG_STD   0
 
#define FLAG_TWOSTD   3
 
#define FLAG_QRING   4
 
#define FLAG_QRING_DEF   5
 
#define FLAG_OTHER_RING   6
 
#define FLAG_RING   7
 
#define hasFlag(A, F)   Sy_inset((F),(A)->flag)
 
#define setFlag(A, F)   (A)->flag|=Sy_bit(F)
 
#define resetFlag(A, F)   (A)->flag&=~Sy_bit(F)
 
#define IDNEXT(a)   ((a)->next)
 
#define IDTYP(a)   ((a)->typ)
 
#define IDFLAG(a)   ((a)->flag)
 
#define IDLEV(a)   ((a)->lev)
 
#define IDID(a)   ((a)->id)
 
#define IDATTR(a)   ((a)->attribute)
 
#define IDINT(a)   ((int)(long)((a)->data.ustring))
 
#define IDDATA(a)   ((a)->data.ustring)
 
#define IDRING(a)   ((a)->data.uring)
 
#define IDINTVEC(a)   ((a)->data.iv)
 
#define IDBIMAT(a)   ((a)->data.bim)
 
#define IDPOLY(a)   ((a)->data.p)
 
#define IDBIGINT(a)   ((a)->data.n)
 
#define IDNUMBER(a)   ((a)->data.n)
 
#define IDIDEAL(a)   ((a)->data.uideal)
 
#define IDMATRIX(a)   ((a)->data.umatrix)
 
#define IDMAP(a)   ((a)->data.umap)
 
#define IDSTRING(a)   ((a)->data.ustring)
 
#define IDLIST(a)   ((a)->data.l)
 
#define IDLINK(a)   ((a)->data.li)
 
#define IDPACKAGE(a)   ((a)->data.pack)
 
#define IDPROC(a)   ((a)->data.pinf)
 

Typedefs

typedef ip_commandcommand
 
typedef int(* SModulFunc_t) (SModulFunctions *)
 

Functions

package paCopy (package pack)
 
void paKill (package pack)
 
BOOLEAN load_builtin (const char *newlib, BOOLEAN autoexport, SModulFunc_t init)
 
void module_help_main (const char *newlib, const char *help)
 
void module_help_proc (const char *newlib, const char *p, const char *help)
 
idhdl enterid (const char *a, int lev, int t, idhdl *root, BOOLEAN init=TRUE, BOOLEAN search=TRUE)
 
idhdl ggetid (const char *n)
 
void killid (const char *a, idhdl *i)
 
void killhdl (idhdl h, package prooti=currPack)
 
void killhdl2 (idhdl h, idhdl *ih, ring r)
 
lists ipNameList (idhdl root)
 
lists ipNameListLev (idhdl root, int lev)
 
void ipMoveId (idhdl h)
 
BOOLEAN checkPackage (package pack)
 
idhdl packFindHdl (package r)
 
poly jj_NormalizeQRingP (poly p, const ring r)
 
void jjNormalizeQRingId (leftv I)
 
voididrecDataInit (int t)
 
void ipListFlag (idhdl h)
 

Variables

EXTERN_VAR idhdl currPackHdl
 
EXTERN_VAR idhdl basePackHdl
 
EXTERN_VAR package currPack
 
EXTERN_VAR package basePack
 
EXTERN_VAR proclevelprocstack
 
EXTERN_VAR idhdl currRingHdl
 
EXTERN_VAR omBin sip_command_bin
 
EXTERN_VAR omBin sip_package_bin
 
EXTERN_VAR omBin idrec_bin
 
EXTERN_VAR omBin sleftv_bin
 
EXTERN_VAR coeffs coeffs_BIGINT
 
const struct soptionStruct optionStruct []
 
const struct soptionStruct verboseStruct []
 

Data Structure Documentation

◆ sip_command

struct sip_command

Definition at line 25 of file ipid.h.

Data Fields
sleftv arg1
sleftv arg2
sleftv arg3
short argc
short op

◆ sip_package

struct sip_package

Definition at line 34 of file ipid.h.

Data Fields
void * handle
idhdl idroot
language_defs language
char * libname
BOOLEAN loaded
short ref

◆ soptionStruct

struct soptionStruct

Definition at line 150 of file ipid.h.

Data Fields
const char * name
unsigned resetval
unsigned setval

Macro Definition Documentation

◆ FLAG_OTHER_RING

#define FLAG_OTHER_RING   6

Definition at line 110 of file ipid.h.

◆ FLAG_QRING

#define FLAG_QRING   4

Definition at line 108 of file ipid.h.

◆ FLAG_QRING_DEF

#define FLAG_QRING_DEF   5

Definition at line 109 of file ipid.h.

◆ FLAG_RING

#define FLAG_RING   7

Definition at line 111 of file ipid.h.

◆ FLAG_STD

#define FLAG_STD   0

Definition at line 106 of file ipid.h.

◆ FLAG_TWOSTD

#define FLAG_TWOSTD   3

Definition at line 107 of file ipid.h.

◆ hasFlag

#define hasFlag ( A,
F )   Sy_inset((F),(A)->flag)

Definition at line 112 of file ipid.h.

◆ IDATTR

#define IDATTR ( a)    ((a)->attribute)

Definition at line 123 of file ipid.h.

◆ IDBIGINT

#define IDBIGINT ( a)    ((a)->data.n)

Definition at line 131 of file ipid.h.

◆ IDBIMAT

#define IDBIMAT ( a)    ((a)->data.bim)

Definition at line 129 of file ipid.h.

◆ IDDATA

#define IDDATA ( a)    ((a)->data.ustring)

Definition at line 126 of file ipid.h.

◆ IDFLAG

#define IDFLAG ( a)    ((a)->flag)

Definition at line 120 of file ipid.h.

◆ IDID

#define IDID ( a)    ((a)->id)

Definition at line 122 of file ipid.h.

◆ IDIDEAL

#define IDIDEAL ( a)    ((a)->data.uideal)

Definition at line 133 of file ipid.h.

◆ IDINT

#define IDINT ( a)    ((int)(long)((a)->data.ustring))

Definition at line 125 of file ipid.h.

◆ IDINTVEC

#define IDINTVEC ( a)    ((a)->data.iv)

Definition at line 128 of file ipid.h.

◆ IDLEV

#define IDLEV ( a)    ((a)->lev)

Definition at line 121 of file ipid.h.

◆ IDLINK

#define IDLINK ( a)    ((a)->data.li)

Definition at line 138 of file ipid.h.

◆ IDLIST

#define IDLIST ( a)    ((a)->data.l)

Definition at line 137 of file ipid.h.

◆ IDMAP

#define IDMAP ( a)    ((a)->data.umap)

Definition at line 135 of file ipid.h.

◆ IDMATRIX

#define IDMATRIX ( a)    ((a)->data.umatrix)

Definition at line 134 of file ipid.h.

◆ IDNEXT

#define IDNEXT ( a)    ((a)->next)

Definition at line 118 of file ipid.h.

◆ IDNUMBER

#define IDNUMBER ( a)    ((a)->data.n)

Definition at line 132 of file ipid.h.

◆ IDPACKAGE

#define IDPACKAGE ( a)    ((a)->data.pack)

Definition at line 139 of file ipid.h.

◆ IDPOLY

#define IDPOLY ( a)    ((a)->data.p)

Definition at line 130 of file ipid.h.

◆ IDPROC

#define IDPROC ( a)    ((a)->data.pinf)

Definition at line 140 of file ipid.h.

◆ IDRING

#define IDRING ( a)    ((a)->data.uring)

Definition at line 127 of file ipid.h.

◆ IDROOT

#define IDROOT   (currPack->idroot)

Definition at line 19 of file ipid.h.

◆ IDSTRING

#define IDSTRING ( a)    ((a)->data.ustring)

Definition at line 136 of file ipid.h.

◆ IDTYP

#define IDTYP ( a)    ((a)->typ)

Definition at line 119 of file ipid.h.

◆ jjNormalizeQRingP

#define jjNormalizeQRingP ( p)    jj_NormalizeQRingP(p,currRing)

Definition at line 103 of file ipid.h.

◆ resetFlag

#define resetFlag ( A,
F )   (A)->flag&=~Sy_bit(F)

Definition at line 114 of file ipid.h.

◆ setFlag

#define setFlag ( A,
F )   (A)->flag|=Sy_bit(F)

Definition at line 113 of file ipid.h.

Typedef Documentation

◆ command

Definition at line 23 of file ipid.h.

◆ SModulFunc_t

typedef int(* SModulFunc_t) (SModulFunctions *)

Definition at line 81 of file ipid.h.

Function Documentation

◆ checkPackage()

BOOLEAN checkPackage ( package pack)

◆ enterid()

idhdl enterid ( const char * a,
int lev,
int t,
idhdl * root,
BOOLEAN init = TRUE,
BOOLEAN search = TRUE )

Definition at line 258 of file ipid.cc.

259{
260 if (s==NULL) return NULL;
261 if (root==NULL) return NULL;
262 idhdl h;
263 s=omStrDup(s);
264 // idhdl *save_root=root;
265 if (t==PACKAGE_CMD)
266 {
267 if (root!=&(basePack->idroot))
268 {
269 root=&(basePack->idroot);
270 }
271 }
272 // is it already defined in root ?
273 if ((h=(*root)->get_level(s,lev))!=NULL)
274 {
275 if ((IDTYP(h) == t)||(t==DEF_CMD))
276 {
277 if (IDTYP(h)==PACKAGE_CMD)
278 {
279 if (strcmp(s,"Top")==0)
280 {
281 goto errlabel;
282 }
283 else return h;
284 }
285 else
286 {
287 if (BVERBOSE(V_REDEFINE))
288 {
289 const char *f=VoiceName();
290 if (strcmp(f,"STDIN")==0)
291 Warn("redefining %s (%s)",s,my_yylinebuf);
292 else
293 Warn("redefining %s (%s) %s:%d",s,my_yylinebuf,f, yylineno);
294 }
295 if (s==IDID(h)) IDID(h)=NULL;
296 if((t!=PROC_CMD)||(IDPROC(h)->language!=LANG_C))
297 {
298 killhdl2(h,root,currRing);
299 }
300 }
301 }
302 else
303 goto errlabel;
304 }
305 // is it already defined in currRing->idroot ?
306 else if (search && (currRing!=NULL)&&((*root) != currRing->idroot))
307 {
308 if ((h=currRing->idroot->get_level(s,lev))!=NULL)
309 {
310 if ((IDTYP(h) == t)||(t==DEF_CMD))
311 {
312 if (BVERBOSE(V_REDEFINE))
313 {
314 const char *f=VoiceName();
315 if (strcmp(f,"STDIN")==0)
316 Warn("redefining %s (%s)",s,my_yylinebuf);
317 else
318 Warn("redefining %s (%s) %s:%d",s,my_yylinebuf,f, yylineno);
319 }
320 if (s==IDID(h)) IDID(h)=NULL;
321 // proc is not ring-dep, no need to check for type "proc":
322 killhdl2(h,&currRing->idroot,currRing);
323 }
324 else
325 goto errlabel;
326 }
327 }
328 // is it already defined in idroot ?
329 else if (search && (*root != IDROOT))
330 {
331 if ((h=IDROOT->get_level(s,lev))!=NULL)
332 {
333 if ((IDTYP(h) == t)||(t==DEF_CMD))
334 {
335 if (BVERBOSE(V_REDEFINE))
336 {
337 const char *f=VoiceName();
338 if (strcmp(f,"STDIN")==0)
339 Warn("redefining %s (%s)",s,my_yylinebuf);
340 else
341 Warn("redefining %s (%s) %s:%d",s,my_yylinebuf,f, yylineno);
342 }
343 if (s==IDID(h)) IDID(h)=NULL;
344 if((t!=PROC_CMD)||(IDPROC(h)->language!=LANG_C))
345 {
347 }
348 }
349 else
350 goto errlabel;
351 }
352 }
353 *root = (*root)->set(s, lev, t, init);
354#ifndef SING_NDEBUG
355 checkall();
356#endif
357 return *root;
358
359 errlabel:
360 //Werror("identifier `%s` in use(lev h=%d,typ=%d,t=%d, curr=%d)",s,IDLEV(h),IDTYP(h),t,lev);
361 Werror("identifier `%s` in use",s);
362 //listall();
364 return NULL;
365}
FILE * f
Definition checklibs.c:9
Definition idrec.h:35
idhdl set(const char *s, int lev, int t, BOOLEAN init=TRUE)
Definition ipid.cc:217
#define Warn
Definition emacs.cc:77
const CanonicalForm int s
Definition facAbsFact.cc:51
int search(const CFArray &A, const CanonicalForm &F, int i, int j)
search for F in A between index i and j
VAR int yylineno
Definition febase.cc:40
VAR char my_yylinebuf[80]
Definition febase.cc:44
const char * VoiceName()
Definition fevoices.cc:58
@ PROC_CMD
Definition grammar.cc:281
void killhdl2(idhdl h, idhdl *ih, ring r)
Definition ipid.cc:424
VAR package basePack
Definition ipid.cc:58
#define IDPROC(a)
Definition ipid.h:140
#define IDID(a)
Definition ipid.h:122
#define IDROOT
Definition ipid.h:19
#define IDTYP(a)
Definition ipid.h:119
STATIC_VAR Poly * h
Definition janet.cc:971
#define omStrDup(s)
#define omFreeBinAddr(addr)
#define NULL
Definition omList.c:12
#define BVERBOSE(a)
Definition options.h:35
#define V_REDEFINE
Definition options.h:45
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
void Werror(const char *fmt,...)
Definition reporter.cc:189
@ LANG_C
Definition subexpr.h:22
@ PACKAGE_CMD
Definition tok.h:150
@ DEF_CMD
Definition tok.h:58

◆ ggetid()

idhdl ggetid ( const char * n)

Definition at line 560 of file ipid.cc.

561{
562 if (currRing!=NULL)
563 {
564 idhdl h2 = currRing->idroot->get(n,myynest);
565 if ((h2!=NULL)&&(IDLEV(h2)==myynest)) return h2;
566 idhdl h = IDROOT->get(n,myynest);
567 if (h!=NULL) return h;
568 if (h2!=NULL) return h2;
569 }
570 else
571 {
572 idhdl h = IDROOT->get(n,myynest);
573 if (h!=NULL) return h;
574 }
575 if (basePack!=currPack)
576 return basePack->idroot->get(n,myynest);
577 return NULL;
578}
VAR int myynest
Definition febase.cc:41
VAR package currPack
Definition ipid.cc:57
#define IDLEV(a)
Definition ipid.h:121

◆ idrecDataInit()

void * idrecDataInit ( int t)

Definition at line 118 of file ipid.cc.

119{
120 switch (t)
121 {
122 //the type with init routines:
123#ifdef SINGULAR_4_2
124 case CNUMBER_CMD:
125 return (void*)n2Init(0,NULL);
126 case CPOLY_CMD:
127 return (void*)p2Init(0,NULL);
128 case CMATRIX_CMD:
129#endif
130 case BIGINTMAT_CMD:
131 return (void *)new bigintmat();
132 case BIGINTVEC_CMD:
133 return (void *)new bigintmat(1,0,coeffs_BIGINT);
134 case BUCKET_CMD:
135 if (currRing!=NULL)
136 return (void*)sBucketCreate(currRing);
137 else
138 {
139 WerrorS("need basering for polyBucket");
140 return NULL;
141 }
142 case INTVEC_CMD:
143 case INTMAT_CMD:
144 return (void *)new intvec();
145 case NUMBER_CMD:
146 {
147 if (currRing!=NULL) return (void *) nInit(0);
148 else return NULL;
149 }
150 case BIGINT_CMD:
151 return (void *) n_Init(0, coeffs_BIGINT);
152 case IDEAL_CMD:
153 case MODUL_CMD:
154 case MATRIX_CMD:
155 case SMATRIX_CMD:
156 return (void*) idInit(1,1);
157 case MAP_CMD:
158 {
159 map m = (map)idInit(1,1);
160 m->preimage = omStrDup(IDID(currRingHdl));
161 return (void *)m;
162 }
163 case STRING_CMD:
164 return (void *)omAlloc0(1);
165 case LIST_CMD:
166 {
168 l->Init();
169 return (void*)l;
170 }
171 //the types with the standard init: set the struct to zero
172 case LINK_CMD:
173 return (void*) omAlloc0Bin(sip_link_bin);
174 case PACKAGE_CMD:
175 {
176 package pa=(package)omAlloc0Bin(sip_package_bin);
177 pa->language=LANG_NONE;
178 pa->loaded = FALSE;
179 return (void*)pa;
180 }
181 case PROC_CMD:
182 {
184 pi->ref=1;
185 pi->language=LANG_NONE;
186 return (void*)pi;
187 }
188 case RESOLUTION_CMD:
189 return (void *)omAlloc0(sizeof(ssyStrategy));
190 //other types: without alloc. (int,script,poly,def,package,..)
191 case INT_CMD:
192 case DEF_CMD:
193 case POLY_CMD:
194 case VECTOR_CMD:
195 case RING_CMD:
196 case CRING_CMD:
197 case QRING_CMD:
198 return NULL;
199 default:
200 {
201 if (t>MAX_TOK)
202 {
203#ifdef BLACKBOX_DEVEL
204 Print("bb-type %d\n",t);
205#endif
207 if (bb!=NULL)
208 return (void *)bb->blackbox_Init(bb);
209 }
210 else
211 Werror("unknown type in idrecDataInit:%d",t);
212 break;
213 }
214 }
215 return (void *)0L;
216}
#define FALSE
Definition auxiliary.h:96
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition blackbox.cc:17
int l
Definition cfEzgcd.cc:100
int m
Definition cfEzgcd.cc:128
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
Matrices of numbers.
Definition bigintmat.h:51
Definition lists.h:24
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition coeffs.h:539
static BOOLEAN pa(leftv res, leftv args)
Definition cohomo.cc:3770
#define Print
Definition emacs.cc:80
void WerrorS(const char *s)
Definition feFopen.cc:24
@ IDEAL_CMD
Definition grammar.cc:285
@ MATRIX_CMD
Definition grammar.cc:287
@ BUCKET_CMD
Definition grammar.cc:284
@ BIGINTMAT_CMD
Definition grammar.cc:278
@ MAP_CMD
Definition grammar.cc:286
@ INTMAT_CMD
Definition grammar.cc:280
@ MODUL_CMD
Definition grammar.cc:288
@ SMATRIX_CMD
Definition grammar.cc:292
@ VECTOR_CMD
Definition grammar.cc:293
@ RESOLUTION_CMD
Definition grammar.cc:291
@ BIGINTVEC_CMD
Definition grammar.cc:279
@ NUMBER_CMD
Definition grammar.cc:289
@ POLY_CMD
Definition grammar.cc:290
@ RING_CMD
Definition grammar.cc:282
VAR idhdl currRingHdl
Definition ipid.cc:59
VAR coeffs coeffs_BIGINT
Definition ipid.cc:50
#define pi
Definition libparse.cc:1145
VAR omBin slists_bin
Definition lists.cc:23
slists * lists
#define nInit(i)
Definition numbers.h:24
#define omAllocBin(bin)
#define omAlloc0Bin(bin)
#define omAlloc0(size)
sBucket_pt sBucketCreate(const ring r)
Definition sbuckets.cc:96
ideal idInit(int idsize, int rank)
initialise an ideal / module
procinfo * procinfov
Definition structs.h:60
VAR omBin procinfo_bin
Definition subexpr.cc:42
@ LANG_NONE
Definition subexpr.h:22
@ BIGINT_CMD
Definition tok.h:38
@ CRING_CMD
Definition tok.h:56
@ LIST_CMD
Definition tok.h:118
@ INTVEC_CMD
Definition tok.h:101
@ CMATRIX_CMD
Definition tok.h:46
@ CNUMBER_CMD
Definition tok.h:47
@ LINK_CMD
Definition tok.h:117
@ QRING_CMD
Definition tok.h:160
@ STRING_CMD
Definition tok.h:187
@ CPOLY_CMD
Definition tok.h:48
@ INT_CMD
Definition tok.h:96
@ MAX_TOK
Definition tok.h:220

◆ ipListFlag()

void ipListFlag ( idhdl h)

Definition at line 598 of file ipid.cc.

599{
600 if (hasFlag(h,FLAG_STD)) PrintS(" (SB)");
601#ifdef HAVE_PLURAL
602 if (hasFlag(h,FLAG_TWOSTD)) PrintS(" (2SB)");
603#endif
604}
#define hasFlag(A, F)
Definition ipid.h:112
#define FLAG_TWOSTD
Definition ipid.h:107
#define FLAG_STD
Definition ipid.h:106
void PrintS(const char *s)
Definition reporter.cc:284

◆ ipMoveId()

void ipMoveId ( idhdl h)

Definition at line 683 of file ipid.cc.

684{
685 if ((currRing!=NULL)&&(tomove!=NULL))
686 {
689 {
690 /*move 'tomove' to ring id's*/
691 if (ipSwapId(tomove,IDROOT,currRing->idroot))
692 ipSwapId(tomove,basePack->idroot,currRing->idroot);
693 }
694 else
695 {
696 /*move 'tomove' to global id's*/
698 }
699 }
700}
static int RingDependend(int t)
Definition gentable.cc:23
static int ipSwapId(idhdl tomove, idhdl &root1, idhdl &root2)
Definition ipid.cc:658
#define IDLIST(a)
Definition ipid.h:137
BOOLEAN lRingDependend(lists L)
Definition lists.cc:222

◆ ipNameList()

lists ipNameList ( idhdl root)

Definition at line 606 of file ipid.cc.

607{
608 idhdl h=root;
609 /* compute the length */
610 int l=0;
611 while (h!=NULL) { l++; h=IDNEXT(h); }
612 /* allocate list */
614 L->Init(l);
615 /* copy names */
616 h=root;
617 l=0;
618 while (h!=NULL)
619 {
620 /* list is initialized with 0 => no need to clear anything */
621 L->m[l].rtyp=STRING_CMD;
622 L->m[l].data=omStrDup(IDID(h));
623 l++;
624 h=IDNEXT(h);
625 }
626 return L;
627}
int rtyp
Definition subexpr.h:91
void * data
Definition subexpr.h:88
sleftv * m
Definition lists.h:46
INLINE_THIS void Init(int l=0)
#define IDNEXT(a)
Definition ipid.h:118

◆ ipNameListLev()

lists ipNameListLev ( idhdl root,
int lev )

Definition at line 629 of file ipid.cc.

630{
631 idhdl h=root;
632 /* compute the length */
633 int l=0;
634 while (h!=NULL) { if (IDLEV(h)==lev) l++; h=IDNEXT(h); }
635 /* allocate list */
637 L->Init(l);
638 /* copy names */
639 h=root;
640 l=0;
641 while (h!=NULL)
642 {
643 if (IDLEV(h)==lev)
644 {
645 /* list is initialized with 0 => no need to clear anything */
646 L->m[l].rtyp=STRING_CMD;
647 L->m[l].data=omStrDup(IDID(h));
648 l++;
649 }
650 h=IDNEXT(h);
651 }
652 return L;
653}

◆ jj_NormalizeQRingP()

poly jj_NormalizeQRingP ( poly p,
const ring r )

Definition at line 2494 of file ipassign.cc.

2495{
2496 if((p!=NULL) && (r->qideal!=NULL))
2497 {
2499 if (r!=currRing) rChangeCurrRing(r);
2500 ideal F=idInit(1,1);
2501 poly p2=kNF(F,r->qideal,p);
2502 p_Normalize(p2,r);
2503 id_Delete(&F,r);
2504 p_Delete(&p,r);
2505 p=p2;
2506 if (r!=save) rChangeCurrRing(save);
2507 }
2508 return p;
2509}
int p
Definition cfModGcd.cc:4086
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition kstd1.cc:3225
void p_Normalize(poly p, const ring r)
Definition p_polys.cc:3834
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:901
void rChangeCurrRing(ring r)
Definition polys.cc:15
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix

◆ jjNormalizeQRingId()

void jjNormalizeQRingId ( leftv I)

Definition at line 2459 of file ipassign.cc.

2460{
2461 assume ((currRing->qideal!=NULL) && (!hasFlag(I,FLAG_QRING)));
2462 {
2463 if (I->e==NULL)
2464 {
2465 ideal I0=(ideal)I->Data();
2466 switch (I->Typ())
2467 {
2468 case IDEAL_CMD:
2469 case MODUL_CMD:
2470 {
2471 ideal F=idInit(1,1);
2472 ideal II=kNF(F,currRing->qideal,I0);
2473 idDelete(&F);
2474 if (I->rtyp!=IDHDL)
2475 {
2476 idDelete((ideal*)&(I0));
2477 I->data=II;
2478 }
2479 else
2480 {
2481 idhdl h=(idhdl)I->data;
2482 idDelete((ideal*)&IDIDEAL(h));
2483 IDIDEAL(h)=II;
2485 }
2486 break;
2487 }
2488 default: break;
2489 }
2491 }
2492 }
2493}
#define idDelete(H)
delete an ideal
Definition ideals.h:29
#define setFlag(A, F)
Definition ipid.h:113
#define IDIDEAL(a)
Definition ipid.h:133
#define FLAG_QRING
Definition ipid.h:108
#define assume(x)
Definition mod2.h:387
idrec * idhdl
Definition ring.h:21
#define IDHDL
Definition tok.h:31

◆ killhdl()

void killhdl ( idhdl h,
package prooti = currPack )

Definition at line 393 of file ipid.cc.

394{
395 int t=IDTYP(h);
396 if (((BEGIN_RING<t) && (t<END_RING))
397 || ((t==LIST_CMD) && (lRingDependend((lists)IDDATA(h)))))
398 killhdl2(h,&currRing->idroot,currRing);
399 else
400 {
401 if(t==PACKAGE_CMD)
402 {
403 killhdl2(h,&(basePack->idroot),NULL);
404 }
405 else
406 {
407 idhdl s=proot->idroot;
408 while ((s!=h) && (s!=NULL)) s=s->next;
409 if (s!=NULL)
410 killhdl2(h,&(proot->idroot),NULL);
411 else if (basePack!=proot)
412 {
413 idhdl s=basePack->idroot;
414 while ((s!=h) && (s!=NULL)) s=s->next;
415 if (s!=NULL)
416 killhdl2(h,&(basePack->idroot),currRing);
417 else
418 killhdl2(h,&(currRing->idroot),currRing);
419 }
420 }
421 }
422}
@ END_RING
Definition grammar.cc:311
@ BEGIN_RING
Definition grammar.cc:283
#define IDDATA(a)
Definition ipid.h:126

◆ killhdl2()

void killhdl2 ( idhdl h,
idhdl * ih,
ring r )

Definition at line 424 of file ipid.cc.

425{
426 //printf("kill %s, id %x, typ %d lev: %d\n",IDID(h),(int)IDID(h),IDTYP(h),IDLEV(h));
427 idhdl hh;
428
430 && (IDLEV(h)!=myynest)
431 &&(IDLEV(h)==0))
432 {
433 if (((*ih)==basePack->idroot)
434 || ((currRing!=NULL)&&((*ih)==currRing->idroot)))
435 Warn("kill global `%s` at line >>%s<<\n",IDID(h),my_yylinebuf);
436 }
437 if (h->attribute!=NULL)
438 {
439 if ((IDTYP(h)==RING_CMD)&&(IDRING(h)!=r))
440 h->attribute->killAll(IDRING(h));
441 else
442 h->attribute->killAll(r);
443 h->attribute=NULL;
444 }
445 if (IDTYP(h) == PACKAGE_CMD)
446 {
447 if ((((IDPACKAGE(h)->language==LANG_C) ||(IDPACKAGE(h)->language==LANG_MIX))
448 &&(IDPACKAGE(h)->idroot!=NULL))
449 || (strcmp(IDID(h),"Top")==0))
450 {
451 Warn("cannot kill `%s`",IDID(h));
452 return;
453 }
454 // any objects defined for this package ?
455 if ((IDPACKAGE(h)->ref<=0) && (IDPACKAGE(h)->idroot!=NULL))
456 {
457 if (currPack==IDPACKAGE(h))
458 {
461 }
462 idhdl * hd = &IDRING(h)->idroot;
463 idhdl hdh = IDNEXT(*hd);
464 idhdl temp;
465 while (hdh!=NULL)
466 {
467 temp = IDNEXT(hdh);
468 killhdl2(hdh,&(IDPACKAGE(h)->idroot),NULL);
469 hdh = temp;
470 }
471 killhdl2(*hd,hd,NULL);
472 if (IDPACKAGE(h)->libname!=NULL) omFreeBinAddr((ADDRESS)(IDPACKAGE(h)->libname));
473 }
477 }
478 else if (IDTYP(h)==RING_CMD)
479 rKill(h);
480 else if (IDDATA(h)!=NULL)
482 IDDATA(h)=NULL;
483 // general -------------------------------------------------------------
484 // now dechain it and delete idrec
485 if (IDID(h)!=NULL) // OB: ?????
487 IDID(h)=NULL;
488 IDDATA(h)=NULL;
489 if (h == (*ih))
490 {
491 // h is at the beginning of the list
492 *ih = IDNEXT(h) /* ==*ih */;
493 }
494 else if (ih!=NULL)
495 {
496 // h is somethere in the list:
497 hh = *ih;
498 loop
499 {
500 if (hh==NULL)
501 {
502 PrintS(">>?<< not found for kill\n");
503 return;
504 }
505 idhdl hhh = IDNEXT(hh);
506 if (hhh == h)
507 {
508 IDNEXT(hh) = IDNEXT(hhh);
509 break;
510 }
511 hh = hhh;
512 }
513 }
515}
VAR omBin idrec_bin
Definition ipid.cc:48
VAR idhdl currPackHdl
Definition ipid.cc:55
idhdl packFindHdl(package r)
Definition ipid.cc:810
#define IDPACKAGE(a)
Definition ipid.h:139
void paKill(package pack)
Definition ipid.h:50
#define IDRING(a)
Definition ipid.h:127
void iiCheckPack(package &p)
Definition ipshell.cc:1629
void rKill(ring r)
Definition ipshell.cc:6173
#define omFreeBin(addr, bin)
#define TEST_V_ALLWARN
Definition options.h:142
#define loop
Definition structs.h:75
void s_internalDelete(const int t, void *d, const ring r)
Definition subexpr.cc:518
@ LANG_MIX
Definition subexpr.h:22

◆ killid()

void killid ( const char * a,
idhdl * i )

Definition at line 366 of file ipid.cc.

367{
368 if (id!=NULL)
369 {
370 idhdl h = (*ih)->get(id,myynest);
371
372 // id not found in global list, is it defined in current ring ?
373 if (h==NULL)
374 {
375 if ((currRing!=NULL) && (*ih != (currRing->idroot)))
376 {
377 h = currRing->idroot->get(id,myynest);
378 if (h!=NULL)
379 {
380 killhdl2(h,&(currRing->idroot),currRing);
381 return;
382 }
383 }
384 Werror("`%s` is not defined",id);
385 return;
386 }
388 }
389 else
390 WerrorS("kill what ?");
391}

◆ load_builtin()

BOOLEAN load_builtin ( const char * newlib,
BOOLEAN autoexport,
SModulFunc_t init )

Definition at line 1303 of file iplib.cc.

1304{
1305 int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic,
1306 BOOLEAN(*func)(leftv res, leftv v));
1307/*
1308 typedef int (*fktn_t)(int(*iiAddCproc)(const char *libname, const char *procname,
1309 BOOLEAN pstatic,
1310 BOOLEAN(*func)(leftv res, leftv v)));
1311*/
1312 // SModulFunc_t fktn;
1313 idhdl pl;
1314 char *plib = iiConvName(newlib);
1315 // BOOLEAN RET=TRUE;
1316 // int token;
1317
1318 pl = basePack->idroot->get(plib,0); // search PACKAGE only in Top
1319 if ((pl!=NULL)
1320 &&(IDTYP(pl)==PACKAGE_CMD))
1321 {
1322 if(IDPACKAGE(pl)->language==LANG_C)
1323 {
1324 if (BVERBOSE(V_LOAD_LIB)) Warn( "(builtin) %s already loaded", newlib);
1326 return FALSE;
1327 }
1328 }
1329 else
1330 {
1331 pl = enterid( plib,0, PACKAGE_CMD, &IDROOT, TRUE );
1332 IDPACKAGE(pl)->libname=omStrDup(newlib);
1333 }
1335 IDPACKAGE(pl)->language = LANG_C;
1336
1337 IDPACKAGE(pl)->handle=(void *)NULL;
1339
1340 package s=currPack;
1341 currPack=IDPACKAGE(pl);
1342 if( init!= NULL)
1343 {
1344 sModulFunctions.iiArithAddCmd = iiArithAddCmd;
1345 if (autoexport) sModulFunctions.iiAddCproc = iiAddCprocTop;
1346 else sModulFunctions.iiAddCproc = iiAddCproc;
1347 (*init)(&sModulFunctions);
1348 }
1349 if (BVERBOSE(V_LOAD_LIB)) Print( "// ** loaded (builtin) %s \n", newlib);
1350 currPack->loaded=1;
1351 currPack=s;
1352
1353 return FALSE;
1354}
int BOOLEAN
Definition auxiliary.h:87
#define TRUE
Definition auxiliary.h:100
idhdl get(const char *s, int lev)
Definition ipid.cc:65
Class used for (list of) interpreter objects.
Definition subexpr.h:83
CanonicalForm res
Definition facAbsFact.cc:60
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
int iiArithAddCmd(const char *szName, short nAlias, short nTokval, short nToktype, short nPos=-1)
Definition iparith.cc:10105
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition ipid.cc:258
int iiAddCproc(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition iplib.cc:1072
char * iiConvName(const char *libname)
Definition iplib.cc:1438
int iiAddCprocTop(const char *libname, const char *procname, BOOLEAN pstatic, BOOLEAN(*func)(leftv res, leftv v))
Definition iplib.cc:1147
#define V_LOAD_LIB
Definition options.h:47

◆ module_help_main()

void module_help_main ( const char * newlib,
const char * help )

Definition at line 1356 of file iplib.cc.

1357{
1358 char *plib = iiConvName(newlib);
1359 idhdl pl = basePack->idroot->get(plib,0);
1360 if ((pl==NULL)||(IDTYP(pl)!=PACKAGE_CMD))
1361 Werror(">>%s<< is not a package (trying to add package help)",plib);
1362 else
1363 {
1364 package s=currPack;
1365 currPack=IDPACKAGE(pl);
1366 idhdl h=enterid("info",0,STRING_CMD,&IDROOT,FALSE);
1368 currPack=s;
1369 }
1370}
#define IDSTRING(a)
Definition ipid.h:136
#define help
Definition libparse.cc:1230

◆ module_help_proc()

void module_help_proc ( const char * newlib,
const char * p,
const char * help )

Definition at line 1371 of file iplib.cc.

1372{
1373 char *plib = iiConvName(newlib);
1374 idhdl pl = basePack->idroot->get(plib,0);
1375 if ((pl==NULL)||(IDTYP(pl)!=PACKAGE_CMD))
1376 Werror(">>%s<< is not a package(trying to add help for %s)",plib,p);
1377 else
1378 {
1379 package s=currPack;
1380 currPack=IDPACKAGE(pl);
1381 char buff[SINGULAR_PATH_LENGTH];
1382 buff[SINGULAR_PATH_LENGTH-1]='\0';
1384 strncat(buff,"_help",SINGULAR_PATH_LENGTH-1-strlen(p));
1387 currPack=s;
1388 }
1389}
#define SINGULAR_PATH_LENGTH
Definition iplib.cc:21

◆ packFindHdl()

idhdl packFindHdl ( package r)

Definition at line 810 of file ipid.cc.

811{
812 idhdl h=basePack->idroot;
813 while (h!=NULL)
814 {
815 if ((IDTYP(h)==PACKAGE_CMD)
816 && (IDPACKAGE(h)==r))
817 return h;
818 h=IDNEXT(h);
819 }
820 return NULL;
821}

◆ paCopy()

package paCopy ( package pack)
inline

Definition at line 44 of file ipid.h.

45{
46 pack->ref++;
47 return pack;
48}

◆ paKill()

void paKill ( package pack)
inline

Definition at line 50 of file ipid.h.

51{
52 pack->ref--;
53}

Variable Documentation

◆ basePack

EXTERN_VAR package basePack

Definition at line 18 of file ipid.h.

◆ basePackHdl

EXTERN_VAR idhdl basePackHdl

Definition at line 16 of file ipid.h.

◆ coeffs_BIGINT

EXTERN_VAR coeffs coeffs_BIGINT

Definition at line 147 of file ipid.h.

◆ currPack

EXTERN_VAR package currPack

Definition at line 17 of file ipid.h.

◆ currPackHdl

EXTERN_VAR idhdl currPackHdl

Definition at line 15 of file ipid.h.

◆ currRingHdl

EXTERN_VAR idhdl currRingHdl

Definition at line 78 of file ipid.h.

◆ idrec_bin

EXTERN_VAR omBin idrec_bin

Definition at line 144 of file ipid.h.

◆ optionStruct

const struct soptionStruct optionStruct[]
extern

Definition at line 507 of file misc_ip.cc.

508{
509 {"prot", Sy_bit(OPT_PROT), ~Sy_bit(OPT_PROT) },
510 {"redSB", Sy_bit(OPT_REDSB), ~Sy_bit(OPT_REDSB) },
511 {"notBuckets", Sy_bit(OPT_NOT_BUCKETS), ~Sy_bit(OPT_NOT_BUCKETS) },
512 {"notSugar", Sy_bit(OPT_NOT_SUGAR), ~Sy_bit(OPT_NOT_SUGAR) },
513 {"interrupt", Sy_bit(OPT_INTERRUPT), ~Sy_bit(OPT_INTERRUPT) },
514 {"sugarCrit", Sy_bit(OPT_SUGARCRIT), ~Sy_bit(OPT_SUGARCRIT) },
515 {"teach", Sy_bit(OPT_DEBUG), ~Sy_bit(OPT_DEBUG) },
516 {"notSyzMinim", Sy_bit(OPT_NO_SYZ_MINIM), ~Sy_bit(OPT_NO_SYZ_MINIM) },
517 /* 9 return SB in syz, quotient, intersect, modulo */
518 {"returnSB", Sy_bit(OPT_RETURN_SB), ~Sy_bit(OPT_RETURN_SB) },
519 {"fastHC", Sy_bit(OPT_FASTHC), ~Sy_bit(OPT_FASTHC) },
520 /* 11-19 sort in L/T */
521 {"staircaseBound",Sy_bit(OPT_STAIRCASEBOUND),~Sy_bit(OPT_STAIRCASEBOUND) },
522 {"multBound", Sy_bit(OPT_MULTBOUND), ~Sy_bit(OPT_MULTBOUND) },
523 {"degBound", Sy_bit(OPT_DEGBOUND), ~Sy_bit(OPT_DEGBOUND) },
524 {"redTailSyz", Sy_bit(OPT_REDTAIL_SYZ), ~Sy_bit(OPT_REDTAIL_SYZ) },
525 /* 25 no redTail(p)/redTail(s) */
526 {"redTail", Sy_bit(OPT_REDTAIL), ~Sy_bit(OPT_REDTAIL) },
527 {"redThrough", Sy_bit(OPT_REDTHROUGH), ~Sy_bit(OPT_REDTHROUGH) },
528 {"lazy", Sy_bit(OPT_OLDSTD), ~Sy_bit(OPT_OLDSTD) },
529 {"intStrategy", Sy_bit(OPT_INTSTRATEGY), ~Sy_bit(OPT_INTSTRATEGY) },
530 {"infRedTail", Sy_bit(OPT_INFREDTAIL), ~Sy_bit(OPT_INFREDTAIL) },
531 /* 30: use not regularity for syz */
532 {"notRegularity",Sy_bit(OPT_NOTREGULARITY), ~Sy_bit(OPT_NOTREGULARITY) },
533 {"weightM", Sy_bit(OPT_WEIGHTM), ~Sy_bit(OPT_WEIGHTM) },
534/*special for "none" and also end marker for showOption:*/
535 {"ne", 0, 0 }
536};
#define OPT_SUGARCRIT
Definition options.h:80
#define OPT_PROT
Definition options.h:75
#define OPT_INFREDTAIL
Definition options.h:94
#define OPT_INTSTRATEGY
Definition options.h:92
#define OPT_WEIGHTM
Definition options.h:97
#define OPT_REDTAIL_SYZ
Definition options.h:87
#define OPT_REDTAIL
Definition options.h:91
#define OPT_RETURN_SB
Definition options.h:84
#define OPT_NOT_SUGAR
Definition options.h:78
#define OPT_REDTHROUGH
Definition options.h:82
#define OPT_REDSB
Definition options.h:76
#define Sy_bit(x)
Definition options.h:31
#define OPT_NOTREGULARITY
Definition options.h:96
#define OPT_DEBUG
Definition options.h:81
#define OPT_MULTBOUND
Definition options.h:89
#define OPT_STAIRCASEBOUND
Definition options.h:88
#define OPT_INTERRUPT
Definition options.h:79
#define OPT_DEGBOUND
Definition options.h:90
#define OPT_NOT_BUCKETS
Definition options.h:77
#define OPT_FASTHC
Definition options.h:85
#define OPT_OLDSTD
Definition options.h:86
#define OPT_NO_SYZ_MINIM
Definition options.h:83

◆ procstack

EXTERN_VAR proclevel* procstack

Definition at line 66 of file ipid.h.

◆ sip_command_bin

EXTERN_VAR omBin sip_command_bin

Definition at line 142 of file ipid.h.

◆ sip_package_bin

EXTERN_VAR omBin sip_package_bin

Definition at line 143 of file ipid.h.

◆ sleftv_bin

EXTERN_VAR omBin sleftv_bin

Definition at line 145 of file ipid.h.

◆ verboseStruct

const struct soptionStruct verboseStruct[]
extern

Definition at line 538 of file misc_ip.cc.

539{
540 {"assign_none",Sy_bit(V_ASSIGN_NONE),~Sy_bit(V_ASSIGN_NONE)},
541 {"mem", Sy_bit(V_SHOW_MEM), ~Sy_bit(V_SHOW_MEM) },
542 {"yacc", Sy_bit(V_YACC), ~Sy_bit(V_YACC) },
543 {"redefine", Sy_bit(V_REDEFINE), ~Sy_bit(V_REDEFINE) },
544 {"reading", Sy_bit(V_READING), ~Sy_bit(V_READING) },
545 {"loadLib", Sy_bit(V_LOAD_LIB), ~Sy_bit(V_LOAD_LIB) },
546 {"debugLib", Sy_bit(V_DEBUG_LIB), ~Sy_bit(V_DEBUG_LIB) },
547 {"loadProc", Sy_bit(V_LOAD_PROC), ~Sy_bit(V_LOAD_PROC) },
548 {"defRes", Sy_bit(V_DEF_RES), ~Sy_bit(V_DEF_RES) },
549 {"usage", Sy_bit(V_SHOW_USE), ~Sy_bit(V_SHOW_USE) },
550 {"Imap", Sy_bit(V_IMAP), ~Sy_bit(V_IMAP) },
551 {"prompt", Sy_bit(V_PROMPT), ~Sy_bit(V_PROMPT) },
552 {"length", Sy_bit(V_LENGTH), ~Sy_bit(V_LENGTH) },
553 {"notWarnSB",Sy_bit(V_NSB), ~Sy_bit(V_NSB) },
554 {"contentSB",Sy_bit(V_CONTENTSB), ~Sy_bit(V_CONTENTSB) },
555 {"cancelunit",Sy_bit(V_CANCELUNIT),~Sy_bit(V_CANCELUNIT)},
556 {"modpsolve",Sy_bit(V_MODPSOLVSB),~Sy_bit(V_MODPSOLVSB)},
557 {"geometricSB",Sy_bit(V_UPTORADICAL),~Sy_bit(V_UPTORADICAL)},
558 {"findMonomials",Sy_bit(V_FINDMONOM),~Sy_bit(V_FINDMONOM)},
559 {"coefStrat",Sy_bit(V_COEFSTRAT), ~Sy_bit(V_COEFSTRAT)},
560 {"qringNF", Sy_bit(V_QRING), ~Sy_bit(V_QRING)},
561 {"warn", Sy_bit(V_ALLWARN), ~Sy_bit(V_ALLWARN)},
562 {"intersectSyz",Sy_bit(V_INTERSECT_SYZ), ~Sy_bit(V_INTERSECT_SYZ)},
563 {"intersectElim",Sy_bit(V_INTERSECT_ELIM), ~Sy_bit(V_INTERSECT_ELIM)},
564/*special for "none" and also end marker for showOption:*/
565 {"ne", 0, 0 }
566};
#define V_QRING
Definition options.h:42
#define V_DEF_RES
Definition options.h:50
#define V_INTERSECT_SYZ
Definition options.h:69
#define V_SHOW_MEM
Definition options.h:43
#define V_ALLWARN
Definition options.h:67
#define V_READING
Definition options.h:46
#define V_COEFSTRAT
Definition options.h:61
#define V_ASSIGN_NONE
Definition options.h:70
#define V_CONTENTSB
Definition options.h:56
#define V_DEBUG_LIB
Definition options.h:48
#define V_MODPSOLVSB
Definition options.h:58
#define V_LOAD_PROC
Definition options.h:49
#define V_UPTORADICAL
Definition options.h:59
#define V_YACC
Definition options.h:44
#define V_FINDMONOM
Definition options.h:60
#define V_CANCELUNIT
Definition options.h:57
#define V_INTERSECT_ELIM
Definition options.h:68
#define V_NSB
Definition options.h:55
#define V_LENGTH
Definition options.h:64
#define V_IMAP
Definition options.h:53
#define V_PROMPT
Definition options.h:54
#define V_SHOW_USE
Definition options.h:52