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,
 
)    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,
 
)    (A)->flag&=~Sy_bit(F)

Definition at line 114 of file ipid.h.

◆ setFlag

#define setFlag (   A,
 
)    (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 281 of file ipid.cc.

282{
283 if (s==NULL) return NULL;
284 if (root==NULL) return NULL;
285 idhdl h;
286 s=omStrDup(s);
287 // idhdl *save_root=root;
288 if (t==PACKAGE_CMD)
289 {
290 if (root!=&(basePack->idroot))
291 {
292 root=&(basePack->idroot);
293 }
294 }
295 // is it already defined in root ?
296 if ((h=(*root)->get_level(s,lev))!=NULL)
297 {
298 if ((IDTYP(h) == t)||(t==DEF_CMD))
299 {
300 if (IDTYP(h)==PACKAGE_CMD)
301 {
302 if (strcmp(s,"Top")==0)
303 {
304 goto errlabel;
305 }
306 else return h;
307 }
308 else
309 {
310 if (BVERBOSE(V_REDEFINE))
311 {
312 const char *f=VoiceName();
313 if (strcmp(f,"STDIN")==0)
314 Warn("redefining %s (%s)",s,my_yylinebuf);
315 else
316 Warn("redefining %s (%s) %s:%d",s,my_yylinebuf,f, yylineno);
317 }
318 if (s==IDID(h)) IDID(h)=NULL;
319 if((t!=PROC_CMD)||(IDPROC(h)->language!=LANG_C))
320 {
321 killhdl2(h,root,currRing);
322 }
323 }
324 }
325 else
326 goto errlabel;
327 }
328 // is it already defined in currRing->idroot ?
329 else if (search && (currRing!=NULL)&&((*root) != currRing->idroot))
330 {
331 if ((h=currRing->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 // proc is not ring-dep, no need to check for type "proc":
345 killhdl2(h,&currRing->idroot,currRing);
346 }
347 else
348 goto errlabel;
349 }
350 }
351 // is it already defined in idroot ?
352 else if (search && (*root != IDROOT))
353 {
354 if ((h=IDROOT->get_level(s,lev))!=NULL)
355 {
356 if ((IDTYP(h) == t)||(t==DEF_CMD))
357 {
358 if (BVERBOSE(V_REDEFINE))
359 {
360 const char *f=VoiceName();
361 if (strcmp(f,"STDIN")==0)
362 Warn("redefining %s (%s)",s,my_yylinebuf);
363 else
364 Warn("redefining %s (%s) %s:%d",s,my_yylinebuf,f, yylineno);
365 }
366 if (s==IDID(h)) IDID(h)=NULL;
367 if((t!=PROC_CMD)||(IDPROC(h)->language!=LANG_C))
368 {
370 }
371 }
372 else
373 goto errlabel;
374 }
375 }
376 *root = (*root)->set(s, lev, t, init);
377#ifndef SING_NDEBUG
378 checkall();
379#endif
380 return *root;
381
382 errlabel:
383 //Werror("identifier `%s` in use(lev h=%d,typ=%d,t=%d, curr=%d)",s,IDLEV(h),IDTYP(h),t,lev);
384 Werror("identifier `%s` in use",s);
385 //listall();
387 return NULL;
388}
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:239
#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:447
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 583 of file ipid.cc.

584{
585 if (currRing!=NULL)
586 {
587 idhdl h2 = currRing->idroot->get(n,myynest);
588 if ((h2!=NULL)&&(IDLEV(h2)==myynest)) return h2;
589 idhdl h = IDROOT->get(n,myynest);
590 if (h!=NULL) return h;
591 if (h2!=NULL) return h2;
592 }
593 else
594 {
595 idhdl h = IDROOT->get(n,myynest);
596 if (h!=NULL) return h;
597 }
598 if (basePack!=currPack)
599 return basePack->idroot->get(n,myynest);
600 return NULL;
601}
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 140 of file ipid.cc.

141{
142 switch (t)
143 {
144 //the type with init routines:
145#ifdef SINGULAR_4_2
146 case CNUMBER_CMD:
147 return (void*)n2Init(0,NULL);
148 case CPOLY_CMD:
149 return (void*)p2Init(0,NULL);
150 case CMATRIX_CMD:
151#endif
152 case BIGINTMAT_CMD:
153 return (void *)new bigintmat();
154 case BIGINTVEC_CMD:
155 return (void *)new bigintmat(1,0,coeffs_BIGINT);
156 case BUCKET_CMD:
157 if (currRing!=NULL)
158 return (void*)sBucketCreate(currRing);
159 else
160 {
161 WerrorS("need basering for polyBucket");
162 return NULL;
163 }
164 case INTVEC_CMD:
165 case INTMAT_CMD:
166 return (void *)new intvec();
167 case NUMBER_CMD:
168 {
169 if (currRing!=NULL) return (void *) nInit(0);
170 else return NULL;
171 }
172 case BIGINT_CMD:
173 return (void *) n_Init(0, coeffs_BIGINT);
174 case IDEAL_CMD:
175 case MODUL_CMD:
176 case MATRIX_CMD:
177 case SMATRIX_CMD:
178 return (void*) idInit(1,1);
179 case MAP_CMD:
180 {
181 map m = (map)idInit(1,1);
182 m->preimage = omStrDup(IDID(currRingHdl));
183 return (void *)m;
184 }
185 case STRING_CMD:
186 return (void *)omAlloc0(1);
187 case LIST_CMD:
188 {
190 l->Init();
191 return (void*)l;
192 }
193 //the types with the standard init: set the struct to zero
194 case LINK_CMD:
195 return (void*) omAlloc0Bin(sip_link_bin);
196 case PACKAGE_CMD:
197 {
198 package pa=(package)omAlloc0Bin(sip_package_bin);
199 pa->language=LANG_NONE;
200 pa->loaded = FALSE;
201 return (void*)pa;
202 }
203 case PROC_CMD:
204 {
206 pi->ref=1;
207 pi->language=LANG_NONE;
208 return (void*)pi;
209 }
210 case RESOLUTION_CMD:
211 return (void *)omAlloc0(sizeof(ssyStrategy));
212 //other types: without alloc. (int,script,poly,def,package,..)
213 case INT_CMD:
214 case DEF_CMD:
215 case POLY_CMD:
216 case VECTOR_CMD:
217 case RING_CMD:
218 case CRING_CMD:
219 case QRING_CMD:
220 return NULL;
221 default:
222 {
223 if (t>MAX_TOK)
224 {
225#ifdef BLACKBOX_DEVEL
226 Print("bb-type %d\n",t);
227#endif
229 if (bb!=NULL)
230 return (void *)bb->blackbox_Init(bb);
231 }
232 else
233 Werror("unknown type in idrecDataInit:%d",t);
234 break;
235 }
236 }
237 return (void *)0L;
238}
#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 621 of file ipid.cc.

622{
623 if (hasFlag(h,FLAG_STD)) PrintS(" (SB)");
624#ifdef HAVE_PLURAL
625 if (hasFlag(h,FLAG_TWOSTD)) PrintS(" (2SB)");
626#endif
627}
#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 706 of file ipid.cc.

707{
708 if ((currRing!=NULL)&&(tomove!=NULL))
709 {
712 {
713 /*move 'tomove' to ring id's*/
714 if (ipSwapId(tomove,IDROOT,currRing->idroot))
715 ipSwapId(tomove,basePack->idroot,currRing->idroot);
716 }
717 else
718 {
719 /*move 'tomove' to global id's*/
721 }
722 }
723}
static int RingDependend(int t)
Definition gentable.cc:23
static int ipSwapId(idhdl tomove, idhdl &root1, idhdl &root2)
Definition ipid.cc:681
#define IDLIST(a)
Definition ipid.h:137
BOOLEAN lRingDependend(lists L)
Definition lists.cc:222

◆ ipNameList()

lists ipNameList ( idhdl  root)

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) { 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 /* list is initialized with 0 => no need to clear anything */
644 L->m[l].rtyp=STRING_CMD;
645 L->m[l].data=omStrDup(IDID(h));
646 l++;
647 h=IDNEXT(h);
648 }
649 return L;
650}
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 652 of file ipid.cc.

653{
654 idhdl h=root;
655 /* compute the length */
656 int l=0;
657 while (h!=NULL) { if (IDLEV(h)==lev) l++; h=IDNEXT(h); }
658 /* allocate list */
660 L->Init(l);
661 /* copy names */
662 h=root;
663 l=0;
664 while (h!=NULL)
665 {
666 if (IDLEV(h)==lev)
667 {
668 /* list is initialized with 0 => no need to clear anything */
669 L->m[l].rtyp=STRING_CMD;
670 L->m[l].data=omStrDup(IDID(h));
671 l++;
672 }
673 h=IDNEXT(h);
674 }
675 return L;
676}

◆ 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:3224
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 416 of file ipid.cc.

417{
418 int t=IDTYP(h);
419 if (((BEGIN_RING<t) && (t<END_RING))
420 || ((t==LIST_CMD) && (lRingDependend((lists)IDDATA(h)))))
421 killhdl2(h,&currRing->idroot,currRing);
422 else
423 {
424 if(t==PACKAGE_CMD)
425 {
426 killhdl2(h,&(basePack->idroot),NULL);
427 }
428 else
429 {
430 idhdl s=proot->idroot;
431 while ((s!=h) && (s!=NULL)) s=s->next;
432 if (s!=NULL)
433 killhdl2(h,&(proot->idroot),NULL);
434 else if (basePack!=proot)
435 {
436 idhdl s=basePack->idroot;
437 while ((s!=h) && (s!=NULL)) s=s->next;
438 if (s!=NULL)
439 killhdl2(h,&(basePack->idroot),currRing);
440 else
441 killhdl2(h,&(currRing->idroot),currRing);
442 }
443 }
444 }
445}
@ 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 447 of file ipid.cc.

448{
449 //printf("kill %s, id %x, typ %d lev: %d\n",IDID(h),(int)IDID(h),IDTYP(h),IDLEV(h));
450 idhdl hh;
451
453 && (IDLEV(h)!=myynest)
454 &&(IDLEV(h)==0))
455 {
456 if (((*ih)==basePack->idroot)
457 || ((currRing!=NULL)&&((*ih)==currRing->idroot)))
458 Warn("kill global `%s` at line >>%s<<\n",IDID(h),my_yylinebuf);
459 }
460 if (h->attribute!=NULL)
461 {
462 if ((IDTYP(h)==RING_CMD)&&(IDRING(h)!=r))
463 h->attribute->killAll(IDRING(h));
464 else
465 h->attribute->killAll(r);
466 h->attribute=NULL;
467 }
468 if (IDTYP(h) == PACKAGE_CMD)
469 {
470 if ((((IDPACKAGE(h)->language==LANG_C) ||(IDPACKAGE(h)->language==LANG_MIX))
471 &&(IDPACKAGE(h)->idroot!=NULL))
472 || (strcmp(IDID(h),"Top")==0))
473 {
474 Warn("cannot kill `%s`",IDID(h));
475 return;
476 }
477 // any objects defined for this package ?
478 if ((IDPACKAGE(h)->ref<=0) && (IDPACKAGE(h)->idroot!=NULL))
479 {
480 if (currPack==IDPACKAGE(h))
481 {
484 }
485 idhdl * hd = &IDRING(h)->idroot;
486 idhdl hdh = IDNEXT(*hd);
487 idhdl temp;
488 while (hdh!=NULL)
489 {
490 temp = IDNEXT(hdh);
491 killhdl2(hdh,&(IDPACKAGE(h)->idroot),NULL);
492 hdh = temp;
493 }
494 killhdl2(*hd,hd,NULL);
495 if (IDPACKAGE(h)->libname!=NULL) omFreeBinAddr((ADDRESS)(IDPACKAGE(h)->libname));
496 }
500 }
501 else if (IDTYP(h)==RING_CMD)
502 rKill(h);
503 else if (IDDATA(h)!=NULL)
505 IDDATA(h)=NULL;
506 // general -------------------------------------------------------------
507 // now dechain it and delete idrec
508 if (IDID(h)!=NULL) // OB: ?????
510 IDID(h)=NULL;
511 IDDATA(h)=NULL;
512 if (h == (*ih))
513 {
514 // h is at the beginning of the list
515 *ih = IDNEXT(h) /* ==*ih */;
516 }
517 else if (ih!=NULL)
518 {
519 // h is somethere in the list:
520 hh = *ih;
521 loop
522 {
523 if (hh==NULL)
524 {
525 PrintS(">>?<< not found for kill\n");
526 return;
527 }
528 idhdl hhh = IDNEXT(hh);
529 if (hhh == h)
530 {
531 IDNEXT(hh) = IDNEXT(hhh);
532 break;
533 }
534 hh = hhh;
535 }
536 }
538}
VAR omBin idrec_bin
Definition ipid.cc:48
VAR idhdl currPackHdl
Definition ipid.cc:55
idhdl packFindHdl(package r)
Definition ipid.cc:833
#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:6174
#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 389 of file ipid.cc.

390{
391 if (id!=NULL)
392 {
393 idhdl h = (*ih)->get(id,myynest);
394
395 // id not found in global list, is it defined in current ring ?
396 if (h==NULL)
397 {
398 if ((currRing!=NULL) && (*ih != (currRing->idroot)))
399 {
400 h = currRing->idroot->get(id,myynest);
401 if (h!=NULL)
402 {
403 killhdl2(h,&(currRing->idroot),currRing);
404 return;
405 }
406 }
407 Werror("`%s` is not defined",id);
408 return;
409 }
411 }
412 else
413 WerrorS("kill what ?");
414}

◆ 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:72
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:10108
idhdl enterid(const char *s, int lev, int t, idhdl *root, BOOLEAN init, BOOLEAN search)
Definition ipid.cc:281
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 833 of file ipid.cc.

834{
835 idhdl h=basePack->idroot;
836 while (h!=NULL)
837 {
838 if ((IDTYP(h)==PACKAGE_CMD)
839 && (IDPACKAGE(h)==r))
840 return h;
841 h=IDNEXT(h);
842 }
843 return NULL;
844}

◆ 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