My Project
number2.h
Go to the documentation of this file.
1 #ifndef NUMBER2_H
2 #define NUMBER2_H
3 
4 #include "kernel/mod2.h"
5 #include "omalloc/omalloc.h"
6 #include "coeffs/coeffs.h"
7 #include "kernel/structs.h"
8 #ifdef SINGULAR_4_2
9 struct snumber2;
10 struct spoly2;
11 typedef struct snumber2 * number2;
12 typedef struct spoly2 * poly2;
13 struct snumber2
14 { coeffs cf;
15  number n;
16 };
17 
18 struct spoly2
19 { ring cf;
20  poly n;
21 };
22 
23 static inline number2 n2Init(long i, coeffs c)
24 { number2 N=(number2)omAlloc0(sizeof(snumber2)); if (c!=NULL) { N->cf=c; N->n=n_Init(i,c);} return N;}
25 
26 static inline poly2 p2Init(long i, ring c)
27 { poly2 N=(poly2)omAlloc0(sizeof(spoly2)); if (c!=NULL) { N->cf=c; N->n=p_ISet(i,c);} return N;}
28 
29 // type conversion:
30 BOOLEAN jjNUMBER2CR(leftv res, leftv a, leftv b); // <any>,cring ->number2
31 BOOLEAN jjN2_CR(leftv res, leftv a); // number2 ->cring
32 BOOLEAN jjCM_CR(leftv res, leftv a); // cmatrix ->cring
33 BOOLEAN jjBIM2_CR(leftv res, leftv a); // bigint ->cring
34 BOOLEAN jjN2_N(leftv res, leftv a); // number2 ->number
35 BOOLEAN jjP2_R(leftv res, leftv a); // poly2 ->ring
36 // operations:
37 BOOLEAN jjNUMBER2_OP1(leftv res, leftv a);
38 BOOLEAN jjNUMBER2_OP2(leftv res, leftv a, leftv b);
39 BOOLEAN jjNUMBER2_POW(leftv res, leftv a, leftv b);
40 BOOLEAN jjPOLY2_OP1(leftv res, leftv a);
41 BOOLEAN jjPOLY2_OP2(leftv res, leftv a, leftv b);
42 BOOLEAN jjPOLY2_POW(leftv res, leftv a, leftv b);
43 
44 number2 n2Copy(const number2 d);
45 void n2Delete(number2 &d);
46 char *n2String(number2 d, BOOLEAN typed);
47 void n2Print(number2 d);
48 
49 poly2 p2Copy(const poly2 d);
50 void p2Delete(poly2 &d);
51 char *p2String(poly2 d, BOOLEAN typed);
52 void p2Print(poly2 d);
53 
54 BOOLEAN jjCMATRIX_3(leftv, leftv, leftv,leftv);
55 #endif
56 char *crString(coeffs c);
57 
58 void crPrint(coeffs cf);
59 
60 BOOLEAN jjR2_CR(leftv res, leftv a); // ring ->cring
61 
64 
65 BOOLEAN jjEQUAL_CR(leftv res, leftv a, leftv b); // compare cring
66 
67 #endif
int BOOLEAN
Definition: auxiliary.h:87
const CanonicalForm CFMap CFMap & N
Definition: cfEzgcd.cc:56
int i
Definition: cfEzgcd.cc:132
CanonicalForm cf
Definition: cfModGcd.cc:4083
CanonicalForm b
Definition: cfModGcd.cc:4103
Class used for (list of) interpreter objects.
Definition: subexpr.h:83
Coefficient rings, fields and other domains suitable for Singular polynomials.
static FORCE_INLINE number n_Init(long i, const coeffs r)
a number representing i in the given coeff field/ring r
Definition: coeffs.h:538
CanonicalForm res
Definition: facAbsFact.cc:60
The main handler for Singular numbers which are suitable for Singular polynomials.
BOOLEAN jjCRING_Zp(leftv res, leftv a, leftv b)
Definition: number2.cc:35
BOOLEAN jjEQUAL_CR(leftv res, leftv a, leftv b)
Definition: number2.cc:123
BOOLEAN jjCRING_Zm(leftv res, leftv a, leftv b)
Definition: number2.cc:88
void crPrint(coeffs cf)
Definition: number2.cc:25
BOOLEAN jjR2_CR(leftv res, leftv a)
Definition: number2.cc:132
char * crString(coeffs c)
Definition: number2.cc:17
#define omAlloc0(size)
Definition: omAllocDecl.h:211
#define NULL
Definition: omList.c:12
poly p_ISet(long i, const ring r)
returns the poly representing the integer i
Definition: p_polys.cc:1293