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