My Project
Loading...
Searching...
No Matches
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
9struct snumber2;
10struct spoly2;
11typedef struct snumber2 * number2;
12typedef struct spoly2 * poly2;
13struct snumber2
14{ coeffs cf;
15 number n;
16};
17
18struct spoly2
19{ ring cf;
20 poly n;
21};
22
23static 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
26static 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:
30BOOLEAN jjNUMBER2CR(leftv res, leftv a, leftv b); // <any>,cring ->number2
31BOOLEAN jjN2_CR(leftv res, leftv a); // number2 ->cring
32BOOLEAN jjCM_CR(leftv res, leftv a); // cmatrix ->cring
33BOOLEAN jjBIM2_CR(leftv res, leftv a); // bigint ->cring
34BOOLEAN jjN2_N(leftv res, leftv a); // number2 ->number
35BOOLEAN jjP2_R(leftv res, leftv a); // poly2 ->ring
36// operations:
37BOOLEAN jjNUMBER2_OP1(leftv res, leftv a);
38BOOLEAN jjNUMBER2_OP2(leftv res, leftv a, leftv b);
39BOOLEAN jjNUMBER2_POW(leftv res, leftv a, leftv b);
40BOOLEAN jjPOLY2_OP1(leftv res, leftv a);
41BOOLEAN jjPOLY2_OP2(leftv res, leftv a, leftv b);
42BOOLEAN jjPOLY2_POW(leftv res, leftv a, leftv b);
43
44number2 n2Copy(const number2 d);
45void n2Delete(number2 &d);
46char *n2String(number2 d, BOOLEAN typed);
47void n2Print(number2 d);
48
49poly2 p2Copy(const poly2 d);
50void p2Delete(poly2 &d);
51char *p2String(poly2 d, BOOLEAN typed);
52void p2Print(poly2 d);
53
54BOOLEAN jjCMATRIX_3(leftv, leftv, leftv,leftv);
55#endif
56char *crString(coeffs c);
57
58void crPrint(coeffs cf);
59
60BOOLEAN jjR2_CR(leftv res, leftv a); // ring ->cring
61
64
65BOOLEAN 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:535
CanonicalForm res
Definition: facAbsFact.cc:60
The main handler for Singular numbers which are suitable for Singular polynomials.
char * crString(coeffs c)
Definition: number2.cc:17
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
#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:1297