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, package pa)
 
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 1455 of file subexpr.cc.

1456 {
1457  if (h->e!=NULL)
1458  {
1459  leftv hh=h->LData();
1460  if (h!=hh) return assumeStdFlag(h->LData());
1461  }
1462  if (!hasFlag(h,FLAG_STD))
1463  {
1464  if (!TEST_VERB_NSB)
1465  {
1466  if (TEST_V_ALLWARN)
1467  Warn("%s is no standard basis in >>%s<<",h->Name(),my_yylinebuf);
1468  else
1469  Warn("%s is no standard basis",h->Name());
1470  }
1471  return FALSE;
1472  }
1473  return TRUE;
1474 }
#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:1455
#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:1387
#define TEST_V_ALLWARN
Definition: options.h:135
#define Warn
Definition: emacs.cc:80
const char* iiSleftv2name ( leftv  v)

Definition at line 1933 of file subexpr.cc.

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

Definition at line 401 of file subexpr.cc.

402 {
403  switch (t)
404  {
405 #ifdef SINGULAR_4_1
406  case CRING_CMD:
407  {
408  coeffs cf=(coeffs)d;
409  cf->ref++;
410  return (void*)d;
411  }
412  case CNUMBER_CMD:
413  return (void*)n2Copy((number2)d);
414  case CMATRIX_CMD: // like BIGINTMAT
415 #endif
416  case BIGINTMAT_CMD:
417  return (void*)bimCopy((bigintmat *)d);
418  case INTVEC_CMD:
419  case INTMAT_CMD:
420  return (void *)ivCopy((intvec *)d);
421  case MATRIX_CMD:
422  return (void *)mp_Copy((matrix)d, currRing);
423  case IDEAL_CMD:
424  case MODUL_CMD:
425  return (void *)idCopy((ideal)d);
426  case STRING_CMD:
427  return (void *)omStrDup((char *)d);
428  case PACKAGE_CMD:
429  return (void *)paCopy((package) d);
430  case PROC_CMD:
431  return (void *)piCopy((procinfov) d);
432  case POLY_CMD:
433  case VECTOR_CMD:
434  return (void *)pCopy((poly)d);
435  case INT_CMD:
436  return d;
437  case NUMBER_CMD:
438  return (void *)nCopy((number)d);
439  case BIGINT_CMD:
440  return (void *)n_Copy((number)d, coeffs_BIGINT);
441  case MAP_CMD:
442  return (void *)maCopy((map)d, currRing);
443  case LIST_CMD:
444  return (void *)lCopy((lists)d);
445  case LINK_CMD:
446  return (void *)slCopy((si_link) d);
447  case RING_CMD:
448  case QRING_CMD:
449  {
450  ring r=(ring)d;
451  if (r!=NULL) r->ref++;
452  //Print("+ ring %d, ref %d\n",r,r->ref);
453  return d;
454  }
455  case RESOLUTION_CMD:
456  return (void*)syCopy((syStrategy)d);
457  case DEF_CMD:
458  case NONE:
459  case 0: /* type in error case */
460  break; /* error recovery: do nothing */
461  //case COMMAND:
462  default:
463  {
464  if (t>MAX_TOK)
465  {
466  blackbox *b=getBlackboxStuff(t);
467  if (b!=NULL) return b->blackbox_Copy(b,d);
468  return NULL;
469  }
470  else
471  Warn("s_internalCopy: cannot copy type %s(%d)",
472  Tok2Cmdname(t),t);
473  }
474  }
475  return NULL;
476 }
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:98
Definition: lists.h:22
Definition: tok.h:42
Matrices of numbers.
Definition: bigintmat.h:51
Definition: tok.h:217
intvec * ivCopy(const intvec *o)
Definition: intvec.h:126
procinfov piCopy(procinfov pi)
Definition: subexpr.h:149
coeffs coeffs_BIGINT
Definition: ipid.cc:54
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:12
Definition: tok.h:59
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
bigintmat * bimCopy(const bigintmat *b)
same as copy constructor - apart from it being able to accept NULL as input
Definition: bigintmat.cc:408
Definition: tok.h:61
The main handler for Singular numbers which are suitable for Singular polynomials.
package paCopy(package pack)
Definition: ipid.h:45
lists lCopy(lists L)
Definition: lists.cc:32
ideal idCopy(ideal A)
Definition: ideals.h:73
number2 n2Copy(const number2 d)
Definition: number2.cc:270
CanonicalForm cf
Definition: cfModGcd.cc:4024
Definition: tok.h:119
#define NULL
Definition: omList.c:10
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of &#39;n&#39;
Definition: coeffs.h:452
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:120
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
Definition: matpol.cc:75
map maCopy(map theMap, const ring r)
Definition: maps.cc:38
Definition: tok.h:159
polyrec * poly
Definition: hilb.h:10
const poly b
Definition: syzextra.cc:213
#define NONE
Definition: tok.h:220
#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 478 of file subexpr.cc.

479 {
480  assume(d!=NULL);
481  switch (t)
482  {
483 #ifdef SINGULAR_4_1
484  case CRING_CMD:
485  nKillChar((coeffs)d);
486  break;
487  case CNUMBER_CMD:
488  {
489  number2 n=(number2)d;
490  n2Delete(n);
491  break;
492  }
493  case CMATRIX_CMD: //like BIGINTMAT
494 #endif
495  case BIGINTMAT_CMD:
496  {
497  bigintmat *v=(bigintmat*)d;
498  delete v;
499  break;
500  }
501  case INTVEC_CMD:
502  case INTMAT_CMD:
503  {
504  intvec *v=(intvec*)d;
505  delete v;
506  break;
507  }
508  case MAP_CMD:
509  {
510  map m=(map)d;
511  omFreeBinAddr((ADDRESS)m->preimage);
512  m->preimage=NULL;
513  /* no break: continue as IDEAL*/
514  }
515  case MATRIX_CMD:
516  case IDEAL_CMD:
517  case MODUL_CMD:
518  {
519  ideal i=(ideal)d;
520  id_Delete(&i,r);
521  break;
522  }
523  case STRING_CMD:
524  omFree(d);
525  break;
526  //case PACKAGE_CMD:
527  // return (void *)paCopy((package) d);
528  case PROC_CMD:
529  piKill((procinfo*)d);
530  break;
531  case POLY_CMD:
532  case VECTOR_CMD:
533  {
534  poly p=(poly)d;
535  p_Delete(&p,r);
536  break;
537  }
538  case NUMBER_CMD:
539  {
540  number n=(number)d;
541  n_Delete(&n,r);
542  break;
543  }
544  case BIGINT_CMD:
545  {
546  number n=(number)d;
548  break;
549  }
550  case LIST_CMD:
551  {
552  lists l=(lists)d;
553  l->Clean(r);
554  break;
555  }
556  case LINK_CMD:
557  {
558  si_link l=(si_link)d;
559  slKill(l);
560  break;
561  }
562  case RING_CMD:
563  case QRING_CMD:
564  {
565  ring R=(ring)d;
566  if ((R!=currRing)||(R->ref>=0))
567  rKill(R);
568  #ifdef TEST
569  else
570  Print("currRing? ref=%d\n",R->ref);
571  #endif
572  break;
573  }
574  case RESOLUTION_CMD:
575  {
577  if (s!=NULL) syKillComputation(s,r);
578  break;
579  }
580  case COMMAND:
581  {
582  command cmd=(command)d;
583  if (cmd->arg1.rtyp!=0) cmd->arg1.CleanUp(r);
584  if (cmd->arg2.rtyp!=0) cmd->arg2.CleanUp(r);
585  if (cmd->arg3.rtyp!=0) cmd->arg3.CleanUp(r);
587  break;
588  }
589  case INT_CMD:
590  case DEF_CMD:
591  case ALIAS_CMD:
592  case PACKAGE_CMD:
593  case IDHDL:
594  case NONE:
595  case ANY_TYPE:
596  case VECHO:
597  case VPRINTLEVEL:
598  case VCOLMAX:
599  case VTIMER:
600  case VRTIMER:
601  case VOICE:
602  case VMAXDEG:
603  case VMAXMULT:
604  case TRACE:
605  case VSHORTOUT:
606  case VNOETHER:
607  case VMINPOLY:
608  case LIB_CMD:
609  case 0: /* type in error case */
610  break; /* error recovery: do nothing */
611  //case COMMAND:
612  //case COMMAND:
613  default:
614  {
615  if (t>MAX_TOK)
616  {
617  blackbox *b=getBlackboxStuff(t);
618  if (b!=NULL) b->blackbox_destroy(b,d);
619  break;
620  }
621  else
622  Warn("s_internalDelete: cannot delete type %s(%d)",
623  Tok2Cmdname(t),t);
624  }
625  }
626 }
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:211
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: tok.h:207
ip_command * command
Definition: ipid.h:24
#define ANY_TYPE
Definition: tok.h:34
#define Print
Definition: emacs.cc:83
Definition: tok.h:98
Definition: tok.h:208
Definition: lists.h:22
Definition: tok.h:42
return P p
Definition: myNF.cc:203
Matrices of numbers.
Definition: bigintmat.h:51
void n2Delete(number2 &d)
Definition: number2.cc:285
Definition: tok.h:217
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
void * ADDRESS
Definition: auxiliary.h:161
coeffs coeffs_BIGINT
Definition: ipid.cc:54
BOOLEAN piKill(procinfov pi)
Definition: ipid.cc:647
#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:212
Definition: tok.h:59
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
void rKill(ring r)
Definition: ipshell.cc:6057
Definition: tok.h:61
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
#define omFree(addr)
Definition: omAllocDecl.h:261
#define assume(x)
Definition: mod2.h:405
The main handler for Singular numbers which are suitable for Singular polynomials.
const ring R
Definition: DebugPrint.cc:36
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:210
Definition: tok.h:38
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:849
Definition: tok.h:213
const Variable & v
< [in] a sqrfree bivariate poly
Definition: facBivar.h:37
Definition: tok.h:119
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
omBin sip_command_bin
Definition: ipid.cc:49
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:128
void Clean(ring r=currRing)
Definition: lists.h:25
Definition: tok.h:120
Definition: tok.h:159
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:456
polyrec * poly
Definition: hilb.h:10
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
Definition: tok.h:209
const poly b
Definition: syzextra.cc:213
#define NONE
Definition: tok.h:220
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:488
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 628 of file subexpr.cc.

629 {
630  if (t==STRING_CMD)
631  {
632  if ((e==NULL)
633  || (source->rtyp==LIST_CMD)
634  || ((source->rtyp==IDHDL)
635  &&((IDTYP((idhdl)source->data)==LIST_CMD)
636  || (IDTYP((idhdl)source->data)>MAX_TOK)))
637  || (source->rtyp>MAX_TOK))
638  return (void *)omStrDup((char *)d);
639  else if (e->next==NULL)
640  {
641  char *s=(char*)omAllocBin(size_two_bin);
642  s[0]=*(char *)d;
643  s[1]='\0';
644  return s;
645  }
646  #ifdef TEST
647  else
648  {
649  Werror("not impl. string-op in `%s`",my_yylinebuf);
650  return NULL;
651  }
652  #endif
653  }
654  return s_internalCopy(t,d);
655 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
const CanonicalForm int s
Definition: facAbsFact.cc:55
Definition: tok.h:217
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:401
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:92
Definition: tok.h:120
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,
package  pa 
)

Definition at line 1481 of file subexpr.cc.

1482 {
1483  /* resolv an identifier: (to DEF_CMD, if siq>0)
1484  * 1) reserved id: done by scanner
1485  * 2) `basering` / 'Current`
1486  * 3) existing identifier, local
1487  * 4) ringvar, ringpar, local ring
1488  * 5) existing identifier, global
1489  * 6) monom (resp. number), local ring: consisting of:
1490  * 6') ringvar, ringpar,global ring
1491  * 6'') monom (resp. number), local ring
1492  * 7) monom (resp. number), non-local ring
1493  * 8) basering
1494  * 9) `_`
1495  * 10) everything else is of type 0
1496  */
1497 #ifdef TEST
1498  if ((*id<' ')||(*id>(char)126))
1499  {
1500  Print("wrong id :%s:\n",id);
1501  }
1502 #endif
1503  idhdl save_ring=currRingHdl;
1504  v->Init();
1505  if(pa != NULL)
1506  {
1507  v->req_packhdl = pa;
1508  }
1509  else v->req_packhdl = currPack;
1510 // if (v->req_packhdl!=basePack)
1511 // Print("search %s in %s\n",id,v->req_packhdl->libname);
1512  idhdl h=NULL;
1513 #ifdef SIQ
1514  if (siq<=0)
1515 #endif
1516  {
1517  if (!isdigit(id[0]))
1518  {
1519  if (strcmp(id,"basering")==0)
1520  {
1521  if (currRingHdl!=NULL)
1522  {
1523  if (id!=IDID(currRingHdl)) omFreeBinAddr((ADDRESS)id);
1524  h=currRingHdl;
1525  goto id_found;
1526  }
1527  else
1528  {
1529  v->name = id;
1530  return; /* undefined */
1531  }
1532  }
1533  else if (strcmp(id,"Current")==0)
1534  {
1535  if (currPackHdl!=NULL)
1536  {
1537  omFreeBinAddr((ADDRESS)id);
1538  h=currPackHdl;
1539  goto id_found;
1540  }
1541  else
1542  {
1543  v->name = id;
1544  return; /* undefined */
1545  }
1546  }
1547  if(v->req_packhdl!=currPack)
1548  {
1549  h=v->req_packhdl->idroot->get(id,myynest);
1550  }
1551  else
1552  h=ggetid(id);
1553  /* 3) existing identifier, local */
1554  if ((h!=NULL) && (IDLEV(h)==myynest))
1555  {
1556  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1557  goto id_found;
1558  }
1559  }
1561  {
1562  currRingHdl=NULL;
1563  }
1564  /* 4. local ring: ringvar */
1565  if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest)
1566  /*&& (!yyInRingConstruction)*/)
1567  {
1568  int vnr;
1569  if ((vnr=r_IsRingVar(id, currRing->names,currRing->N))>=0)
1570  {
1571  poly p=pOne();
1572  pSetExp(p,vnr+1,1);
1573  pSetm(p);
1574  v->data = (void *)p;
1575  v->name = id;
1576  v->rtyp = POLY_CMD;
1577  return;
1578  }
1579  if((n_NumberOfParameters(currRing->cf)>0)
1580  &&((vnr=r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1581  n_NumberOfParameters(currRing->cf))>=0)))
1582  {
1583  BOOLEAN ok=FALSE;
1584  poly p = pmInit(id,ok);
1585  if (ok && (p!=NULL))
1586  {
1587  v->data = pGetCoeff(p);
1588  pGetCoeff(p)=NULL;
1589  pLmFree(p);
1590  v->rtyp = NUMBER_CMD;
1591  v->name = id;
1592  return;
1593  }
1594  }
1595  }
1596  /* 5. existing identifier, global */
1597  if (h!=NULL)
1598  {
1599  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1600  goto id_found;
1601  }
1602  /* 6. local ring: number/poly */
1603  if ((currRingHdl!=NULL) && (IDLEV(currRingHdl)==myynest))
1604  {
1605  BOOLEAN ok=FALSE;
1606  /*poly p = (!yyInRingConstruction) ? pmInit(id,ok) : (poly)NULL;*/
1607  poly p = pmInit(id,ok);
1608  if (ok)
1609  {
1610  if (p==NULL)
1611  {
1612  v->data = (void *)nInit(0);
1613  v->rtyp = NUMBER_CMD;
1614  #ifdef HAVE_PLURAL
1615  // in this case we may have monomials equal to 0 in p_Read
1616  v->name = id;
1617  #else
1618  omFreeBinAddr((ADDRESS)id);
1619  #endif
1620  }
1621  else if (pIsConstant(p))
1622  {
1623  v->data = pGetCoeff(p);
1624  pGetCoeff(p)=NULL;
1625  pLmFree(p);
1626  v->rtyp = NUMBER_CMD;
1627  v->name = id;
1628  }
1629  else
1630  {
1631  v->data = p;
1632  v->rtyp = POLY_CMD;
1633  v->name = id;
1634  }
1635  return;
1636  }
1637  }
1638  /* 7. non-local ring: number/poly */
1639  {
1640  BOOLEAN ok=FALSE;
1641  poly p = ((currRing!=NULL) /* ring required */
1642  && (currRingHdl!=NULL)
1643  /*&& (!yyInRingConstruction) - not in decl */
1644  && (IDLEV(currRingHdl)!=myynest)) /* already in case 4/6 */
1645  ? pmInit(id,ok) : (poly)NULL;
1646  if (ok)
1647  {
1648  if (p==NULL)
1649  {
1650  v->data = (void *)nInit(0);
1651  v->rtyp = NUMBER_CMD;
1652  #ifdef HAVE_PLURAL
1653  // in this case we may have monomials equal to 0 in p_Read
1654  v->name = id;
1655  #else
1656  omFreeBinAddr((ADDRESS)id);
1657  #endif
1658  }
1659  else
1660  if (pIsConstant(p))
1661  {
1662  v->data = pGetCoeff(p);
1663  pGetCoeff(p)=NULL;
1664  pLmFree(p);
1665  v->rtyp = NUMBER_CMD;
1666  v->name = id;
1667  }
1668  else
1669  {
1670  v->data = p;
1671  v->rtyp = POLY_CMD;
1672  v->name = id;
1673  }
1674  //if (TEST_V_ALLWARN /*&& (myynest>0)*/
1675  //&& ((r_IsRingVar(id, currRing->names,currRing->N)>=0)
1676  // || ((n_NumberOfParameters(currRing->cf)>0)
1677  // &&(r_IsRingVar(id, (char**)n_ParameterNames(currRing->cf),
1678  // n_NumberOfParameters(currRing->cf))>=0))))
1679  //{
1680  //// WARNING: do not use ring variable names in procedures
1681  // Warn("use of variable >>%s<< in a procedure in line %s",id,my_yylinebuf);
1682  //}
1683  return;
1684  }
1685  }
1686  /* 8. basering ? */
1687  if ((myynest>1)&&(currRingHdl!=NULL))
1688  {
1689  if (strcmp(id,IDID(currRingHdl))==0)
1690  {
1691  if (IDID(currRingHdl)!=id) omFreeBinAddr((ADDRESS)id); /*assume strlen (id) <1000 */
1692  h=currRingHdl;
1693  goto id_found;
1694  }
1695  }
1696  if((v->req_packhdl!=basePack) && (v->req_packhdl==currPack))
1697  {
1698  h=basePack->idroot->get(id,myynest);
1699  if (h!=NULL)
1700  {
1701  if (id!=IDID(h)) omFreeBinAddr((ADDRESS)id); /*assume strlen(id) <1000 */
1702  v->req_packhdl=basePack;
1703  goto id_found;
1704  }
1705  }
1706  }
1707 #ifdef SIQ
1708  else
1709  v->rtyp=DEF_CMD;
1710 #endif
1711  /* 9: _ */
1712  if (strcmp(id,"_")==0)
1713  {
1714  omFreeBinAddr((ADDRESS)id);
1715  v->Copy(&sLastPrinted);
1716  }
1717  else
1718  {
1719  /* 10: everything else */
1720  /* v->rtyp = UNKNOWN;*/
1721  v->name = id;
1722  }
1723  currRingHdl=save_ring;
1724  return;
1725 id_found: // we have an id (in h) found, to set the data in from h
1726  if (IDTYP(h)!=ALIAS_CMD)
1727  {
1728  v->rtyp = IDHDL;
1729  v->flag = IDFLAG(h);
1730  v->attribute=IDATTR(h);
1731  }
1732  else
1733  {
1734  v->rtyp = ALIAS_CMD;
1735  }
1736  v->name = IDID(h);
1737  v->data = (char *)h;
1738  currRingHdl=save_ring;
1739 }
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:801
#define pSetm(p)
Definition: polys.h:241
#define Print
Definition: emacs.cc:83
idhdl currPackHdl
Definition: ipid.cc:61
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:797
void * data
Definition: subexpr.h:89
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:61
const char * name
Definition: subexpr.h:88
#define omFreeBinAddr(addr)
Definition: omAllocDecl.h:258
idhdl currRingHdl
Definition: ipid.cc:65
void Copy(leftv e)
Definition: subexpr.cc:657
#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:64
package currPack
Definition: ipid.cc:63
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
polyrec * poly
Definition: hilb.h:10
#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:490

Variable Documentation

int iiCmatrix_index =0
static

Definition at line 1116 of file subexpr.cc.

snumber2 iiNumber2Data[4]
static

Definition at line 1115 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.