72 ch[0]=c->op;ch[1]=
'\0';
75 ::Print(
"##command %d(%s), %d args\n",
78 c->arg1.Print(
NULL,spaces+2);
82 c->arg2.Print(
NULL,spaces+2);
84 c->arg3.Print(
NULL,spaces+2);
145 ((
intvec *)d)->show(t,spaces);
150 const ring r = (ring)d;
293 l->m[
i].Print(
NULL,spaces+3);
305 if (bb!=
NULL) { bb->blackbox_Print(bb,d); }
306 else {
::Print(
"Print: blackbox %d(bb=NULL)",t); }
309 ::Print(
"Print:unknown type %s(%d)",
Tok2Cmdname(t),t);
311 if ((store!=
NULL)&&(store!=
this))
442 return (
void*)n2Copy((number2)d);
444 return (
void*)p2Copy((poly2)d);
459 return (
void *)
idCopy((ideal)d);
468 return (
void *)
pCopy((poly)d);
472 return (
void *)
nCopy((number)d);
503 if (
b!=
NULL)
return b->blackbox_Copy(
b,d);
507 Warn(
"s_internalCopy: cannot copy type %s(%d)",
535 number2 n=(number2)d;
628 Print(
"currRing? ref=%d\n",
R->ref);
641 if (cmd->arg1.rtyp!=0) cmd->arg1.CleanUp(r);
642 if (cmd->arg2.rtyp!=0) cmd->arg2.CleanUp(r);
643 if (cmd->arg3.rtyp!=0) cmd->arg3.CleanUp(r);
675 if (
b!=
NULL)
b->blackbox_destroy(
b,d);
679 Warn(
"s_internalDelete: cannot delete type %s(%d)",
689 void *d=source->
Data();
715 WerrorS(
"object from another ring");
792 sprintf(
s,
"int(%ld)",(
long)d);
801 sprintf(
s,
"%ld",(
long)d);
813 s = (
char*)
omAlloc(strlen((
char*) d) + 3);
814 sprintf(
s,
"\"%s\"", (
char*) d);
827 s = (
char*)
omAlloc(strlen(ps) + 10);
828 sprintf(
s,
"%s(%s)", (t ==
POLY_CMD ?
"poly" :
"vector"), ps);
839 return n2String((number2)d,typed);
874 char* ns = (
char*)
omAlloc(strlen(
s) + 40);
875 sprintf(ns,
"matrix(ideal(%s),%d,%d)",
s,
892 char* ns = (
char*)
omAlloc(strlen(
s) + 10);
894 sprintf(ns,
"ideal(%s)",
s);
896 sprintf(ns,
"module(%s)",
s);
913 ns = (
char*)
omAlloc(strlen(
s) + 40);
914 sprintf(ns,
"intmat(intvec(%s),%d,%d)",
s,
v->rows(),
v->cols());
918 ns = (
char*)
omAlloc(strlen(
s) + 10);
919 sprintf(ns,
"intvec(%s)",
s);
934 char* ns = (
char*)
omAlloc0(strlen(
s) + 40);
935 sprintf(ns,
"bigintmat(bigintvec(%s),%d,%d)",
s, bim->
rows(), bim->
cols());
954 ns = (
char*)
omAlloc(strlen(
s) + strlen(
id) + 20);
955 sprintf(ns,
"\"%s\";%sideal(%s)",
s,(
dim == 2 ?
"\n" :
" "),
id);
959 ns = (
char*)
omAlloc(strlen(
s) + 4);
960 sprintf(ns,
"\"%s\"",
s);
979 s = (
pi->data.s.body);
984 char* ns = (
char*)
omAlloc(strlen(
s) + 4);
985 sprintf(ns,
"\"%s\"",
s);
996 char* ns = (
char*)
omAlloc(strlen(
s) + 10);
997 sprintf(ns,
"link(\"%s\")",
s);
1011 if (bb!=
NULL)
return bb->blackbox_String(bb,d);
1030 return ((
idhdl)
h->data.ustring)->typ;
1104 if ((0<
e->start)&&(
e->start<=
l->nr+1))
1106 Subexpr tmp=
l->m[
e->start-1].e;
1107 l->m[
e->start-1].e=
e->next;
1108 r=
l->m[
e->start-1].Typ();
1109 e->next=
l->m[
e->start-1].e;
1110 l->m[
e->start-1].e=tmp;
1140 if ((0<
e->start)&&(
e->start<=
l->nr+1))
1142 l->m[
e->start-1].e=
e->next;
1143 r=
l->m[
e->start-1].LTyp();
1169 WerrorS(
"object from another ring");
1179 return ((
idhdl)
h->data.ustring)->
data.ustring;
1200 return (
void *)
A->qideal->m[0];
1203 return (
void *)
nInit(0);
1243 r=(
char *)(
long)((*iv)[
index-1]);
1251 ||(
e->next->start<1)
1252 ||(
e->next->start>iv->
cols()))
1255 Werror(
"wrong range[%d,%d] in intmat %s(%dx%d)",
index,
e->next->start,
1256 this->Name(),iv->
rows(),iv->
cols());
1267 ||(
e->next->start<1)
1268 ||(
e->next->start>
m->cols()))
1271 Werror(
"wrong range[%d,%d] in bigintmat %s(%dx%d)",
index,
e->next->start,
1272 this->Name(),
m->rows(),
m->cols());
1284 ||(
e->next->start<1)
1285 ||(
e->next->start>
m->cols()))
1288 Werror(
"wrong range[%d,%d] in matrix %s(%dx%d)",
index,
e->next->start,
1289 this->Name(),
m->rows(),
m->cols());
1293 iiNumber2Data[iiCmatrix_index].cf=
m->basecoeffs();
1295 r=(
char*)&iiNumber2Data[iiCmatrix_index];
1296 iiCmatrix_index=(iiCmatrix_index+1) % 4;
1312 r=(
char *)I->m[
index-1];
1324 && ((c=
e->next->start)>0) &&(c<=
IDELEMS(I)))
1338 memcpy(
this,&tmp,
sizeof(tmp));
1363 if ((
index>0)&& (
index<=(int)strlen((
char *)d)))
1365 r[0]=*(((
char *)d)+
index-1);
1380 memcpy(
this,&tmp,
sizeof(tmp));
1400 ||(
e->next->start<1)
1404 Werror(
"wrong range[%d,%d] in matrix %s(%dx%d)",
1429 char *dd=(
char *)
l->m[
index-1].data;
1430 int j=
e->next->start-1;
1432 if ((
j>=0) && (
j<(
int)strlen(dd)))
1444 Subexpr tmp=
l->m[
index-1].e;
1446 r=(
char *)
l->m[
index-1].Data();
1471 return &(
v->attribute);
1500 if ((0>=
e->start)||(
e->start>
l->nr+1))
1504 l->m[
e->start-1].e=
e->next;
1505 leftv r=
l->m[
e->start-1].LData();
1509 return &(
l->m[
e->start-1]);
1528 if ((0>=
e->start)||(
e->start>
l->nr+1))
1532 l->m[
e->start-1].e=
e->next;
1533 leftv r=
l->m[
e->start-1].LHdl();
1537 return &(
l->m[
e->start-1]);
1558 Warn(
"%s is no standard basis",
h->Name());
1588 if ((*
id<
' ')||(*
id>(
char)126))
1590 Print(
"wrong id :%s:\n",
id);
1597 v->req_packhdl =
pa;
1607 if (strcmp(
id,
"basering")==0)
1621 else if (strcmp(
id,
"Current")==0)
1637 h=
v->req_packhdl->idroot->get(
id,
myynest);
1663 v->data = (
void *)
p;
1674 if (ok && (
p!=
NULL))
1696 if (
id[0]==
'-') {
i=1; }
1697 while(isdigit(
id[
i]))
i++;
1702 sprintf(tmp,
"%d",
j);
1712 v->data=(
void*)(
long)
j;
1729 v->data = (
void *)
nInit(0);
1749 #ifdef HAVE_SHIFTBBA
1776 v->data = (
void *)
nInit(0);
1833 if (strcmp(
id,
"_")==0)
1858 v->data = (
char *)
h;
1864 if (!isdigit(
id[0]))
1866 Print(
"non-digit:%s\n",
id);
1874 if ((*
id<
' ')||(*
id>(
char)126))
1876 Print(
"wrong id :%s:\n",
id);
1893 v->data = (
void *)
nInit(0);
1910 #ifdef HAVE_SHIFTBBA
1932 if (strcmp(
id,
"_")==0)
1967 char *what=(
char *)(d->arg1.Data());
1985 else if (d->op==
'=')
1993 const char *n=d->arg1.name;
1994 nok=(n ==
NULL) || d->arg2.Eval();
1997 int save_typ=d->arg1.rtyp;
1999 if (d->arg1.rtyp!=
IDHDL)
2002 if (d->arg1.rtyp==
IDHDL)
2017 memcpy(&d->arg1,&t,
sizeof(
sleftv));
2019 nok=nok||
iiAssign(&d->arg1,&d->arg2);
2036 if ((toktype==
CMD_M)
2042 if (d->argc>=1) nok=d->arg1.Eval();
2043 if ((!nok) && (d->argc>=2))
2047 memcpy(d->arg1.next,&d->arg2,
sizeof(
sleftv));
2050 if ((!nok) && (d->argc==3))
2054 memcpy(d->arg1.next->next,&d->arg3,
sizeof(
sleftv));
2068 else if (d->argc==1)
2076 nok=nok||d->arg2.Eval();
2082 nok=nok||d->arg2.Eval();
2083 nok=nok||d->arg3.Eval();
2084 nok=nok||
iiExprArith3(&tmp,d->op,&d->arg1,&d->arg2,&d->arg3);
2096 memcpy(
this,&tmp,
sizeof(tmp));
2124 ideal
id=(ideal)
Data();
2126 int i=
id->ncols*
id->nrows-1;
bigintmat * bimCopy(const bigintmat *b)
same as copy constructor - apart from it being able to accept NULL as input
#define BIMATELEM(M, I, J)
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
CanonicalForm map(const CanonicalForm &primElem, const Variable &alpha, const CanonicalForm &F, const Variable &beta)
map from to such that is mapped onto
char * String()
IO: String returns a singular string containing the matrix, needs freeing afterwards.
void killAll(const ring r)
Class used for (list of) interpreter objects.
char * String(void *d=NULL, BOOLEAN typed=FALSE, int dim=1)
Called for conversion to string (used by string(..), write(..),..)
void CleanUp(ring r=currRing)
void Print(leftv store=NULL, int spaces=0)
Called by type_cmd (e.g. "r;") or as default in jPRINT.
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
static FORCE_INLINE BOOLEAN nCoeff_is_GF(const coeffs r)
#define n_Test(a, r)
BOOLEAN n_Test(number a, const coeffs r)
@ n_long_C
complex floating point (GMP) numbers
static FORCE_INLINE char * nCoeffString(const coeffs cf)
TODO: make it a virtual method of coeffs, together with: Decompose & Compose, rParameter & rPar.
static FORCE_INLINE char const ** n_ParameterNames(const coeffs r)
Returns a (const!) pointer to (const char*) names of parameters.
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE char * nCoeffName(const coeffs cf)
static FORCE_INLINE int n_NumberOfParameters(const coeffs r)
Returns the number of parameters.
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
static FORCE_INLINE BOOLEAN nCoeff_is_algExt(const coeffs r)
TRUE iff r represents an algebraic extension field.
static FORCE_INLINE const char * n_Read(const char *s, number *a, const coeffs r)
!!! Recommendation: This method is too cryptic to be part of the user- !!! interface....
void nKillChar(coeffs r)
undo all initialisations
static BOOLEAN pa(leftv res, leftv args)
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
void WerrorS(const char *s)
VAR char my_yylinebuf[80]
void nfShowMipo(const coeffs r)
Show the mininimal polynom.... NOTE: this is used by char * sleftv::String(void *d,...
const char * iiTwoOps(int t)
const char * Tok2Cmdname(int tok)
VAR BOOLEAN yyInRingConstruction
ideal id_Copy(ideal h1, const ring r)
copy an ideal
intvec * ivCopy(const intvec *o)
#define IMATELEM(M, I, J)
BOOLEAN iiExprArith2(leftv res, leftv a, int op, leftv b, BOOLEAN proccall)
BOOLEAN iiExprArith1(leftv res, leftv a, int op)
BOOLEAN iiExprArithM(leftv res, leftv a, int op)
BOOLEAN iiExprArith3(leftv res, int op, leftv a, leftv b, leftv c)
void jjNormalizeQRingId(leftv I)
BOOLEAN iiAssign(leftv l, leftv r, BOOLEAN toplevel)
VAR omBin sip_command_bin
idhdl ggetid(const char *n)
void killhdl(idhdl h, package proot)
BOOLEAN piKill(procinfov pi)
EXTERN_VAR omBin sleftv_bin
#define jjNormalizeQRingP(p)
package paCopy(package pack)
BOOLEAN iiMake_proc(idhdl pn, package pack, leftv args)
INST_VAR sleftv iiRETURNEXPR
void ipPrint_MA0(matrix m, const char *name)
int iiDeclCommand(leftv sy, leftv name, int lev, int t, idhdl *root, BOOLEAN isring, BOOLEAN init_b)
BOOLEAN iiCheckRing(int i)
lists syConvRes(syStrategy syzstr, BOOLEAN toDel, int add_row_shift)
void paPrint(const char *n, package p)
char * lString(lists l, BOOLEAN typed, int dim)
BOOLEAN lRingDependend(lists L)
map maCopy(map theMap, const ring r)
char * iiStringMatrix(matrix im, int dim, const ring r, char ch)
matrix mp_Copy(matrix a, const ring r)
copies matrix a (from ring r to r)
void iiWriteMatrix(matrix im, const char *n, int dim, const ring r, int spaces)
set spaces to zero by default
#define MATELEM(mat, i, j)
1-based access to matrix
#define SMATELEM(A, i, j, R)
static number & pGetCoeff(poly p)
return an alias to the leading coefficient of p assumes that p != NULL NOTE: not copy
The main handler for Singular numbers which are suitable for Singular polynomials.
#define omCheckAddr(addr)
#define omCheckIf(cond, test)
#define omCheckAddrSize(addr, size)
#define omFreeBin(addr, bin)
#define omFreeBinAddr(addr)
#define omGetSpecBin(size)
static int index(p_Length length, p_Ord ord)
static void p_LmDelete(poly p, const ring r)
static void p_Delete(poly *p, const ring r)
static poly p_Copy(poly p, const ring r)
returns a copy of p
static long p_Totaldegree(poly p, const ring r)
VAR ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
Compatibility layer for legacy polynomial operations (over currRing)
#define pIsConstant(p)
like above, except that Comp must be 0
static void pLmFree(poly p)
frees the space of the monomial m, assumes m != NULL coef is not freed, m is not advanced
#define pCopy(p)
return a copy of the poly
void StringSetS(const char *st)
void StringAppendS(const char *st)
void PrintNSpaces(const int n)
void PrintS(const char *s)
void Werror(const char *fmt,...)
void rWrite(ring r, BOOLEAN details)
int r_IsRingVar(const char *n, char **names, int N)
static BOOLEAN rIsPluralRing(const ring r)
we must always have this test!
static ring rIncRefCnt(ring r)
static BOOLEAN rField_is_GF(const ring r)
void sBucketPrint(sBucket_pt bucket)
char * sBucketString(sBucket_pt bucket)
void sBucketDeleteAndDestroy(sBucket_pt *bucket_pt)
sBucket_pt sBucketCopy(const sBucket_pt bucket)
Copy sBucket non-intrusive!!!
poly sBucketPeek(sBucket_pt b)
const char * slStatus(si_link l, const char *request)
static si_link slCopy(si_link l)
static char * slString(si_link l)
void id_Delete(ideal *h, ring r)
deletes an ideal/module/matrix
matrix id_Module2Matrix(ideal mod, const ring R)
void syMake(leftv v, const char *id, package pa)
void s_internalDelete(const int t, void *d, const ring r)
STATIC_VAR omBin size_two_bin
INST_VAR sleftv sLastPrinted
static void * s_internalCopy(const int t, void *d)
BOOLEAN assumeStdFlag(leftv h)
void syMakeMonom(leftv v, const char *id)
procinfov piCopy(procinfov pi)
void s_internalDelete(const int t, void *d, const ring r)
EXTERN_VAR omBin sSubexpr_bin
const char * piProcinfo(procinfov pi, const char *request)
void syMake(leftv v, const char *name, package pa=NULL)
syStrategy syCopy(syStrategy syzstr)
void syKillComputation(syStrategy syzstr, ring r=currRing)
void syPrint(syStrategy syzstr, const char *currRingName)
int name
New type name for int.