 |
My Project
debian-1:4.1.1-p2+ds-4
|
Go to the documentation of this file.
38 int i2=(int)(
long)
b->Data();
49 mpz_init_set_ui(modBase,i2);
52 if (mpz_popcount((mpz_ptr)modBase)==1)
56 if (i2<(8*
sizeof(
unsigned long)))
64 mpz_set_ui(modBase,2);
81 number i2=(number)
b->Data();
88 info.base= (mpz_ptr)modBase;
90 if (mpz_popcount(modBase)==1)
93 mp_bitcnt_t
l=mpz_scan1 (modBase,0);
94 if ((
l>0) && (
l<=8*
sizeof(
unsigned long)))
100 mpz_set_ui(modBase,2);
118 res->data=(
void*)(
long)(a2==b2);
124 ring r=(ring)a->
Data();
138 number2 a2=(number2)a->
Data();
140 number2 r=(number2)
omAlloc0(
sizeof(*r));
142 n_Power(a2->n,(
int)(
long)
b->Data(),&(r->n),r->cf);
164 a2=(number2)an->
Data();
165 b2=(number2)bn->
Data();
166 if (((a2!=
NULL) && (b2!=
NULL) && (a2->cf!=b2->cf))
174 WerrorS(
"Number not compatible");
179 number2 r=(number2)
omAlloc0(
sizeof(*r));
181 if (r->cf==
NULL) op=0;
184 case '+': r->n=
n_Add(aa,bb,r->cf);
break;
185 case '-': r->n=
n_Sub(aa,bb,r->cf);
break;
186 case '*': r->n=
n_Mult(aa,bb,r->cf);
break;
187 case '/': r->n=
n_Div(aa,bb,r->cf);
break;
188 case '%': r->n=
n_IntMod(aa,bb,r->cf);
break;
205 Werror(
"cannot convert second operand (%s) to Number",
b->Name());
211 Werror(
"cannot convert first operand (%s) to Number",a->
Name());
219 number2 a2=(number2)a->
Data();
220 number2 r=(number2)
omAlloc(
sizeof(*r));
222 if (a2->cf==
NULL) op=0;
225 case '-': r->n=
n_Copy(a2->n,a2->cf);r->n=
n_InpNeg(r->n,a2->cf);
break;
237 poly2 a2=(poly2)a->
Data();
239 poly2 r=(poly2)
omAlloc0(
sizeof(*r));
263 a2=(poly2)an->
Data();
264 b2=(poly2)bn->
Data();
265 if (((a2!=
NULL) && (b2!=
NULL) && (a2->cf!=b2->cf))
273 WerrorS(
"Poly not compatible");
278 poly2 r=(poly2)
omAlloc0(
sizeof(*r));
280 if (r->cf==
NULL) op=0;
304 Werror(
"cannot convert second operand (%s) to Poly",
b->Name());
310 Werror(
"cannot convert first operand (%s) to Poly",a->
Name());
318 poly2 a2=(poly2)a->
Data();
319 poly2 r=(poly2)
omAlloc(
sizeof(*r));
321 if (a2->cf==
NULL) op=0;
324 case '-': r->n=
p_Copy(a2->n,a2->cf);r->n=
p_Neg(r->n,a2->cf);
break;
336 number2 r=(number2)
omAlloc(
sizeof(*r));
359 number2 a2=(number2)a->
Data();
365 r->n=nMap(a2->n,a2->cf,r->cf);
371 default: bo=
TRUE;
break;
385 number2 n=(number2)a->
Data();
387 res->data=(
void*)n->cf;
393 poly2 n=(poly2)a->
Data();
395 res->data=(
void*)n->cf;
414 (int)(
long)c->
Data(),
422 number2 n2=(number2)a->
Data();
439 number2 n2Copy(
const number2 d)
444 r=(number2)
omAlloc(
sizeof(*r));
454 void n2Delete(number2 &d)
467 char *n2String(number2 d,
BOOLEAN typed)
480 void n2Print(number2 d)
482 char *
s=n2String(d,
FALSE);
491 poly2 p2Copy(
const poly2 d)
506 void p2Delete(poly2 &d)
519 char *p2String(poly2 d,
BOOLEAN typed)
532 void p2Print(poly2 d)
534 char *
s=p2String(d,
FALSE);
static FORCE_INLINE number n_IntMod(number a, number b, const coeffs r)
for r a field, return n_Init(0,r) always: n_Div(a,b,r)*b+n_IntMod(a,b,r)==a n_IntMod(a,...
BOOLEAN iiConvert(int inputType, int outputType, int index, leftv input, leftv output, const struct sConvertTypes *dConvertTypes)
only used if HAVE_RINGS is defined
void StringAppendS(const char *st)
void p_Write0(poly p, ring lmRing, ring tailRing)
static poly p_Neg(poly p, const ring r)
only used if HAVE_RINGS is defined
static int SI_LOG2(int v)
static FORCE_INLINE void n_Delete(number *p, const coeffs r)
delete 'p'
coeffs nInitChar(n_coeffType t, void *parameter)
one-time initialisations for new coeffs in case of an error return NULL
only used if HAVE_RINGS is defined
Class used for (list of) interpreter objects.
static poly p_Copy(poly p, const ring r)
returns a copy of p
poly p_Power(poly p, int i, const ring r)
ring currRing
Widely used global variable which specifies the current polynomial ring for Singular interpreter and ...
static FORCE_INLINE number n_Add(number a, number b, const coeffs r)
return the sum of 'a' and 'b', i.e., a+b
struct for passing initialization parameters to naInitChar
poly p_Sub(poly p1, poly p2, const ring r)
number(* nMapFunc)(number a, const coeffs src, const coeffs dst)
maps "a", which lives in src, into dst
static FORCE_INLINE void n_Write(number n, const coeffs r, const BOOLEAN bShortOut=TRUE)
BOOLEAN jjEQUAL_CR(leftv res, leftv a, leftv b)
void PrintS(const char *s)
#define omFreeSize(addr, size)
static poly pp_Mult_qq(poly p, poly q, const ring r)
only used if HAVE_RINGS is defined
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
int iiTestConvert(int inputType, int outputType)
char * crString(coeffs c)
void CleanUp(ring r=currRing)
static FORCE_INLINE number n_InpNeg(number n, const coeffs r)
in-place negation of n MUST BE USED: n = n_InpNeg(n) (no copy is returned)
BOOLEAN jjR2_CR(leftv res, leftv a)
used for all transcendental extensions, i.e., the top-most extension in an extension tower is transce...
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 jjCRING_Zp(leftv res, leftv a, leftv b)
static void p_Delete(poly *p, const ring r)
static poly p_Add_q(poly p, poly q, const ring r)
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'
void WerrorS(const char *s)
BOOLEAN jjCRING_Zm(leftv res, leftv a, leftv b)
static FORCE_INLINE char * nCoeffName(const coeffs cf)
static FORCE_INLINE void n_Power(number a, int b, number *res, const coeffs r)
fill res with the power a^b
const struct sConvertTypes dConvertTypes[]
const CanonicalForm int s
const char * Tok2Cmdname(int tok)
static FORCE_INLINE number n_Div(number a, number b, const coeffs r)
return the quotient of 'a' and 'b', i.e., a/b; raises an error if 'b' is not invertible in r exceptio...
static FORCE_INLINE nMapFunc n_SetMap(const coeffs src, const coeffs dst)
set the mapping function pointers for translating numbers from src to dst
#define omFreeBin(addr, bin)
const ExtensionInfo & info
< [in] sqrfree poly
void nKillChar(coeffs r)
undo all initialisations
void nlGMP(number &i, mpz_t n, const coeffs r)