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_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)
 
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 1079 of file ipassign.cc.

◆ IPASSIGN

#define IPASSIGN

Definition at line 1078 of file ipassign.cc.

◆ NULL_VAL

#define NULL_VAL   NULL

Definition at line 1080 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 1793 of file ipassign.cc.

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

1251 {
1252  int rt=r->Typ();
1253 
1254  if (rt==0)
1255  {
1256  if (!errorreported) Werror("`%s` is undefined",r->Fullname());
1257  return TRUE;
1258  }
1259  int i=0;
1260  int lt=l->rtyp;
1261  while (((dAssign_sys[i].res!=lt)
1262  || (dAssign_sys[i].arg!=rt))
1263  && (dAssign_sys[i].res!=0)) i++;
1264  if (dAssign_sys[i].res!=0)
1265  {
1266  if (!dAssign_sys[i].p(l,r))
1267  {
1268  // everything ok, clean up
1269  return FALSE;
1270  }
1271  }
1272  // implicite type conversion ----------------------------------------------
1273  if (dAssign_sys[i].res==0)
1274  {
1275  int ri;
1277  BOOLEAN failed=FALSE;
1278  i=0;
1279  while ((dAssign_sys[i].res!=lt)
1280  && (dAssign_sys[i].res!=0)) i++;
1281  while (dAssign_sys[i].res==lt)
1282  {
1283  if ((ri=iiTestConvert(rt,dAssign_sys[i].arg))!=0)
1284  {
1285  failed= ((iiConvert(rt,dAssign_sys[i].arg,ri,r,rn))
1286  || (dAssign_sys[i].p(l,rn)));
1287  // everything done, clean up temp. variables
1288  rn->CleanUp();
1290  if (failed)
1291  {
1292  // leave loop, goto error handling
1293  break;
1294  }
1295  else
1296  {
1297  // everything ok, return
1298  return FALSE;
1299  }
1300  }
1301  i++;
1302  }
1303  // error handling ---------------------------------------------------
1304  if(!errorreported)
1305  {
1306  Werror("`%s` = `%s` is not supported"
1307  ,Tok2Cmdname(lt),Tok2Cmdname(rt));
1308  if (BVERBOSE(V_SHOW_USE))
1309  {
1310  i=0;
1311  while ((dAssign_sys[i].res!=lt)
1312  && (dAssign_sys[i].res!=0)) i++;
1313  while (dAssign_sys[i].res==lt)
1314  {
1315  Werror("expected `%s` = `%s`"
1316  ,Tok2Cmdname(lt),Tok2Cmdname(dAssign_sys[i].arg));
1317  i++;
1318  }
1319  }
1320  }
1321  }
1322  return TRUE;
1323 }
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:293
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#define FALSE
Definition: auxiliary.h:94
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:401
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
void * ADDRESS
Definition: auxiliary.h:115
sleftv * leftv
Definition: structs.h:60
int Typ()
Definition: subexpr.cc:995
const char * Fullname()
Definition: subexpr.h:125
poly res
Definition: myNF.cc:322
#define V_SHOW_USE
Definition: options.h:50
const struct sValAssign_sys dAssign_sys[]
Definition: table.h:1318
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:132
int rtyp
Definition: subexpr.h:91
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int BOOLEAN
Definition: auxiliary.h:85
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 701 of file ipassign.cc.

702 {
703  if (/*(*/ res->rtyp!=INTMAT_CMD /*)*/) /*|| (e!=NULL) - TRUE because of type int */
704  {
705  // no error message: assignment simply fails
706  return TRUE;
707  }
708  intvec* am=(intvec*)a->CopyD(INTMAT_CMD);
709  if ((am->rows()!=1) || (am->cols()!=1))
710  {
711  WerrorS("must be 1x1 intmat");
712  delete am;
713  return TRUE;
714  }
715  intvec* m=(intvec *)res->data;
716  // indices are correct (see ipExprArith3(..,'['..) )
717  int i=e->start;
718  int j=e->next->start;
719  IMATELEM(*m,i,j)=IMATELEM(*am,1,1);
720  delete am;
721  return FALSE;
722 }
#define FALSE
Definition: auxiliary.h:94
int rows() const
Definition: intvec.h:88
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:88
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:91
#define IMATELEM(M, I, J)
Definition: intvec.h:77
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jiA_1x1MATRIX()

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

Definition at line 723 of file ipassign.cc.

724 {
725  if (/*(*/ res->rtyp!=MATRIX_CMD /*)*/) /*|| (e!=NULL) - TRUE because of type poly */
726  {
727  // no error message: assignment simply fails
728  return TRUE;
729  }
730  matrix am=(matrix)a->CopyD(MATRIX_CMD);
731  if ((MATROWS(am)!=1) || (MATCOLS(am)!=1))
732  {
733  WerrorS("must be 1x1 matrix");
734  idDelete((ideal *)&am);
735  return TRUE;
736  }
737  matrix m=(matrix)res->data;
738  // indices are correct (see ipExprArith3(..,'['..) )
739  int i=e->start;
740  int j=e->next->start;
741  pDelete(&MATELEM(m,i,j));
742  pNormalize(MATELEM(am,1,1));
743  MATELEM(m,i,j)=MATELEM(am,1,1);
744  MATELEM(am,1,1)=NULL;
745  idDelete((ideal *)&am);
746  return FALSE;
747 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
void * data
Definition: subexpr.h:88
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:91
#define MATROWS(i)
Definition: matpol.h:27
void * CopyD(int t)
Definition: subexpr.cc:707
#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 583 of file ipassign.cc.

584 {
585  number p=(number)a->CopyD(BIGINT_CMD);
586  if (e==NULL)
587  {
588  if (res->data!=NULL) n_Delete((number *)&res->data,coeffs_BIGINT);
589  res->data=(void *)p;
590  }
591  else
592  {
593  int i=e->start-1;
594  if (i<0)
595  {
596  Werror("index[%d] must be positive",i+1);
597  return TRUE;
598  }
599  bigintmat *iv=(bigintmat *)res->data;
600  if (e->next==NULL)
601  {
602  WerrorS("only one index given");
603  return TRUE;
604  }
605  else
606  {
607  int c=e->next->start;
608  if ((i>=iv->rows())||(c<1)||(c>iv->cols()))
609  {
610  Werror("wrong range [%d,%d] in bigintmat %s(%d,%d)",i+1,c,res->Name(),iv->rows(),iv->cols());
611  return TRUE;
612  }
613  else
614  {
615  n_Delete((number *)&BIMATELEM(*iv,i+1,c),iv->basecoeffs());
616  BIMATELEM(*iv,i+1,c) = p;
617  }
618  }
619  }
620  jiAssignAttr(res,a);
621  return FALSE;
622 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:94
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:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
coeffs coeffs_BIGINT
Definition: ipid.cc:54
const char * Name()
Definition: subexpr.h:120
void * data
Definition: subexpr.h:88
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:707

◆ jiA_BIGINTMAT()

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

Definition at line 811 of file ipassign.cc.

812 {
813  if (res->data!=NULL) delete ((bigintmat *)res->data);
814  res->data=(void *)a->CopyD(BIGINTMAT_CMD);
815  jiAssignAttr(res,a);
816  return FALSE;
817 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define FALSE
Definition: auxiliary.h:94
Matrices of numbers.
Definition: bigintmat.h:51
void * data
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jiA_CRING()

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

Definition at line 1067 of file ipassign.cc.

1068 {
1069  coeffs r=(coeffs)a->Data();
1070  if (r==NULL) return TRUE;
1071  if (res->data!=NULL) nKillChar((coeffs)res->data);
1072  res->data=(void *)a->CopyD(CRING_CMD);
1073  jiAssignAttr(res,a);
1074  return FALSE;
1075 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:88
Definition: tok.h:56
const ring r
Definition: syzextra.cc:208
The main handler for Singular numbers which are suitable for Singular polynomials.
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:504
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jiA_DEF()

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

Definition at line 1062 of file ipassign.cc.

1063 {
1064  res->data=(void *)0;
1065  return FALSE;
1066 }
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88

◆ jiA_IDEAL()

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

Definition at line 818 of file ipassign.cc.

819 {
820  if (res->data!=NULL) idDelete((ideal*)&res->data);
821  res->data=(void *)a->CopyD(MATRIX_CMD);
822  if (a->rtyp==IDHDL) id_Normalize((ideal)a->Data(), currRing);
823  else id_Normalize((ideal)res->data, currRing);
824  jiAssignAttr(res,a);
825  if (((res->rtyp==IDEAL_CMD)||(res->rtyp==MODUL_CMD))
826  && (IDELEMS((ideal)(res->data))==1)
827  && (currRing->qideal==NULL)
828  && (!rIsPluralRing(currRing))
829  )
830  {
831  setFlag(res,FLAG_STD);
832  }
833  if (TEST_V_QRING && (currRing->qideal!=NULL)&& (!hasFlag(res,FLAG_QRING))) jjNormalizeQRingId(res);
834  return FALSE;
835 }
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:29
#define FALSE
Definition: auxiliary.h:94
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
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:2137
#define NULL
Definition: omList.c:10
#define hasFlag(A, F)
Definition: ipid.h:109
int rtyp
Definition: subexpr.h:91
void * Data()
Definition: subexpr.cc:1137
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jiA_IDEAL_M()

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

Definition at line 859 of file ipassign.cc.

860 {
861  if (res->data!=NULL) idDelete((ideal*)&res->data);
863  if (TEST_V_ALLWARN)
864  if (MATROWS(m)>1)
865  Warn("assign matrix with %d rows to an ideal in >>%s<<",MATROWS(m),my_yylinebuf);
866  IDELEMS((ideal)m)=MATROWS(m)*MATCOLS(m);
867  ((ideal)m)->rank=1;
868  MATROWS(m)=1;
869  id_Normalize((ideal)m, currRing);
870  res->data=(void *)m;
871  if (TEST_V_QRING && (currRing->qideal!=NULL)) jjNormalizeQRingId(res);
872  return FALSE;
873 }
void id_Normalize(ideal I, const ring r)
normialize all polys in id
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:2137
#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:707
#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:94
int rows() const
Definition: intvec.h:88
#define TRUE
Definition: auxiliary.h:98
const char * Name()
Definition: subexpr.h:120
void * data
Definition: subexpr.h:88
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:1137
#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 788 of file ipassign.cc.

789 {
790  //if ((res->data==NULL) || (res->Typ()==a->Typ()))
791  {
792  if (res->data!=NULL) delete ((intvec *)res->data);
793  res->data=(void *)a->CopyD(INTVEC_CMD);
794  jiAssignAttr(res,a);
795  return FALSE;
796  }
797 #if 0
798  else
799  {
800  intvec *r=(intvec *)(res->data);
801  intvec *s=(intvec *)(a->Data());
802  int i=si_min(r->length(), s->length())-1;
803  for(;i>=0;i--)
804  {
805  (*r)[i]=(*s)[i];
806  }
807  return FALSE; //(r->length()< s->length());
808  }
809 #endif
810 }
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:121
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
void * Data()
Definition: subexpr.cc:1137
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jiA_INTVEC_L()

static BOOLEAN jiA_INTVEC_L ( leftv  l,
leftv  r 
)
static

Definition at line 1324 of file ipassign.cc.

1325 {
1326  /* right side is intvec, left side is list (of int)*/
1327  BOOLEAN nok;
1328  int i=0;
1329  leftv l1=l;
1330  leftv h;
1331  sleftv t;
1332  intvec *iv=(intvec *)r->Data();
1333  memset(&t,0,sizeof(sleftv));
1334  t.rtyp=INT_CMD;
1335  while ((i<iv->length())&&(l!=NULL))
1336  {
1337  t.data=(char *)(long)(*iv)[i];
1338  h=l->next;
1339  l->next=NULL;
1340  nok=jiAssign_1(l,&t,TRUE);
1341  l->next=h;
1342  if (nok) return TRUE;
1343  i++;
1344  l=h;
1345  }
1346  l1->CleanUp();
1347  r->CleanUp();
1348  return FALSE;
1349 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
static BOOLEAN jiAssign_1(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1086
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:88
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:86
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
void * Data()
Definition: subexpr.cc:1137
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:85
int l
Definition: cfEzgcd.cc:94

◆ jiA_LINK()

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

Definition at line 874 of file ipassign.cc.

875 {
876  si_link l=(si_link)res->data;
877 
878  if (l!=NULL) slCleanUp(l);
879 
880  if (a->Typ() == STRING_CMD)
881  {
882  if (l == NULL)
883  {
885  res->data = (void *) l;
886  }
887  return slInit(l, (char *) a->Data());
888  }
889  else if (a->Typ() == LINK_CMD)
890  {
891  if (l != NULL) omFreeBin(l, sip_link_bin);
892  res->data = slCopy((si_link)a->Data());
893  return FALSE;
894  }
895  return TRUE;
896 }
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
int Typ()
Definition: subexpr.cc:995
void * data
Definition: subexpr.h:88
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
Definition: tok.h:116
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
#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 634 of file ipassign.cc.

635 {
636  lists l=(lists)a->CopyD(LIST_CMD);
637  if (res->data!=NULL) ((lists)res->data)->Clean();
638  res->data=(void *)l;
639  jiAssignAttr(res,a);
640  return FALSE;
641 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
Definition: tok.h:117
void * CopyD(int t)
Definition: subexpr.cc:707
int l
Definition: cfEzgcd.cc:94

◆ jiA_LIST_RES()

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

Definition at line 623 of file ipassign.cc.

624 {
626  if (res->data!=NULL) ((lists)res->data)->Clean();
627  int add_row_shift = 0;
628  intvec *weights=(intvec*)atGet(a,"isHomog",INTVEC_CMD);
629  if (weights!=NULL) add_row_shift=weights->min_in();
630  res->data=(void *)syConvRes(r,TRUE,add_row_shift);
631  //jiAssignAttr(res,a);
632  return FALSE;
633 }
#define FALSE
Definition: auxiliary.h:94
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
Definition: ipshell.cc:3109
#define TRUE
Definition: auxiliary.h:98
int min_in()
Definition: intvec.h:113
void * data
Definition: subexpr.h:88
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
Definition: attrib.cc:137
#define NULL
Definition: omList.c:10
slists * lists
Definition: mpr_numeric.h:146
void * CopyD(int t)
Definition: subexpr.cc:707
ssyStrategy * syStrategy
Definition: syz.h:35

◆ jiA_MAP()

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

Definition at line 898 of file ipassign.cc.

899 {
900  if (res->data!=NULL)
901  {
902  omFree((ADDRESS)((map)res->data)->preimage);
903  ((map)res->data)->preimage=NULL;
904  idDelete((ideal*)&res->data);
905  }
906  res->data=(void *)a->CopyD(MAP_CMD);
907  jiAssignAttr(res,a);
908  return FALSE;
909 }
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:29
#define FALSE
Definition: auxiliary.h:94
void * ADDRESS
Definition: auxiliary.h:115
void * data
Definition: subexpr.h:88
#define omFree(addr)
Definition: omAllocDecl.h:261
#define NULL
Definition: omList.c:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jiA_MAP_ID()

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

Definition at line 911 of file ipassign.cc.

912 {
913  map f=(map)res->data;
914  char *rn=f->preimage; // save the old/already assigned preimage ring name
915  f->preimage=NULL;
916  idDelete((ideal *)&f);
917  res->data=(void *)a->CopyD(IDEAL_CMD);
918  f=(map)res->data;
919  id_Normalize((ideal)f, currRing);
920  f->preimage = rn;
921  return FALSE;
922 }
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:29
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:9
#define NULL
Definition: omList.c:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jiA_MATRIX_L()

static BOOLEAN jiA_MATRIX_L ( leftv  l,
leftv  r 
)
static

Definition at line 1588 of file ipassign.cc.

1589 {
1590  /* right side is matrix, left side is list (of poly)*/
1591  BOOLEAN nok=FALSE;
1592  int i;
1594  leftv h;
1595  leftv ol=l;
1596  leftv o_r=r;
1597  sleftv t;
1598  memset(&t,0,sizeof(sleftv));
1599  t.rtyp=POLY_CMD;
1600  int mxn=MATROWS(m)*MATCOLS(m);
1601  loop
1602  {
1603  i=0;
1604  while ((i<mxn /*MATROWS(m)*MATCOLS(m)*/)&&(l!=NULL))
1605  {
1606  t.data=(char *)m->m[i];
1607  m->m[i]=NULL;
1608  h=l->next;
1609  l->next=NULL;
1610  idhdl hh=NULL;
1611  if ((l->rtyp==IDHDL)&&(l->Typ()==DEF_CMD)) hh=(idhdl)l->data;
1612  nok=jiAssign_1(l,&t,TRUE);
1613  if (hh!=NULL) { ipMoveId(hh);hh=NULL;}
1614  l->next=h;
1615  if (nok)
1616  {
1617  idDelete((ideal *)&m);
1618  goto ende;
1619  }
1620  i++;
1621  l=h;
1622  }
1623  idDelete((ideal *)&m);
1624  h=r;
1625  r=r->next;
1626  if (l==NULL)
1627  {
1628  if (r!=NULL)
1629  {
1630  Warn("list length mismatch in assign (l>r)");
1631  nok=TRUE;
1632  }
1633  break;
1634  }
1635  else if (r==NULL)
1636  {
1637  Warn("list length mismatch in assign (l<r)");
1638  nok=TRUE;
1639  break;
1640  }
1641  if ((r->Typ()==IDEAL_CMD)||(r->Typ()==MATRIX_CMD))
1642  {
1643  m=(matrix)r->CopyD(MATRIX_CMD);
1644  mxn=MATROWS(m)*MATCOLS(m);
1645  }
1646  else if (r->Typ()==POLY_CMD)
1647  {
1648  m=mpNew(1,1);
1649  MATELEM(m,1,1)=(poly)r->CopyD(POLY_CMD);
1650  pNormalize(MATELEM(m,1,1));
1651  mxn=1;
1652  }
1653  else
1654  {
1655  nok=TRUE;
1656  break;
1657  }
1658  }
1659 ende:
1660  o_r->CleanUp();
1661  ol->CleanUp();
1662  return nok;
1663 }
void ipMoveId(idhdl tomove)
Definition: ipid.cc:610
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
loop
Definition: myNF.cc:98
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:94
static BOOLEAN jiAssign_1(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1086
#define TRUE
Definition: auxiliary.h:98
int Typ()
Definition: subexpr.cc:995
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
poly * m
Definition: matpol.h:19
const ring r
Definition: syzextra.cc:208
Definition: tok.h:58
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:86
matrix mpNew(int r, int c)
create a r x c zero-matrix
Definition: matpol.cc:44
#define MATCOLS(i)
Definition: matpol.h:28
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
#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:85
void * CopyD(int t)
Definition: subexpr.cc:707
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 843 of file ipassign.cc.

845 {
846  if (res->data!=NULL) idDelete((ideal*)&res->data);
847  ideal I=idInit(1,1);
848  I->m[0]=(poly)a->CopyD(POLY_CMD);
849  if (I->m[0]!=NULL) pSetCompP(I->m[0],1);
850  pNormalize(I->m[0]);
851  res->data=(void *)I;
852  if (TEST_V_QRING && (currRing->qideal!=NULL))
853  {
854  if (hasFlag(a,FLAG_QRING)) setFlag(res,FLAG_QRING);
855  else jjNormalizeQRingId(res);
856  }
857  return FALSE;
858 }
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
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:285
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:2137
#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:707

◆ 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:94
return P p
Definition: myNF.cc:203
void * data
Definition: subexpr.h:88
#define nDelete(n)
Definition: numbers.h:16
#define NULL
Definition: omList.c:10
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jiA_PACKAGE()

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

Definition at line 1056 of file ipassign.cc.

1057 {
1058  res->data=(void *)a->CopyD(PACKAGE_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:94
void * data
Definition: subexpr.h:88
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jiA_POLY()

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

Definition at line 642 of file ipassign.cc.

643 {
644  poly p=(poly)a->CopyD(POLY_CMD);
645  pNormalize(p);
646  if (e==NULL)
647  {
648  if ((p!=NULL) && TEST_V_QRING && (currRing->qideal!=NULL)
649  && (!hasFlag(a,FLAG_QRING)))
650  {
652  setFlag(res,FLAG_QRING);
653  }
654  if (res->data!=NULL) pDelete((poly*)&res->data);
655  res->data=(void*)p;
656  jiAssignAttr(res,a);
657  }
658  else
659  {
660  int i,j;
661  matrix m=(matrix)res->data;
662  i=e->start;
663  if (e->next==NULL)
664  {
665  j=i; i=1;
666  // for all ideal like data types: check indices
667  if (j>MATCOLS(m))
668  {
669  if (TEST_V_ALLWARN)
670  {
671  Warn("increase ideal %d -> %d in %s",MATCOLS(m),j,my_yylinebuf);
672  }
673  pEnlargeSet(&(m->m),MATCOLS(m),j-MATCOLS(m));
674  MATCOLS(m)=j;
675  }
676  else if (j<=0)
677  {
678  Werror("index[%d] must be positive",j/*e->start*/);
679  return TRUE;
680  }
681  }
682  else
683  {
684  // for matrices: indices are correct (see ipExprArith3(..,'['..) )
685  j=e->next->start;
686  }
687  if ((p!=NULL) && TEST_V_QRING && (currRing->qideal!=NULL))
688  {
690  }
691  pDelete(&MATELEM(m,i,j));
692  MATELEM(m,i,j)=p;
693  /* for module: update rank */
694  if ((p!=NULL) && (pGetComp(p)!=0))
695  {
696  m->rank=si_max(m->rank,pMaxComp(p));
697  }
698  }
699  return FALSE;
700 }
void jjNormalizeQRingP(poly &p)
Definition: ipassign.cc:2172
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define pMaxComp(p)
Definition: polys.h:281
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:94
return P p
Definition: myNF.cc:203
#define TRUE
Definition: auxiliary.h:98
#define pGetComp(p)
Component.
Definition: polys.h:37
void * data
Definition: subexpr.h:88
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:120
#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:3602
#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:707
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 770 of file ipassign.cc.

771 {
772  extern procinfo *iiInitSingularProcinfo(procinfo *pi, const char *libname,
773  const char *procname, int line,
774  long pos, BOOLEAN pstatic=FALSE);
775  if(res->data!=NULL) piKill((procinfo *)res->data);
776  if(a->Typ()==STRING_CMD)
777  {
778  res->data = (void *)omAlloc0Bin(procinfo_bin);
779  ((procinfo *)(res->data))->language=LANG_NONE;
780  iiInitSingularProcinfo((procinfo *)res->data,"",res->name,0,0);
781  ((procinfo *)res->data)->data.s.body=(char *)a->CopyD(STRING_CMD);
782  }
783  else
784  res->data=(void *)a->CopyD(PROC_CMD);
785  jiAssignAttr(res,a);
786  return FALSE;
787 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define FALSE
Definition: auxiliary.h:94
procinfo * iiInitSingularProcinfo(procinfov pi, const char *libname, const char *procname, int, long pos, BOOLEAN pstatic)
Definition: iplib.cc:1009
int Typ()
Definition: subexpr.cc:995
BOOLEAN piKill(procinfov pi)
Definition: ipid.cc:653
omBin procinfo_bin
Definition: subexpr.cc:51
void * data
Definition: subexpr.h:88
const char * name
Definition: subexpr.h:87
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define pi
Definition: libparse.cc:1143
#define NULL
Definition: omList.c:10
int BOOLEAN
Definition: auxiliary.h:85
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jiA_QRING()

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

Definition at line 923 of file ipassign.cc.

924 {
925  // the follwing can only happen, if:
926  // - the left side is of type qring AND not an id
927  if ((e!=NULL)||(res->rtyp!=IDHDL))
928  {
929  WerrorS("qring_id expected");
930  return TRUE;
931  }
932  ring old_ring=(ring)res->Data();
933 
934  coeffs newcf = currRing->cf;
935  ideal id = (ideal)a->Data(); //?
936  const int cpos = idPosConstant(id);
938  if (cpos >= 0)
939  {
940  newcf = n_CoeffRingQuot1(p_GetCoeff(id->m[cpos], currRing), currRing->cf);
941  if(newcf == NULL)
942  return TRUE;
943  }
944  //qr=(ring)res->Data();
945  //if (qr!=NULL) omFreeBin((ADDRESS)qr, ip_sring_bin);
946  ring qr = rCopy(currRing);
947  assume(qr->cf == currRing->cf);
948 
949  if ( qr->cf != newcf )
950  {
951  nKillChar ( qr->cf ); // ???
952  qr->cf = newcf;
953  }
954  // we have to fill it, but the copy also allocates space
955  idhdl h=(idhdl)res->data; // we have res->rtyp==IDHDL
956  IDRING(h)=qr;
957 
958  ideal qid;
959 
960  if((rField_is_Ring(currRing)) && (cpos != -1))
961  {
962  int i, j;
963  int *perm = (int *)omAlloc0((qr->N+1)*sizeof(int));
964 
965  for(i=qr->N;i>0;i--)
966  perm[i]=i;
967 
968  nMapFunc nMap = n_SetMap(currRing->cf, newcf);
969  qid = idInit(IDELEMS(id)-1,1);
970  for(i = 0, j = 0; i<IDELEMS(id); i++)
971  if( i != cpos )
972  qid->m[j++] = p_PermPoly(id->m[i], perm, currRing, qr, nMap, NULL, 0);
973  }
974  else
975  qid = idrCopyR(id,currRing,qr);
976 
977  idSkipZeroes(qid);
978  //idPrint(qid);
979  if ((idElem(qid)>1) || rIsSCA(currRing) || (currRing->qideal!=NULL))
980  assumeStdFlag(a);
981 
982  if (currRing->qideal!=NULL) /* we are already in a qring! */
983  {
984  ideal tmp=idSimpleAdd(qid,currRing->qideal);
985  // both ideals should be GB, so dSimpleAdd is sufficient
986  idDelete(&qid);
987  qid=tmp;
988  // delete the qr copy of quotient ideal!!!
989  idDelete(&qr->qideal);
990  }
991  if (idElem(qid)==0)
992  {
993  qr->qideal = NULL;
994  id_Delete(&qid,currRing);
995  IDTYP(h)=RING_CMD;
996  }
997  else
998  qr->qideal = qid;
999 
1000  // qr is a copy of currRing with the new qideal!
1001  #ifdef HAVE_PLURAL
1002  if(rIsPluralRing(currRing) &&(qr->qideal!=NULL))
1003  {
1004  if (!hasFlag(a,FLAG_TWOSTD))
1005  {
1006  Warn("%s is no twosided standard basis",a->Name());
1007  }
1008 
1009  if( nc_SetupQuotient(qr, currRing) )
1010  {
1011 // WarnS("error in nc_SetupQuotient");
1012  }
1013  }
1014  #endif
1015  //rWrite(qr);
1016  rSetHdl((idhdl)res->data);
1017  if (old_ring!=NULL)
1018  {
1019  rDelete(old_ring);
1020  }
1021  return FALSE;
1022 }
#define idPosConstant(I)
index of generator with leading term in ground ring (if any); otherwise -1
Definition: ideals.h:37
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
bool nc_SetupQuotient(ring rGR, const ring rG=NULL, bool bCopy=false)
Definition: old.gring.cc:3434
#define idSimpleAdd(A, B)
Definition: ideals.h:42
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
const char * Name()
Definition: subexpr.h:120
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
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:3985
#define FLAG_TWOSTD
Definition: ipid.h:107
int j
Definition: myNF.cc:70
#define assume(x)
Definition: mod2.h:394
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:1474
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:1614
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:91
static bool rIsSCA(const ring r)
Definition: nc.h:206
void * Data()
Definition: subexpr.cc:1137
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:5038
static Poly * h
Definition: janet.cc:978
void nKillChar(coeffs r)
undo all initialisations
Definition: numbers.cc:504
#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 836 of file ipassign.cc.

837 {
838  if (res->data!=NULL) syKillComputation((syStrategy)res->data);
839  res->data=(void *)a->CopyD(RESOLUTION_CMD);
840  jiAssignAttr(res,a);
841  return FALSE;
842 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
#define FALSE
Definition: auxiliary.h:94
void * data
Definition: subexpr.h:88
#define NULL
Definition: omList.c:10
void syKillComputation(syStrategy syzstr, ring r=currRing)
Definition: syz1.cc:1503
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jiA_RING()

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

Definition at line 1024 of file ipassign.cc.

1025 {
1026  BOOLEAN have_id=TRUE;
1027  if ((e!=NULL)||(res->rtyp!=IDHDL))
1028  {
1029  //WerrorS("id expected");
1030  //return TRUE;
1031  have_id=FALSE;
1032  }
1033  ring r=(ring)a->Data();
1034  if ((r==NULL)||(r->cf==NULL)) return TRUE;
1035  if (have_id)
1036  {
1037  idhdl rl=(idhdl)res->data;
1038  if (IDRING(rl)!=NULL) rKill(rl);
1039  IDRING(rl)=r;
1040  if ((IDLEV((idhdl)a->data)!=myynest) && (r==currRing))
1041  currRingHdl=(idhdl)res->data;
1042  }
1043  else
1044  {
1045  if (e==NULL) res->data=(char *)r;
1046  else
1047  {
1048  WerrorS("id expected");
1049  return TRUE;
1050  }
1051  }
1052  r->ref++;
1053  jiAssignAttr(res,a);
1054  return FALSE;
1055 }
static void jiAssignAttr(leftv l, leftv r)
Definition: ipassign.cc:322
if(0 > strat->sl)
Definition: myNF.cc:73
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void WerrorS(const char *s)
Definition: feFopen.cc:24
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
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:6057
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:91
void * Data()
Definition: subexpr.cc:1137
int BOOLEAN
Definition: auxiliary.h:85

◆ jiA_STRING()

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

Definition at line 748 of file ipassign.cc.

749 {
750  if (e==NULL)
751  {
752  void* tmp = res->data;
753  res->data=(void *)a->CopyD(STRING_CMD);
754  jiAssignAttr(res,a);
755  omfree(tmp);
756  }
757  else
758  {
759  char *s=(char *)res->data;
760  if ((e->start>0)&&(e->start<=(int)strlen(s)))
761  s[e->start-1]=(char)(*((char *)a->Data()));
762  else
763  {
764  Werror("string index %d out of range 1..%d",e->start,(int)strlen(s));
765  return TRUE;
766  }
767  }
768  return FALSE;
769 }
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:94
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:88
#define omfree(addr)
Definition: omAllocDecl.h:237
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
void Werror(const char *fmt,...)
Definition: reporter.cc:189
void * CopyD(int t)
Definition: subexpr.cc:707

◆ jiA_STRING_L()

static BOOLEAN jiA_STRING_L ( leftv  l,
leftv  r 
)
static

Definition at line 1664 of file ipassign.cc.

1665 {
1666  /*left side are strings, right side is a string*/
1667  /*e.g. s[2..3]="12" */
1668  /*the case s=t[1..4] is handled in iiAssign,
1669  * the case s[2..3]=t[3..4] is handled in iiAssgn_rec*/
1670  BOOLEAN nok=FALSE;
1671  sleftv t;
1672  leftv h,l1=l;
1673  int i=0;
1674  char *ss;
1675  char *s=(char *)r->Data();
1676  int sl=strlen(s);
1677 
1678  memset(&t,0,sizeof(sleftv));
1679  t.rtyp=STRING_CMD;
1680  while ((i<sl)&&(l!=NULL))
1681  {
1682  ss=(char *)omAlloc(2);
1683  ss[1]='\0';
1684  ss[0]=s[i];
1685  t.data=ss;
1686  h=l->next;
1687  l->next=NULL;
1688  nok=jiAssign_1(l,&t,TRUE);
1689  if (nok)
1690  {
1691  break;
1692  }
1693  i++;
1694  l=h;
1695  }
1696  r->CleanUp();
1697  l1->CleanUp();
1698  return nok;
1699 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#define FALSE
Definition: auxiliary.h:94
static BOOLEAN jiAssign_1(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1086
#define TRUE
Definition: auxiliary.h:98
#define omAlloc(size)
Definition: omAllocDecl.h:210
void * data
Definition: subexpr.h:88
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:86
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
void * Data()
Definition: subexpr.cc:1137
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:85
int l
Definition: cfEzgcd.cc:94

◆ jiA_VECTOR_L()

static BOOLEAN jiA_VECTOR_L ( leftv  l,
leftv  r 
)
static

Definition at line 1350 of file ipassign.cc.

1351 {
1352  /* right side is vector, left side is list (of poly)*/
1353  BOOLEAN nok;
1354  leftv l1=l;
1355  ideal I=idVec2Ideal((poly)r->Data());
1356  leftv h;
1357  sleftv t;
1358  int i=0;
1359  while (l!=NULL)
1360  {
1361  memset(&t,0,sizeof(sleftv));
1362  t.rtyp=POLY_CMD;
1363  if (i>=IDELEMS(I))
1364  {
1365  t.data=NULL;
1366  }
1367  else
1368  {
1369  t.data=(char *)I->m[i];
1370  I->m[i]=NULL;
1371  }
1372  h=l->next;
1373  l->next=NULL;
1374  nok=jiAssign_1(l,&t,TRUE);
1375  l->next=h;
1376  t.CleanUp();
1377  if (nok)
1378  {
1379  idDelete(&I);
1380  return TRUE;
1381  }
1382  i++;
1383  l=h;
1384  }
1385  idDelete(&I);
1386  l1->CleanUp();
1387  r->CleanUp();
1388  //if (TEST_V_QRING && (currRing->qideal!=NULL)) jjNormalizeQRingP(l);
1389  return FALSE;
1390 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define FALSE
Definition: auxiliary.h:94
static BOOLEAN jiAssign_1(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1086
#define TRUE
Definition: auxiliary.h:98
void * data
Definition: subexpr.h:88
int i
Definition: cfEzgcd.cc:123
#define IDELEMS(i)
Definition: simpleideals.h:24
leftv next
Definition: subexpr.h:86
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
void * Data()
Definition: subexpr.cc:1137
static ideal idVec2Ideal(poly vec)
Definition: ideals.h:170
polyrec * poly
Definition: hilb.h:10
static Poly * h
Definition: janet.cc:978
int BOOLEAN
Definition: auxiliary.h:85
int l
Definition: cfEzgcd.cc:94

◆ jiAssign_1()

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

Definition at line 1086 of file ipassign.cc.

1087 {
1088  int rt=r->Typ();
1089  if (rt==0)
1090  {
1091  if (!errorreported) Werror("`%s` is undefined",r->Fullname());
1092  return TRUE;
1093  }
1094 
1095  int lt=l->Typ();
1096  if (lt==0)
1097  {
1098  if (!errorreported) Werror("left side `%s` is undefined",l->Fullname());
1099  return TRUE;
1100  }
1101  if(rt==NONE)
1102  {
1103  WarnS("right side is not a datum, assignment ignored");
1104  Warn("in line >>%s<<",my_yylinebuf);
1105  // if (!errorreported)
1106  // WerrorS("right side is not a datum");
1107  //return TRUE;
1108  return FALSE;
1109  }
1110 
1111  if (lt==DEF_CMD)
1112  {
1113  if (TEST_V_ALLWARN
1114  && (rt!=RING_CMD)
1115  && (l->name!=NULL)
1116  && (l->e==NULL)
1117  && (iiCurrArgs==NULL) /* not in proc header */
1118  )
1119  {
1120  Warn("use `%s` instead of `def` in %s:%d:%s",Tok2Cmdname(rt),
1122  }
1123  if (l->rtyp==IDHDL)
1124  {
1125  IDTYP((idhdl)l->data)=rt;
1126  }
1127  else if (l->name!=NULL)
1128  {
1129  sleftv ll;
1130  iiDeclCommand(&ll,l,myynest,rt,&IDROOT);
1131  memcpy(l,&ll,sizeof(sleftv));
1132  }
1133  else
1134  {
1135  l->rtyp=rt;
1136  }
1137  lt=rt;
1138  }
1139  else
1140  {
1141  if ((l->data==r->data)&&(l->e==NULL)&&(r->e==NULL))
1142  return FALSE;
1143  }
1144  leftv ld=l;
1145  if (l->rtyp==IDHDL)
1146  {
1147  if (lt!=RING_CMD)
1148  ld=(leftv)l->data;
1149  }
1150  else if (toplevel)
1151  {
1152  WerrorS("error in assign: left side is not an l-value");
1153  return TRUE;
1154  }
1155  if (lt>MAX_TOK)
1156  {
1157  blackbox *bb=getBlackboxStuff(lt);
1158 #ifdef BLACKBOX_DEVEL
1159  Print("bb-assign: bb=%lx\n",bb);
1160 #endif
1161  return (bb==NULL) || bb->blackbox_Assign(l,r);
1162  }
1163  int start=0;
1164  while ((dAssign[start].res!=lt)
1165  && (dAssign[start].res!=0)) start++;
1166  int i=start;
1167  while ((dAssign[i].res==lt)
1168  && (dAssign[i].arg!=rt)) i++;
1169  if (dAssign[i].res==lt)
1170  {
1171  if (traceit&TRACE_ASSIGN) Print("assign %s=%s\n",Tok2Cmdname(lt),Tok2Cmdname(rt));
1172  BOOLEAN b;
1173  b=dAssign[i].p(ld,r,l->e);
1174  if(l!=ld) /* i.e. l is IDHDL, l->data is ld */
1175  {
1176  l->flag=ld->flag;
1177  l->attribute=ld->attribute;
1178  }
1179  return b;
1180  }
1181  // implicite type conversion ----------------------------------------------
1182  if (dAssign[i].res!=lt)
1183  {
1184  int ri;
1186  BOOLEAN failed=FALSE;
1187  i=start;
1188  //while ((dAssign[i].res!=lt)
1189  // && (dAssign[i].res!=0)) i++;
1190  while (dAssign[i].res==lt)
1191  {
1192  if ((ri=iiTestConvert(rt,dAssign[i].arg))!=0)
1193  {
1194  failed= iiConvert(rt,dAssign[i].arg,ri,r,rn);
1195  if(!failed)
1196  {
1197  failed= dAssign[i].p(ld,rn,l->e);
1198  if (traceit&TRACE_ASSIGN)
1199  Print("assign %s=%s ok? %d\n",Tok2Cmdname(lt),Tok2Cmdname(rn->rtyp),!failed);
1200  }
1201  // everything done, clean up temp. variables
1202  rn->CleanUp();
1204  if (failed)
1205  {
1206  // leave loop, goto error handling
1207  break;
1208  }
1209  else
1210  {
1211  if(l!=ld) /* i.e. l is IDHDL, l->data is ld */
1212  {
1213  l->flag=ld->flag;
1214  l->attribute=ld->attribute;
1215  }
1216  // everything ok, return
1217  return FALSE;
1218  }
1219  }
1220  i++;
1221  }
1222  // error handling ---------------------------------------------------
1223  if (!errorreported)
1224  {
1225  if ((l->rtyp==IDHDL) && (l->e==NULL))
1226  Werror("`%s`(%s) = `%s` is not supported",
1227  Tok2Cmdname(lt),l->Name(),Tok2Cmdname(rt));
1228  else
1229  Werror("`%s` = `%s` is not supported"
1230  ,Tok2Cmdname(lt),Tok2Cmdname(rt));
1231  if (BVERBOSE(V_SHOW_USE))
1232  {
1233  i=0;
1234  while ((dAssign[i].res!=lt)
1235  && (dAssign[i].res!=0)) i++;
1236  while (dAssign[i].res==lt)
1237  {
1238  Werror("expected `%s` = `%s`"
1239  ,Tok2Cmdname(lt),Tok2Cmdname(dAssign[i].arg));
1240  i++;
1241  }
1242  }
1243  }
1244  }
1245  return TRUE;
1246 }
int iiTestConvert(int inputType, int outputType)
Definition: gentable.cc:293
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#define TRACE_ASSIGN
Definition: reporter.h:45
int yylineno
Definition: febase.cc:45
#define Print
Definition: emacs.cc:83
Subexpr e
Definition: subexpr.h:105
BITSET flag
Definition: subexpr.h:90
#define FALSE
Definition: auxiliary.h:94
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
Definition: ipconv.cc:401
char * filename
Definition: fevoices.h:63
Definition: tok.h:213
#define IDROOT
Definition: ipid.h:20
#define TRUE
Definition: auxiliary.h:98
void * ADDRESS
Definition: auxiliary.h:115
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:995
const char * Name()
Definition: subexpr.h:120
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
const char * Fullname()
Definition: subexpr.h:125
void * data
Definition: subexpr.h:88
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:58
const char * name
Definition: subexpr.h:87
const struct sValAssign dAssign[]
Definition: table.h:1267
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:1122
#define omAlloc0Bin(bin)
Definition: omAllocDecl.h:206
#define NULL
Definition: omList.c:10
const char * Tok2Cmdname(int tok)
Definition: gentable.cc:132
Voice * currentVoice
Definition: fevoices.cc:57
leftv iiCurrArgs
Definition: ipshell.cc:78
int rtyp
Definition: subexpr.h:91
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
attr attribute
Definition: subexpr.h:89
#define omFreeBin(addr, bin)
Definition: omAllocDecl.h:259
int BOOLEAN
Definition: auxiliary.h:85
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 1700 of file ipassign.cc.

1701 {
1702  int i=l->e->start-1;
1703  if (i<0)
1704  {
1705  Werror("index[%d] must be positive",i+1);
1706  return TRUE;
1707  }
1708  if(l->attribute!=NULL)
1709  {
1710  atKillAll((idhdl)l);
1711  l->attribute=NULL;
1712  }
1713  l->flag=0;
1714  lists li;
1715  if (l->rtyp==IDHDL)
1716  {
1717  li=IDLIST((idhdl)l->data);
1718  }
1719  else
1720  {
1721  li=(lists)l->data;
1722  }
1723  if (i>li->nr)
1724  {
1725  if (TEST_V_ALLWARN)
1726  {
1727  Warn("increase list %d -> %d in %s",li->nr,i,my_yylinebuf);
1728  }
1729  li->m=(leftv)omreallocSize(li->m,(li->nr+1)*sizeof(sleftv),(i+1)*sizeof(sleftv));
1730  memset(&(li->m[li->nr+1]),0,(i-li->nr)*sizeof(sleftv));
1731  int j=li->nr+1;
1732  for(;j<=i;j++)
1733  li->m[j].rtyp=DEF_CMD;
1734  li->nr=i;
1735  }
1736  leftv ld=&(li->m[i]);
1737  ld->e=l->e->next;
1738  BOOLEAN b;
1739  if (/*(ld->rtyp!=LIST_CMD)
1740  &&*/(ld->e==NULL)
1741  && (ld->Typ()!=r->Typ()))
1742  {
1743  sleftv tmp;
1744  memset(&tmp,0,sizeof(sleftv));
1745  tmp.rtyp=DEF_CMD;
1746  b=iiAssign(&tmp,r,FALSE);
1747  ld->CleanUp();
1748  memcpy(ld,&tmp,sizeof(sleftv));
1749  }
1750  else if ((ld->e==NULL)
1751  && (ld->Typ()==r->Typ())
1752  && (ld->Typ()<MAX_TOK))
1753  {
1754  sleftv tmp;
1755  memset(&tmp,0,sizeof(sleftv));
1756  tmp.rtyp=r->Typ();
1757  tmp.data=(char*)idrecDataInit(r->Typ());
1758  b=iiAssign(&tmp,r,FALSE);
1759  ld->CleanUp();
1760  memcpy(ld,&tmp,sizeof(sleftv));
1761  }
1762  else
1763  {
1764  b=iiAssign(ld,r,FALSE);
1765  if (l->e!=NULL) l->e->next=ld->e;
1766  ld->e=NULL;
1767  }
1768  return b;
1769 }
void * idrecDataInit(int t)
Definition: ipid.cc:131
#define IDLIST(a)
Definition: ipid.h:134
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Subexpr e
Definition: subexpr.h:105
BITSET flag
Definition: subexpr.h:90
Definition: lists.h:22
#define FALSE
Definition: auxiliary.h:94
#define omreallocSize(addr, o_size, size)
Definition: omAllocDecl.h:231
Definition: tok.h:213
#define TRUE
Definition: auxiliary.h:98
sleftv * leftv
Definition: structs.h:60
int Typ()
Definition: subexpr.cc:995
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
char my_yylinebuf[80]
Definition: febase.cc:48
int j
Definition: myNF.cc:70
Definition: tok.h:58
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:91
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
attr attribute
Definition: subexpr.h:89
int BOOLEAN
Definition: auxiliary.h:85
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:1793
#define Warn
Definition: emacs.cc:80

◆ jiAssign_rec()

static BOOLEAN jiAssign_rec ( leftv  l,
leftv  r 
)
static

Definition at line 1770 of file ipassign.cc.

1771 {
1772  leftv l1=l;
1773  leftv r1=r;
1774  leftv lrest;
1775  leftv rrest;
1776  BOOLEAN b;
1777  do
1778  {
1779  lrest=l->next;
1780  rrest=r->next;
1781  l->next=NULL;
1782  r->next=NULL;
1783  b=iiAssign(l,r);
1784  l->next=lrest;
1785  r->next=rrest;
1786  l=lrest;
1787  r=rrest;
1788  } while ((!b)&&(l!=NULL));
1789  l1->CleanUp();
1790  r1->CleanUp();
1791  return b;
1792 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
const ring r
Definition: syzextra.cc:208
leftv next
Definition: subexpr.h:86
#define NULL
Definition: omList.c:10
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
int BOOLEAN
Definition: auxiliary.h:85
const poly b
Definition: syzextra.cc:213
int l
Definition: cfEzgcd.cc:94
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1793

◆ 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:82
Definition: attrib.h:15
Subexpr e
Definition: subexpr.h:105
BITSET flag
Definition: subexpr.h:90
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
idrec * idhdl
Definition: ring.h:18
#define NULL
Definition: omList.c:10
int rtyp
Definition: subexpr.h:91
#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:89
static Poly * h
Definition: janet.cc:978
leftv LData()
Definition: subexpr.cc:1406

◆ jjA_L_BIGINTMAT()

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

Definition at line 1505 of file ipassign.cc.

1506 {
1507  /* left side is bigintmat, right side is list (of int,intvec,intmat)*/
1508  leftv hh=r;
1509  int i = 0;
1510  if (bim->length()==0) { WerrorS("bigintmat is 1x0"); delete bim; return TRUE; }
1511  while (hh!=NULL)
1512  {
1513  if (i>=bim->cols()*bim->rows())
1514  {
1515  if (traceit&TRACE_ASSIGN)
1516  {
1517  Warn("expression list length(%d) does not match bigintmat size(%d x %d)",
1518  exprlist_length(hh),bim->rows(),bim->cols());
1519  }
1520  break;
1521  }
1522  if (hh->Typ() == INT_CMD)
1523  {
1524  number tp = n_Init((int)((long)(hh->Data())), coeffs_BIGINT);
1525  bim->set(i++, tp);
1526  n_Delete(&tp, coeffs_BIGINT);
1527  }
1528  else if (hh->Typ() == BIGINT_CMD)
1529  {
1530  bim->set(i++, (number)(hh->Data()));
1531  }
1532  /*
1533  ((hh->Typ() == INTVEC_CMD)
1534  ||(hh->Typ() == INTMAT_CMD))
1535  {
1536  intvec *ivv = (intvec *)(hh->Data());
1537  int ll = 0,l = si_min(ivv->length(),iv->length());
1538  for (; l>0; l--)
1539  {
1540  (*iv)[i++] = (*ivv)[ll++];
1541  }
1542  }*/
1543  else
1544  {
1545  delete bim;
1546  return TRUE;
1547  }
1548  hh = hh->next;
1549  }
1550  if (IDBIMAT((idhdl)l->data)!=NULL) delete IDBIMAT((idhdl)l->data);
1551  IDBIMAT((idhdl)l->data)=bim;
1552  return FALSE;
1553 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#define TRACE_ASSIGN
Definition: reporter.h:45
Definition: tok.h:95
#define FALSE
Definition: auxiliary.h:94
Definition: tok.h:38
int exprlist_length(leftv v)
Definition: ipshell.cc:544
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:98
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:995
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:88
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:86
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
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 1456 of file ipassign.cc.

1457 {
1458  /* left side is intvec/intmat, right side is list (of int,intvec,intmat)*/
1459  leftv hh=r;
1460  int i = 0;
1461  while (hh!=NULL)
1462  {
1463  if (i>=iv->length())
1464  {
1465  if (traceit&TRACE_ASSIGN)
1466  {
1467  Warn("expression list length(%d) does not match intmat size(%d)",
1468  iv->length()+exprlist_length(hh),iv->length());
1469  }
1470  break;
1471  }
1472  if (hh->Typ() == INT_CMD)
1473  {
1474  (*iv)[i++] = (int)((long)(hh->Data()));
1475  }
1476  else if ((hh->Typ() == INTVEC_CMD)
1477  ||(hh->Typ() == INTMAT_CMD))
1478  {
1479  intvec *ivv = (intvec *)(hh->Data());
1480  int ll = 0,l = si_min(ivv->length(),iv->length());
1481  for (; l>0; l--)
1482  {
1483  (*iv)[i++] = (*ivv)[ll++];
1484  }
1485  }
1486  else
1487  {
1488  delete iv;
1489  return TRUE;
1490  }
1491  hh = hh->next;
1492  }
1493  if (l->rtyp==IDHDL)
1494  {
1495  if (IDINTVEC((idhdl)l->data)!=NULL) delete IDINTVEC((idhdl)l->data);
1496  IDINTVEC((idhdl)l->data)=iv;
1497  }
1498  else
1499  {
1500  if (l->data!=NULL) delete ((intvec*)l->data);
1501  l->data=(char*)iv;
1502  }
1503  return FALSE;
1504 }
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#define TRACE_ASSIGN
Definition: reporter.h:45
Definition: tok.h:95
#define IDINTVEC(a)
Definition: ipid.h:125
static int si_min(const int a, const int b)
Definition: auxiliary.h:121
#define FALSE
Definition: auxiliary.h:94
int exprlist_length(leftv v)
Definition: ipshell.cc:544
#define TRUE
Definition: auxiliary.h:98
int traceit
Definition: febase.cc:47
int Typ()
Definition: subexpr.cc:995
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
const ring r
Definition: syzextra.cc:208
Definition: intvec.h:14
int i
Definition: cfEzgcd.cc:123
leftv next
Definition: subexpr.h:86
#define NULL
Definition: omList.c:10
int length() const
Definition: intvec.h:86
int rtyp
Definition: subexpr.h:91
void * Data()
Definition: subexpr.cc:1137
#define Warn
Definition: emacs.cc:80

◆ jjA_L_LIST()

static BOOLEAN jjA_L_LIST ( leftv  l,
leftv  r 
)
static

Definition at line 1391 of file ipassign.cc.

1395 {
1396  int sl = r->listLength();
1398  lists oldL;
1399  leftv h=NULL,o_r=r;
1400  int i;
1401  int rt;
1402 
1403  L->Init(sl);
1404  for (i=0;i<sl;i++)
1405  {
1406  if (h!=NULL) { /* e.g. not in the first step:
1407  * h is the pointer to the old sleftv,
1408  * r is the pointer to the next sleftv
1409  * (in this moment) */
1410  h->next=r;
1411  }
1412  h=r;
1413  r=r->next;
1414  h->next=NULL;
1415  rt=h->Typ();
1416  if ((rt==0)||(rt==NONE)||(rt==DEF_CMD))
1417  {
1418  L->Clean();
1419  Werror("`%s` is undefined",h->Fullname());
1420  //listall();
1421  goto err;
1422  }
1423  //if (rt==RING_CMD)
1424  //{
1425  // L->m[i].rtyp=rt;
1426  // L->m[i].data=h->Data();
1427  // ((ring)L->m[i].data)->ref++;
1428  //}
1429  //else
1430  L->m[i].CleanUp();
1431  L->m[i].Copy(h);
1432  if(errorreported)
1433  {
1434  L->Clean();
1435  goto err;
1436  }
1437  }
1438  oldL=(lists)l->Data();
1439  if (oldL!=NULL) oldL->Clean();
1440  if (l->rtyp==IDHDL)
1441  {
1442  IDLIST((idhdl)l->data)=L;
1443  IDTYP((idhdl)l->data)=LIST_CMD; // was possibly DEF_CMD
1444  if (lRingDependend(L)) ipMoveId((idhdl)l->data);
1445  }
1446  else
1447  {
1448  l->LData()->data=L;
1449  if ((l->e!=NULL) && (l->rtyp==DEF_CMD))
1450  l->rtyp=LIST_CMD;
1451  }
1452 err:
1453  o_r->CleanUp();
1454  return errorreported;
1455 }
#define omAllocBin(bin)
Definition: omAllocDecl.h:205
#define IDLIST(a)
Definition: ipid.h:134
void ipMoveId(idhdl tomove)
Definition: ipid.cc:610
sleftv * m
Definition: lists.h:45
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
Subexpr e
Definition: subexpr.h:105
Definition: lists.h:22
int listLength()
Definition: subexpr.cc:60
int Typ()
Definition: subexpr.cc:995
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
const char * Fullname()
Definition: subexpr.h:125
void * data
Definition: subexpr.h:88
#define IDTYP(a)
Definition: ipid.h:116
const ring r
Definition: syzextra.cc:208
Definition: tok.h:58
void Copy(leftv e)
Definition: subexpr.cc:688
int i
Definition: cfEzgcd.cc:123
short errorreported
Definition: feFopen.cc:23
leftv next
Definition: subexpr.h:86
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:91
void CleanUp(ring r=currRing)
Definition: subexpr.cc:332
void Clean(ring r=currRing)
Definition: lists.h:25
void * Data()
Definition: subexpr.cc:1137
Definition: tok.h:117
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:1406
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 1554 of file ipassign.cc.

1555 {
1556  /* left side is string, right side is list of string*/
1557  leftv hh=r;
1558  int sl = 1;
1559  char *s;
1560  char *t;
1561  int tl;
1562  /* find the length */
1563  while (hh!=NULL)
1564  {
1565  if (hh->Typ()!= STRING_CMD)
1566  {
1567  return TRUE;
1568  }
1569  sl += strlen((char *)hh->Data());
1570  hh = hh->next;
1571  }
1572  s = (char * )omAlloc(sl);
1573  sl=0;
1574  hh = r;
1575  while (hh!=NULL)
1576  {
1577  t=(char *)hh->Data();
1578  tl=strlen(t);
1579  memcpy(s+sl,t,tl);
1580  sl+=tl;
1581  hh = hh->next;
1582  }
1583  s[sl]='\0';
1584  omFree((ADDRESS)IDDATA((idhdl)(l->data)));
1585  IDDATA((idhdl)(l->data))=s;
1586  return FALSE;
1587 }
const CanonicalForm int s
Definition: facAbsFact.cc:55
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#define FALSE
Definition: auxiliary.h:94
#define TRUE
Definition: auxiliary.h:98
void * ADDRESS
Definition: auxiliary.h:115
int Typ()
Definition: subexpr.cc:995
#define omAlloc(size)
Definition: omAllocDecl.h:210
Definition: idrec.h:34
void * data
Definition: subexpr.h:88
const ring r
Definition: syzextra.cc:208
#define omFree(addr)
Definition: omAllocDecl.h:261
leftv next
Definition: subexpr.h:86
#define NULL
Definition: omList.c:10
void * Data()
Definition: subexpr.cc:1137
#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:94
void * Data()
Definition: subexpr.cc:1137
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:94
void * Data()
Definition: subexpr.cc:1137
int si_echo
Definition: febase.cc:41

◆ jjIMPORTFROM()

BOOLEAN jjIMPORTFROM ( leftv  ,
leftv  u,
leftv  v 
)

Definition at line 2184 of file ipassign.cc.

2185 {
2186  //Print("importfrom %s::%s ->.\n",v->Name(),u->Name() );
2187  assume(u->Typ()==PACKAGE_CMD);
2188  char *vn=(char *)v->Name();
2189  idhdl h=((package)(u->Data()))->idroot->get(vn /*v->Name()*/, myynest);
2190  if (h!=NULL)
2191  {
2192  //check for existence
2193  if (((package)(u->Data()))==basePack)
2194  {
2195  WarnS("source and destination packages are identical");
2196  return FALSE;
2197  }
2198  idhdl t=basePack->idroot->get(vn /*v->Name()*/, myynest);
2199  if (t!=NULL)
2200  {
2201  if (BVERBOSE(V_REDEFINE)) Warn("redefining %s (%s)",vn,my_yylinebuf);
2202  killhdl(t);
2203  }
2204  sleftv tmp_expr;
2205  if (iiDeclCommand(&tmp_expr,v,myynest,DEF_CMD,&IDROOT)) return TRUE;
2206  sleftv h_expr;
2207  memset(&h_expr,0,sizeof(h_expr));
2208  h_expr.rtyp=IDHDL;
2209  h_expr.data=h;
2210  h_expr.name=vn;
2211  return iiAssign(&tmp_expr,&h_expr);
2212  }
2213  else
2214  {
2215  Werror("`%s` not found in `%s`",v->Name(), u->Name());
2216  return TRUE;
2217  }
2218  return FALSE;
2219 }
ip_package * package
Definition: structs.h:46
Class used for (list of) interpreter objects.
Definition: subexpr.h:82
#define FALSE
Definition: auxiliary.h:94
#define IDROOT
Definition: ipid.h:20
#define TRUE
Definition: auxiliary.h:98
#define WarnS
Definition: emacs.cc:81
int Typ()
Definition: subexpr.cc:995
const char * Name()
Definition: subexpr.h:120
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
int myynest
Definition: febase.cc:46
char my_yylinebuf[80]
Definition: febase.cc:48
Definition: tok.h:58
const char * name
Definition: subexpr.h:87
#define assume(x)
Definition: mod2.h:394
#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:1122
#define NULL
Definition: omList.c:10
void killhdl(idhdl h, package proot)
Definition: ipid.cc:377
package basePack
Definition: ipid.cc:64
int rtyp
Definition: subexpr.h:91
void * Data()
Definition: subexpr.cc:1137
static Poly * h
Definition: janet.cc:978
#define V_REDEFINE
Definition: options.h:43
void Werror(const char *fmt,...)
Definition: reporter.cc:189
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
Definition: ipassign.cc:1793
#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:94
#define Sy_bit(x)
Definition: options.h:30
void * Data()
Definition: subexpr.cc:1137
#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:94
#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:1137

◆ 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->cf);
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:94
return P p
Definition: myNF.cc:203
static short rVar(const ring r)
#define rVar(r) (r->N)
Definition: ring.h:583
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
#define TRUE
Definition: auxiliary.h:98
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:115
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:248
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:408
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:927
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:935
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:1614
#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:1137
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:504
void * CopyD(int t)
Definition: subexpr.cc:707
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
Definition: numbers.cc:341
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:117
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:94
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:707

◆ jjNormalizeQRingId()

void jjNormalizeQRingId ( leftv  I)

Definition at line 2137 of file ipassign.cc.

2138 {
2139  if ((currRing->qideal!=NULL) && (!hasFlag(I,FLAG_QRING)))
2140  {
2141  if (I->e==NULL)
2142  {
2143  ideal I0=(ideal)I->Data();
2144  switch (I->Typ())
2145  {
2146  case IDEAL_CMD:
2147  case MODUL_CMD:
2148  {
2149  ideal F=idInit(1,1);
2150  ideal II=kNF(F,currRing->qideal,I0);
2151  idDelete(&F);
2152  if (I->rtyp!=IDHDL)
2153  {
2154  idDelete((ideal*)&(I0));
2155  I->data=II;
2156  }
2157  else
2158  {
2159  idhdl h=(idhdl)I->data;
2160  idDelete((ideal*)&IDIDEAL(h));
2161  IDIDEAL(h)=II;
2162  setFlag(h,FLAG_QRING);
2163  }
2164  break;
2165  }
2166  default: break;
2167  }
2168  setFlag(I,FLAG_QRING);
2169  }
2170  }
2171 }
poly kNF(ideal F, ideal Q, poly p, int syzComp, int lazyReduce)
Definition: kstd1.cc:2971
Subexpr e
Definition: subexpr.h:105
#define idDelete(H)
delete an ideal
Definition: ideals.h:29
#define IDIDEAL(a)
Definition: ipid.h:130
int Typ()
Definition: subexpr.cc:995
Definition: idrec.h:34
#define IDHDL
Definition: tok.h:31
void * data
Definition: subexpr.h:88
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:91
void * Data()
Definition: subexpr.cc:1137
static Poly * h
Definition: janet.cc:978

◆ jjNormalizeQRingP()

void jjNormalizeQRingP ( poly p)

Definition at line 2172 of file ipassign.cc.

2173 {
2174  if((p!=NULL) && (currRing->qideal!=NULL))
2175  {
2176  ideal F=idInit(1,1);
2177  poly p2=kNF(F,currRing->qideal,p);
2178  pNormalize(p2);
2179  idDelete(&F);
2180  pDelete(&p);
2181  p=p2;
2182  }
2183 }
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:29
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:94
void * Data()
Definition: subexpr.cc:1137
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:94
void initRTimer()
Definition: timer.cc:158
void * Data()
Definition: subexpr.cc:1137
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:94
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:394
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:1137
static FORCE_INLINE BOOLEAN nCoeff_is_Extension(const coeffs r)
Definition: coeffs.h:863
int BOOLEAN
Definition: auxiliary.h:85

◆ 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:94
int timerv
Definition: timer.cc:19
void * Data()
Definition: subexpr.cc:1137
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:94
int traceit
Definition: febase.cc:47
void * Data()
Definition: subexpr.cc:1137