Functions | Variables
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/subexpr.h>
#include <Singular/blackbox.h>
#include <Singular/number2.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <unistd.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)
 
void * slInternalCopy (leftv source, const int t, void *d, Subexpr e)
 
BOOLEAN assumeStdFlag (leftv h)
 
void syMake (leftv v, const char *id, idhdl packhdl)
 
const char * iiSleftv2name (leftv v)
 

Variables

omBin sSubexpr_bin = omGetSpecBin(sizeof(_ssubexpr))
 
omBin sleftv_bin = omGetSpecBin(sizeof(sleftv))
 
omBin procinfo_bin = omGetSpecBin(sizeof(procinfo))
 
omBin libstack_bin = omGetSpecBin(sizeof(libstack))
 
static omBin size_two_bin = omGetSpecBin(2)
 
sleftv sLastPrinted
 
const char sNoName [] ="_"
 
BOOLEAN siq =FALSE
 
static snumber2 iiNumber2Data [4]
 
static int iiCmatrix_index =0
 

Function Documentation

BOOLEAN assumeStdFlag ( leftv  h)

Definition at line 1428 of file subexpr.cc.

1429 {
1430  if (h->e!=NULL)
1431  {
1432  leftv hh=h->LData();
1433  if (h!=hh) return assumeStdFlag(h->LData());
1434  }
1435  if (!hasFlag(h,FLAG_STD))
1436  {
1437  if (!TEST_VERB_NSB)
1438  {
1439  if (TEST_V_ALLWARN)
1440  Warn("%s is no standard basis in >>%s<<",h->Name(),my_yylinebuf);
1441  else
1442  Warn("%s is no standard basis",h->Name());
1443  }
1444  return FALSE;
1445  }
1446  return TRUE;
1447 }
#define TEST_VERB_NSB
Definition: options.h:129
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Subexpr e
Definition: subexpr.h:106
#define FALSE
Definition: auxiliary.h:140
#define TRUE
Definition: auxiliary.h:144
const char * Name()
Definition: subexpr.h:121
char my_yylinebuf[80]
Definition: febase.cc:48
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1428
#define FLAG_STD
Definition: ipid.h:108
#define NULL
Definition: omList.c:10
#define hasFlag(A, F)
Definition: ipid.h:111
leftv LData()
Definition: subexpr.cc:1360
#define TEST_V_ALLWARN
Definition: options.h:135
#define Warn
Definition: emacs.cc:80
const char* iiSleftv2name ( leftv  v)

Definition at line 1907 of file subexpr.cc.

1908 {
1909  return(v->name);
1910 }
const char * name
Definition: subexpr.h:88
static void* s_internalCopy ( const int  t,
void *  d 
)
inlinestatic

Definition at line 381 of file subexpr.cc.

382 {
383  switch (t)
384  {
385 #ifdef SINGULAR_4_1
386  case CRING_CMD:
387  {
388  coeffs cf=(coeffs)d;
389  cf->ref++;
390  return (void*)d;
391  }
392  case CNUMBER_CMD:
393  return (void*)n2Copy((number2)d);
394  case CMATRIX_CMD: // like BIGINTMAT
395 #endif
396  case BIGINTMAT_CMD:
397  return (void*)bimCopy((bigintmat *)d);
398  case INTVEC_CMD:
399  case INTMAT_CMD:
400  return (void *)ivCopy((intvec *)d);
401  case MATRIX_CMD:
402  return (void *)mp_Copy((matrix)d, currRing);
403  case IDEAL_CMD:
404  case MODUL_CMD:
405  return (void *)idCopy((ideal)d);
406  case STRING_CMD:
407  return (void *)omStrDup((char *)d);
408  case PACKAGE_CMD:
409  return (void *)paCopy((package) d);
410  case PROC_CMD:
411  return (void *)piCopy((procinfov) d);
412  case POLY_CMD:
413  case VECTOR_CMD:
414  return (void *)pCopy((poly)d);
415  case INT_CMD:
416  return d;
417  case NUMBER_CMD:
418  return (void *)nCopy((number)d);
419  case BIGINT_CMD:
420  return (void *)n_Copy((number)d, coeffs_BIGINT);
421  case MAP_CMD:
422  return (void *)maCopy((map)d, currRing);
423  case LIST_CMD:
424  return (void *)lCopy((lists)d);
425  case LINK_CMD:
426  return (void *)slCopy((si_link) d);
427  case RING_CMD:
428  case QRING_CMD:
429  {
430  ring r=(ring)d;
431  if (r!=NULL) r->ref++;
432  //Print("+ ring %d, ref %d\n",r,r->ref);
433  return d;
434  }
435  case RESOLUTION_CMD:
436  return (void*)syCopy((syStrategy)d);
437  case DEF_CMD:
438  case NONE:
439  case 0: /* type in error case */
440  break; /* error recovery: do nothing */
441  //case COMMAND:
442  default:
443  {
444  if (t>MAX_TOK)
445  {
446  blackbox *b=getBlackboxStuff(t);
447  if (b!=NULL) return b->blackbox_Copy(b,d);
448  return NULL;
449  }
450  else
451  Warn("s_internalCopy: cannot copy type %s(%d)",
452  Tok2Cmdname(t),t);
453  }
454  }
455  return NULL;
456 }
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:400
ip_package * package
Definition: structs.h:46
Definition: tok.h:85
Definition: lists.h:22
Definition: tok.h:42
Matrices of numbers.
Definition: bigintmat.h:32
Definition: tok.h:167
const ideal
Definition: gb_hack.h:42
intvec * ivCopy(const intvec *o)
Definition: intvec.h:132
procinfov piCopy(procinfov pi)
Definition: subexpr.h:149
coeffs coeffs_BIGINT
Definition: ipid.cc:53
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: tok.h:56
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:16
bigintmat * bimCopy(const bigintmat *b)
same as copy constructor - apart from it being able to accept NULL as input
Definition: bigintmat.cc:403
Definition: tok.h:58
polyrec * poly
Definition: hilb.h:10
The main handler for Singular numbers which are suitable for Singular polynomials.
package paCopy(package pack)
Definition: ipid.h:45
Definition: tok.h:88
lists lCopy(lists L)
Definition: lists.cc:32
number2 n2Copy(const number2 d)
Definition: number2.cc:270
CanonicalForm cf
Definition: cfModGcd.cc:4024
Definition: tok.h:95
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
Definition: coeffs.h:451
syStrategy syCopy(syStrategy syzstr)
Definition: syz1.cc:1895
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:128
#define nCopy(n)
Definition: numbers.h:15
Definition: tok.h:96
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:74
ideal idCopy(ideal A, const ring R=currRing)
Definition: ideals.h:76
map maCopy(map theMap, const ring r)
Definition: maps.cc:38
Definition: tok.h:126
const poly b
Definition: syzextra.cc:213
#define NONE
Definition: tok.h:170
#define pCopy(p)
return a copy of the poly
Definition: polys.h:156
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:20
#define Warn
Definition: emacs.cc:80
#define omStrDup(s)
Definition: omAllocDecl.h:263
void s_internalDelete ( const int  t,
void *  d,
const ring  r 
)

Definition at line 458 of file subexpr.cc.

459 {
460  assume(d!=NULL);
461  switch (t)
462  {
463 #ifdef SINGULAR_4_1
464  case CRING_CMD:
465  nKillChar((coeffs)d);
466  break;
467  case CNUMBER_CMD:
468  {
469  number2 n=(number2)d;
470  n2Delete(n);
471  break;
472  }
473  case CMATRIX_CMD: //like BIGINTMAT
474 #endif
475  case BIGINTMAT_CMD:
476  {
477  bigintmat *v=(bigintmat*)d;
478  delete v;
479  break;
480  }
481  case INTVEC_CMD:
482  case INTMAT_CMD:
483  {
484  intvec *v=(intvec*)d;
485  delete v;
486  break;
487  }
488  case MAP_CMD:
489  {
490  map m=(map)d;
491  omFreeBinAddr((ADDRESS)m->preimage);
492  m->preimage=NULL;
493  /* no break: continue as IDEAL*/
494  }
495  case MATRIX_CMD:
496  case IDEAL_CMD:
497  case MODUL_CMD:
498  {
499  ideal i=(ideal)d;
500  id_Delete(&i,r);
501  break;
502  }
503  case STRING_CMD:
504  omFree(d);
505  break;
506  //case PACKAGE_CMD:
507  // return (void *)paCopy((package) d);
508  case PROC_CMD:
509  piKill((procinfo*)d);
510  break;
511  case POLY_CMD:
512  case VECTOR_CMD:
513  {
514  poly p=(poly)d;
515  p_Delete(&p,r);
516  break;
517  }
518  case NUMBER_CMD:
519  {
520  number n=(number)d;
521  n_Delete(&n,r);
522  break;
523  }
524  case BIGINT_CMD:
525  {
526  number n=(number)d;
528  break;
529  }
530  case LIST_CMD:
531  {
532  lists l=(lists)d;
533  l->Clean(r);
534  break;
535  }
536  case LINK_CMD:
537  {
538  si_link l=(si_link)d;
539  slKill(l);
540  break;
541  }
542  case RING_CMD:
543  case QRING_CMD:
544  {
545  ring R=(ring)d;
546  if ((R!=currRing)||(R->ref>=0))
547  rKill(R);
548  #ifdef TEST
549  else
550  Print("currRing? ref=%d\n",R->ref);
551  #endif
552  break;
553  }
554  case RESOLUTION_CMD:
555  {
557  if (s!=NULL) syKillComputation(s,r);
558  break;
559  }
560  case COMMAND:
561  {
562  command cmd=(command)d;
563  if (cmd->arg1.rtyp!=0) cmd->arg1.CleanUp(r);
564  if (cmd->arg2.rtyp!=0) cmd->arg2.CleanUp(r);
565  if (cmd->arg3.rtyp!=0) cmd->arg3.CleanUp(r);
567  break;
568  }
569  case INT_CMD:
570  case DEF_CMD:
571  case ALIAS_CMD:
572  case PACKAGE_CMD:
573  case IDHDL:
574  case NONE:
575  case ANY_TYPE:
576  case VECHO:
577  case VPRINTLEVEL:
578  case VCOLMAX:
579  case VTIMER:
580  case VRTIMER:
581  case VOICE:
582  case VMAXDEG:
583  case VMAXMULT:
584  case TRACE:
585  case VSHORTOUT:
586  case VNOETHER:
587  case VMINPOLY:
588  case LIB_CMD:
589  case 0: /* type in error case */
590  break; /* error recovery: do nothing */
591  //case COMMAND:
592  //case COMMAND:
593  default:
594  {
595  if (t>MAX_TOK)
596  {
597  blackbox *b=getBlackboxStuff(t);
598  if (b!=NULL) b->blackbox_destroy(b,d);
599  break;
600  }
601  else
602  Warn("s_internalDelete: cannot delete type %s(%d)",
603  Tok2Cmdname(t),t);
604  }
605  }
606 }
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:400
Definition: tok.h:161
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: tok.h:157
ip_command * command
Definition: ipid.h:24
#define ANY_TYPE
Definition: tok.h:34
#define Print
Definition: emacs.cc:83
Definition: tok.h:85
Definition: tok.h:158
Definition: lists.h:22
Definition: tok.h:42
return P p
Definition: myNF.cc:203
Matrices of numbers.
Definition: bigintmat.h:32
void n2Delete(number2 &d)
Definition: number2.cc:285
Definition: tok.h:167
const ideal
Definition: gb_hack.h:42
const CanonicalForm CFMap CFMap int &both_non_zero int n
Definition: cfEzgcd.cc:52
void id_Delete(ideal *h, ring r)
void * ADDRESS
Definition: auxiliary.h:161
coeffs coeffs_BIGINT
Definition: ipid.cc:53
BOOLEAN piKill(procinfov pi)
Definition: ipid.cc:644
#define IDHDL
Definition: tok.h:35
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: tok.h:162
Definition: tok.h:56
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:16
void rKill(ring r)
Definition: ipshell.cc:5815
Definition: tok.h:58
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
#define omFree(addr)
Definition: omAllocDecl.h:261
polyrec * poly
Definition: hilb.h:10
#define assume(x)
Definition: mod2.h:405
The main handler for Singular numbers which are suitable for Singular polynomials.
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:160
Definition: tok.h:88
Definition: tok.h:38
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:850
Definition: tok.h:163
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
Definition: tok.h:95
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
omBin sip_command_bin
Definition: ipid.cc:48
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:128
#define R
Definition: sirandom.c:26
void Clean(ring r=currRing)
Definition: lists.h:25
Definition: tok.h:96
Definition: tok.h:126
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Definition: coeffs.h:455
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
Definition: tok.h:159
const poly b
Definition: syzextra.cc:213
#define NONE
Definition: tok.h:170
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:477
void syKillComputation(syStrategy syzstr, ring r=currRing)
Definition: syz1.cc:1497
int l
Definition: cfEzgcd.cc:94
#define COMMAND
Definition: tok.h:33
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:20
ssyStrategy * syStrategy
Definition: syz.h:35
#define Warn
Definition: emacs.cc:80
void* slInternalCopy ( leftv  source,
const int  t,
void *  d,
Subexpr  e 
)

Definition at line 608 of file subexpr.cc.

609 {
610  if (t==STRING_CMD)
611  {
612  if ((e==NULL)
613  || (source->rtyp==LIST_CMD)
614  || ((source->rtyp==IDHDL)
615  &&((IDTYP((idhdl)source->data)==LIST_CMD)
616  || (IDTYP((idhdl)source->data)>MAX_TOK)))
617  || (source->rtyp>MAX_TOK))
618  return (void *)omStrDup((char *)d);
619  else if (e->next==NULL)
620  {
621  char *s=(char*)omAllocBin(size_two_bin);
622  s[0]=*(char *)d;
623  s[1]='\0';
624  return s;
625  }
626  #ifdef TEST
627  else
628  {
629  Werror("not impl. string-op in `%s`",my_yylinebuf);
630  return NULL;
631  }
632  #endif
633  }
634  return s_internalCopy(t,d);
635 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: tok.h:167
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:35
void * data
Definition: subexpr.h:89
#define IDTYP(a)
Definition: ipid.h:118
char my_yylinebuf[80]
Definition: febase.cc:48
static void * s_internalCopy(const int t, void *d)
Definition: subexpr.cc:381
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
Definition: tok.h:96
void Werror(const char *fmt,...)
Definition: reporter.cc:199
static omBin size_two_bin
Definition: subexpr.cc:53
#define omStrDup(s)
Definition: omAllocDecl.h:263
void syMake ( leftv  v,
const char *  id,
idhdl  packhdl 
)

Definition at line 1454 of file subexpr.cc.

1455 {
1456  /* resolv an identifier: (to DEF_CMD, if siq>0)
1457  * 1) reserved id: done by scanner
1458  * 2) `basering` / 'Current`
1459  * 3) existing identifier, local
1460  * 4) ringvar, ringpar, local ring
1461  * 5) existing identifier, global
1462  * 6) monom (resp. number), local ring: consisting of:
1463  * 6') ringvar, ringpar,global ring
1464  * 6'') monom (resp. number), local ring
1465  * 7) monom (resp. number), non-local ring
1466  * 8) basering
1467  * 9) `_`
1468  * 10) everything else is of type 0
1469  */
1470 #ifdef TEST
1471  if ((*id<' ')||(*id>(char)126))
1472  {
1473  Print("wrong id :%s:\n",id);
1474  }
1475 #endif
1476  idhdl save_ring=currRingHdl;
1477  v->Init();
1478  if(packhdl != NULL)
1479  {
1480  // Print("setting req_packhdl to %s\n",IDID(packhdl));
1481  v->req_packhdl = IDPACKAGE(packhdl);
1482  }
1483  else v->req_packhdl = currPack;
1484 // if (v->req_packhdl!=basePack)
1485 // Print("search %s in %s\n",id,v->req_packhdl->libname);
1486  idhdl h=NULL;
1487 #ifdef SIQ
1488  if (siq<=0)
1489 #endif
1490  {
1491  if (!isdigit(id[0]))
1492  {
1493  if (strcmp(id,"basering")==0)
1494  {
1495  if (currRingHdl!=NULL)
1496  {
1497  if (id!=IDID(currRingHdl)) omFreeBinAddr((ADDRESS)id);
1498  h=currRingHdl;
1499  goto id_found;
1500  }
1501  else
1502  {
1503  v->name = id;
1504  return; /* undefined */
1505  }
1506  }
1507  else if (strcmp(id,"Current")==0)
1508  {
1509  if (currPackHdl!=NULL)
1510  {
1511  omFreeBinAddr((ADDRESS)id);
1512  h=currPackHdl;
1513  goto id_found;
1514  }
1515  else
1516  {
1517  v->name = id;
1518  return; /* undefined */
1519  }
1520  }
1521  if(v->req_packhdl!=currPack)
1522  {
1523  h=v->req_packhdl->idroot->get(id,myynest);
1524  }
1525  else
1526  h=ggetid(id);
1527  /* 3) existing identifier, local */
1528  if ((h!=NULL) && (IDLEV(h)==myynest))
1529  {
1530  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1531  goto id_found;
1532  }
1533  }
1535  {
1536  currRingHdl=NULL;
1537  }
1538  /* 4. local ring: ringvar */
1539  if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest)
1540  /*&& (!yyInRingConstruction)*/)
1541  {
1542  int vnr;
1543  if ((vnr=r_IsRingVar(id, currRing->names,currRing->N))>=0)
1544  {
1545  poly p=pOne();
1546  pSetExp(p,vnr+1,1);
1547  pSetm(p);
1548  v->data = (void *)p;
1549  v->name = id;
1550  v->rtyp = POLY_CMD;
1551  return;
1552  }
1553  if((n_NumberOfParameters(currRing->cf)>0)
1554  &&((vnr=r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1555  n_NumberOfParameters(currRing->cf))>=0)))
1556  {
1557  BOOLEAN ok=FALSE;
1558  poly p = pmInit(id,ok);
1559  if (ok && (p!=NULL))
1560  {
1561  v->data = pGetCoeff(p);
1562  pGetCoeff(p)=NULL;
1563  pLmFree(p);
1564  v->rtyp = NUMBER_CMD;
1565  v->name = id;
1566  return;
1567  }
1568  }
1569  }
1570  /* 5. existing identifier, global */
1571  if (h!=NULL)
1572  {
1573  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1574  goto id_found;
1575  }
1576  /* 6. local ring: number/poly */
1577  if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest))
1578  {
1579  BOOLEAN ok=FALSE;
1580  /*poly p = (!yyInRingConstruction) ? pmInit(id,ok) : (poly)NULL;*/
1581  poly p = pmInit(id,ok);
1582  if (ok)
1583  {
1584  if (p==NULL)
1585  {
1586  v->data = (void *)nInit(0);
1587  v->rtyp = NUMBER_CMD;
1588  #ifdef HAVE_PLURAL
1589  // in this case we may have monomials equal to 0 in p_Read
1590  v->name = id;
1591  #else
1592  omFreeBinAddr((ADDRESS)id);
1593  #endif
1594  }
1595  else if (pIsConstant(p))
1596  {
1597  v->data = pGetCoeff(p);
1598  pGetCoeff(p)=NULL;
1599  pLmFree(p);
1600  v->rtyp = NUMBER_CMD;
1601  v->name = id;
1602  }
1603  else
1604  {
1605  v->data = p;
1606  v->rtyp = POLY_CMD;
1607  v->name = id;
1608  }
1609  return;
1610  }
1611  }
1612  /* 7. non-local ring: number/poly */
1613  {
1614  BOOLEAN ok=FALSE;
1615  poly p = ((currRing!=NULL) /* ring required */
1616  && (currRingHdl!=NULL)
1617  /*&& (!yyInRingConstruction) - not in decl */
1618  && (IDLEV(currRingHdl)!=myynest)) /* already in case 4/6 */
1619  ? pmInit(id,ok) : (poly)NULL;
1620  if (ok)
1621  {
1622  if (p==NULL)
1623  {
1624  v->data = (void *)nInit(0);
1625  v->rtyp = NUMBER_CMD;
1626  #ifdef HAVE_PLURAL
1627  // in this case we may have monomials equal to 0 in p_Read
1628  v->name = id;
1629  #else
1630  omFreeBinAddr((ADDRESS)id);
1631  #endif
1632  }
1633  else
1634  if (pIsConstant(p))
1635  {
1636  v->data = pGetCoeff(p);
1637  pGetCoeff(p)=NULL;
1638  pLmFree(p);
1639  v->rtyp = NUMBER_CMD;
1640  v->name = id;
1641  }
1642  else
1643  {
1644  v->data = p;
1645  v->rtyp = POLY_CMD;
1646  v->name = id;
1647  }
1648  //if (TEST_V_ALLWARN /*&& (myynest>0)*/
1649  //&& ((r_IsRingVar(id, currRing->names,currRing->N)>=0)
1650  // || ((n_NumberOfParameters(currRing->cf)>0)
1651  // &&(r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1652  // n_NumberOfParameters(currRing->cf))>=0))))
1653  //{
1654  //// WARNING: do not use ring variable names in procedures
1655  // Warn("use of variable >>%s<< in a procedure in line %s",id,my_yylinebuf);
1656  //}
1657  return;
1658  }
1659  }
1660  /* 8. basering ? */
1661  if ((myynest>1)&&(currRingHdl!=NULL))
1662  {
1663  if (strcmp(id,IDID(currRingHdl))==0)
1664  {
1665  if (IDID(currRingHdl)!=id) omFreeBinAddr((ADDRESS)id); /*assume strlen (id) <1000 */
1666  h=currRingHdl;
1667  goto id_found;
1668  }
1669  }
1670  if((v->req_packhdl!=basePack) && (v->req_packhdl==currPack))
1671  {
1672  h=basePack->idroot->get(id,myynest);
1673  if (h!=NULL)
1674  {
1675  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1676  v->req_packhdl=basePack;
1677  goto id_found;
1678  }
1679  }
1680  }
1681 #ifdef SIQ
1682  else
1683  v->rtyp=DEF_CMD;
1684 #endif
1685  /* 9: _ */
1686  if (strcmp(id,"_")==0)
1687  {
1688  omFreeBinAddr((ADDRESS)id);
1689  v->Copy(&sLastPrinted);
1690  }
1691  else
1692  {
1693  /* 10: everything else */
1694  /* v->rtyp = UNKNOWN;*/
1695  v->name = id;
1696  }
1697  currRingHdl=save_ring;
1698  return;
1699 id_found: // we have an id (in h) found, to set the data in from h
1700  if (IDTYP(h)!=ALIAS_CMD)
1701  {
1702  v->rtyp = IDHDL;
1703  v->flag = IDFLAG(h);
1704  v->attribute=IDATTR(h);
1705  }
1706  else
1707  {
1708  v->rtyp = ALIAS_CMD;
1709  }
1710  v->name = IDID(h);
1711  v->data = (char *)h;
1712  currRingHdl=save_ring;
1713 }
BOOLEAN yyInRingConstruction
Definition: grammar.cc:173
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
Definition: coeffs.h:794
#define pSetm(p)
Definition: polys.h:241
#define Print
Definition: emacs.cc:83
idhdl currPackHdl
Definition: ipid.cc:60
BITSET flag
Definition: subexpr.h:91
#define IDID(a)
Definition: ipid.h:121
#define pSetExp(p, i, v)
Definition: polys.h:42
#define FALSE
Definition: auxiliary.h:140
return P p
Definition: myNF.cc:203
BOOLEAN siq
Definition: subexpr.cc:58
void Init()
Definition: subexpr.h:108
void * ADDRESS
Definition: auxiliary.h:161
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
Definition: monomials.h:51
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:35
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
Definition: coeffs.h:790
void * data
Definition: subexpr.h:89
#define IDPACKAGE(a)
Definition: ipid.h:138
int myynest
Definition: febase.cc:46
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
#define IDTYP(a)
Definition: ipid.h:118
int r_IsRingVar(const char *n, char **names, int N)
Definition: ring.cc:222
Definition: tok.h:58
const char * name
Definition: subexpr.h:88
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
polyrec * poly
Definition: hilb.h:10
idhdl currRingHdl
Definition: ipid.cc:64
void Copy(leftv e)
Definition: subexpr.cc:637
#define pIsConstant(p)
like above, except that Comp might be != 0
Definition: polys.h:209
#define pOne()
Definition: polys.h:286
#define IDLEV(a)
Definition: ipid.h:120
Definition: tok.h:38
#define NULL
Definition: omList.c:10
package req_packhdl
Definition: subexpr.h:107
package basePack
Definition: ipid.cc:63
package currPack
Definition: ipid.cc:62
int rtyp
Definition: subexpr.h:92
sleftv sLastPrinted
Definition: subexpr.cc:55
#define IDFLAG(a)
Definition: ipid.h:119
#define pmInit(a, b)
Definition: polys.h:260
#define IDATTR(a)
Definition: ipid.h:122
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:70
attr attribute
Definition: subexpr.h:90
#define nInit(i)
Definition: numbers.h:24
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:131
idhdl ggetid(const char *n, BOOLEAN, idhdl *packhdl)
Definition: ipid.cc:487

Variable Documentation

int iiCmatrix_index =0
static

Definition at line 1089 of file subexpr.cc.

snumber2 iiNumber2Data[4]
static

Definition at line 1088 of file subexpr.cc.

omBin libstack_bin = omGetSpecBin(sizeof(libstack))

Definition at line 52 of file subexpr.cc.

omBin procinfo_bin = omGetSpecBin(sizeof(procinfo))

Definition at line 51 of file subexpr.cc.

BOOLEAN siq =FALSE

Definition at line 58 of file subexpr.cc.

omBin size_two_bin = omGetSpecBin(2)
static

Definition at line 53 of file subexpr.cc.

sleftv sLastPrinted

Definition at line 55 of file subexpr.cc.

omBin sleftv_bin = omGetSpecBin(sizeof(sleftv))

Definition at line 50 of file subexpr.cc.

const char sNoName[] ="_"

Definition at line 56 of file subexpr.cc.

omBin sSubexpr_bin = omGetSpecBin(sizeof(_ssubexpr))

Definition at line 49 of file subexpr.cc.