82 ch[0]=c->op;ch[1]=
'\0';
85 ::Print(
"##command %d(%s), %d args\n",
88 c->arg1.Print(
NULL,spaces+2);
92 c->arg2.Print(
NULL,spaces+2);
94 c->arg3.Print(
NULL,spaces+2);
101 const char *
n=
Name();
105 if ((store!=
NULL)&&(store!=
this))
135 ((
intvec *)d)->show(t,spaces);
141 const ring
r = (
const ring)d;
260 if (bb!=
NULL) { bb->blackbox_Print(bb,d); }
261 else {
::Print(
"Print: blackbox %d(bb=NULL)",t); }
393 return (
void*)
n2Copy((number2)d);
418 return (
void *)
nCopy((number)d);
431 if (r!=
NULL) r->ref++;
447 if (b!=
NULL)
return b->blackbox_Copy(b,d);
451 Warn(
"s_internalCopy: cannot copy type %s(%d)",
469 number2
n=(number2)d;
550 Print(
"currRing? ref=%d\n",R->ref);
563 if (cmd->arg1.rtyp!=0) cmd->arg1.CleanUp(r);
564 if (cmd->arg2.rtyp!=0) cmd->arg2.CleanUp(r);
565 if (cmd->arg3.rtyp!=0) cmd->arg3.CleanUp(r);
598 if (b!=
NULL) b->blackbox_destroy(b,d);
602 Warn(
"s_internalDelete: cannot delete type %s(%d)",
619 else if (e->next==
NULL)
641 void *d=source->
Data();
670 x=(
void *)
p_Copy(A->qideal->m[0], A);
706 if (((
command)data)->arg1.rtyp!=0)
708 if (((
command)data)->arg2.rtyp!=0)
710 if (((
command)data)->arg3.rtyp==0)
727 sprintf(s,
"int(%d)",(
int)(
long)d);
732 sprintf(s,
"%d",(
int)(
long)d);
744 s = (
char*)
omAlloc(strlen((
char*) d) + 3);
745 sprintf(s,
"\"%s\"", (
char*) d);
758 s = (
char*)
omAlloc(strlen(ps) + 10);
759 sprintf(s,
"%s(%s)", (t ==
POLY_CMD ?
"poly" :
"vector"), ps);
779 number
n=(number)data;
789 number
n=
nCopy((number)d);
809 char* ns = (
char*)
omAlloc(strlen(s) + 40);
810 sprintf(ns,
"matrix(ideal(%s),%d,%d)", s,
826 char* ns = (
char*)
omAlloc(strlen(s) + 10);
827 sprintf(ns,
"%s(%s)", (t==
MODUL_CMD ?
"module" :
"ideal"), s);
843 ns = (
char*)
omAlloc(strlen(s) + 40);
844 sprintf(ns,
"intmat(intvec(%s),%d,%d)", s, v->
rows(), v->
cols());
848 ns = (
char*)
omAlloc(strlen(s) + 10);
849 sprintf(ns,
"intvec(%s)", s);
864 char* ns = (
char*)
omAlloc0(strlen(s) + 40);
865 sprintf(ns,
"bigintmat(bigintvec(%s),%d,%d)", s, bim->
rows(), bim->
cols());
884 ns = (
char*)
omAlloc(strlen(s) + strlen(
id) + 20);
885 sprintf(ns,
"\"%s\";%sideal(%s)", s,(dim == 2 ?
"\n" :
" "),
id);
889 ns = (
char*)
omAlloc(strlen(s) + 4);
890 sprintf(ns,
"\"%s\"", s);
909 s = (pi->
data.s.body);
914 char* ns = (
char*)
omAlloc(strlen(s) + 4);
915 sprintf(ns,
"\"%s\"", s);
926 char* ns = (
char*)
omAlloc(strlen(s) + 10);
927 sprintf(ns,
"link(\"%s\")", s);
941 if (bb!=
NULL)
return bb->blackbox_String(bb,d);
1033 if ((0<
e->start)&&(
e->start<=l->
nr+1))
1035 Subexpr tmp=l->
m[
e->start-1].
e;
1036 l->
m[
e->start-1].
e=
e->next;
1037 r=l->
m[
e->start-1].
Typ();
1038 e->next=l->
m[
e->start-1].
e;
1039 l->
m[
e->start-1].
e=tmp;
1069 if ((0<
e->start)&&(
e->start<=l->
nr+1))
1071 l->
m[
e->start-1].
e=
e->next;
1072 r=l->
m[
e->start-1].
LTyp();
1123 return (
void *)A->qideal->m[0];
1126 return (
void *)
currRing->cf->nNULL;
1160 if ((index<1)||(index>iv->
length()))
1163 Werror(
"wrong range[%d] in intvec %s(%d)",index,this->
Name(),iv->
length());
1166 r=(
char *)(
long)((*iv)[index-1]);
1173 ||(index>iv->
rows())
1174 ||(
e->next->start<1)
1175 ||(
e->next->start>iv->
cols()))
1178 Werror(
"wrong range[%d,%d] in intmat %s(%dx%d)",index,
e->next->start,
1179 this->Name(),iv->
rows(),iv->
cols());
1182 r=(
char *)(
long)(
IMATELEM((*iv),index,
e->next->start));
1190 ||(
e->next->start<1)
1191 ||(
e->next->start>m->
cols()))
1194 Werror(
"wrong range[%d,%d] in bigintmat %s(%dx%d)",index,
e->next->start,
1207 ||(
e->next->start<1)
1208 ||(
e->next->start>m->
cols()))
1211 Werror(
"wrong range[%d,%d] in matrix %s(%dx%d)",index,
e->next->start,
1218 r=(
char*)&iiNumber2Data[iiCmatrix_index];
1219 iiCmatrix_index=(iiCmatrix_index+1) % 4;
1229 if ((index<1)||(index>
IDELEMS(I)))
1235 r=(
char *)I->m[index-1];
1247 if ((index>0)&& (index<=(
int)strlen((
char *)d)))
1249 r[0]=*(((
char *)d)+index-1);
1264 memcpy(
this,&tmp,
sizeof(tmp));
1284 ||(
e->next->start<1)
1288 Werror(
"wrong range[%d,%d] in matrix %s(%dx%d)",
1289 index,
e->next->start,
1307 if ((0<index)&&(index<=l->
nr+1))
1313 char *dd=(
char *)l->
m[index-1].
data;
1314 int j=
e->next->start-1;
1316 if ((
j>=0) && (
j<(
int)strlen(dd)))
1328 Subexpr tmp=l->
m[index-1].
e;
1329 l->
m[index-1].
e=
e->next;
1330 r=(
char *)l->
m[index-1].
Data();
1331 e->next=l->
m[index-1].
e;
1332 l->
m[index-1].
e=tmp;
1336 Werror(
"wrong range[%d] in list %s(%d)",index,this->
Name(),l->
nr+1);
1384 if ((0>=
e->start)||(
e->start>l->
nr+1))
1388 l->
m[
e->start-1].
e=
e->next;
1393 return &(l->
m[
e->start-1]);
1400 leftv sleftv::LHdl()
1412 if ((0>=
e->start)||(
e->start>l->
nr+1))
1416 l->
m[
e->start-1].
e=
e->next;
1421 return &(l->
m[
e->start-1]);
1442 Warn(
"%s is no standard basis",h->
Name());
1471 if ((*
id<
' ')||(*
id>(
char)126))
1473 Print(
"wrong id :%s:\n",
id);
1491 if (!isdigit(
id[0]))
1493 if (strcmp(
id,
"basering")==0)
1507 else if (strcmp(
id,
"Current")==0)
1548 v->
data = (
void *)p;
1559 if (ok && (p!=
NULL))
1686 if (strcmp(
id,
"_")==0)
1689 v->
Copy(&sLastPrinted);
1711 v->
data = (
char *)h;
1737 char *what=(
char *)(d->arg1.Data());
1755 else if (d->op==
'=')
1763 const char *
n=d->arg1.name;
1764 nok=(n ==
NULL) || d->arg2.Eval();
1767 int save_typ=d->arg1.rtyp;
1769 if (d->arg1.rtyp!=
IDHDL)
1772 if (d->arg1.rtyp==
IDHDL)
1787 memcpy(&d->arg1,&t,
sizeof(
sleftv));
1789 nok=nok||
iiAssign(&d->arg1,&d->arg2);
1794 memset(&d->arg1,0,
sizeof(
sleftv));
1806 if ((toktype==
CMD_M)
1812 if (d->argc>=1) nok=d->arg1.Eval();
1813 if ((!nok) && (d->argc>=2))
1817 memcpy(d->arg1.next,&d->arg2,
sizeof(
sleftv));
1820 if ((!nok) && (d->argc==3))
1824 memcpy(d->arg1.next->next,&d->arg3,
sizeof(
sleftv));
1838 else if (d->argc==1)
1846 nok=nok||d->arg2.Eval();
1852 nok=nok||d->arg2.Eval();
1853 nok=nok||d->arg3.Eval();
1854 nok=nok||
iiExprArith3(&tmp,d->op,&d->arg1,&d->arg2,&d->arg3);
1866 memcpy(
this,&tmp,
sizeof(tmp));
1896 int i=
id->ncols*
id->nrows-1;
1897 for(;i>=0;i--)
pTest(id->m[i]);
const const intvec const intvec const ring _currRing const const intvec const intvec const ring _currRing int
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
BOOLEAN yyInRingConstruction
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
void * slInternalCopy(leftv source, const int t, void *d, Subexpr e)
const CanonicalForm int s
#define omCheckAddrSize(addr, size)
Class used for (list of) interpreter objects.
void jjNormalizeQRingP(leftv I)
void syMake(leftv v, const char *id, idhdl packhdl)
void killAll(const ring r)
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
Compatiblity layer for legacy polynomial operations (over currRing)
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
void n2Delete(number2 &d)
#define omCheckIf(cond, test)
const CanonicalForm CFMap CFMap int &both_non_zero int n
void id_Delete(ideal *h, ring r)
intvec * ivCopy(const intvec *o)
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
void syPrint(syStrategy syzstr, const char *currRingName)
procinfov piCopy(procinfov pi)
static BOOLEAN rField_is_GF(const ring r)
const char * slStatus(si_link l, const char *request)
char * lString(lists l, BOOLEAN typed, int dim)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy ...
BOOLEAN piKill(procinfov pi)
void Print(leftv store=NULL, int spaces=0)
Called by type_cmd (e.g. "r;") or as default in jPRINT.
static poly p_Copy(poly p, const ring r)
returns a copy of p
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
char * String(int dim=2) const
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..)
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
void nfShowMipo(const coeffs r)
Show the mininimal polynom.... NOTE: this is used by char * sleftv::String(void *d, BOOLEAN typed, int dim) (from Singular/subexpr.cc) for printing minpoly.
BOOLEAN iiMake_proc(idhdl pn, package pack, sleftv *sl)
int r_IsRingVar(const char *n, char **names, int N)
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
const char * iiTwoOps(int t)
const char * piProcinfo(procinfov pi, const char *request)
bigintmat * bimCopy(const bigintmat *b)
same as copy constructor - apart from it being able to accept NULL as input
#define omFreeBinAddr(addr)
The main handler for Singular numbers which are suitable for Singular polynomials.
void StringSetS(const char *st)
void StringAppendS(const char *st)
static FORCE_INLINE void n_Write(number &n, const coeffs r, const BOOLEAN bShortOut=TRUE)
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
void s_internalDelete(const int t, void *d, const ring r)
#define pIsConstant(p)
like above, except that Comp might be != 0
package paCopy(package pack)
BOOLEAN assumeStdFlag(leftv h)
void PrintS(const char *s)
char * slString(si_link l)
void rWrite(ring r, BOOLEAN details)
static int iiCmatrix_index
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
static void * s_internalCopy(const int t, void *d)
static int index(p_Length length, p_Ord ord)
#define BIMATELEM(M, I, J)
number2 n2Copy(const number2 d)
int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl *root, BOOLEAN isring, BOOLEAN init_b)
static void p_Delete(poly *p, const ring r)
#define omGetSpecBin(size)
void paPrint(const char *n, package p)
BOOLEAN iiCheckRing(int i)
const Variable & v
< [in] a sqrfree bivariate poly
void jjNormalizeQRingId(leftv I)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
static snumber2 iiNumber2Data[4]
syStrategy syCopy(syStrategy syzstr)
const char * Tok2Cmdname(int tok)
void killhdl(idhdl h, package proot)
char * String()
IO: String returns a singular string containing the matrix, needs freeing afterwards.
coeffs basecoeffs() const
void CleanUp(ring r=currRing)
void Clean(ring r=currRing)
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced ...
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
ideal idCopy(ideal A, const ring R=currRing)
map maCopy(map theMap, const ring r)
#define omCheckAddr(addr)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
#define omFreeBin(addr, bin)
#define IMATELEM(M, I, J)
char * iiStringMatrix(matrix im, int dim, const ring r, char ch)
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
BOOLEAN lRingDependend(lists L)
void nKillChar(coeffs r)
undo all initialisations
const char * iiSleftv2name(leftv v)
void Werror(const char *fmt,...)
void syKillComputation(syStrategy syzstr, ring r=currRing)
void PrintNSpaces(const int n)
idhdl ggetid(const char *n, BOOLEAN, idhdl *packhdl)
static omBin size_two_bin
char * n2String(number2 d, BOOLEAN typed)
si_link slCopy(si_link l)
#define pCopy(p)
return a copy of the poly
#define MATELEM(mat, i, j)
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)