 |
My Project
debian-1:4.1.1-p2+ds-4
|
Go to the documentation of this file.
23 #define HAVE_BIGINTM 1
29 static int bigintm_type_id = -1;
33 static char * bigintm_String(blackbox *,
void *d)
42 static void * bigintm_Copy(blackbox*,
void *d)
47 assume(
l->Typ() == bigintm_type_id );
53 if (bigintm_type_id == r->
Typ())
58 number n2=(number)r->
CopyD();
71 Werror(
"bigintm_Assign: assign %s (%d) = %s (%d)",
124 number n1=(number)a1->
Data();
137 else if (a2->
Typ()==a1->
Typ())
139 number n2=(number)a2->
Data();
146 Werror(
"bigintm_Op2: Op: '+': Sorry unsupported 2nd argument-type: %s in",
Tok2Cmdname(a2->
Typ()));
160 else if (a2->
Typ()==a1->
Typ())
162 number n2=(number)a2->
Data();
169 Werror(
"bigintm_Op2: Op: '-': Sorry unsupported 2nd argument-type: %s in",
Tok2Cmdname(a2->
Typ()));
184 else if (a2->
Typ()==a1->
Typ())
186 number n2=(number)a2->
Data();
192 Werror(
"bigintm_Op2: Op: '*': Sorry unsupported 2nd argument-type: '%s' in",
Tok2Cmdname(a2->
Typ()));
212 else if (a2->
Typ()==a1->
Typ())
214 number n2=(number)a2->
Data();
220 Werror(
"bigintm_Op2: Op: '==': Sorry unsupported 2nd argument-type: '%s' in",
Tok2Cmdname(a2->
Typ()));
229 Werror(
"bigintm_Op2: Op: '.': 2nd argument-type: '%s'(%d) should be a NAME",
Tok2Cmdname(a2->
Typ()), a2->
Typ());
245 assume( args->
Typ() == bigintm_type_id );
251 res->data=(
void *)a->blackbox_String(a,args->
Data());
262 static void bigintm_destroy(blackbox *,
void *d)
279 Werror(
"bigintm_setup: Sorry BIGINTM was not compiled in!");
283 if( bigintm_type_id == -1 )
285 blackbox *
b=(blackbox*)
omAlloc0(
sizeof(blackbox));
289 b->blackbox_destroy=bigintm_destroy;
290 b->blackbox_String=bigintm_String;
293 b->blackbox_Copy=bigintm_Copy;
294 b->blackbox_Assign=bigintm_Assign;
295 b->blackbox_Op1=bigintm_Op1;
296 b->blackbox_Op2=bigintm_Op2;
298 b->blackbox_OpM=bigintm_OpM;
302 Print(
"bigintm_setup: created a blackbox type [%d] '%s'",bigintm_type_id,
getBlackboxName(bigintm_type_id));
309 Werror(
"bigintm_setup: Sorry should NOT be run twice!");
BOOLEAN blackboxDefaultOp2(int, leftv, leftv, leftv)
default procedure blackboxDefaultOp2, to be called as "default:" branch
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
Class used for (list of) interpreter objects.
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 void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
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_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
static FORCE_INLINE number n_Sub(number a, number b, const coeffs r)
return the difference of 'a' and 'b', i.e., a-b
BOOLEAN blackboxDefaultOp1(int op, leftv l, leftv r)
default procedure blackboxDefaultOp1, to be called as "default:" branch
void StringSetS(const char *st)
void Werror(const char *fmt,...)
static FORCE_INLINE number n_Copy(number n, const coeffs r)
return a copy of 'n'
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)
BOOLEAN blackboxDefaultOpM(int op, leftv res, leftv args)
default procedure blackboxDefaultOpM, to be called as "default:" branch
blackbox * getBlackboxStuff(const int t)
return the structure to the type given by t
const char * getBlackboxName(const int t)
return the name to the type given by t (r/o)
int setBlackboxStuff(blackbox *bb, const char *n)
define a new type