Macros | Functions
ipassign.cc File Reference
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include <kernel/mod2.h>
#include <omalloc/omalloc.h>
#include <polys/ext_fields/transext.h>
#include <misc/options.h>
#include <misc/intvec.h>
#include <coeffs/coeffs.h>
#include <coeffs/numbers.h>
#include <coeffs/bigintmat.h>
#include <polys/ext_fields/algext.h>
#include <polys/monomials/ring.h>
#include <polys/matpol.h>
#include <polys/monomials/maps.h>
#include <polys/nc/nc.h>
#include <polys/nc/sca.h>
#include <polys/prCopy.h>
#include <kernel/polys.h>
#include <kernel/ideals.h>
#include <kernel/GBEngine/kstd1.h>
#include <kernel/oswrapper/timer.h>
#include <kernel/combinatorics/stairc.h>
#include <kernel/GBEngine/syz.h>
#include "tok.h"
#include "ipid.h"
#include "idrec.h"
#include "subexpr.h"
#include "lists.h"
#include "ipconv.h"
#include "attrib.h"
#include "links/silink.h"
#include "ipshell.h"
#include "blackbox.h"
#include "Singular/number2.h"
#include "table.h"

Go to the source code of this file.

Macros

#define TRANSEXT_PRIVATES
 
#define IPASSIGN
 
#define D(A)   A
 
#define NULL_VAL   NULL
 

Functions

static BOOLEAN jjECHO (leftv, leftv a)
 
static BOOLEAN jjPRINTLEVEL (leftv, leftv a)
 
static BOOLEAN jjCOLMAX (leftv, leftv a)
 
static BOOLEAN jjTIMER (leftv, leftv a)
 
static BOOLEAN jjRTIMER (leftv, leftv a)
 
static BOOLEAN jjMAXDEG (leftv, leftv a)
 
static BOOLEAN jjMAXMULT (leftv, leftv a)
 
static BOOLEAN jjTRACE (leftv, leftv a)
 
static BOOLEAN jjSHORTOUT (leftv, leftv a)
 
static void jjMINPOLY_red (idhdl h)
 
static BOOLEAN jjMINPOLY (leftv, leftv a)
 
static BOOLEAN jjNOETHER (leftv, leftv a)
 
static void jiAssignAttr (leftv l, leftv r)
 
static BOOLEAN jiA_INT (leftv res, leftv a, Subexpr e)
 
static BOOLEAN jiA_NUMBER (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_NUMBER2 (leftv res, leftv a, Subexpr e)
 
static BOOLEAN jiA_NUMBER2_I (leftv res, leftv a, Subexpr e)
 
static BOOLEAN jiA_NUMBER2_N (leftv res, leftv a, Subexpr e)
 
static BOOLEAN jiA_BIGINT (leftv res, leftv a, Subexpr e)
 
static BOOLEAN jiA_LIST_RES (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_LIST (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_POLY (leftv res, leftv a, Subexpr e)
 
static BOOLEAN jiA_1x1INTMAT (leftv res, leftv a, Subexpr e)
 
static BOOLEAN jiA_1x1MATRIX (leftv res, leftv a, Subexpr e)
 
static BOOLEAN jiA_STRING (leftv res, leftv a, Subexpr e)
 
static BOOLEAN jiA_PROC (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_INTVEC (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_BIGINTMAT (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_IDEAL (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_RESOLUTION (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_MODUL_P (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_IDEAL_M (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_LINK (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_MAP (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_MAP_ID (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_QRING (leftv res, leftv a, Subexpr e)
 
static BOOLEAN jiA_RING (leftv res, leftv a, Subexpr e)
 
static BOOLEAN jiA_PACKAGE (leftv res, leftv a, Subexpr)
 
static BOOLEAN jiA_DEF (leftv res, leftv, Subexpr)
 
static BOOLEAN jiA_CRING (leftv res, leftv a, Subexpr e)
 
static BOOLEAN jiAssign_1 (leftv l, leftv r, BOOLEAN toplevel)
 
static BOOLEAN iiAssign_sys (leftv l, leftv r)
 
static BOOLEAN jiA_INTVEC_L (leftv l, leftv r)
 
static BOOLEAN jiA_VECTOR_L (leftv l, leftv r)
 
static BOOLEAN jjA_L_LIST (leftv l, leftv r)
 
static BOOLEAN jjA_L_INTVEC (leftv l, leftv r, intvec *iv)
 
static BOOLEAN jjA_L_BIGINTMAT (leftv l, leftv r, bigintmat *bim)
 
static BOOLEAN jjA_L_STRING (leftv l, leftv r)
 
static BOOLEAN jiA_MATRIX_L (leftv l, leftv r)
 
static BOOLEAN jiA_STRING_L (leftv l, leftv r)
 
static BOOLEAN jiAssign_list (leftv l, leftv r)
 
static BOOLEAN jiAssign_rec (leftv l, leftv r)
 
BOOLEAN iiAssign (leftv l, leftv r, BOOLEAN toplevel)
 
void jjNormalizeQRingId (leftv I)
 
void jjNormalizeQRingP (poly &p)
 
BOOLEAN jjIMPORTFROM (leftv, leftv u, leftv v)
 

Macro Definition Documentation

§ D

#define D (   A)    A

Definition at line 1066 of file ipassign.cc.

§ IPASSIGN

#define IPASSIGN

Definition at line 1065 of file ipassign.cc.

§ NULL_VAL

#define NULL_VAL   NULL

Definition at line 1067 of file ipassign.cc.

§ TRANSEXT_PRIVATES

#define TRANSEXT_PRIVATES

Definition at line 18 of file ipassign.cc.

Function Documentation

§ iiAssign()

BOOLEAN iiAssign ( leftv  l,
leftv  r,
BOOLEAN  toplevel 
)

Definition at line 1780 of file ipassign.cc.

1781 {
1782  if (errorreported) return TRUE;
1783  int ll=l->listLength();
1784  int rl;
1785  int lt=l->Typ();
1786  int rt=NONE;
1787  BOOLEAN b;
1788  if (l->rtyp==ALIAS_CMD)
1789  {
1790  Werror("`%s` is read-only",l->Name());
1791  }
1792 
1793  if (l->rtyp==IDHDL)
1794  {
1795  atKillAll((idhdl)l->data);
1796  IDFLAG((idhdl)l->data)=0;
1797  l->attribute=NULL;
1798  toplevel=FALSE;
1799  }
1800  else if (l->attribute!=NULL)
1801  atKillAll((idhdl)l);
1802  l->flag=0;
1803  if (ll==1)
1804  {
1805  /* l[..] = ... */
1806  if(l->e!=NULL)
1807  {
1808  BOOLEAN like_lists=0;
1809  blackbox *bb=NULL;
1810  int bt;
1811  if (((bt=l->rtyp)>MAX_TOK)
1812  || ((l->rtyp==IDHDL) && ((bt=IDTYP((idhdl)l->data))>MAX_TOK)))
1813  {
1814  bb=getBlackboxStuff(bt);
1815  like_lists=BB_LIKE_LIST(bb); // bb like a list
1816  }
1817  else if (((l->rtyp==IDHDL) && (IDTYP((idhdl)l->data)==LIST_CMD))
1818  || (l->rtyp==LIST_CMD))
1819  {
1820  like_lists=2; // bb in a list
1821  }
1822  if(like_lists)
1823  {
1824  if (traceit&TRACE_ASSIGN) PrintS("assign list[..]=...or similar\n");
1825  if (like_lists==1)
1826  {
1827  // check blackbox/newtype type:
1828  if(bb->blackbox_CheckAssign(bb,l,r)) return TRUE;
1829  }
1830  b=jiAssign_list(l,r);
1831  if((!b) && (like_lists==2))
1832  {
1833  //Print("jjA_L_LIST: - 2 \n");
1834  if((l->rtyp==IDHDL) && (l->data!=NULL))
1835  {
1836  ipMoveId((idhdl)l->data);
1837  l->attribute=IDATTR((idhdl)l->data);
1838  l->flag=IDFLAG((idhdl)l->data);
1839  }
1840  }
1841  r->CleanUp();
1842  Subexpr h;
1843  while (l->e!=NULL)
1844  {
1845  h=l->e->next;
1847  l->e=h;
1848  }
1849  return b;
1850  }
1851  }
1852  if (lt>MAX_TOK)
1853  {
1854  blackbox *bb=getBlackboxStuff(lt);
1855 #ifdef BLACKBOX_DEVEL
1856  Print("bb-assign: bb=%lx\n",bb);
1857 #endif
1858  return (bb==NULL) || bb->blackbox_Assign(l,r);
1859  }
1860  // end of handling elems of list and similar
1861  rl=r->listLength();
1862  if (rl==1)
1863  {
1864  /* system variables = ... */
1865  if(((l->rtyp>=VECHO)&&(l->rtyp<=VPRINTLEVEL))
1866  ||((l->rtyp>=VALTVARS)&&(l->rtyp<=VMINPOLY)))
1867  {
1868  b=iiAssign_sys(l,r);
1869  r->CleanUp();
1870  //l->CleanUp();
1871  return b;
1872  }
1873  rt=r->Typ();
1874  /* a = ... */
1875  if ((lt!=MATRIX_CMD)
1876  &&(lt!=BIGINTMAT_CMD)
1877  &&(lt!=CMATRIX_CMD)
1878  &&(lt!=INTMAT_CMD)
1879  &&((lt==rt)||(lt!=LIST_CMD)))
1880  {
1881  b=jiAssign_1(l,r,toplevel);
1882  if (l->rtyp==IDHDL)
1883  {
1884  if ((lt==DEF_CMD)||(lt==LIST_CMD))
1885  {
1886  ipMoveId((idhdl)l->data);
1887  }
1888  l->attribute=IDATTR((idhdl)l->data);
1889  l->flag=IDFLAG((idhdl)l->data);
1890  l->CleanUp();
1891  }
1892  r->CleanUp();
1893  return b;
1894  }
1895  if (((lt!=LIST_CMD)
1896  &&((rt==MATRIX_CMD)
1897  ||(rt==BIGINTMAT_CMD)
1898  ||(rt==CMATRIX_CMD)
1899  ||(rt==INTMAT_CMD)
1900  ||(rt==INTVEC_CMD)
1901  ||(rt==MODUL_CMD)))
1902  ||((lt==LIST_CMD)
1903  &&(rt==RESOLUTION_CMD))
1904  )
1905  {
1906  b=jiAssign_1(l,r,toplevel);
1907  if((l->rtyp==IDHDL)&&(l->data!=NULL))
1908  {
1909  if ((lt==DEF_CMD) || (lt==LIST_CMD))
1910  {
1911  //Print("ipAssign - 3.0\n");
1912  ipMoveId((idhdl)l->data);
1913  }
1914  l->attribute=IDATTR((idhdl)l->data);
1915  l->flag=IDFLAG((idhdl)l->data);
1916  }
1917  r->CleanUp();
1918  Subexpr h;
1919  while (l->e!=NULL)
1920  {
1921  h=l->e->next;
1923  l->e=h;
1924  }
1925  return b;
1926  }
1927  }
1928  if (rt==NONE) rt=r->Typ();
1929  }
1930  else if (ll==(rl=r->listLength()))
1931  {
1932  b=jiAssign_rec(l,r);
1933  return b;
1934  }
1935  else
1936  {
1937  if (rt==NONE) rt=r->Typ();
1938  if (rt==INTVEC_CMD)
1939  return jiA_INTVEC_L(l,r);
1940  else if (rt==VECTOR_CMD)
1941  return jiA_VECTOR_L(l,r);
1942  else if ((rt==IDEAL_CMD)||(rt==MATRIX_CMD))
1943  return jiA_MATRIX_L(l,r);
1944  else if ((rt==STRING_CMD)&&(rl==1))
1945  return jiA_STRING_L(l,r);
1946  Werror("length of lists in assignment does not match (l:%d,r:%d)",
1947  ll,rl);
1948  return TRUE;
1949  }
1950 
1951  leftv hh=r;
1952  BOOLEAN nok=FALSE;
1953  BOOLEAN map_assign=FALSE;
1954  switch (lt)
1955  {
1956  case INTVEC_CMD:
1957  nok=jjA_L_INTVEC(l,r,new intvec(exprlist_length(r)));
1958  break;
1959  case INTMAT_CMD:
1960  {
1961  nok=jjA_L_INTVEC(l,r,new intvec(IDINTVEC((idhdl)l->data)));
1962  break;
1963  }
1964  case BIGINTMAT_CMD:
1965  {
1966  nok=jjA_L_BIGINTMAT(l, r, new bigintmat(IDBIMAT((idhdl)l->data)));
1967  break;
1968  }
1969  case MAP_CMD:
1970  {
1971  // first element in the list sl (r) must be a ring
1972  if ((rt == RING_CMD)&&(r->e==NULL))
1973  {
1974  omFree((ADDRESS)IDMAP((idhdl)l->data)->preimage);
1975  IDMAP((idhdl)l->data)->preimage = omStrDup (r->Fullname());
1976  /* advance the expressionlist to get the next element after the ring */
1977  hh = r->next;
1978  //r=hh;
1979  }
1980  else
1981  {
1982  WerrorS("expected ring-name");
1983  nok=TRUE;
1984  break;
1985  }
1986  if (hh==NULL) /* map-assign: map f=r; */
1987  {
1988  WerrorS("expected image ideal");
1989  nok=TRUE;
1990  break;
1991  }
1992  if ((hh->next==NULL)&&(hh->Typ()==IDEAL_CMD))
1993  return jiAssign_1(l,hh,toplevel); /* map-assign: map f=r,i; */
1994  //no break, handle the rest like an ideal:
1995  map_assign=TRUE;
1996  }
1997  case MATRIX_CMD:
1998  case IDEAL_CMD:
1999  case MODUL_CMD:
2000  {
2001  sleftv t;
2002  matrix olm = (matrix)l->Data();
2003  int rk;
2004  char *pr=((map)olm)->preimage;
2005  BOOLEAN module_assign=(/*l->Typ()*/ lt==MODUL_CMD);
2006  matrix lm ;
2007  int num;
2008  int j,k;
2009  int i=0;
2010  int mtyp=MATRIX_CMD; /*Type of left side object*/
2011  int etyp=POLY_CMD; /*Type of elements of left side object*/
2012 
2013  if (lt /*l->Typ()*/==MATRIX_CMD)
2014  {
2015  rk=olm->rows();
2016  num=olm->cols()*rk /*olm->rows()*/;
2017  lm=mpNew(olm->rows(),olm->cols());
2018  int el;
2019  if ((traceit&TRACE_ASSIGN) && (num!=(el=exprlist_length(hh))))
2020  {
2021  Warn("expression list length(%d) does not match matrix size(%d)",el,num);
2022  }
2023  }
2024  else /* IDEAL_CMD or MODUL_CMD */
2025  {
2026  num=exprlist_length(hh);
2027  lm=(matrix)idInit(num,1);
2028  if (module_assign)
2029  {
2030  rk=0;
2031  mtyp=MODUL_CMD;
2032  etyp=VECTOR_CMD;
2033  }
2034  else
2035  rk=1;
2036  }
2037 
2038  int ht;
2039  loop
2040  {
2041  if (hh==NULL)
2042  break;
2043  else
2044  {
2045  matrix rm;
2046  ht=hh->Typ();
2047  if ((j=iiTestConvert(ht,etyp))!=0)
2048  {
2049  nok=iiConvert(ht,etyp,j,hh,&t);
2050  hh->next=t.next;
2051  if (nok) break;
2052  lm->m[i]=(poly)t.CopyD(etyp);
2053  pNormalize(lm->m[i]);
2054  if (module_assign) rk=si_max(rk,(int)pMaxComp(lm->m[i]));
2055  i++;
2056  }
2057  else
2058  if ((j=iiTestConvert(ht,mtyp))!=0)
2059  {
2060  nok=iiConvert(ht,mtyp,j,hh,&t);
2061  hh->next=t.next;
2062  if (nok) break;
2063  rm = (matrix)t.CopyD(mtyp);
2064  if (module_assign)
2065  {
2066  j = si_min(num,rm->cols());
2067  rk=si_max(rk,(int)rm->rank);
2068  }
2069  else
2070  j = si_min(num-i,rm->rows() * rm->cols());
2071  for(k=0;k<j;k++,i++)
2072  {
2073  lm->m[i]=rm->m[k];
2074  pNormalize(lm->m[i]);
2075  rm->m[k]=NULL;
2076  }
2077  idDelete((ideal *)&rm);
2078  }
2079  else
2080  {
2081  nok=TRUE;
2082  break;
2083  }
2084  t.next=NULL;t.CleanUp();
2085  if (i==num) break;
2086  hh=hh->next;
2087  }
2088  }
2089  if (nok)
2090  idDelete((ideal *)&lm);
2091  else
2092  {
2093  idDelete((ideal *)&olm);
2094  if (module_assign) lm->rank=rk;
2095  else if (map_assign) ((map)lm)->preimage=pr;
2096  l=l->LData();
2097  if (l->rtyp==IDHDL)
2098  IDMATRIX((idhdl)l->data)=lm;
2099  else
2100  l->data=(char *)lm;
2101  }
2102  break;
2103  }
2104  case STRING_CMD:
2105  nok=jjA_L_STRING(l,r);
2106  break;
2107  //case DEF_CMD:
2108  case LIST_CMD:
2109  nok=jjA_L_LIST(l,r);
2110  break;
2111  case NONE:
2112  case 0:
2113  Werror("cannot assign to %s",l->Fullname());
2114  nok=TRUE;
2115  break;
2116  default:
2117  WerrorS("assign not impl.");
2118  nok=TRUE;
2119  break;
2120  } /* end switch: typ */
2121  if (nok && (!errorreported)) WerrorS("incompatible type in list assignment");
2122  r->CleanUp();
2123  return nok;
2124 }
int & rows()
Definition: matpol.h:24
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
static BOOLEAN jiA_INTVEC_L(leftv l, leftv r)
Definition: ipassign.cc:1311
void ipMoveId(idhdl tomove)
Definition: ipid.cc:604
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:292
Definition: tok.h:203
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define TRACE_ASSIGN
Definition: reporter.h:45
static BOOLEAN jjA_L_INTVEC(leftv l, leftv r, intvec *iv)
Definition: ipassign.cc:1443
#define Print
Definition: emacs.cc:83
Subexpr e
Definition: subexpr.h:107
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
BITSET flag
Definition: subexpr.h:92
CanonicalForm num(const CanonicalForm &f)
#define IDINTVEC(a)
Definition: ipid.h:125
#define pMaxComp(p)
Definition: polys.h:282
loop
Definition: myNF.cc:98
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
#define FALSE
Definition: auxiliary.h:97
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:360
int exprlist_length(leftv v)
Definition: ipshell.cc:546
Matrices of numbers.
Definition: bigintmat.h:51
static BOOLEAN jiAssign_list(leftv l, leftv r)
Definition: ipassign.cc:1687
Definition: tok.h:213
static BOOLEAN jiAssign_1(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1073
#define BB_LIKE_LIST(B)
Definition: blackbox.h:54
int listLength()
Definition: subexpr.cc:61
#define TRUE
Definition: auxiliary.h:101
void * ADDRESS
Definition: auxiliary.h:118
#define IDBIMAT(a)
Definition: ipid.h:126
void WerrorS(const char *s)
Definition: feFopen.cc:24
int k
Definition: cfEzgcd.cc:93
int traceit
Definition: febase.cc:47
int Typ()
Definition: subexpr.cc:979
const char * Name()
Definition: subexpr.h:122
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
const char * Fullname()
Definition: subexpr.h:127
static BOOLEAN jjA_L_BIGINTMAT(leftv l, leftv r, bigintmat *bim)
Definition: ipassign.cc:1492
static BOOLEAN iiAssign_sys(leftv l, leftv r)
Definition: ipassign.cc:1237
void * data
Definition: subexpr.h:90
#define IDTYP(a)
Definition: ipid.h:116
poly * m
Definition: matpol.h:19
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
int j
Definition: myNF.cc:70
Definition: tok.h:57
#define omFree(addr)
Definition: omAllocDecl.h:261
pNormalize(P.p)
static BOOLEAN jiA_VECTOR_L(leftv l, leftv r)
Definition: ipassign.cc:1337
omBin sSubexpr_bin
Definition: subexpr.cc:49
ip_smatrix * matrix
static BOOLEAN jjA_L_STRING(leftv l, leftv r)
Definition: ipassign.cc:1541
static int si_max(const int a, const int b)
Definition: auxiliary.h:123
int i
Definition: cfEzgcd.cc:123
void PrintS(const char *s)
Definition: reporter.cc:284
Definition: tok.h:99
#define IDMAP(a)
Definition: ipid.h:132
short errorreported
Definition: feFopen.cc:23
leftv next
Definition: subexpr.h:88
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:48
Definition: tok.h:34
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define atKillAll(H)
Definition: attrib.h:42
static BOOLEAN jiA_STRING_L(leftv l, leftv r)
Definition: ipassign.cc:1651
int & cols()
Definition: matpol.h:25
#define NULL
Definition: omList.c:10
static BOOLEAN jiAssign_rec(leftv l, leftv r)
Definition: ipassign.cc:1757
static BOOLEAN jiA_MATRIX_L(leftv l, leftv r)
Definition: ipassign.cc:1575
static BOOLEAN jjA_L_LIST(leftv l, leftv r)
Definition: ipassign.cc:1378
int rtyp
Definition: subexpr.h:93
#define IDFLAG(a)
Definition: ipid.h:117
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
#define IDATTR(a)
Definition: ipid.h:120
void * Data()
Definition: subexpr.cc:1121
Definition: tok.h:116
attr attribute
Definition: subexpr.h:91
polyrec * poly
Definition: hilb.h:10
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88
const poly b
Definition: syzextra.cc:213
#define NONE
Definition: tok.h:216
leftv LData()
Definition: subexpr.cc:1390
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:679
long rank
Definition: matpol.h:20
#define IDMATRIX(a)
Definition: ipid.h:131
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:16
#define Warn
Definition: emacs.cc:80
#define omStrDup(s)
Definition: omAllocDecl.h:263

§ iiAssign_sys()

static BOOLEAN iiAssign_sys ( leftv  l,
leftv  r 
)
static

Definition at line 1237 of file ipassign.cc.

1238 {
1239  int rt=r->Typ();
1240 
1241  if (rt==0)
1242  {
1243  if (!errorreported) Werror("`%s` is undefined",r->Fullname());
1244  return TRUE;
1245  }
1246  int i=0;
1247  int lt=l->rtyp;
1248  while (((dAssign_sys[i].res!=lt)
1249  || (dAssign_sys[i].arg!=rt))
1250  && (dAssign_sys[i].res!=0)) i++;
1251  if (dAssign_sys[i].res!=0)
1252  {
1253  if (!dAssign_sys[i].p(l,r))
1254  {
1255  // everything ok, clean up
1256  return FALSE;
1257  }
1258  }
1259  // implicite type conversion ----------------------------------------------
1260  if (dAssign_sys[i].res==0)
1261  {
1262  int ri;
1264  BOOLEAN failed=FALSE;
1265  i=0;
1266  while ((dAssign_sys[i].res!=lt)
1267  && (dAssign_sys[i].res!=0)) i++;
1268  while (dAssign_sys[i].res==lt)
1269  {
1270  if ((ri=iiTestConvert(rt,dAssign_sys[i].arg))!=0)
1271  {
1272  failed= ((iiConvert(rt,dAssign_sys[i].arg,ri,r,rn))
1273  || (dAssign_sys[i].p(l,rn)));
1274  // everything done, clean up temp. variables
1275  rn->CleanUp();
1277  if (failed)
1278  {
1279  // leave loop, goto error handling
1280  break;
1281  }
1282  else
1283  {
1284  // everything ok, return
1285  return FALSE;
1286  }
1287  }
1288  i++;
1289  }
1290  // error handling ---------------------------------------------------
1291  if(!errorreported)
1292  {
1293  Werror("`%s` = `%s` is not supported"
1294  ,Tok2Cmdname(lt),Tok2Cmdname(rt));
1295  if (BVERBOSE(V_SHOW_USE))
1296  {
1297  i=0;
1298  while ((dAssign_sys[i].res!=lt)
1299  && (dAssign_sys[i].res!=0)) i++;
1300  while (dAssign_sys[i].res==lt)
1301  {
1302  Werror("expected `%s` = `%s`"
1303  ,Tok2Cmdname(lt),Tok2Cmdname(dAssign_sys[i].arg));
1304  i++;
1305  }
1306  }
1307  }
1308  }
1309  return TRUE;
1310 }
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:292
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:360
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
void * ADDRESS
Definition: auxiliary.h:118
sleftv * leftv
Definition: structs.h:60
int Typ()
Definition: subexpr.cc:979
const char * Fullname()
Definition: subexpr.h:127
poly res
Definition: myNF.cc:322
#define V_SHOW_USE
Definition: options.h:50
const struct sValAssign_sys dAssign_sys[]
Definition: table.h:1307
omBin sleftv_bin
Definition: subexpr.cc:50
int i
Definition: cfEzgcd.cc:123
short errorreported
Definition: feFopen.cc:23
#define BVERBOSE(a)
Definition: options.h:33
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:128
int rtyp
Definition: subexpr.h:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int BOOLEAN
Definition: auxiliary.h:88
void Werror(const char *fmt,...)
Definition: reporter.cc:189

§ jiA_1x1INTMAT()

static BOOLEAN jiA_1x1INTMAT ( leftv  res,
leftv  a,
Subexpr  e 
)
static

Definition at line 689 of file ipassign.cc.

690 {
691  if (/*(*/ res->rtyp!=INTMAT_CMD /*)*/) /*|| (e!=NULL) - TRUE because of type int */
692  {
693  // no error message: assignment simply fails
694  return TRUE;
695  }
696  intvec* am=(intvec*)a->CopyD(INTMAT_CMD);
697  if ((am->rows()!=1) || (am->cols()!=1))
698  {
699  WerrorS("must be 1x1 intmat");
700  delete am;
701  return TRUE;
702  }
703  intvec* m=(intvec *)res->data;
704  // indices are correct (see ipExprArith3(..,'['..) )
705  int i=e->start;
706  int j=e->next->start;
707  IMATELEM(*m,i,j)=IMATELEM(*am,1,1);
708  delete am;
709  return FALSE;
710 }
#define FALSE
Definition: auxiliary.h:97
int rows() const
Definition: intvec.h:88
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
int j
Definition: myNF.cc:70
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
int cols() const
Definition: intvec.h:87
int rtyp
Definition: subexpr.h:93
#define IMATELEM(M, I, J)
Definition: intvec.h:77
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_1x1MATRIX()

static BOOLEAN jiA_1x1MATRIX ( leftv  res,
leftv  a,
Subexpr  e 
)
static

Definition at line 711 of file ipassign.cc.

712 {
713  if (/*(*/ res->rtyp!=MATRIX_CMD /*)*/) /*|| (e!=NULL) - TRUE because of type poly */
714  {
715  // no error message: assignment simply fails
716  return TRUE;
717  }
718  matrix am=(matrix)a->CopyD(MATRIX_CMD);
719  if ((MATROWS(am)!=1) || (MATCOLS(am)!=1))
720  {
721  WerrorS("must be 1x1 matrix");
722  idDelete((ideal *)&am);
723  return TRUE;
724  }
725  matrix m=(matrix)res->data;
726  // indices are correct (see ipExprArith3(..,'['..) )
727  int i=e->start;
728  int j=e->next->start;
729  pDelete(&MATELEM(m,i,j));
730  pNormalize(MATELEM(am,1,1));
731  MATELEM(m,i,j)=MATELEM(am,1,1);
732  MATELEM(am,1,1)=NULL;
733  idDelete((ideal *)&am);
734  return FALSE;
735 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:90
int j
Definition: myNF.cc:70
pNormalize(P.p)
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
int i
Definition: cfEzgcd.cc:123
#define MATCOLS(i)
Definition: matpol.h:28
#define NULL
Definition: omList.c:10
#define pDelete(p_ptr)
Definition: polys.h:169
int rtyp
Definition: subexpr.h:93
#define MATROWS(i)
Definition: matpol.h:27
void * CopyD(int t)
Definition: subexpr.cc:679
#define MATELEM(mat, i, j)
Definition: matpol.h:29

§ jiA_BIGINT()

static BOOLEAN jiA_BIGINT ( leftv  res,
leftv  a,
Subexpr  e 
)
static

Definition at line 571 of file ipassign.cc.

572 {
573  number p=(number)a->CopyD(BIGINT_CMD);
574  if (e==NULL)
575  {
576  if (res->data!=NULL) n_Delete((number *)&res->data,coeffs_BIGINT);
577  res->data=(void *)p;
578  }
579  else
580  {
581  int i=e->start-1;
582  if (i<0)
583  {
584  Werror("index[%d] must be positive",i+1);
585  return TRUE;
586  }
587  bigintmat *iv=(bigintmat *)res->data;
588  if (e->next==NULL)
589  {
590  WerrorS("only one index given");
591  return TRUE;
592  }
593  else
594  {
595  int c=e->next->start;
596  if ((i>=iv->rows())||(c<1)||(c>iv->cols()))
597  {
598  Werror("wrong range [%d,%d] in bigintmat %s(%d,%d)",i+1,c,res->Name(),iv->rows(),iv->cols());
599  return TRUE;
600  }
601  else
602  {
603  n_Delete((number *)&BIMATELEM(*iv,i+1,c),iv->basecoeffs());
604  BIMATELEM(*iv,i+1,c) = p;
605  }
606  }
607  }
608  jiAssignAttr(res,a);
609  return FALSE;
610 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
Definition: tok.h:38
return P p
Definition: myNF.cc:203
Matrices of numbers.
Definition: bigintmat.h:51
int rows() const
Definition: bigintmat.h:146
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
const char * Name()
Definition: subexpr.h:122
void * data
Definition: subexpr.h:90
int cols() const
Definition: bigintmat.h:145
int i
Definition: cfEzgcd.cc:123
#define BIMATELEM(M, I, J)
Definition: bigintmat.h:134
#define NULL
Definition: omList.c:10
coeffs basecoeffs() const
Definition: bigintmat.h:147
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_BIGINTMAT()

static BOOLEAN jiA_BIGINTMAT ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 799 of file ipassign.cc.

800 {
801  if (res->data!=NULL) delete ((bigintmat *)res->data);
802  res->data=(void *)a->CopyD(BIGINTMAT_CMD);
803  jiAssignAttr(res,a);
804  return FALSE;
805 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:90
#define NULL
Definition: omList.c:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_CRING()

static BOOLEAN jiA_CRING ( leftv  res,
leftv  a,
Subexpr  e 
)
static

Definition at line 1056 of file ipassign.cc.

1057 {
1058  res->data=(void *)a->CopyD(CRING_CMD);
1059  jiAssignAttr(res,a);
1060  return FALSE;
1061 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
Definition: tok.h:55
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_DEF()

static BOOLEAN jiA_DEF ( leftv  res,
leftv  ,
Subexpr   
)
static

Definition at line 1050 of file ipassign.cc.

1051 {
1052  res->data=(void *)0;
1053  return FALSE;
1054 }
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90

§ jiA_IDEAL()

static BOOLEAN jiA_IDEAL ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 806 of file ipassign.cc.

807 {
808  if (res->data!=NULL) idDelete((ideal*)&res->data);
809  res->data=(void *)a->CopyD(MATRIX_CMD);
810  if (a->rtyp==IDHDL) id_Normalize((ideal)a->Data(), currRing);
811  else id_Normalize((ideal)res->data, currRing);
812  jiAssignAttr(res,a);
813  if (((res->rtyp==IDEAL_CMD)||(res->rtyp==MODUL_CMD))
814  && (IDELEMS((ideal)(res->data))==1)
815  && (currRing->qideal==NULL)
816  && (!rIsPluralRing(currRing))
817  )
818  {
819  setFlag(res,FLAG_STD);
820  }
821  if (TEST_V_QRING && (currRing->qideal!=NULL)&& (!hasFlag(res,FLAG_QRING))) jjNormalizeQRingId(res);
822  return FALSE;
823 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_QRING
Definition: ipid.h:108
#define TEST_V_QRING
Definition: options.h:125
#define IDELEMS(i)
Definition: simpleideals.h:24
#define FLAG_STD
Definition: ipid.h:106
void jjNormalizeQRingId(leftv I)
Definition: ipassign.cc:2125
#define NULL
Definition: omList.c:10
#define hasFlag(A, F)
Definition: ipid.h:109
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_IDEAL_M()

static BOOLEAN jiA_IDEAL_M ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 847 of file ipassign.cc.

848 {
849  if (res->data!=NULL) idDelete((ideal*)&res->data);
851  if (TEST_V_ALLWARN)
852  if (MATROWS(m)>1)
853  Warn("assign matrix with %d rows to an ideal in >>%s<<",MATROWS(m),my_yylinebuf);
854  IDELEMS((ideal)m)=MATROWS(m)*MATCOLS(m);
855  ((ideal)m)->rank=1;
856  MATROWS(m)=1;
857  id_Normalize((ideal)m, currRing);
858  res->data=(void *)m;
859  if (TEST_V_QRING && (currRing->qideal!=NULL)) jjNormalizeQRingId(res);
860  return FALSE;
861 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
char my_yylinebuf[80]
Definition: febase.cc:48
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
#define TEST_V_QRING
Definition: options.h:125
#define IDELEMS(i)
Definition: simpleideals.h:24
void jjNormalizeQRingId(leftv I)
Definition: ipassign.cc:2125
#define MATCOLS(i)
Definition: matpol.h:28
#define NULL
Definition: omList.c:10
#define MATROWS(i)
Definition: matpol.h:27
#define TEST_V_ALLWARN
Definition: options.h:135
void * CopyD(int t)
Definition: subexpr.cc:679
#define Warn
Definition: emacs.cc:80

§ jiA_INT()

static BOOLEAN jiA_INT ( leftv  res,
leftv  a,
Subexpr  e 
)
static

Definition at line 355 of file ipassign.cc.

356 {
357  if (e==NULL)
358  {
359  res->data=(void *)a->Data();
360  jiAssignAttr(res,a);
361  }
362  else
363  {
364  int i=e->start-1;
365  if (i<0)
366  {
367  Werror("index[%d] must be positive",i+1);
368  return TRUE;
369  }
370  intvec *iv=(intvec *)res->data;
371  if (e->next==NULL)
372  {
373  if (i>=iv->length())
374  {
375  intvec *iv1=new intvec(i+1);
376  (*iv1)[i]=(int)((long)(a->Data()));
377  intvec *ivn=ivAdd(iv,iv1);
378  delete iv;
379  delete iv1;
380  res->data=(void *)ivn;
381  }
382  else
383  (*iv)[i]=(int)((long)(a->Data()));
384  }
385  else
386  {
387  int c=e->next->start;
388  if ((i>=iv->rows())||(c<1)||(c>iv->cols()))
389  {
390  Werror("wrong range [%d,%d] in intmat %s(%d,%d)",i+1,c,res->Name(),iv->rows(),iv->cols());
391  return TRUE;
392  }
393  else
394  IMATELEM(*iv,i+1,c) = (int)((long)(a->Data()));
395  }
396  }
397  return FALSE;
398 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
int rows() const
Definition: intvec.h:88
#define TRUE
Definition: auxiliary.h:101
const char * Name()
Definition: subexpr.h:122
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
int cols() const
Definition: intvec.h:87
void * Data()
Definition: subexpr.cc:1121
#define IMATELEM(M, I, J)
Definition: intvec.h:77
void Werror(const char *fmt,...)
Definition: reporter.cc:189
intvec * ivAdd(intvec *a, intvec *b)
Definition: intvec.cc:250

§ jiA_INTVEC()

static BOOLEAN jiA_INTVEC ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 776 of file ipassign.cc.

777 {
778  //if ((res->data==NULL) || (res->Typ()==a->Typ()))
779  {
780  if (res->data!=NULL) delete ((intvec *)res->data);
781  res->data=(void *)a->CopyD(INTVEC_CMD);
782  jiAssignAttr(res,a);
783  return FALSE;
784  }
785 #if 0
786  else
787  {
788  intvec *r=(intvec *)(res->data);
789  intvec *s=(intvec *)(a->Data());
790  int i=si_min(r->length(), s->length())-1;
791  for(;i>=0;i--)
792  {
793  (*r)[i]=(*s)[i];
794  }
795  return FALSE; //(r->length()< s->length());
796  }
797 #endif
798 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:99
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
void * Data()
Definition: subexpr.cc:1121
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_INTVEC_L()

static BOOLEAN jiA_INTVEC_L ( leftv  l,
leftv  r 
)
static

Definition at line 1311 of file ipassign.cc.

1312 {
1313  /* right side is intvec, left side is list (of int)*/
1314  BOOLEAN nok;
1315  int i=0;
1316  leftv l1=l;
1317  leftv h;
1318  sleftv t;
1319  intvec *iv=(intvec *)r->Data();
1320  memset(&t,0,sizeof(sleftv));
1321  t.rtyp=INT_CMD;
1322  while ((i<iv->length())&&(l!=NULL))
1323  {
1324  t.data=(char *)(long)(*iv)[i];
1325  h=l->next;
1326  l->next=NULL;
1327  nok=jiAssign_1(l,&t,TRUE);
1328  l->next=h;
1329  if (nok) return TRUE;
1330  i++;
1331  l=h;
1332  }
1333  l1->CleanUp();
1334  r->CleanUp();
1335  return FALSE;
1336 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: tok.h:94
#define FALSE
Definition: auxiliary.h:97
static BOOLEAN jiAssign_1(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1073
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
void * Data()
Definition: subexpr.cc:1121
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88
int l
Definition: cfEzgcd.cc:94

§ jiA_LINK()

static BOOLEAN jiA_LINK ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 862 of file ipassign.cc.

863 {
864  si_link l=(si_link)res->data;
865 
866  if (l!=NULL) slCleanUp(l);
867 
868  if (a->Typ() == STRING_CMD)
869  {
870  if (l == NULL)
871  {
873  res->data = (void *) l;
874  }
875  return slInit(l, (char *) a->Data());
876  }
877  else if (a->Typ() == LINK_CMD)
878  {
879  if (l != NULL) omFreeBin(l, sip_link_bin);
880  res->data = slCopy((si_link)a->Data());
881  return FALSE;
882  }
883  return TRUE;
884 }
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
int Typ()
Definition: subexpr.cc:979
void * data
Definition: subexpr.h:90
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
Definition: tok.h:115
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int l
Definition: cfEzgcd.cc:94

§ jiA_LIST()

static BOOLEAN jiA_LIST ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 622 of file ipassign.cc.

623 {
624  lists l=(lists)a->CopyD(LIST_CMD);
625  if (res->data!=NULL) ((lists)res->data)->Clean();
626  res->data=(void *)l;
627  jiAssignAttr(res,a);
628  return FALSE;
629 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
Definition: tok.h:116
void * CopyD(int t)
Definition: subexpr.cc:679
int l
Definition: cfEzgcd.cc:94

§ jiA_LIST_RES()

static BOOLEAN jiA_LIST_RES ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 611 of file ipassign.cc.

612 {
614  if (res->data!=NULL) ((lists)res->data)->Clean();
615  int add_row_shift = 0;
616  intvec *weights=(intvec*)atGet(a,"isHomog",INTVEC_CMD);
617  if (weights!=NULL) add_row_shift=weights->min_in();
618  res->data=(void *)syConvRes(r,TRUE,add_row_shift);
619  //jiAssignAttr(res,a);
620  return FALSE;
621 }
#define FALSE
Definition: auxiliary.h:97
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
Definition: ipshell.cc:3088
#define TRUE
Definition: auxiliary.h:101
int min_in()
Definition: intvec.h:113
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
Definition: tok.h:99
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:135
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
void * CopyD(int t)
Definition: subexpr.cc:679
ssyStrategy * syStrategy
Definition: syz.h:35

§ jiA_MAP()

static BOOLEAN jiA_MAP ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 886 of file ipassign.cc.

887 {
888  if (res->data!=NULL)
889  {
890  omFree((ADDRESS)((map)res->data)->preimage);
891  ((map)res->data)->preimage=NULL;
892  idDelete((ideal*)&res->data);
893  }
894  res->data=(void *)a->CopyD(MAP_CMD);
895  jiAssignAttr(res,a);
896  return FALSE;
897 }
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
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
void * ADDRESS
Definition: auxiliary.h:118
void * data
Definition: subexpr.h:90
#define omFree(addr)
Definition: omAllocDecl.h:261
#define NULL
Definition: omList.c:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_MAP_ID()

static BOOLEAN jiA_MAP_ID ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 899 of file ipassign.cc.

900 {
901  map f=(map)res->data;
902  char *rn=f->preimage; // save the old/already assigned preimage ring name
903  f->preimage=NULL;
904  idDelete((ideal *)&f);
905  res->data=(void *)a->CopyD(IDEAL_CMD);
906  f=(map)res->data;
907  id_Normalize((ideal)f, currRing);
908  f->preimage = rn;
909  return FALSE;
910 }
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
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
FILE * f
Definition: checklibs.c:7
#define NULL
Definition: omList.c:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_MATRIX_L()

static BOOLEAN jiA_MATRIX_L ( leftv  l,
leftv  r 
)
static

Definition at line 1575 of file ipassign.cc.

1576 {
1577  /* right side is matrix, left side is list (of poly)*/
1578  BOOLEAN nok=FALSE;
1579  int i;
1581  leftv h;
1582  leftv ol=l;
1583  leftv o_r=r;
1584  sleftv t;
1585  memset(&t,0,sizeof(sleftv));
1586  t.rtyp=POLY_CMD;
1587  int mxn=MATROWS(m)*MATCOLS(m);
1588  loop
1589  {
1590  i=0;
1591  while ((i<mxn /*MATROWS(m)*MATCOLS(m)*/)&&(l!=NULL))
1592  {
1593  t.data=(char *)m->m[i];
1594  m->m[i]=NULL;
1595  h=l->next;
1596  l->next=NULL;
1597  idhdl hh=NULL;
1598  if ((l->rtyp==IDHDL)&&(l->Typ()==DEF_CMD)) hh=(idhdl)l->data;
1599  nok=jiAssign_1(l,&t,TRUE);
1600  if (hh!=NULL) { ipMoveId(hh);hh=NULL;}
1601  l->next=h;
1602  if (nok)
1603  {
1604  idDelete((ideal *)&m);
1605  goto ende;
1606  }
1607  i++;
1608  l=h;
1609  }
1610  idDelete((ideal *)&m);
1611  h=r;
1612  r=r->next;
1613  if (l==NULL)
1614  {
1615  if (r!=NULL)
1616  {
1617  Warn("list length mismatch in assign (l>r)");
1618  nok=TRUE;
1619  }
1620  break;
1621  }
1622  else if (r==NULL)
1623  {
1624  Warn("list length mismatch in assign (l<r)");
1625  nok=TRUE;
1626  break;
1627  }
1628  if ((r->Typ()==IDEAL_CMD)||(r->Typ()==MATRIX_CMD))
1629  {
1630  m=(matrix)r->CopyD(MATRIX_CMD);
1631  mxn=MATROWS(m)*MATCOLS(m);
1632  }
1633  else if (r->Typ()==POLY_CMD)
1634  {
1635  m=mpNew(1,1);
1636  MATELEM(m,1,1)=(poly)r->CopyD(POLY_CMD);
1637  pNormalize(MATELEM(m,1,1));
1638  mxn=1;
1639  }
1640  else
1641  {
1642  nok=TRUE;
1643  break;
1644  }
1645  }
1646 ende:
1647  o_r->CleanUp();
1648  ol->CleanUp();
1649  return nok;
1650 }
void ipMoveId(idhdl tomove)
Definition: ipid.cc:604
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
loop
Definition: myNF.cc:98
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
static BOOLEAN jiAssign_1(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1073
#define TRUE
Definition: auxiliary.h:101
int Typ()
Definition: subexpr.cc:979
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
poly * m
Definition: matpol.h:19
const ring r
Definition: syzextra.cc:208
Definition: tok.h:57
pNormalize(P.p)
ip_smatrix * matrix
int m
Definition: cfEzgcd.cc:119
idrec * idhdl
Definition: ring.h:18
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:88
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:48
#define MATCOLS(i)
Definition: matpol.h:28
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
#define MATROWS(i)
Definition: matpol.h:27
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88
void * CopyD(int t)
Definition: subexpr.cc:679
int l
Definition: cfEzgcd.cc:94
#define MATELEM(mat, i, j)
Definition: matpol.h:29
#define Warn
Definition: emacs.cc:80

§ jiA_MODUL_P()

static BOOLEAN jiA_MODUL_P ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 831 of file ipassign.cc.

833 {
834  if (res->data!=NULL) idDelete((ideal*)&res->data);
835  ideal I=idInit(1,1);
836  I->m[0]=(poly)a->CopyD(POLY_CMD);
837  if (I->m[0]!=NULL) pSetCompP(I->m[0],1);
838  pNormalize(I->m[0]);
839  res->data=(void *)I;
840  if (TEST_V_QRING && (currRing->qideal!=NULL))
841  {
842  if (hasFlag(a,FLAG_QRING)) setFlag(res,FLAG_QRING);
843  else jjNormalizeQRingId(res);
844  }
845  return FALSE;
846 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pSetCompP(a, i)
Definition: polys.h:286
pNormalize(P.p)
#define setFlag(A, F)
Definition: ipid.h:110
#define FLAG_QRING
Definition: ipid.h:108
#define TEST_V_QRING
Definition: options.h:125
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
void jjNormalizeQRingId(leftv I)
Definition: ipassign.cc:2125
#define NULL
Definition: omList.c:10
#define hasFlag(A, F)
Definition: ipid.h:109
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_NUMBER()

static BOOLEAN jiA_NUMBER ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 399 of file ipassign.cc.

400 {
401  number p=(number)a->CopyD(NUMBER_CMD);
402  if (res->data!=NULL) nDelete((number *)&res->data);
403  nNormalize(p);
404  res->data=(void *)p;
405  jiAssignAttr(res,a);
406  return FALSE;
407 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define nNormalize(n)
Definition: numbers.h:30
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:90
#define nDelete(n)
Definition: numbers.h:16
#define NULL
Definition: omList.c:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_NUMBER2()

static BOOLEAN jiA_NUMBER2 ( leftv  res,
leftv  a,
Subexpr  e 
)
static

Definition at line 409 of file ipassign.cc.

410 {
411  number2 n=(number2)a->CopyD(CNUMBER_CMD);
412  if (e==NULL)
413  {
414  if (res->data!=NULL)
415  {
416  number2 nn=(number2)res->data;
417  n2Delete(nn);
418  }
419  res->data=(void *)n;
420  jiAssignAttr(res,a);
421  }
422  else
423  {
424  int i=e->start-1;
425  if (i<0)
426  {
427  Werror("index[%d] must be positive",i+1);
428  return TRUE;
429  }
430  bigintmat *iv=(bigintmat *)res->data;
431  if (e->next==NULL)
432  {
433  WerrorS("only one index given");
434  return TRUE;
435  }
436  else
437  {
438  int c=e->next->start;
439  if ((i>=iv->rows())||(c<1)||(c>iv->cols()))
440  {
441  Werror("wrong range [%d,%d] in cmatrix %s(%d,%d)",i+1,c,res->Name(),iv->rows(),iv->cols());
442  return TRUE;
443  }
444  else if (iv->basecoeffs()==n->cf)
445  {
446  n_Delete((number *)&BIMATELEM(*iv,i+1,c),iv->basecoeffs());
447  BIMATELEM(*iv,i+1,c) = n->n;
448  }
449  else
450  {
451  WerrorS("different base");
452  return TRUE;
453  }
454  }
455  }
456  jiAssignAttr(res,a);
457  return FALSE;
458 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
int rows() const
Definition: bigintmat.h:146
void n2Delete(number2 &d)
Definition: number2.cc:285
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
const char * Name()
Definition: subexpr.h:122
void * data
Definition: subexpr.h:90
int cols() const
Definition: bigintmat.h:145
int i
Definition: cfEzgcd.cc:123
#define BIMATELEM(M, I, J)
Definition: bigintmat.h:134
#define NULL
Definition: omList.c:10
coeffs basecoeffs() const
Definition: bigintmat.h:147
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_NUMBER2_I()

static BOOLEAN jiA_NUMBER2_I ( leftv  res,
leftv  a,
Subexpr  e 
)
static

Definition at line 459 of file ipassign.cc.

460 {
461  if (e==NULL)
462  {
463  if (res->data!=NULL)
464  {
465  number2 nn=(number2)res->data;
466  number2 n=n2Init((long)a->Data(),nn->cf);
467  n2Delete(nn);
468  res->data=(void *)n;
469  }
470  else
471  {
472  WerrorS("no Ring avialable for conversion from int");
473  return TRUE;
474  }
475  }
476  else
477  {
478  int i=e->start-1;
479  if (i<0)
480  {
481  Werror("index[%d] must be positive",i+1);
482  return TRUE;
483  }
484  bigintmat *iv=(bigintmat *)res->data;
485  if (e->next==NULL)
486  {
487  WerrorS("only one index given");
488  return TRUE;
489  }
490  else
491  {
492  int c=e->next->start;
493  if ((i>=iv->rows())||(c<1)||(c>iv->cols()))
494  {
495  Werror("wrong range [%d,%d] in cmatrix %s(%d,%d)",i+1,c,res->Name(),iv->rows(),iv->cols());
496  return TRUE;
497  }
498  else
499  {
500  n_Delete((number *)&BIMATELEM(*iv,i+1,c),iv->basecoeffs());
501  BIMATELEM(*iv,i+1,c) = n_Init((long)a->Data(),iv->basecoeffs());
502  }
503  }
504  }
505  return FALSE;
506 }
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
int rows() const
Definition: bigintmat.h:146
void n2Delete(number2 &d)
Definition: number2.cc:285
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:542
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
const char * Name()
Definition: subexpr.h:122
void * data
Definition: subexpr.h:90
static number2 n2Init(long i, coeffs c)
Definition: number2.h:17
int cols() const
Definition: bigintmat.h:145
int i
Definition: cfEzgcd.cc:123
#define BIMATELEM(M, I, J)
Definition: bigintmat.h:134
#define NULL
Definition: omList.c:10
coeffs basecoeffs() const
Definition: bigintmat.h:147
void * Data()
Definition: subexpr.cc:1121
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
void Werror(const char *fmt,...)
Definition: reporter.cc:189

§ jiA_NUMBER2_N()

static BOOLEAN jiA_NUMBER2_N ( leftv  res,
leftv  a,
Subexpr  e 
)
static

Definition at line 507 of file ipassign.cc.

508 {
509  if (e==NULL)
510  {
511  if (res->data!=NULL)
512  {
513  number2 nn=(number2)res->data;
514  if (currRing->cf==nn->cf)
515  {
516  number2 n=(number2)omAlloc(sizeof(*n));
517  n->cf=currRing->cf; n->cf++;
518  n->n=(number)a->CopyD(NUMBER_CMD);
519  n2Delete(nn);
520  res->data=(void *)n;
521  }
522  else
523  {
524  WerrorS("different base");
525  return TRUE;
526  }
527  }
528  else
529  {
530  WerrorS("no (c)ring avialable for conversion from number");
531  return TRUE;
532  }
533  }
534  else
535  {
536  int i=e->start-1;
537  if (i<0)
538  {
539  Werror("index[%d] must be positive",i+1);
540  return TRUE;
541  }
542  bigintmat *iv=(bigintmat *)res->data;
543  if (e->next==NULL)
544  {
545  WerrorS("only one index given");
546  return TRUE;
547  }
548  else
549  {
550  int c=e->next->start;
551  if ((i>=iv->rows())||(c<1)||(c>iv->cols()))
552  {
553  Werror("wrong range [%d,%d] in cmatrix %s(%d,%d)",i+1,c,res->Name(),iv->rows(),iv->cols());
554  return TRUE;
555  }
556  else if (iv->basecoeffs()==currRing->cf)
557  {
558  n_Delete((number *)&BIMATELEM(*iv,i+1,c),iv->basecoeffs());
559  BIMATELEM(*iv,i+1,c) = (number)(a->CopyD(NUMBER_CMD));
560  }
561  else
562  {
563  WerrorS("different base");
564  return TRUE;
565  }
566  }
567  }
568  return FALSE;
569 }
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
Matrices of numbers.
Definition: bigintmat.h:51
int rows() const
Definition: bigintmat.h:146
void n2Delete(number2 &d)
Definition: number2.cc:285
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
#define omAlloc(size)
Definition: omAllocDecl.h:210
const char * Name()
Definition: subexpr.h:122
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
int cols() const
Definition: bigintmat.h:145
int i
Definition: cfEzgcd.cc:123
#define BIMATELEM(M, I, J)
Definition: bigintmat.h:134
#define NULL
Definition: omList.c:10
coeffs basecoeffs() const
Definition: bigintmat.h:147
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_PACKAGE()

static BOOLEAN jiA_PACKAGE ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 1044 of file ipassign.cc.

1045 {
1046  res->data=(void *)a->CopyD(PACKAGE_CMD);
1047  jiAssignAttr(res,a);
1048  return FALSE;
1049 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_POLY()

static BOOLEAN jiA_POLY ( leftv  res,
leftv  a,
Subexpr  e 
)
static

Definition at line 630 of file ipassign.cc.

631 {
632  poly p=(poly)a->CopyD(POLY_CMD);
633  pNormalize(p);
634  if (e==NULL)
635  {
636  if ((p!=NULL) && TEST_V_QRING && (currRing->qideal!=NULL)
637  && (!hasFlag(a,FLAG_QRING)))
638  {
640  setFlag(res,FLAG_QRING);
641  }
642  if (res->data!=NULL) pDelete((poly*)&res->data);
643  res->data=(void*)p;
644  jiAssignAttr(res,a);
645  }
646  else
647  {
648  int i,j;
649  matrix m=(matrix)res->data;
650  i=e->start;
651  if (e->next==NULL)
652  {
653  j=i; i=1;
654  // for all ideal like data types: check indices
655  if (j>MATCOLS(m))
656  {
657  if (TEST_V_ALLWARN)
658  {
659  Warn("increase ideal %d -> %d in %s",MATCOLS(m),j,my_yylinebuf);
660  }
661  pEnlargeSet(&(m->m),MATCOLS(m),j-MATCOLS(m));
662  MATCOLS(m)=j;
663  }
664  else if (j<=0)
665  {
666  Werror("index[%d] must be positive",j/*e->start*/);
667  return TRUE;
668  }
669  }
670  else
671  {
672  // for matrices: indices are correct (see ipExprArith3(..,'['..) )
673  j=e->next->start;
674  }
675  if ((p!=NULL) && TEST_V_QRING && (currRing->qideal!=NULL))
676  {
678  }
679  pDelete(&MATELEM(m,i,j));
680  MATELEM(m,i,j)=p;
681  /* for module: update rank */
682  if ((p!=NULL) && (pGetComp(p)!=0))
683  {
684  m->rank=si_max(m->rank,pMaxComp(p));
685  }
686  }
687  return FALSE;
688 }
void jjNormalizeQRingP(poly &p)
Definition: ipassign.cc:2160
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define pMaxComp(p)
Definition: polys.h:282
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:101
#define pGetComp(p)
Component.
Definition: polys.h:37
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
poly * m
Definition: matpol.h:19
char my_yylinebuf[80]
Definition: febase.cc:48
int j
Definition: myNF.cc:70
pNormalize(P.p)
ip_smatrix * matrix
#define setFlag(A, F)
Definition: ipid.h:110
int m
Definition: cfEzgcd.cc:119
static int si_max(const int a, const int b)
Definition: auxiliary.h:123
#define FLAG_QRING
Definition: ipid.h:108
int i
Definition: cfEzgcd.cc:123
#define TEST_V_QRING
Definition: options.h:125
#define MATCOLS(i)
Definition: matpol.h:28
#define NULL
Definition: omList.c:10
void pEnlargeSet(poly **p, int l, int increment)
Definition: p_polys.cc:3556
#define hasFlag(A, F)
Definition: ipid.h:109
#define pDelete(p_ptr)
Definition: polys.h:169
polyrec * poly
Definition: hilb.h:10
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define TEST_V_ALLWARN
Definition: options.h:135
void * CopyD(int t)
Definition: subexpr.cc:679
long rank
Definition: matpol.h:20
#define MATELEM(mat, i, j)
Definition: matpol.h:29
#define Warn
Definition: emacs.cc:80

§ jiA_PROC()

static BOOLEAN jiA_PROC ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 758 of file ipassign.cc.

759 {
760  extern procinfo *iiInitSingularProcinfo(procinfo *pi, const char *libname,
761  const char *procname, int line,
762  long pos, BOOLEAN pstatic=FALSE);
763  if(res->data!=NULL) piKill((procinfo *)res->data);
764  if(a->Typ()==STRING_CMD)
765  {
766  res->data = (void *)omAlloc0Bin(procinfo_bin);
767  ((procinfo *)(res->data))->language=LANG_NONE;
768  iiInitSingularProcinfo((procinfo *)res->data,"",res->name,0,0);
769  ((procinfo *)res->data)->data.s.body=(char *)a->CopyD(STRING_CMD);
770  }
771  else
772  res->data=(void *)a->CopyD(PROC_CMD);
773  jiAssignAttr(res,a);
774  return FALSE;
775 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
procinfo * iiInitSingularProcinfo(procinfov pi, const char *libname, const char *procname, int line, long pos, BOOLEAN pstatic)
Definition: iplib.cc:883
#define FALSE
Definition: auxiliary.h:97
int Typ()
Definition: subexpr.cc:979
BOOLEAN piKill(procinfov pi)
Definition: ipid.cc:647
omBin procinfo_bin
Definition: subexpr.cc:51
void * data
Definition: subexpr.h:90
const char * name
Definition: subexpr.h:89
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define pi
Definition: libparse.cc:1143
#define NULL
Definition: omList.c:10
int BOOLEAN
Definition: auxiliary.h:88
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_QRING()

static BOOLEAN jiA_QRING ( leftv  res,
leftv  a,
Subexpr  e 
)
static

Definition at line 911 of file ipassign.cc.

912 {
913  // the follwing can only happen, if:
914  // - the left side is of type qring AND not an id
915  if ((e!=NULL)||(res->rtyp!=IDHDL))
916  {
917  WerrorS("qring_id expected");
918  return TRUE;
919  }
920  ring old_ring=(ring)res->Data();
921 
922  coeffs newcf = currRing->cf;
923  ideal id = (ideal)a->Data(); //?
924  const int cpos = idPosConstant(id);
926  if (cpos >= 0)
927  {
928  newcf = n_CoeffRingQuot1(p_GetCoeff(id->m[cpos], currRing), currRing->cf);
929  if(newcf == NULL)
930  return TRUE;
931  }
932  //qr=(ring)res->Data();
933  //if (qr!=NULL) omFreeBin((ADDRESS)qr, ip_sring_bin);
934  ring qr = rCopy(currRing);
935  assume(qr->cf == currRing->cf);
936 
937  if ( qr->cf != newcf )
938  {
939  nKillChar ( qr->cf ); // ???
940  qr->cf = newcf;
941  }
942  // we have to fill it, but the copy also allocates space
943  idhdl h=(idhdl)res->data; // we have res->rtyp==IDHDL
944  IDRING(h)=qr;
945 
946  ideal qid;
947 
948  if((rField_is_Ring(currRing)) && (cpos != -1))
949  {
950  int i, j;
951  int *perm = (int *)omAlloc0((qr->N+1)*sizeof(int));
952 
953  for(i=qr->N;i>0;i--)
954  perm[i]=i;
955 
956  nMapFunc nMap = n_SetMap(currRing->cf, newcf);
957  qid = idInit(IDELEMS(id)-1,1);
958  for(i = 0, j = 0; i<IDELEMS(id); i++)
959  if( i != cpos )
960  qid->m[j++] = p_PermPoly(id->m[i], perm, currRing, qr, nMap, NULL, 0);
961  }
962  else
963  qid = idrCopyR(id,currRing,qr);
964 
965  idSkipZeroes(qid);
966  //idPrint(qid);
967  if ((idElem(qid)>1) || rIsSCA(currRing) || (currRing->qideal!=NULL))
968  assumeStdFlag(a);
969 
970  if (currRing->qideal!=NULL) /* we are already in a qring! */
971  {
972  ideal tmp=idSimpleAdd(qid,currRing->qideal);
973  // both ideals should be GB, so dSimpleAdd is sufficient
974  idDelete(&qid);
975  qid=tmp;
976  // delete the qr copy of quotient ideal!!!
977  idDelete(&qr->qideal);
978  }
979  if (idElem(qid)==0)
980  {
981  qr->qideal = NULL;
982  id_Delete(&qid,currRing);
983  IDTYP(h)=RING_CMD;
984  }
985  else
986  qr->qideal = qid;
987 
988  // qr is a copy of currRing with the new qideal!
989  #ifdef HAVE_PLURAL
990  if(rIsPluralRing(currRing) &&(qr->qideal!=NULL))
991  {
992  if (!hasFlag(a,FLAG_TWOSTD))
993  {
994  Warn("%s is no twosided standard basis",a->Name());
995  }
996 
997  if( nc_SetupQuotient(qr, currRing) )
998  {
999 // WarnS("error in nc_SetupQuotient");
1000  }
1001  }
1002  #endif
1003  //rWrite(qr);
1004  rSetHdl((idhdl)res->data);
1005  if (old_ring!=NULL)
1006  {
1007  rDelete(old_ring);
1008  }
1009  return FALSE;
1010 }
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
Definition: ideals.h:39
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
bool nc_SetupQuotient(ring rGR, const ring rG=NULL, bool bCopy=false)
Definition: old.gring.cc:3488
#define idSimpleAdd(A, B)
Definition: ideals.h:44
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
const char * Name()
Definition: subexpr.h:122
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define IDTYP(a)
Definition: ipid.h:116
poly p_PermPoly(poly p, const int *perm, const ring oldRing, const ring dst, nMapFunc nMap, const int *par_perm, int OldPar, BOOLEAN use_mult)
Definition: p_polys.cc:3939
#define FLAG_TWOSTD
Definition: ipid.h:107
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:403
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
Definition: ring.h:404
The main handler for Singular numbers which are suitable for Singular polynomials.
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
Definition: coeffs.h:73
idrec * idhdl
Definition: ring.h:18
BOOLEAN assumeStdFlag(leftv h)
Definition: subexpr.cc:1458
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
Definition: coeffs.h:725
void idSkipZeroes(ideal ide)
gives an ideal/module the minimal possible size
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
ring rCopy(ring r)
Definition: ring.cc:1619
static BOOLEAN rField_is_Ring(const ring r)
Definition: ring.h:477
#define NULL
Definition: omList.c:10
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
#define hasFlag(A, F)
Definition: ipid.h:109
#define IDRING(a)
Definition: ipid.h:124
int rtyp
Definition: subexpr.h:93
static bool rIsSCA(const ring r)
Definition: nc.h:206
void * Data()
Definition: subexpr.cc:1121
ideal idrCopyR(ideal id, ring src_r, ring dest_r)
Definition: prCopy.cc:193
#define p_GetCoeff(p, r)
Definition: monomials.h:57
int idElem(const ideal F)
count non-zero elements
void rSetHdl(idhdl h)
Definition: ipshell.cc:5017
int perm[100]
static Poly * h
Definition: janet.cc:978
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:490
#define omAlloc0(size)
Definition: omAllocDecl.h:211
static FORCE_INLINE coeffs n_CoeffRingQuot1(number c, const coeffs r)
Definition: coeffs.h:522
#define Warn
Definition: emacs.cc:80

§ jiA_RESOLUTION()

static BOOLEAN jiA_RESOLUTION ( leftv  res,
leftv  a,
Subexpr   
)
static

Definition at line 824 of file ipassign.cc.

825 {
826  if (res->data!=NULL) syKillComputation((syStrategy)res->data);
827  res->data=(void *)a->CopyD(RESOLUTION_CMD);
828  jiAssignAttr(res,a);
829  return FALSE;
830 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define FALSE
Definition: auxiliary.h:97
void * data
Definition: subexpr.h:90
#define NULL
Definition: omList.c:10
void syKillComputation(syStrategy syzstr, ring r=currRing)
Definition: syz1.cc:1497
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_RING()

static BOOLEAN jiA_RING ( leftv  res,
leftv  a,
Subexpr  e 
)
static

Definition at line 1012 of file ipassign.cc.

1013 {
1014  BOOLEAN have_id=TRUE;
1015  if ((e!=NULL)||(res->rtyp!=IDHDL))
1016  {
1017  //WerrorS("id expected");
1018  //return TRUE;
1019  have_id=FALSE;
1020  }
1021  ring r=(ring)a->Data();
1022  if ((r==NULL)||(r->cf==NULL)) return TRUE;
1023  if (have_id)
1024  {
1025  idhdl rl=(idhdl)res->data;
1026  if (IDRING(rl)!=NULL) rKill(rl);
1027  IDRING(rl)=r;
1028  if ((IDLEV((idhdl)a->data)!=myynest) && (r==currRing))
1029  currRingHdl=(idhdl)res->data;
1030  }
1031  else
1032  {
1033  if (e==NULL) res->data=(char *)r;
1034  else
1035  {
1036  WerrorS("id expected");
1037  return TRUE;
1038  }
1039  }
1040  r->ref++;
1041  jiAssignAttr(res,a);
1042  return FALSE;
1043 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void WerrorS(const char *s)
Definition: feFopen.cc:24
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
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:10
const ring r
Definition: syzextra.cc:208
void rKill(ring r)
Definition: ipshell.cc:6044
idhdl currRingHdl
Definition: ipid.cc:65
idrec * idhdl
Definition: ring.h:18
#define IDLEV(a)
Definition: ipid.h:118
#define NULL
Definition: omList.c:10
#define IDRING(a)
Definition: ipid.h:124
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
int BOOLEAN
Definition: auxiliary.h:88

§ jiA_STRING()

static BOOLEAN jiA_STRING ( leftv  res,
leftv  a,
Subexpr  e 
)
static

Definition at line 736 of file ipassign.cc.

737 {
738  if (e==NULL)
739  {
740  void* tmp = res->data;
741  res->data=(void *)a->CopyD(STRING_CMD);
742  jiAssignAttr(res,a);
743  omfree(tmp);
744  }
745  else
746  {
747  char *s=(char *)res->data;
748  if ((e->start>0)&&(e->start<=(int)strlen(s)))
749  s[e->start-1]=(char)(*((char *)a->Data()));
750  else
751  {
752  Werror("string index %d out of range 1..%d",e->start,(int)strlen(s));
753  return TRUE;
754  }
755  }
756  return FALSE;
757 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
#define omfree(addr)
Definition: omAllocDecl.h:237
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:679

§ jiA_STRING_L()

static BOOLEAN jiA_STRING_L ( leftv  l,
leftv  r 
)
static

Definition at line 1651 of file ipassign.cc.

1652 {
1653  /*left side are strings, right side is a string*/
1654  /*e.g. s[2..3]="12" */
1655  /*the case s=t[1..4] is handled in iiAssign,
1656  * the case s[2..3]=t[3..4] is handled in iiAssgn_rec*/
1657  BOOLEAN nok=FALSE;
1658  sleftv t;
1659  leftv h,l1=l;
1660  int i=0;
1661  char *ss;
1662  char *s=(char *)r->Data();
1663  int sl=strlen(s);
1664 
1665  memset(&t,0,sizeof(sleftv));
1666  t.rtyp=STRING_CMD;
1667  while ((i<sl)&&(l!=NULL))
1668  {
1669  ss=(char *)omAlloc(2);
1670  ss[1]='\0';
1671  ss[0]=s[i];
1672  t.data=ss;
1673  h=l->next;
1674  l->next=NULL;
1675  nok=jiAssign_1(l,&t,TRUE);
1676  if (nok)
1677  {
1678  break;
1679  }
1680  i++;
1681  l=h;
1682  }
1683  r->CleanUp();
1684  l1->CleanUp();
1685  return nok;
1686 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
static BOOLEAN jiAssign_1(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1073
#define TRUE
Definition: auxiliary.h:101
#define omAlloc(size)
Definition: omAllocDecl.h:210
void * data
Definition: subexpr.h:90
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
void * Data()
Definition: subexpr.cc:1121
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88
int l
Definition: cfEzgcd.cc:94

§ jiA_VECTOR_L()

static BOOLEAN jiA_VECTOR_L ( leftv  l,
leftv  r 
)
static

Definition at line 1337 of file ipassign.cc.

1338 {
1339  /* right side is vector, left side is list (of poly)*/
1340  BOOLEAN nok;
1341  leftv l1=l;
1342  ideal I=idVec2Ideal((poly)r->Data());
1343  leftv h;
1344  sleftv t;
1345  int i=0;
1346  while (l!=NULL)
1347  {
1348  memset(&t,0,sizeof(sleftv));
1349  t.rtyp=POLY_CMD;
1350  if (i>=IDELEMS(I))
1351  {
1352  t.data=NULL;
1353  }
1354  else
1355  {
1356  t.data=(char *)I->m[i];
1357  I->m[i]=NULL;
1358  }
1359  h=l->next;
1360  l->next=NULL;
1361  nok=jiAssign_1(l,&t,TRUE);
1362  l->next=h;
1363  t.CleanUp();
1364  if (nok)
1365  {
1366  idDelete(&I);
1367  return TRUE;
1368  }
1369  i++;
1370  l=h;
1371  }
1372  idDelete(&I);
1373  l1->CleanUp();
1374  r->CleanUp();
1375  //if (TEST_V_QRING && (currRing->qideal!=NULL)) jjNormalizeQRingP(l);
1376  return FALSE;
1377 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define FALSE
Definition: auxiliary.h:97
static BOOLEAN jiAssign_1(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1073
#define TRUE
Definition: auxiliary.h:101
void * data
Definition: subexpr.h:90
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
void * Data()
Definition: subexpr.cc:1121
static ideal idVec2Ideal(poly vec)
Definition: ideals.h:156
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:88
int l
Definition: cfEzgcd.cc:94

§ jiAssign_1()

static BOOLEAN jiAssign_1 ( leftv  l,
leftv  r,
BOOLEAN  toplevel 
)
static

Definition at line 1073 of file ipassign.cc.

1074 {
1075  int rt=r->Typ();
1076  if (rt==0)
1077  {
1078  if (!errorreported) Werror("`%s` is undefined",r->Fullname());
1079  return TRUE;
1080  }
1081 
1082  int lt=l->Typ();
1083  if (lt==0)
1084  {
1085  if (!errorreported) Werror("left side `%s` is undefined",l->Fullname());
1086  return TRUE;
1087  }
1088  if(rt==NONE)
1089  {
1090  WarnS("right side is not a datum, assignment ignored");
1091  Warn("in line >>%s<<",my_yylinebuf);
1092  // if (!errorreported)
1093  // WerrorS("right side is not a datum");
1094  //return TRUE;
1095  return FALSE;
1096  }
1097 
1098  if (lt==DEF_CMD)
1099  {
1100  if (TEST_V_ALLWARN
1101  && (rt!=RING_CMD)
1102  && (l->name!=NULL)
1103  && (l->e==NULL)
1104  && (iiCurrArgs==NULL) /* not in proc header */
1105  )
1106  {
1107  Warn("use `%s` instead of `def` in %s:%d:%s",Tok2Cmdname(rt),
1109  }
1110  if (l->rtyp==IDHDL)
1111  {
1112  IDTYP((idhdl)l->data)=rt;
1113  }
1114  else if (l->name!=NULL)
1115  {
1116  sleftv ll;
1117  iiDeclCommand(&ll,l,myynest,rt,&IDROOT);
1118  memcpy(l,&ll,sizeof(sleftv));
1119  }
1120  else
1121  {
1122  l->rtyp=rt;
1123  }
1124  lt=rt;
1125  }
1126  else
1127  {
1128  if ((l->data==r->data)&&(l->e==NULL)&&(r->e==NULL))
1129  return FALSE;
1130  }
1131  leftv ld=l;
1132  if (l->rtyp==IDHDL)
1133  {
1134  if (lt!=RING_CMD)
1135  ld=(leftv)l->data;
1136  }
1137  else if (toplevel)
1138  {
1139  WerrorS("error in assign: left side is not an l-value");
1140  return TRUE;
1141  }
1142  if (lt>MAX_TOK)
1143  {
1144  blackbox *bb=getBlackboxStuff(lt);
1145 #ifdef BLACKBOX_DEVEL
1146  Print("bb-assign: bb=%lx\n",bb);
1147 #endif
1148  return (bb==NULL) || bb->blackbox_Assign(l,r);
1149  }
1150  int start=0;
1151  while ((dAssign[start].res!=lt)
1152  && (dAssign[start].res!=0)) start++;
1153  int i=start;
1154  while ((dAssign[i].res==lt)
1155  && (dAssign[i].arg!=rt)) i++;
1156  if (dAssign[i].res==lt)
1157  {
1158  if (traceit&TRACE_ASSIGN) Print("assign %s=%s\n",Tok2Cmdname(lt),Tok2Cmdname(rt));
1159  BOOLEAN b;
1160  b=dAssign[i].p(ld,r,l->e);
1161  if(l!=ld) /* i.e. l is IDHDL, l->data is ld */
1162  {
1163  l->flag=ld->flag;
1164  l->attribute=ld->attribute;
1165  }
1166  return b;
1167  }
1168  // implicite type conversion ----------------------------------------------
1169  if (dAssign[i].res!=lt)
1170  {
1171  int ri;
1173  BOOLEAN failed=FALSE;
1174  i=start;
1175  //while ((dAssign[i].res!=lt)
1176  // && (dAssign[i].res!=0)) i++;
1177  while (dAssign[i].res==lt)
1178  {
1179  if ((ri=iiTestConvert(rt,dAssign[i].arg))!=0)
1180  {
1181  failed= iiConvert(rt,dAssign[i].arg,ri,r,rn);
1182  if(!failed)
1183  {
1184  failed= dAssign[i].p(ld,rn,l->e);
1185  if (traceit&TRACE_ASSIGN)
1186  Print("assign %s=%s ok? %d\n",Tok2Cmdname(lt),Tok2Cmdname(rn->rtyp),!failed);
1187  }
1188  // everything done, clean up temp. variables
1189  rn->CleanUp();
1191  if (failed)
1192  {
1193  // leave loop, goto error handling
1194  break;
1195  }
1196  else
1197  {
1198  if(l!=ld) /* i.e. l is IDHDL, l->data is ld */
1199  {
1200  l->flag=ld->flag;
1201  l->attribute=ld->attribute;
1202  }
1203  // everything ok, return
1204  return FALSE;
1205  }
1206  }
1207  i++;
1208  }
1209  // error handling ---------------------------------------------------
1210  if (!errorreported)
1211  {
1212  if ((l->rtyp==IDHDL) && (l->e==NULL))
1213  Werror("`%s`(%s) = `%s` is not supported",
1214  Tok2Cmdname(lt),l->Name(),Tok2Cmdname(rt));
1215  else
1216  Werror("`%s` = `%s` is not supported"
1217  ,Tok2Cmdname(lt),Tok2Cmdname(rt));
1218  if (BVERBOSE(V_SHOW_USE))
1219  {
1220  i=0;
1221  while ((dAssign[i].res!=lt)
1222  && (dAssign[i].res!=0)) i++;
1223  while (dAssign[i].res==lt)
1224  {
1225  Werror("expected `%s` = `%s`"
1226  ,Tok2Cmdname(lt),Tok2Cmdname(dAssign[i].arg));
1227  i++;
1228  }
1229  }
1230  }
1231  }
1232  return TRUE;
1233 }
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:292
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define TRACE_ASSIGN
Definition: reporter.h:45
int yylineno
Definition: febase.cc:45
#define Print
Definition: emacs.cc:83
Subexpr e
Definition: subexpr.h:107
BITSET flag
Definition: subexpr.h:92
#define FALSE
Definition: auxiliary.h:97
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:360
char * filename
Definition: fevoices.h:62
Definition: tok.h:213
#define IDROOT
Definition: ipid.h:20
#define TRUE
Definition: auxiliary.h:101
void * ADDRESS
Definition: auxiliary.h:118
sleftv * leftv
Definition: structs.h:60
void WerrorS(const char *s)
Definition: feFopen.cc:24
int traceit
Definition: febase.cc:47
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:979
const char * Name()
Definition: subexpr.h:122
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
const char * Fullname()
Definition: subexpr.h:127
void * data
Definition: subexpr.h:90
poly res
Definition: myNF.cc:322
int myynest
Definition: febase.cc:46
#define V_SHOW_USE
Definition: options.h:50
#define IDTYP(a)
Definition: ipid.h:116
char my_yylinebuf[80]
Definition: febase.cc:48
Definition: tok.h:57
const char * name
Definition: subexpr.h:89
const struct sValAssign dAssign[]
Definition: table.h:1261
omBin sleftv_bin
Definition: subexpr.cc:50
int i
Definition: cfEzgcd.cc:123
short errorreported
Definition: feFopen.cc:23
#define BVERBOSE(a)
Definition: options.h:33
int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl *root, BOOLEAN isring, BOOLEAN init_b)
Definition: ipshell.cc:1124
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:128
Voice * currentVoice
Definition: fevoices.cc:57
leftv iiCurrArgs
Definition: ipshell.cc:78
int rtyp
Definition: subexpr.h:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
attr attribute
Definition: subexpr.h:91
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int BOOLEAN
Definition: auxiliary.h:88
const poly b
Definition: syzextra.cc:213
#define NONE
Definition: tok.h:216
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define TEST_V_ALLWARN
Definition: options.h:135
int l
Definition: cfEzgcd.cc:94
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
Definition: blackbox.cc:16
#define Warn
Definition: emacs.cc:80

§ jiAssign_list()

static BOOLEAN jiAssign_list ( leftv  l,
leftv  r 
)
static

Definition at line 1687 of file ipassign.cc.

1688 {
1689  int i=l->e->start-1;
1690  if (i<0)
1691  {
1692  Werror("index[%d] must be positive",i+1);
1693  return TRUE;
1694  }
1695  if(l->attribute!=NULL)
1696  {
1697  atKillAll((idhdl)l);
1698  l->attribute=NULL;
1699  }
1700  l->flag=0;
1701  lists li;
1702  if (l->rtyp==IDHDL)
1703  {
1704  li=IDLIST((idhdl)l->data);
1705  }
1706  else
1707  {
1708  li=(lists)l->data;
1709  }
1710  if (i>li->nr)
1711  {
1712  if (TEST_V_ALLWARN)
1713  {
1714  Warn("increase list %d -> %d in %s",li->nr,i,my_yylinebuf);
1715  }
1716  li->m=(leftv)omreallocSize(li->m,(li->nr+1)*sizeof(sleftv),(i+1)*sizeof(sleftv));
1717  memset(&(li->m[li->nr+1]),0,(i-li->nr)*sizeof(sleftv));
1718  int j=li->nr+1;
1719  for(;j<=i;j++)
1720  li->m[j].rtyp=DEF_CMD;
1721  li->nr=i;
1722  }
1723  leftv ld=&(li->m[i]);
1724  ld->e=l->e->next;
1725  BOOLEAN b;
1726  if (/*(ld->rtyp!=LIST_CMD)
1727  &&*/(ld->e==NULL)
1728  && (ld->Typ()!=r->Typ()))
1729  {
1730  sleftv tmp;
1731  memset(&tmp,0,sizeof(sleftv));
1732  tmp.rtyp=DEF_CMD;
1733  b=iiAssign(&tmp,r,FALSE);
1734  ld->CleanUp();
1735  memcpy(ld,&tmp,sizeof(sleftv));
1736  }
1737  else if ((ld->e==NULL)
1738  && (ld->Typ()==r->Typ())
1739  && (ld->Typ()<MAX_TOK))
1740  {
1741  sleftv tmp;
1742  memset(&tmp,0,sizeof(sleftv));
1743  tmp.rtyp=r->Typ();
1744  tmp.data=(char*)idrecDataInit(r->Typ());
1745  b=iiAssign(&tmp,r,FALSE);
1746  ld->CleanUp();
1747  memcpy(ld,&tmp,sizeof(sleftv));
1748  }
1749  else
1750  {
1751  b=iiAssign(ld,r,FALSE);
1752  if (l->e!=NULL) l->e->next=ld->e;
1753  ld->e=NULL;
1754  }
1755  return b;
1756 }
void * idrecDataInit(int t)
Definition: ipid.cc:132
#define IDLIST(a)
Definition: ipid.h:134
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Subexpr e
Definition: subexpr.h:107
BITSET flag
Definition: subexpr.h:92
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:97
#define omreallocSize(addr, o_size, size)
Definition: omAllocDecl.h:231
Definition: tok.h:213
#define TRUE
Definition: auxiliary.h:101
sleftv * leftv
Definition: structs.h:60
int Typ()
Definition: subexpr.cc:979
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
char my_yylinebuf[80]
Definition: febase.cc:48
int j
Definition: myNF.cc:70
Definition: tok.h:57
int i
Definition: cfEzgcd.cc:123
#define atKillAll(H)
Definition: attrib.h:42
int nr
Definition: lists.h:43
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
attr attribute
Definition: subexpr.h:91
int BOOLEAN
Definition: auxiliary.h:88
const poly b
Definition: syzextra.cc:213
void Werror(const char *fmt,...)
Definition: reporter.cc:189
#define TEST_V_ALLWARN
Definition: options.h:135
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1780
#define Warn
Definition: emacs.cc:80

§ jiAssign_rec()

static BOOLEAN jiAssign_rec ( leftv  l,
leftv  r 
)
static

Definition at line 1757 of file ipassign.cc.

1758 {
1759  leftv l1=l;
1760  leftv r1=r;
1761  leftv lrest;
1762  leftv rrest;
1763  BOOLEAN b;
1764  do
1765  {
1766  lrest=l->next;
1767  rrest=r->next;
1768  l->next=NULL;
1769  r->next=NULL;
1770  b=iiAssign(l,r);
1771  l->next=lrest;
1772  r->next=rrest;
1773  l=lrest;
1774  r=rrest;
1775  } while ((!b)&&(l!=NULL));
1776  l1->CleanUp();
1777  r1->CleanUp();
1778  return b;
1779 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
const ring r
Definition: syzextra.cc:208
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
int BOOLEAN
Definition: auxiliary.h:88
const poly b
Definition: syzextra.cc:213
int l
Definition: cfEzgcd.cc:94
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1780

§ jiAssignAttr()

static void jiAssignAttr ( leftv  l,
leftv  r 
)
static

Definition at line 322 of file ipassign.cc.

323 {
324  // get the attribute of th right side
325  // and set it to l
326  leftv rv=r->LData();
327  if (rv!=NULL)
328  {
329  if (rv->e==NULL)
330  {
331  if (rv->attribute!=NULL)
332  {
333  attr la;
334  if (r->rtyp!=IDHDL)
335  {
336  la=rv->attribute;
337  rv->attribute=NULL;
338  }
339  else
340  {
341  la=rv->attribute->Copy();
342  }
343  l->attribute=la;
344  }
345  l->flag=rv->flag;
346  }
347  }
348  if (l->rtyp==IDHDL)
349  {
350  idhdl h=(idhdl)l->data;
351  IDATTR(h)=l->attribute;
352  IDFLAG(h)=l->flag;
353  }
354 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Definition: attrib.h:15
Subexpr e
Definition: subexpr.h:107
BITSET flag
Definition: subexpr.h:92
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
idrec * idhdl
Definition: ring.h:18
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:93
#define IDFLAG(a)
Definition: ipid.h:117
#define IDATTR(a)
Definition: ipid.h:120
attr Copy()
Definition: attrib.cc:41
attr attribute
Definition: subexpr.h:91
static Poly * h
Definition: janet.cc:978
leftv LData()
Definition: subexpr.cc:1390

§ jjA_L_BIGINTMAT()

static BOOLEAN jjA_L_BIGINTMAT ( leftv  l,
leftv  r,
bigintmat bim 
)
static

Definition at line 1492 of file ipassign.cc.

1493 {
1494  /* left side is bigintmat, right side is list (of int,intvec,intmat)*/
1495  leftv hh=r;
1496  int i = 0;
1497  if (bim->length()==0) { WerrorS("bigintmat is 1x0"); delete bim; return TRUE; }
1498  while (hh!=NULL)
1499  {
1500  if (i>=bim->cols()*bim->rows())
1501  {
1502  if (traceit&TRACE_ASSIGN)
1503  {
1504  Warn("expression list length(%d) does not match bigintmat size(%d x %d)",
1505  exprlist_length(hh),bim->rows(),bim->cols());
1506  }
1507  break;
1508  }
1509  if (hh->Typ() == INT_CMD)
1510  {
1511  number tp = n_Init((int)((long)(hh->Data())), coeffs_BIGINT);
1512  bim->set(i++, tp);
1513  n_Delete(&tp, coeffs_BIGINT);
1514  }
1515  else if (hh->Typ() == BIGINT_CMD)
1516  {
1517  bim->set(i++, (number)(hh->Data()));
1518  }
1519  /*
1520  ((hh->Typ() == INTVEC_CMD)
1521  ||(hh->Typ() == INTMAT_CMD))
1522  {
1523  intvec *ivv = (intvec *)(hh->Data());
1524  int ll = 0,l = si_min(ivv->length(),iv->length());
1525  for (; l>0; l--)
1526  {
1527  (*iv)[i++] = (*ivv)[ll++];
1528  }
1529  }*/
1530  else
1531  {
1532  delete bim;
1533  return TRUE;
1534  }
1535  hh = hh->next;
1536  }
1537  if (IDBIMAT((idhdl)l->data)!=NULL) delete IDBIMAT((idhdl)l->data);
1538  IDBIMAT((idhdl)l->data)=bim;
1539  return FALSE;
1540 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define TRACE_ASSIGN
Definition: reporter.h:45
Definition: tok.h:94
#define FALSE
Definition: auxiliary.h:97
Definition: tok.h:38
int exprlist_length(leftv v)
Definition: ipshell.cc:546
int rows() const
Definition: bigintmat.h:146
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:542
#define TRUE
Definition: auxiliary.h:101
int length()
Definition: bigintmat.h:144
#define IDBIMAT(a)
Definition: ipid.h:126
void WerrorS(const char *s)
Definition: feFopen.cc:24
int traceit
Definition: febase.cc:47
coeffs coeffs_BIGINT
Definition: ipid.cc:54
int Typ()
Definition: subexpr.cc:979
Definition: idrec.h:34
void set(int i, int j, number n, const coeffs C=NULL)
replace an entry with a copy (delete old + copy new!). NOTE: starts at [1,1]
Definition: bigintmat.cc:96
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
int cols() const
Definition: bigintmat.h:145
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
#define Warn
Definition: emacs.cc:80

§ jjA_L_INTVEC()

static BOOLEAN jjA_L_INTVEC ( leftv  l,
leftv  r,
intvec iv 
)
static

Definition at line 1443 of file ipassign.cc.

1444 {
1445  /* left side is intvec/intmat, right side is list (of int,intvec,intmat)*/
1446  leftv hh=r;
1447  int i = 0;
1448  while (hh!=NULL)
1449  {
1450  if (i>=iv->length())
1451  {
1452  if (traceit&TRACE_ASSIGN)
1453  {
1454  Warn("expression list length(%d) does not match intmat size(%d)",
1455  iv->length()+exprlist_length(hh),iv->length());
1456  }
1457  break;
1458  }
1459  if (hh->Typ() == INT_CMD)
1460  {
1461  (*iv)[i++] = (int)((long)(hh->Data()));
1462  }
1463  else if ((hh->Typ() == INTVEC_CMD)
1464  ||(hh->Typ() == INTMAT_CMD))
1465  {
1466  intvec *ivv = (intvec *)(hh->Data());
1467  int ll = 0,l = si_min(ivv->length(),iv->length());
1468  for (; l>0; l--)
1469  {
1470  (*iv)[i++] = (*ivv)[ll++];
1471  }
1472  }
1473  else
1474  {
1475  delete iv;
1476  return TRUE;
1477  }
1478  hh = hh->next;
1479  }
1480  if (l->rtyp==IDHDL)
1481  {
1482  if (IDINTVEC((idhdl)l->data)!=NULL) delete IDINTVEC((idhdl)l->data);
1483  IDINTVEC((idhdl)l->data)=iv;
1484  }
1485  else
1486  {
1487  if (l->data!=NULL) delete ((intvec*)l->data);
1488  l->data=(char*)iv;
1489  }
1490  return FALSE;
1491 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define TRACE_ASSIGN
Definition: reporter.h:45
Definition: tok.h:94
#define IDINTVEC(a)
Definition: ipid.h:125
static int si_min(const int a, const int b)
Definition: auxiliary.h:124
#define FALSE
Definition: auxiliary.h:97
int exprlist_length(leftv v)
Definition: ipshell.cc:546
#define TRUE
Definition: auxiliary.h:101
int traceit
Definition: febase.cc:47
int Typ()
Definition: subexpr.cc:979
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
Definition: tok.h:99
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
#define Warn
Definition: emacs.cc:80

§ jjA_L_LIST()

static BOOLEAN jjA_L_LIST ( leftv  l,
leftv  r 
)
static

Definition at line 1378 of file ipassign.cc.

1382 {
1383  int sl = r->listLength();
1385  lists oldL;
1386  leftv h=NULL,o_r=r;
1387  int i;
1388  int rt;
1389 
1390  L->Init(sl);
1391  for (i=0;i<sl;i++)
1392  {
1393  if (h!=NULL) { /* e.g. not in the first step:
1394  * h is the pointer to the old sleftv,
1395  * r is the pointer to the next sleftv
1396  * (in this moment) */
1397  h->next=r;
1398  }
1399  h=r;
1400  r=r->next;
1401  h->next=NULL;
1402  rt=h->Typ();
1403  if ((rt==0)||(rt==NONE)||(rt==DEF_CMD))
1404  {
1405  L->Clean();
1406  Werror("`%s` is undefined",h->Fullname());
1407  //listall();
1408  goto err;
1409  }
1410  //if (rt==RING_CMD)
1411  //{
1412  // L->m[i].rtyp=rt;
1413  // L->m[i].data=h->Data();
1414  // ((ring)L->m[i].data)->ref++;
1415  //}
1416  //else
1417  L->m[i].CleanUp();
1418  L->m[i].Copy(h);
1419  if(errorreported)
1420  {
1421  L->Clean();
1422  goto err;
1423  }
1424  }
1425  oldL=(lists)l->Data();
1426  if (oldL!=NULL) oldL->Clean();
1427  if (l->rtyp==IDHDL)
1428  {
1429  IDLIST((idhdl)l->data)=L;
1430  IDTYP((idhdl)l->data)=LIST_CMD; // was possibly DEF_CMD
1431  if (lRingDependend(L)) ipMoveId((idhdl)l->data);
1432  }
1433  else
1434  {
1435  l->LData()->data=L;
1436  if ((l->e!=NULL) && (l->rtyp==DEF_CMD))
1437  l->rtyp=LIST_CMD;
1438  }
1439 err:
1440  o_r->CleanUp();
1441  return errorreported;
1442 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
#define IDLIST(a)
Definition: ipid.h:134
void ipMoveId(idhdl tomove)
Definition: ipid.cc:604
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
Subexpr e
Definition: subexpr.h:107
Definition: lists.h:22
int listLength()
Definition: subexpr.cc:61
int Typ()
Definition: subexpr.cc:979
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
const char * Fullname()
Definition: subexpr.h:127
void * data
Definition: subexpr.h:90
#define IDTYP(a)
Definition: ipid.h:116
const ring r
Definition: syzextra.cc:208
Definition: tok.h:57
void Copy(leftv e)
Definition: subexpr.cc:660
int i
Definition: cfEzgcd.cc:123
short errorreported
Definition: feFopen.cc:23
leftv next
Definition: subexpr.h:88
INLINE_THIS void Init(int l=0)
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
int rtyp
Definition: subexpr.h:93
void CleanUp(ring r=currRing)
Definition: subexpr.cc:320
void Clean(ring r=currRing)
Definition: lists.h:25
void * Data()
Definition: subexpr.cc:1121
Definition: tok.h:116
omBin slists_bin
Definition: lists.cc:23
static Poly * h
Definition: janet.cc:978
#define NONE
Definition: tok.h:216
BOOLEAN lRingDependend(lists L)
Definition: lists.cc:199
leftv LData()
Definition: subexpr.cc:1390
void Werror(const char *fmt,...)
Definition: reporter.cc:189

§ jjA_L_STRING()

static BOOLEAN jjA_L_STRING ( leftv  l,
leftv  r 
)
static

Definition at line 1541 of file ipassign.cc.

1542 {
1543  /* left side is string, right side is list of string*/
1544  leftv hh=r;
1545  int sl = 1;
1546  char *s;
1547  char *t;
1548  int tl;
1549  /* find the length */
1550  while (hh!=NULL)
1551  {
1552  if (hh->Typ()!= STRING_CMD)
1553  {
1554  return TRUE;
1555  }
1556  sl += strlen((char *)hh->Data());
1557  hh = hh->next;
1558  }
1559  s = (char * )omAlloc(sl);
1560  sl=0;
1561  hh = r;
1562  while (hh!=NULL)
1563  {
1564  t=(char *)hh->Data();
1565  tl=strlen(t);
1566  memcpy(s+sl,t,tl);
1567  sl+=tl;
1568  hh = hh->next;
1569  }
1570  s[sl]='\0';
1571  omFree((ADDRESS)IDDATA((idhdl)(l->data)));
1572  IDDATA((idhdl)(l->data))=s;
1573  return FALSE;
1574 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
#define TRUE
Definition: auxiliary.h:101
void * ADDRESS
Definition: auxiliary.h:118
int Typ()
Definition: subexpr.cc:979
#define omAlloc(size)
Definition: omAllocDecl.h:210
Definition: idrec.h:34
void * data
Definition: subexpr.h:90
const ring r
Definition: syzextra.cc:208
#define omFree(addr)
Definition: omAllocDecl.h:261
leftv next
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
#define IDDATA(a)
Definition: ipid.h:123

§ jjCOLMAX()

static BOOLEAN jjCOLMAX ( leftv  ,
leftv  a 
)
static

Definition at line 69 of file ipassign.cc.

70 {
71  colmax=(int)((long)(a->Data()));
72  return FALSE;
73 }
#define FALSE
Definition: auxiliary.h:97
void * Data()
Definition: subexpr.cc:1121
int colmax
Definition: febase.cc:43

§ jjECHO()

static BOOLEAN jjECHO ( leftv  ,
leftv  a 
)
static

Definition at line 59 of file ipassign.cc.

60 {
61  si_echo=(int)((long)(a->Data()));
62  return FALSE;
63 }
#define FALSE
Definition: auxiliary.h:97
void * Data()
Definition: subexpr.cc:1121
int si_echo
Definition: febase.cc:41

§ jjIMPORTFROM()

BOOLEAN jjIMPORTFROM ( leftv  ,
leftv  u,
leftv  v 
)

Definition at line 2172 of file ipassign.cc.

2173 {
2174  //Print("importfrom %s::%s ->.\n",v->Name(),u->Name() );
2175  assume(u->Typ()==PACKAGE_CMD);
2176  char *vn=(char *)v->Name();
2177  idhdl h=((package)(u->Data()))->idroot->get(vn /*v->Name()*/, myynest);
2178  if (h!=NULL)
2179  {
2180  //check for existence
2181  if (((package)(u->Data()))==basePack)
2182  {
2183  WarnS("source and destination packages are identical");
2184  return FALSE;
2185  }
2186  idhdl t=basePack->idroot->get(vn /*v->Name()*/, myynest);
2187  if (t!=NULL)
2188  {
2189  Warn("redefining %s (%s)",vn,my_yylinebuf);
2190  killhdl(t);
2191  }
2192  sleftv tmp_expr;
2193  if (iiDeclCommand(&tmp_expr,v,myynest,DEF_CMD,&IDROOT)) return TRUE;
2194  sleftv h_expr;
2195  memset(&h_expr,0,sizeof(h_expr));
2196  h_expr.rtyp=IDHDL;
2197  h_expr.data=h;
2198  h_expr.name=vn;
2199  return iiAssign(&tmp_expr,&h_expr);
2200  }
2201  else
2202  {
2203  Werror("`%s` not found in `%s`",v->Name(), u->Name());
2204  return TRUE;
2205  }
2206  return FALSE;
2207 }
ip_package * package
Definition: structs.h:46
Class used for (list of) interpreter objects.
Definition: subexpr.h:84
#define FALSE
Definition: auxiliary.h:97
#define IDROOT
Definition: ipid.h:20
#define TRUE
Definition: auxiliary.h:101
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:979
const char * Name()
Definition: subexpr.h:122
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
int myynest
Definition: febase.cc:46
char my_yylinebuf[80]
Definition: febase.cc:48
Definition: tok.h:57
const char * name
Definition: subexpr.h:89
#define assume(x)
Definition: mod2.h:403
int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl *root, BOOLEAN isring, BOOLEAN init_b)
Definition: ipshell.cc:1124
#define NULL
Definition: omList.c:10
void killhdl(idhdl h, package proot)
Definition: ipid.cc:372
package basePack
Definition: ipid.cc:64
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
static Poly * h
Definition: janet.cc:978
void Werror(const char *fmt,...)
Definition: reporter.cc:189
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1780
#define Warn
Definition: emacs.cc:80

§ jjMAXDEG()

static BOOLEAN jjMAXDEG ( leftv  ,
leftv  a 
)
static

Definition at line 88 of file ipassign.cc.

89 {
90  Kstd1_deg=(int)((long)(a->Data()));
91  if (Kstd1_deg!=0)
93  else
95  return FALSE;
96 }
unsigned si_opt_1
Definition: options.c:5
#define FALSE
Definition: auxiliary.h:97
#define Sy_bit(x)
Definition: options.h:30
void * Data()
Definition: subexpr.cc:1121
#define OPT_DEGBOUND
Definition: options.h:85
int Kstd1_deg
Definition: kutil.cc:236

§ jjMAXMULT()

static BOOLEAN jjMAXMULT ( leftv  ,
leftv  a 
)
static

Definition at line 97 of file ipassign.cc.

98 {
99  Kstd1_mu=(int)((long)(a->Data()));
100  if (Kstd1_mu!=0)
102  else
104  return FALSE;
105 }
unsigned si_opt_1
Definition: options.c:5
#define FALSE
Definition: auxiliary.h:97
#define OPT_MULTBOUND
Definition: options.h:84
#define Sy_bit(x)
Definition: options.h:30
int Kstd1_mu
Definition: kutil.cc:237
void * Data()
Definition: subexpr.cc:1121

§ jjMINPOLY()

static BOOLEAN jjMINPOLY ( leftv  ,
leftv  a 
)
static

Definition at line 181 of file ipassign.cc.

182 {
183  if( !nCoeff_is_transExt(currRing->cf) && (currRing->idroot == NULL) && n_IsZero((number)a->Data(), currRing->cf) )
184  {
185 #ifndef SING_NDEBUG
186  WarnS("Set minpoly over non-transcendental ground field to 0?!");
187  Warn("in >>%s<<",my_yylinebuf);
188 #endif
189  return FALSE;
190  }
191 
192 
193  if ( !nCoeff_is_transExt(currRing->cf) )
194  {
195  WarnS("Trying to set minpoly over non-transcendental ground field...");
196  if(!nCoeff_is_algExt(currRing->cf) )
197  {
198  WerrorS("cannot set minpoly for these coeffients");
199  return TRUE;
200  }
201  }
202  if ((rVar(currRing->cf->extRing)!=1)
203  && !n_IsZero((number)a->Data(), currRing->cf) )
204  {
205  WerrorS("only univarite minpoly allowed");
206  return TRUE;
207  }
208 
209  if ( currRing->idroot != NULL )
210  {
211 // return TRUE;
212 #ifndef SING_NDEBUG
213  idhdl p = currRing->idroot;
214 
215  WarnS("no minpoly allowed if there are local objects belonging to the basering: ");
216 
217  while(p != NULL)
218  {
219  PrintS(p->String(TRUE)); PrintLn();
220  p = p->next;
221  }
222 #endif
223  }
224 
225 // assume (currRing->idroot==NULL);
226 
227  number p = (number)a->CopyD(NUMBER_CMD);
228  n_Normalize(p, currRing->cf);
229 
230  if (n_IsZero(p, currRing->cf))
231  {
232  n_Delete(&p, currRing);
233  if( nCoeff_is_transExt(currRing->cf) )
234  {
235 #ifndef SING_NDEBUG
236  WarnS("minpoly is already 0...");
237 #endif
238  return FALSE;
239  }
240  WarnS("cannot set minpoly to 0 / alg. extension?");
241  return TRUE;
242  }
243 
244  // remove all object currently in the ring
245  while(currRing->idroot!=NULL)
246  {
247 #ifndef SING_NDEBUG
248  Warn("killing a local object due to minpoly change: %s", IDID(currRing->idroot));
249 #endif
250  killhdl2(currRing->idroot,&(currRing->idroot),currRing);
251  }
252 
253  AlgExtInfo A;
254 
255  A.r = rCopy(currRing->cf->extRing); // Copy ground field!
256  // if minpoly was already set:
257  if( currRing->cf->extRing->qideal != NULL ) id_Delete(&(A.r->qideal),A.r);
258  ideal q = idInit(1,1);
259  if ((p==NULL) ||(NUM((fraction)p)==NULL))
260  {
261  WerrorS("Could not construct the alg. extension: minpoly==0");
262  // cleanup A: TODO
263  rDelete( A.r );
264  return TRUE;
265  }
266  if (DEN((fraction)(p)) != NULL) // minpoly must be a fraction with poly numerator...!!
267  {
268  poly z=NUM((fraction)p);
269  poly n=DEN((fraction)(p));
270  z=p_Mult_nn(z,pGetCoeff(n),currRing->cf->extRing);
271  NUM((fraction)p)=z;
272  DEN((fraction)(p))=NULL;
273  p_Delete(&n,currRing->cf->extRing);
274  }
275 
276  q->m[0] = NUM((fraction)p);
277  A.r->qideal = q;
278 
279 #if 0
280  PrintS("\nTrying to conver the currRing into an algebraic field: ");
281  PrintS("Ground poly. ring: \n");
282  rWrite( A.r );
283  PrintS("\nGiven MinPOLY: ");
284  p_Write( A.i->m[0], A.r );
285 #endif
286 
287  // :(
288 // NUM((fractionObject *)p) = NULL; // makes 0/ NULL fraction - which should not happen!
289 // n_Delete(&p, currRing->cf); // doesn't expect 0/ NULL :(
290  if(true)
291  {
292  extern omBin fractionObjectBin;
293  NUM((fractionObject *)p) = NULL; // not necessary, but still...
294  omFreeBin((ADDRESS)p, fractionObjectBin);
295  }
296 
297 
298  coeffs new_cf = nInitChar(n_algExt, &A);
299 
300  if (new_cf==NULL)
301  {
302  WerrorS("Could not construct the alg. extension: llegal minpoly?");
303  // cleanup A: TODO
304  rDelete( A.r );
305  return TRUE;
306  }
307  else
308  {
309  nKillChar(currRing->cf); currRing->cf=new_cf;
310  }
311 
312  return FALSE;
313 }
omBin_t * omBin
Definition: omStructs.h:12
void PrintLn()
Definition: reporter.cc:310
ring r
Definition: algext.h:40
#define IDID(a)
Definition: ipid.h:119
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:580
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:101
static FORCE_INLINE void n_Normalize(number &n, const coeffs r)
inplace-normalization of n; produces some canonical representation of n;
Definition: coeffs.h:582
void * ADDRESS
Definition: auxiliary.h:118
void WerrorS(const char *s)
Definition: feFopen.cc:24
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
#define WarnS
Definition: emacs.cc:81
char * String(BOOLEAN typed=FALSE)
Definition: ipid.cc:249
Definition: idrec.h:34
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
void killhdl2(idhdl h, idhdl *ih, ring r)
Definition: ipid.cc:403
char my_yylinebuf[80]
Definition: febase.cc:48
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
Definition: coeffs.h:924
The main handler for Singular numbers which are suitable for Singular polynomials.
#define A
Definition: sirandom.c:23
static FORCE_INLINE BOOLEAN nCoeff_is_transExt(const coeffs r)
TRUE iff r represents a transcendental extension field.
Definition: coeffs.h:932
void PrintS(const char *s)
Definition: reporter.cc:284
static poly p_Mult_nn(poly p, number n, const ring r)
Definition: p_polys.h:895
idhdl next
Definition: idrec.h:38
void rWrite(ring r, BOOLEAN details)
Definition: ring.cc:236
static FORCE_INLINE BOOLEAN n_IsZero(number n, const coeffs r)
TRUE iff &#39;n&#39; represents the zero element.
Definition: coeffs.h:468
static void p_Delete(poly *p, const ring r)
Definition: p_polys.h:843
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
ring rCopy(ring r)
Definition: ring.cc:1619
#define NULL
Definition: omList.c:10
struct for passing initialization parameters to naInitChar
Definition: algext.h:40
void rDelete(ring r)
unconditionally deletes fields in r
Definition: ring.cc:448
used for all algebraic extensions, i.e., the top-most extension in an extension tower is algebraic ...
Definition: coeffs.h:36
void * Data()
Definition: subexpr.cc:1121
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete &#39;p&#39;
Definition: coeffs.h:459
void p_Write(poly p, ring lmRing, ring tailRing)
Definition: polys0.cc:206
polyrec * poly
Definition: hilb.h:10
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:490
void * CopyD(int t)
Definition: subexpr.cc:679
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:329
omBin fractionObjectBin
Definition: transext.cc:90
#define Warn
Definition: emacs.cc:80

§ jjMINPOLY_red()

static void jjMINPOLY_red ( idhdl  h)
static

Definition at line 136 of file ipassign.cc.

137 {
138  switch(IDTYP(h))
139  {
140  case NUMBER_CMD:
141  {
142  number n=(number)IDDATA(h);
143  number one = nInit(1);
144  number nn=nMult(n,one);
145  nDelete(&n);nDelete(&one);
146  IDDATA(h)=(char*)nn;
147  break;
148  }
149  case VECTOR_CMD:
150  case POLY_CMD:
151  {
152  poly p=(poly)IDDATA(h);
153  IDDATA(h)=(char*)p_MinPolyNormalize(p, currRing);
154  break;
155  }
156  case IDEAL_CMD:
157  case MODUL_CMD:
158  case MAP_CMD:
159  case MATRIX_CMD:
160  {
161  int i;
162  ideal I=(ideal)IDDATA(h);
163  for(i=IDELEMS(I)-1;i>=0;i--)
164  I->m[i]=p_MinPolyNormalize(I->m[i], currRing);
165  break;
166  }
167  case LIST_CMD:
168  {
169  lists L=(lists)IDDATA(h);
170  int i=L->nr;
171  for(;i>=0;i--)
172  {
173  jjMINPOLY_red((idhdl)&(L->m[i]));
174  }
175  }
176  default:
177  //case RESOLUTION_CMD:
178  Werror("type %d too complex...set minpoly before",IDTYP(h)); break;
179  }
180 }
sleftv * m
Definition: lists.h:45
Definition: lists.h:22
return P p
Definition: myNF.cc:203
Definition: idrec.h:34
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define IDTYP(a)
Definition: ipid.h:116
#define nMult(n1, n2)
Definition: numbers.h:17
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
#define nDelete(n)
Definition: numbers.h:16
poly p_MinPolyNormalize(poly p, const ring r)
Definition: maps.cc:328
int nr
Definition: lists.h:43
slists * lists
Definition: mpr_numeric.h:146
Definition: tok.h:116
polyrec * poly
Definition: hilb.h:10
#define IDDATA(a)
Definition: ipid.h:123
#define nInit(i)
Definition: numbers.h:24
void Werror(const char *fmt,...)
Definition: reporter.cc:189
static void jjMINPOLY_red(idhdl h)
Definition: ipassign.cc:136

§ jjNOETHER()

static BOOLEAN jjNOETHER ( leftv  ,
leftv  a 
)
static

Definition at line 314 of file ipassign.cc.

315 {
316  poly p=(poly)a->CopyD(POLY_CMD);
317  pDelete(&(currRing->ppNoether));
318  (currRing->ppNoether)=p;
319  return FALSE;
320 }
#define FALSE
Definition: auxiliary.h:97
return P p
Definition: myNF.cc:203
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define pDelete(p_ptr)
Definition: polys.h:169
polyrec * poly
Definition: hilb.h:10
void * CopyD(int t)
Definition: subexpr.cc:679

§ jjNormalizeQRingId()

void jjNormalizeQRingId ( leftv  I)

Definition at line 2125 of file ipassign.cc.

2126 {
2127  if ((currRing->qideal!=NULL) && (!hasFlag(I,FLAG_QRING)))
2128  {
2129  if (I->e==NULL)
2130  {
2131  ideal I0=(ideal)I->Data();
2132  switch (I->Typ())
2133  {
2134  case IDEAL_CMD:
2135  case MODUL_CMD:
2136  {
2137  ideal F=idInit(1,1);
2138  ideal II=kNF(F,currRing->qideal,I0);
2139  idDelete(&F);
2140  if (I->rtyp!=IDHDL)
2141  {
2142  idDelete((ideal*)&(I0));
2143  I->data=II;
2144  }
2145  else
2146  {
2147  idhdl h=(idhdl)I->data;
2148  idDelete((ideal*)&IDIDEAL(h));
2149  IDIDEAL(h)=II;
2150  setFlag(h,FLAG_QRING);
2151  }
2152  break;
2153  }
2154  default: break;
2155  }
2156  setFlag(I,FLAG_QRING);
2157  }
2158  }
2159 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
Subexpr e
Definition: subexpr.h:107
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
#define IDIDEAL(a)
Definition: ipid.h:130
int Typ()
Definition: subexpr.cc:979
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:90
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define setFlag(A, F)
Definition: ipid.h:110
idrec * idhdl
Definition: ring.h:18
#define FLAG_QRING
Definition: ipid.h:108
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
#define hasFlag(A, F)
Definition: ipid.h:109
int rtyp
Definition: subexpr.h:93
void * Data()
Definition: subexpr.cc:1121
static Poly * h
Definition: janet.cc:978

§ jjNormalizeQRingP()

void jjNormalizeQRingP ( poly p)

Definition at line 2160 of file ipassign.cc.

2161 {
2162  if((p!=NULL) && (currRing->qideal!=NULL))
2163  {
2164  ideal F=idInit(1,1);
2165  poly p2=kNF(F,currRing->qideal,p);
2166  pNormalize(p2);
2167  idDelete(&F);
2168  pDelete(&p);
2169  p=p2;
2170  }
2171 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
#define idDelete(H)
delete an ideal
Definition: ideals.h:31
return P p
Definition: myNF.cc:203
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
pNormalize(P.p)
ideal idInit(int idsize, int rank)
initialise an ideal / module
Definition: simpleideals.cc:38
#define NULL
Definition: omList.c:10
#define pDelete(p_ptr)
Definition: polys.h:169
END_NAMESPACE const void * p2
Definition: syzextra.cc:202
polyrec * poly
Definition: hilb.h:10

§ jjPRINTLEVEL()

static BOOLEAN jjPRINTLEVEL ( leftv  ,
leftv  a 
)
static

Definition at line 64 of file ipassign.cc.

65 {
66  printlevel=(int)((long)(a->Data()));
67  return FALSE;
68 }
#define FALSE
Definition: auxiliary.h:97
void * Data()
Definition: subexpr.cc:1121
int printlevel
Definition: febase.cc:42

§ jjRTIMER()

static BOOLEAN jjRTIMER ( leftv  ,
leftv  a 
)
static

Definition at line 81 of file ipassign.cc.

82 {
83  rtimerv=(int)((long)(a->Data()));
84  initRTimer();
85  return FALSE;
86 }
#define FALSE
Definition: auxiliary.h:97
void initRTimer()
Definition: timer.cc:158
void * Data()
Definition: subexpr.cc:1121
int rtimerv
Definition: timer.cc:148

§ jjSHORTOUT()

static BOOLEAN jjSHORTOUT ( leftv  ,
leftv  a 
)
static

Definition at line 111 of file ipassign.cc.

112 {
113  if (currRing != NULL)
114  {
115  BOOLEAN shortOut = (BOOLEAN)((long)a->Data());
116 #if HAVE_CAN_SHORT_OUT
117  if (!shortOut)
118  currRing->ShortOut = 0;
119  else
120  {
121  if (currRing->CanShortOut)
122  currRing->ShortOut = 1;
123  }
124 #else
125  currRing->ShortOut = shortOut;
126  coeffs cf = currRing->cf;
127  while (nCoeff_is_Extension(cf)) {
128  cf->extRing->ShortOut = shortOut;
129  assume(cf->extRing != NULL);
130  cf = cf->extRing->cf;
131  }
132 #endif
133  }
134  return FALSE;
135 }
#define FALSE
Definition: auxiliary.h:97
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Definition: polys.cc:10
#define assume(x)
Definition: mod2.h:403
The main handler for Singular numbers which are suitable for Singular polynomials.
CanonicalForm cf
Definition: cfModGcd.cc:4024
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1121
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
Definition: coeffs.h:860
int BOOLEAN
Definition: auxiliary.h:88

§ jjTIMER()

static BOOLEAN jjTIMER ( leftv  ,
leftv  a 
)
static

Definition at line 74 of file ipassign.cc.

75 {
76  timerv=(int)((long)(a->Data()));
77  initTimer();
78  return FALSE;
79 }
#define FALSE
Definition: auxiliary.h:97
int timerv
Definition: timer.cc:19
void * Data()
Definition: subexpr.cc:1121
int initTimer()
Definition: timer.cc:69

§ jjTRACE()

static BOOLEAN jjTRACE ( leftv  ,
leftv  a 
)
static

Definition at line 106 of file ipassign.cc.

107 {
108  traceit=(int)((long)(a->Data()));
109  return FALSE;
110 }
#define FALSE
Definition: auxiliary.h:97
int traceit
Definition: febase.cc:47
void * Data()
Definition: subexpr.cc:1121