98 if (0 == strcmp(
s,
h->name))
135 if ((temp!=
NULL) && (temp->
atyp==t))
138 return defaultReturnValue;
147 if ((temp!=
NULL) && (temp->
atyp==t))
159 WerrorS(
"cannot set ring-dependend objects at this type");
172 WerrorS(
"cannot set attributes of this object");
175 WerrorS(
"cannot set ring-dependend objects at this type");
191 attr temp =
this,temp1;
215 while (temp1->
next!=temp) temp1 = temp1->
next;
236 attr *aa=(
v->Attribute());
239 WerrorS(
"this object cannot have attributes");
248 PrintS(
"attr:isSB, type int\n");
249 haveNoAttribute=
FALSE;
253 PrintS(
"attr:qringNF, type int\n");
254 haveNoAttribute=
FALSE;
258 PrintS(
"attr:cf_class, type int\n");
259 PrintS(
"attr:cf_class_Zp, type int\n");
260 PrintS(
"attr:cf_class_QQ, type int\n");
261 PrintS(
"attr:global, type int\n");
262 PrintS(
"attr:maxExp, type int\n");
263 PrintS(
"attr:ring_cf, type int\n");
265 PrintS(
"attr:isLetterplaceRing, type int\n");
267 PrintS(
"attr:ncgenCount, type int\n");
270 haveNoAttribute=
FALSE;
279 else if(haveNoAttribute)
PrintS(
"no attributes\n");
284 char *
name=(
char *)
b->Data();
289 if (strcmp(
name,
"isSB")==0)
298 res->data=(
void *)(((ideal)
v->Data())->rank);
300 else if ((strcmp(
name,
"global")==0)
304 res->data=(
void *)(((ring)
v->Data())->OrdSgn==1);
306 else if ((strcmp(
name,
"maxExp")==0)
310 res->data=(
void *)(
long)(((ring)
v->Data())->bitmask);
312 else if ((strcmp(
name,
"ring_cf")==0)
318 else if ((strncmp(
name,
"cf_class",strlen(
"cf_class"))==0)
323 cf=((ring)
v->Data())->cf;
324 if (strcmp(
name,
"cf_class_Zp")==0)
325 res->data=(
void *)(
long)(int)(
cf->type==
n_Zp);
326 else if (strcmp(
name,
"cf_class_QQ")==0)
327 res->data=(
void *)(
long)(int)(
cf->type==
n_Q);
329 res->data=(
void *)(
long)(int)
cf->type;
331 else if (strcmp(
name,
"qringNF")==0)
338 else if ((strcmp(
name,
"isLetterplaceRing")==0)
342 res->data=(
void *)(
long)(((ring)
v->Data())->isLPring);
344 else if ((strcmp(
name,
"ncgenCount")==0)
348 res->data=(
void *)(
long)(((ring)
v->Data())->LPncGenCount);
353 attr *aa=
v->Attribute();
356 WerrorS(
"this object cannot have attributes");
386 char *
name=(
char *)
b->Data();
387 if (strcmp(
name,
"isSB")==0)
391 WerrorS(
"attribute isSB must be int");
394 if (((
long)c->
Data())!=0L)
405 else if (strcmp(
name,
"qringNF")==0)
409 WerrorS(
"attribute qringNF must be int");
412 if (((
long)c->
Data())!=0L)
427 WerrorS(
"attribute `rank` must be int");
430 ideal I=(ideal)
v->Data();
434 else if (((strcmp(
name,
"global")==0)
435 || (strncmp(
name,
"cf_class",strlen(
"cf_class"))==0)
436 || (strcmp(
name,
"ring_cf")==0)
437 || (strcmp(
name,
"maxExp")==0))
444 else if ((strcmp(
name,
"isLetterplaceRing")==0)
448 ((ring)
v->Data())->isLPring=(int)(
long)c->
Data();
451 WerrorS(
"attribute `isLetterplaceRing` must be int");
455 else if ((strcmp(
name,
"ncgenCount")==0)
459 ((ring)
v->Data())->LPncGenCount=(int)(
long)c->
Data();
462 WerrorS(
"attribute `ncgenCount` must be int");
485 if (
h->attribute!=
NULL)
497 WerrorS(
"object must have a name");
500 char *
name=(
char *)
b->Data();
501 if (strcmp(
name,
"isSB")==0)
506 else if (strcmp(
name,
"global")==0)
508 WerrorS(
"can not set attribut `global`");
BOOLEAN atATTRIB3(leftv, leftv v, leftv b, leftv c)
STATIC_VAR omBin sattr_bin
BOOLEAN atKILLATTR2(leftv, leftv a, leftv b)
BOOLEAN atKILLATTR1(leftv, leftv a)
void at_KillAll(idhdl root, const ring r)
void at_Kill(idhdl root, const char *name, const ring r)
void atSet(idhdl root, char *name, void *data, int typ)
static void attr_free(attr h, const ring r=currRing)
BOOLEAN atATTRIB2(leftv res, leftv v, leftv b)
void * atGet(idhdl root, const char *name, int t, void *defaultReturnValue)
BOOLEAN atATTRIB1(leftv res, leftv v)
static int si_max(const int a, const int b)
const CanonicalForm CFMap CFMap & N
void killAll(const ring r)
attr set(char *s, void *data, int t)
@ n_Q
rational (GMP) numbers
const CanonicalForm int s
const Variable & v
< [in] a sqrfree bivariate poly
void WerrorS(const char *s)
const char * Tok2Cmdname(int tok)
static int RingDependend(int t)
The main handler for Singular numbers which are suitable for Singular polynomials.
#define omCheckAddr(addr)
#define omCheckAddrSize(addr, size)
#define omFreeBin(addr, bin)
#define omGetSpecBin(size)
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)
void PrintS(const char *s)
void Werror(const char *fmt,...)
static BOOLEAN rIsLPRing(const ring r)
#define rField_is_Ring(R)
long id_RankFreeModule(ideal s, ring lmRing, ring tailRing)
return the maximal component number found in any polynomial in s
void s_internalDelete(const int t, void *d, const ring r)
int name
New type name for int.