28static char * bigintm_String(blackbox *,
void *d)
37static void * bigintm_Copy(blackbox*,
void *d)
42 assume(
l->Typ() == bigintm_type_id );
48 if (bigintm_type_id == r->
Typ())
53 number n2=(number)r->
CopyD();
66 Werror(
"bigintm_Assign: assign %s (%d) = %s (%d)",
119 number n1=(number)a1->
Data();
132 else if (a2->
Typ()==a1->
Typ())
134 number n2=(number)a2->
Data();
141 Werror(
"bigintm_Op2: Op: '+': Sorry unsupported 2nd argument-type: %s in",
Tok2Cmdname(a2->
Typ()));
155 else if (a2->
Typ()==a1->
Typ())
157 number n2=(number)a2->
Data();
164 Werror(
"bigintm_Op2: Op: '-': Sorry unsupported 2nd argument-type: %s in",
Tok2Cmdname(a2->
Typ()));
179 else if (a2->
Typ()==a1->
Typ())
181 number n2=(number)a2->
Data();
187 Werror(
"bigintm_Op2: Op: '*': Sorry unsupported 2nd argument-type: '%s' in",
Tok2Cmdname(a2->
Typ()));
207 else if (a2->
Typ()==a1->
Typ())
209 number n2=(number)a2->
Data();
215 Werror(
"bigintm_Op2: Op: '==': Sorry unsupported 2nd argument-type: '%s' in",
Tok2Cmdname(a2->
Typ()));
224 Werror(
"bigintm_Op2: Op: '.': 2nd argument-type: '%s'(%d) should be a NAME",
Tok2Cmdname(a2->
Typ()), a2->
Typ());
240 assume( args->
Typ() == bigintm_type_id );
246 res->data=(
void *)a->blackbox_String(a,args->
Data());
257static void bigintm_destroy(blackbox *,
void *d)
274 Werror(
"bigintm_setup: Sorry BIGINTM was not compiled in!");
278 if( bigintm_type_id == -1 )
280 blackbox *
b=(blackbox*)
omAlloc0(
sizeof(blackbox));
284 b->blackbox_destroy=bigintm_destroy;
285 b->blackbox_String=bigintm_String;
288 b->blackbox_Copy=bigintm_Copy;
289 b->blackbox_Assign=bigintm_Assign;
290 b->blackbox_Op1=bigintm_Op1;
291 b->blackbox_Op2=bigintm_Op2;
293 b->blackbox_OpM=bigintm_OpM;
297 Print(
"bigintm_setup: created a blackbox type [%d] '%s'",bigintm_type_id,
getBlackboxName(bigintm_type_id));
304 Werror(
"bigintm_setup: Sorry should NOT be run twice!");
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type
BOOLEAN blackboxDefaultOp2(int, leftv, leftv, leftv)
default procedure blackboxDefaultOp2, to be called as "default:" branch
const char * getBlackboxName(const int t)
return the name to the type given by t (r/o)
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
BOOLEAN blackboxDefaultOpM(int op, leftv res, leftv args)
default procedure blackboxDefaultOpM, to be called as "default:" branch
BOOLEAN blackboxDefaultOp1(int op, leftv l, leftv r)
default procedure blackboxDefaultOp1, to be called as "default:" branch
Class used for (list of) interpreter objects.
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE number n_Mult(number a, number b, const coeffs r)
return the product of 'a' and 'b', i.e., a*b
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of 'a' and 'b', i.e., a-b
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static FORCE_INLINE BOOLEAN n_Equal(number a, number b, const coeffs r)
TRUE iff 'a' and 'b' represent the same number; they may have different representations.
const char * Tok2Cmdname(int tok)
void StringSetS(const char *st)
void Werror(const char *fmt,...)