Loading...
Searching...
No Matches
subexpr.cc File Reference
`#include "kernel/mod2.h"`
`#include "omalloc/omalloc.h"`
`#include "misc/intvec.h"`
`#include "misc/options.h"`
`#include "coeffs/numbers.h"`
`#include "coeffs/bigintmat.h"`
`#include "coeffs/ffields.h"`
`#include "polys/monomials/maps.h"`
`#include "polys/matpol.h"`
`#include "polys/monomials/ring.h"`
`#include "kernel/polys.h"`
`#include "kernel/ideals.h"`
`#include "kernel/GBEngine/kstd1.h"`
`#include "kernel/GBEngine/syz.h"`
`#include "kernel/oswrapper/timer.h"`
`#include "Singular/tok.h"`
`#include "Singular/ipid.h"`
`#include "Singular/ipshell.h"`
`#include "Singular/lists.h"`
`#include "Singular/attrib.h"`
`#include "Singular/links/silink.h"`
`#include "Singular/ipprint.h"`
`#include "Singular/subexpr.h"`
`#include "Singular/blackbox.h"`
`#include "Singular/number2.h"`
`#include <ctype.h>`

Go to the source code of this file.

## Functions

static void * | s_internalCopy (const int t, void *d)
void | s_internalDelete (const int t, void *d, const ring r)
BOOLEAN | assumeStdFlag (leftv h)
void | syMake (leftv v, const char *id, package pa)
void | syMakeMonom (leftv v, const char *id)

## Variables

VAR omBin | sSubexpr_bin = omGetSpecBin(sizeof(_ssubexpr))
VAR omBin | sleftv_bin = omGetSpecBin(sizeof(sleftv))
VAR omBin | procinfo_bin = omGetSpecBin(sizeof(procinfo))
VAR omBin | libstack_bin = omGetSpecBin(sizeof(libstack))
STATIC_VAR omBin | size_two_bin = omGetSpecBin(2)
INST_VAR sleftv | sLastPrinted
VAR BOOLEAN | siq =FALSE

## Function Documentation

## assumeStdFlag()

BOOLEAN assumeStdFlag | ( | leftv | h | ) |

Definition at line 1587 of file subexpr.cc.

{
if (h->e!=NULL)
{
leftv hh=h->LData();
if (h!=hh) return assumeStdFlag(h->LData());
}
if (!hasFlag(h,FLAG_STD))
{
if (!TEST_VERB_NSB)
{
if (TEST_V_ALLWARN)
Warn("%s is no standard basis in >>%s<<",h->Name(),my_yylinebuf);
else
Warn("%s is no standard basis",h->Name());
}
return FALSE;
}
return TRUE;
}
TRUE
#define TRUE
Definition auxiliary.h:101
FALSE
#define FALSE
Definition auxiliary.h:97
Warn
#define Warn
Definition emacs.cc:77
my_yylinebuf
VAR char my_yylinebuf[80]
Definition febase.cc:44
hasFlag
#define hasFlag(A, F)
Definition ipid.h:112
FLAG_STD
#define FLAG_STD
Definition ipid.h:106
h
STATIC_VAR Poly * h
Definition janet.cc:971
NULL
#define NULL
Definition omList.c:12
TEST_V_ALLWARN
#define TEST_V_ALLWARN
Definition options.h:145
TEST_VERB_NSB
#define TEST_VERB_NSB
Definition options.h:139
leftv
sleftv * leftv
Definition structs.h:53
assumeStdFlag
BOOLEAN assumeStdFlag(leftv h)
Definition subexpr.cc:1587

## s_internalCopy()

void * s_internalCopy | ( | const int | t,
|  | void * | d )

inline static

Definition at line 433 of file subexpr.cc.

{
switch (t)
{
case CRING_CMD:
{
coeffs cf=(coeffs)d;
cf->ref++;
return (void*)d;
}
#ifdef SINGULAR_4_2
case CNUMBER_CMD:
return (void*)n2Copy((number2)d);
case CPOLY_CMD:
return (void*)p2Copy((poly2)d);
case CMATRIX_CMD: // like BIGINTMAT
#endif
case BIGINTMAT_CMD:
case BIGINTVEC_CMD:
return (void*)bimCopy((bigintmat *)d);
case BUCKET_CMD:
return (void*)sBucketCopy((sBucket_pt)d);
case INTVEC_CMD:
case INTMAT_CMD:
return (void *)ivCopy((intvec *)d);
case MATRIX_CMD:
return (void *)mp_Copy((matrix)d, currRing);
case SMATRIX_CMD:
case IDEAL_CMD:
case MODUL_CMD:
return (void *)idCopy((ideal)d);
case STRING_CMD:
return (void *)omStrDup((char *)d);
case PACKAGE_CMD:
return (void *)paCopy((package) d);
case PROC_CMD:
return (void *)piCopy((procinfov) d);
case POLY_CMD:
case VECTOR_CMD:
return (void *)pCopy((poly)d);
case INT_CMD:
return d;
case NUMBER_CMD:
return (void *)nCopy((number)d);
case BIGINT_CMD:
return (void *)n_Copy((number)d, coeffs_BIGINT);
case MAP_CMD:
return (void *)maCopy((map)d, currRing);
case LIST_CMD:
return (void *)lCopy((lists)d);
case LINK_CMD:
return (void *)slCopy((si_link) d);
case RING_CMD:
{
ring r=(ring)d;
if (r!=NULL)
{
rIncRefCnt(r);
//Print("s_internalCopy:+ ring %lx, ref %d\n",r,r->ref);
}
return d;
}
case RESOLUTION_CMD:
return (void*)syCopy((syStrategy)d);
case DEF_CMD:
case NONE:
case 0: /* type in error case */
break; /* error recovery: do nothing */
//case COMMAND:
default:
{
if (t>MAX_TOK)
{
blackbox *b=getBlackboxStuff(t);
if (b!=NULL) return b->blackbox_Copy(b,d);
return NULL;
}
else
Warn("s_internalCopy: cannot copy type %s(%d)",
Tok2Cmdname(t),t);
}
}
return NULL;
}
bimCopy
bigintmat * bimCopy(const bigintmat *b)
same as copy constructor - apart from it being able to accept NULL as input
Definition bigintmat.cc:403
getBlackboxStuff
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition blackbox.cc:17
cf
CanonicalForm cf
Definition cfModGcd.cc:4091
b
CanonicalForm b
Definition cfModGcd.cc:4111
map
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
Definition cf_map_ext.cc:505
bigintmat
Matrices of numbers.
Definition bigintmat.h:51
intvec
Definition intvec.h:24
n_Copy
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition coeffs.h:457
Tok2Cmdname
const char * Tok2Cmdname(int tok)
Definition gentable.cc:137
IDEAL_CMD
@ IDEAL_CMD
Definition grammar.cc:285
MATRIX_CMD
@ MATRIX_CMD
Definition grammar.cc:287
BUCKET_CMD
@ BUCKET_CMD
Definition grammar.cc:284
BIGINTMAT_CMD
@ BIGINTMAT_CMD
Definition grammar.cc:278
MAP_CMD
@ MAP_CMD
Definition grammar.cc:286
PROC_CMD
@ PROC_CMD
Definition grammar.cc:281
INTMAT_CMD
@ INTMAT_CMD
Definition grammar.cc:280
MODUL_CMD
@ MODUL_CMD
Definition grammar.cc:288
SMATRIX_CMD
@ SMATRIX_CMD
Definition grammar.cc:292
VECTOR_CMD
@ VECTOR_CMD
Definition grammar.cc:293
RESOLUTION_CMD
@ RESOLUTION_CMD
Definition grammar.cc:291
BIGINTVEC_CMD
@ BIGINTVEC_CMD
Definition grammar.cc:279
NUMBER_CMD
@ NUMBER_CMD
Definition grammar.cc:289
POLY_CMD
@ POLY_CMD
Definition grammar.cc:290
RING_CMD
@ RING_CMD
Definition grammar.cc:282
idCopy
ideal idCopy(ideal A)
Definition ideals.h:60
ivCopy
intvec * ivCopy(const intvec *o)
Definition intvec.h:146
paCopy
package paCopy(package pack)
Definition ipid.h:44
lCopy
lists lCopy(lists L)
Definition lists.cc:32
maCopy
map maCopy(map theMap, const ring r)
Definition maps.cc:34
mp_Copy
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition matpol.cc:57
matrix
ip_smatrix * matrix
Definition matpol.h:43
lists
slists * lists
Definition mpr_numeric.h:146
coeffs
The main handler for Singular numbers which are suitable for Singular polynomials.
nCopy
#define nCopy(n)
Definition numbers.h:15
omStrDup
#define omStrDup(s)
Definition omAllocDecl.h:263
coeffs_BIGINT
VAR coeffs coeffs_BIGINT
Definition polys.cc:14
currRing
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition polys.cc:13
pCopy
#define pCopy(p)
return a copy of the poly
Definition polys.h:186
rIncRefCnt
static ring rIncRefCnt(ring r)
Definition ring.h:849
sBucketCopy
sBucket_pt sBucketCopy(const sBucket_pt bucket)
Copy sBucket non-intrusive!!!
Definition sbuckets.cc:70
sBucket_pt
sBucket * sBucket_pt
Definition sbuckets.h:16
slCopy
static si_link slCopy(si_link l)
Definition silink.h:94
si_link
ip_link * si_link
Definition silink.h:20
package
ip_package * package
Definition structs.h:39
procinfov
procinfo * procinfov
Definition structs.h:56
piCopy
procinfov piCopy(procinfov pi)
Definition subexpr.h:149
syCopy
syStrategy syCopy(syStrategy syzstr)
Definition syz1.cc:1885
syStrategy
ssyStrategy * syStrategy
Definition syz.h:36
BIGINT_CMD
@ BIGINT_CMD
Definition tok.h:38
CRING_CMD
@ CRING_CMD
Definition tok.h:56
LIST_CMD
@ LIST_CMD
Definition tok.h:118
INTVEC_CMD
@ INTVEC_CMD
Definition tok.h:101
PACKAGE_CMD
@ PACKAGE_CMD
Definition tok.h:150
CMATRIX_CMD
@ CMATRIX_CMD
Definition tok.h:46
DEF_CMD
@ DEF_CMD
Definition tok.h:58
CNUMBER_CMD
@ CNUMBER_CMD
Definition tok.h:47
LINK_CMD
@ LINK_CMD
Definition tok.h:117
STRING_CMD
@ STRING_CMD
Definition tok.h:187
CPOLY_CMD
@ CPOLY_CMD
Definition tok.h:48
INT_CMD
@ INT_CMD
Definition tok.h:96
MAX_TOK
@ MAX_TOK
Definition tok.h:220
NONE
#define NONE
Definition tok.h:223

## s_internalDelete()

void s_internalDelete | ( | const int | t,
|  | void * | d,
|  | const ring | r )

Definition at line 518 of file subexpr.cc.

{
assume(d!=NULL);
switch (t)
{
case CRING_CMD:
{
coeffs cf=(coeffs)d;
if ((cf->ref<1)&&
((cf->type <=n_GF)
||((cf->type >=n_long_C)&&(cf->type <=n_CF))))
{
Warn("cannot kill `%s`",nCoeffName(cf));
}
else // allow nKillChar for n_long_R, extensions, and user defined:
nKillChar((coeffs)d);
break;
}
#ifdef SINGULAR_4_2
case CNUMBER_CMD:
{
number2 n=(number2)d;
n2Delete(n);
break;
}
case CPOLY_CMD:
{
poly2 n=(poly2)d;
p2Delete(n);
break;
}
case CMATRIX_CMD: //like BIGINTMAT
#endif
case BIGINTMAT_CMD:
case BIGINTVEC_CMD:
{
bigintmat *v=(bigintmat*)d;
delete v;
break;
}
case BUCKET_CMD:
{
sBucket_pt b=(sBucket_pt)d;
sBucketDeleteAndDestroy(&b);
break;
}
case INTVEC_CMD:
case INTMAT_CMD:
{
intvec *v=(intvec*)d;
delete v;
break;
}
case MAP_CMD:
{
map m=(map)d;
omFreeBinAddr((ADDRESS)m->preimage);
m->preimage=NULL; /* no break: continue as IDEAL*/
}
case SMATRIX_CMD:
case MATRIX_CMD:
case IDEAL_CMD:
case MODUL_CMD:
{
ideal i=(ideal)d;
id_Delete(&i,r);
break;
}
case STRING_CMD:
omFree(d);
break;
//case PACKAGE_CMD:
// return (void *)paCopy((package) d);
case PROC_CMD:
piKill((procinfo*)d);
break;
case POLY_CMD:
case VECTOR_CMD:
{
poly p=(poly)d;
p_Delete(&p,r);
break;
}
case NUMBER_CMD:
{
number n=(number)d;
n_Delete(&n,r->cf);
break;
}
case BIGINT_CMD:
{
number n=(number)d;
n_Delete(&n,coeffs_BIGINT);
break;
}
case LIST_CMD:
{
lists l=(lists)d;
l->Clean(r);
break;
}
case LINK_CMD:
{
si_link l=(si_link)d;
slKill(l);
break;
}
case RING_CMD:
{
ring R=(ring)d;
if ((R!=currRing)||(R->ref>=0))
rKill(R);
#ifdef TEST
else
Print("currRing? ref=%d\n",R->ref);
#endif
break;
}
case RESOLUTION_CMD:
{
syStrategy s=(syStrategy)d;
if (s!=NULL) syKillComputation(s,r);
break;
}
case COMMAND:
{
command cmd=(command)d;
if (cmd->arg1.rtyp!=0) cmd->arg1.CleanUp(r);
if (cmd->arg2.rtyp!=0) cmd->arg2.CleanUp(r);
if (cmd->arg3.rtyp!=0) cmd->arg3.CleanUp(r);
omFreeBin((ADDRESS)d, sip_command_bin);
break;
}
case INT_CMD:
case DEF_CMD:
case ALIAS_CMD:
case PACKAGE_CMD:
case IDHDL:
case NONE:
case ANY_TYPE:
case VECHO:
case VPRINTLEVEL:
case VCOLMAX:
case VTIMER:
case VRTIMER:
case VOICE:
case VMAXDEG:
case VMAXMULT:
case TRACE:
case VSHORTOUT:
case VNOETHER:
case VMINPOLY:
case 0: /* type in error case */
break; /* error recovery: do nothing */
//case COMMAND:
//case COMMAND:
default:
{
if (t>MAX_TOK)
{
blackbox *b=getBlackboxStuff(t);
if (b!=NULL) b->blackbox_destroy(b,d);
break;
}
else
Warn("s_internalDelete: cannot delete type %s(%d)",
Tok2Cmdname(t),t);
}
}
}
ADDRESS
void * ADDRESS
Definition auxiliary.h:120
l
int l
Definition cfEzgcd.cc:100
m
int m
Definition cfEzgcd.cc:128
i
int i
Definition cfEzgcd.cc:132
p
int p
Definition cfModGcd.cc:4086
n_GF
@ n_GF
\GF{p^n < 2^16}
Definition coeffs.h:32
n_CF
@ n_CF
?
Definition coeffs.h:48
n_long_C
@ n_long_C
complex floating point (GMP) numbers
Definition coeffs.h:41
n_Delete
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition coeffs.h:461
nCoeffName
static FORCE_INLINE char * nCoeffName(const coeffs cf)
Definition coeffs.h:962
nKillChar
void nKillChar(coeffs r)
undo all initialisations
Definition numbers.cc:563
Print
#define Print
Definition emacs.cc:80
s
const CanonicalForm int s
Definition facAbsFact.cc:51
v
const Variable & v
< [in] a sqrfree bivariate poly
Definition facBivar.h:39
VMAXMULT
@ VMAXMULT
Definition grammar.cc:308
VMAXDEG
@ VMAXDEG
Definition grammar.cc:307
VMINPOLY
@ VMINPOLY
Definition grammar.cc:310
VNOETHER
@ VNOETHER
Definition grammar.cc:309
sip_command_bin
VAR omBin sip_command_bin
Definition ipid.cc:45
piKill
BOOLEAN piKill(procinfov pi)
Definition ipid.cc:747
command
ip_command * command
Definition ipid.h:23
rKill
void rKill(ring r)
Definition ipshell.cc:6181
assume
#define assume(x)
Definition mod2.h:389
omFree
#define omFree(addr)
Definition omAllocDecl.h:261
omFreeBin
#define omFreeBin(addr, bin)
Definition omAllocDecl.h:259
omFreeBinAddr
#define omFreeBinAddr(addr)
Definition omAllocDecl.h:258
p_Delete
static void p_Delete(poly *p, const ring r)
Definition p_polys.h:903
sBucketDeleteAndDestroy
void sBucketDeleteAndDestroy(sBucket_pt *bucket_pt)
Definition sbuckets.cc:110
slKill
void slKill(si_link l)
Definition silink.cc:146
id_Delete
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
Definition simpleideals.cc:123
R
#define R
Definition sirandom.c:27
procinfo
Definition subexpr.h:54
syKillComputation
void syKillComputation(syStrategy syzstr, ring r=currRing)
Definition syz1.cc:1495
IDHDL
#define IDHDL
Definition tok.h:31
VCOLMAX
@ VCOLMAX
Definition tok.h:211
ALIAS_CMD
@ ALIAS_CMD
Definition tok.h:34
VSHORTOUT
@ VSHORTOUT
Definition tok.h:216
VPRINTLEVEL
@ VPRINTLEVEL
Definition tok.h:217
VECHO
@ VECHO
Definition tok.h:210
TRACE
@ TRACE
Definition tok.h:214
VTIMER
@ VTIMER
Definition tok.h:212
VRTIMER
@ VRTIMER
Definition tok.h:213
VOICE
@ VOICE
Definition tok.h:215
COMMAND
#define COMMAND
Definition tok.h:29
ANY_TYPE
#define ANY_TYPE
Definition tok.h:30

## syMake()

void syMake | ( | leftv | v,
|  | const char * | id,
|  | package | pa )

Definition at line 1613 of file subexpr.cc.

{
/* resolv an identifier: (to DEF_CMD, if siq>0)
* 1) reserved id: done by scanner
* 2) `basering` / 'Current`
* 3) existing identifier, local
* 4) ringvar, ringpar, local ring
* 5) existing identifier, global
* 6a) int/bigint
* 6b) monom (resp. number), local ring: consisting of:
* 6') ringvar, ringpar,global ring
* 6'') monom (resp. number), local ring
* 7) monom (resp. number), non-local ring
* 8) basering
* 9) `_`
* 10) everything else is of type 0
*/
#ifdef TEST
if ((*id<' ')||(*id>(char)126))
{
Print("wrong id :%s:\n",id);
}
#endif
idhdl save_ring=currRingHdl;
v->Init();
if(pa != NULL)
{
v->req_packhdl = pa;
}
else v->req_packhdl = currPack;
// if (v->req_packhdl!=basePack)
// Print("search %s in %s\n",id,v->req_packhdl->libname);
idhdl h=NULL;
#ifdef SIQ
if (siq<=0)
#endif
{
if (id[0]=='#')
{
h=ggetid(id);
/* 3) existing identifier, local */
if ((h!=NULL) && (IDLEV(h)==myynest))
{
if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
goto id_found;
}
}
else if ((id[0]!='-')&&(id[0]>='@' /* letters, _ */))
{
if (strcmp(id,"basering")==0)
{
if (currRingHdl!=NULL)
{
if (id!=IDID(currRingHdl)) omFreeBinAddr((ADDRESS)id);
h=currRingHdl;
goto id_found;
}
else
{
v->name = id;
return; /* undefined */
}
}
else if (strcmp(id,"Current")==0)
{
if (currPackHdl!=NULL)
{
omFreeBinAddr((ADDRESS)id);
h=currPackHdl;
goto id_found;
}
else
{
v->name = id;
return; /* undefined */
}
}
if(v->req_packhdl!=currPack)
{
h=v->req_packhdl->idroot->get(id,myynest);
}
else
{
h=ggetid(id);
}
/* 3) existing identifier, local */
if ((h!=NULL) && (IDLEV(h)==myynest))
{
if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
goto id_found;
}
if (yyInRingConstruction)
{
currRingHdl=NULL;
}
/* 4. local ring: ringvar */
if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest)
/*&& (!yyInRingConstruction)*/)
{
int vnr;
if ((vnr=r_IsRingVar(id, currRing->names,currRing->N))>=0)
{
poly p=pOne();
pSetExp(p,vnr+1,1);
pSetm(p);
v->data = (void *)p;
v->name = id;
v->rtyp = POLY_CMD;
return;
}
if((n_NumberOfParameters(currRing->cf)>0)
&&((vnr=r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
n_NumberOfParameters(currRing->cf))>=0)))
{
BOOLEAN ok=FALSE;
poly p = pmInit(id,ok);
if (ok && (p!=NULL))
{
v->data = pGetCoeff(p);
pGetCoeff(p)=NULL;
pLmFree(p);
v->rtyp = NUMBER_CMD;
v->name = id;
return;
}
}
}
/* 5. existing identifier, global */
if (h!=NULL)
{
if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
goto id_found;
}
}
else
{
/* 6a: int/bigint */
int i=0;
if (id[0]=='-') { i=1; }
while(isdigit(id[i])) i++;
if (id[i]=='\0')
{
int j=atoi(id);
char tmp[MAX_INT_LEN+5];
snprintf(tmp,MAX_INT_LEN+5,"%d",j);
if (strcmp(tmp,id)!=0)
{
number n;
n_Read(id,&n,coeffs_BIGINT);
v->rtyp=BIGINT_CMD;
v->data = n;
}
else
{
v->data=(void*)(long)j;
v->rtyp=INT_CMD;
}
omFreeBinAddr((ADDRESS)id);
return;
}
}
/* 6b local ring: number/poly */
if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest))
{
BOOLEAN ok=FALSE;
/*poly p = (!yyInRingConstruction) ? pmInit(id,ok) : (poly)NULL;*/
poly p = pmInit(id,ok);
if (ok)
{
if (p==NULL)
{
v->data = (void *)nInit(0);
v->rtyp = NUMBER_CMD;
#ifdef HAVE_PLURAL
// in this case we may have monomials equal to 0 in p_Read
v->name = id;
#else
omFreeBinAddr((ADDRESS)id);
#endif
}
else if (pIsConstant(p))
{
v->data = pGetCoeff(p);
pGetCoeff(p)=NULL;
pLmFree(p);
v->rtyp = NUMBER_CMD;
v->name = id;
}
else
{
v->name = id;
#ifdef HAVE_SHIFTBBA
if ((currRing->isLPring!=0)
&& (p_Totaldegree(p,currRing)>1))
{
p_LmDelete(&p,currRing);
/* v->rtyp = UNKNOWN; - already set */
return; /* error, report "unknown id" */
}
#endif
v->data = p;
v->rtyp = POLY_CMD;
}
return;
}
}
/* 7. non-local ring: number/poly */
{
BOOLEAN ok=FALSE;
poly p = ((currRing!=NULL) /* ring required */
&& (currRingHdl!=NULL)
/*&& (!yyInRingConstruction) - not in decl */
&& (IDLEV(currRingHdl)!=myynest)) /* already in case 4/6 */
? pmInit(id,ok) : (poly)NULL;
if (ok)
{
if (p==NULL)
{
v->data = (void *)nInit(0);
v->rtyp = NUMBER_CMD;
omFreeBinAddr((ADDRESS)id);
}
else
if (pIsConstant(p))
{
v->data = pGetCoeff(p);
pGetCoeff(p)=NULL;
pLmFree(p);
v->rtyp = NUMBER_CMD;
v->name = id;
}
else
{
v->data = p;
v->rtyp = POLY_CMD;
v->name = id;
}
//if (TEST_V_ALLWARN /*&& (myynest>0)*/
//&& ((r_IsRingVar(id, currRing->names,currRing->N)>=0)
// || ((n_NumberOfParameters(currRing->cf)>0)
// &&(r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
// n_NumberOfParameters(currRing->cf))>=0))))
//{
//// WARNING: do not use ring variable names in procedures
// Warn("use of variable >>%s<< in a procedure in line %s",id,my_yylinebuf);
//}
return;
}
}
/* 8. basering ? */
if ((myynest>1)&&(currRingHdl!=NULL))
{
if (strcmp(id,IDID(currRingHdl))==0)
{
if (IDID(currRingHdl)!=id) omFreeBinAddr((ADDRESS)id); /*assume strlen (id) <1000 */
h=currRingHdl;
goto id_found;
}
}
if((v->req_packhdl!=basePack) && (v->req_packhdl==currPack))
{
h=basePack->idroot->get(id,myynest);
if (h!=NULL)
{
if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
v->req_packhdl=basePack;
goto id_found;
}
}
}
#ifdef SIQ
else
v->rtyp=DEF_CMD;
#endif
/* 9: _ */
if (strcmp(id,"_")==0)
{
omFreeBinAddr((ADDRESS)id);
v->Copy(&sLastPrinted);
}
else
{
/* 10: everything else */
/* v->rtyp = UNKNOWN;*/
v->name = id;
}
currRingHdl=save_ring;
return;
id_found: // we have an id (in h) found, to set the data in from h
if (IDTYP(h)!=ALIAS_CMD)
{
v->rtyp = IDHDL;
v->flag = IDFLAG(h);
v->attribute=IDATTR(h);
}
else
{
v->rtyp = ALIAS_CMD;
}
v->name = IDID(h);
v->data = (char *)h;
currRingHdl=save_ring;
}
BOOLEAN
int BOOLEAN
Definition auxiliary.h:88
n_ParameterNames
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition coeffs.h:773
n_NumberOfParameters
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition coeffs.h:769
n_Read
static FORCE_INLINE const char * n_Read(const char *s, number *a, const coeffs r)
!!! Recommendation: This method is too cryptic to be part of the user- !!! interface....
Definition coeffs.h:601
pa
static BOOLEAN pa(leftv res, leftv args)
Definition cohomo.cc:3770
j
int j
Definition facHensel.cc:110
myynest
VAR int myynest
Definition febase.cc:41
yyInRingConstruction
BOOLEAN yyInRingConstruction
Definition grammar.cc:172
ggetid
idhdl ggetid(const char *n)
Definition ipid.cc:581
basePack
VAR package basePack
Definition ipid.cc:56
currRingHdl
VAR idhdl currRingHdl
Definition ipid.cc:57
currPack
VAR package currPack
Definition ipid.cc:55
currPackHdl
VAR idhdl currPackHdl
Definition ipid.cc:53
IDFLAG
#define IDFLAG(a)
Definition ipid.h:120
IDID
#define IDID(a)
Definition ipid.h:122
IDLEV
#define IDLEV(a)
Definition ipid.h:121
IDTYP
#define IDTYP(a)
Definition ipid.h:119
IDATTR
#define IDATTR(a)
Definition ipid.h:123
pGetCoeff
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
Definition monomials.h:44
MAX_INT_LEN
const int MAX_INT_LEN
Definition mylimits.h:13
nInit
#define nInit(i)
Definition numbers.h:24
p_LmDelete
static void p_LmDelete(poly p, const ring r)
Definition p_polys.h:725
p_Totaldegree
static long p_Totaldegree(poly p, const ring r)
Definition p_polys.h:1528
pSetm
#define pSetm(p)
Definition polys.h:272
pIsConstant
#define pIsConstant(p)
like above, except that Comp must be 0
Definition polys.h:239
pmInit
#define pmInit(a, b)
Definition polys.h:290
pLmFree
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
Definition polys.h:71
pSetExp
#define pSetExp(p, i, v)
Definition polys.h:43
pOne
#define pOne()
Definition polys.h:316
r_IsRingVar
int r_IsRingVar(const char *n, char **names, int N)
Definition ring.cc:213
idhdl
idrec * idhdl
Definition ring.h:22
sLastPrinted
INST_VAR sleftv sLastPrinted
Definition subexpr.cc:46
siq
VAR BOOLEAN siq
Definition subexpr.cc:48

## syMakeMonom()

void syMakeMonom | ( | leftv | v,
|  | const char * | id )

Definition at line 1917 of file subexpr.cc.

{
if (!isdigit(id[0]))
{
Print("non-digit:%s\n",id);
}
/* resolv an identifier: (to DEF_CMD, if siq>0)
* 6) monom (resp. number), local ring
* 7) monom (resp. number), non-local ring
* 10) everything else is of type 0
*/
#ifdef TEST
if ((*id<' ')||(*id>(char)126))
{
Print("wrong id :%s:\n",id);
}
#endif
idhdl save_ring=currRingHdl;
v->Init();
v->req_packhdl = currPack;
#ifdef SIQ
if (siq<=0)
#endif
{
/* 6. local ring: number/poly */
BOOLEAN ok=FALSE;
poly p = pmInit(id,ok);
if (ok)
{
if (p==NULL)
{
v->data = (void *)nInit(0);
v->rtyp = NUMBER_CMD;
#ifdef HAVE_PLURAL
// in this case we may have monomials equal to 0 in p_Read
if (rIsPluralRing(currRing)) v->name = omStrDup(id);
#endif
}
else if (pIsConstant(p))
{
v->data = pGetCoeff(p);
pGetCoeff(p)=NULL;
pLmFree(p);
v->rtyp = NUMBER_CMD;
}
else
{
v->name = omStrDup(id);
#ifdef HAVE_SHIFTBBA
if ((currRing->isLPring!=0)
&& (p_Totaldegree(p,currRing)>1))
{
p_LmDelete(&p,currRing);
/* v->rtyp = UNKNOWN; - already set */
return; /* error, report "unknown id" */
}
#endif
v->data = p;
v->rtyp = POLY_CMD;
}
return;
}
}
#ifdef SIQ
else
{
v->rtyp=DEF_CMD;
}
#endif
/* 9: _ */
if (strcmp(id,"_")==0)
{
v->Copy(&sLastPrinted);
}
else
{
/* 10: everything else */
/* v->rtyp = UNKNOWN;*/
v->name = omStrDup(id);
}
currRingHdl=save_ring;
}
rIsPluralRing
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition ring.h:406

## Variable Documentation

## libstack_bin

VAR omBin libstack_bin = omGetSpecBin(sizeof(libstack))

Definition at line 43 of file subexpr.cc.

## procinfo_bin

VAR omBin procinfo_bin = omGetSpecBin(sizeof(procinfo))

Definition at line 42 of file subexpr.cc.

## siq

VAR BOOLEAN siq =FALSE

Definition at line 48 of file subexpr.cc.

## size_two_bin

STATIC_VAR omBin size_two_bin = omGetSpecBin(2)

Definition at line 44 of file subexpr.cc.

## sLastPrinted

INST_VAR sleftv sLastPrinted

Definition at line 46 of file subexpr.cc.

## sleftv_bin

VAR omBin sleftv_bin = omGetSpecBin(sizeof(sleftv))

Definition at line 41 of file subexpr.cc.

## sSubexpr_bin

VAR omBin sSubexpr_bin = omGetSpecBin(sizeof(_ssubexpr))

Definition at line 40 of file subexpr.cc.