source: git/Singular/number2.h @ eebdf2

fieker-DuValspielwiese
Last change on this file since eebdf2 was def3b2, checked in by Hans Schoenemann <hannes@…>, 7 years ago
add: cring(ring)
  • Property mode set to 100644
File size: 1.9 KB
Line 
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
10struct snumber2;
11struct spoly2;
12typedef struct snumber2 *   number2;
13typedef struct spoly2 *     poly2;
14struct snumber2
15{ coeffs cf;
16  number n;
17};
18
19struct spoly2
20{ ring cf;
21  poly n;
22};
23
24static 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
27static 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:
31BOOLEAN jjNUMBER2CR(leftv res, leftv a, leftv b); // <any>,cring ->number2
32BOOLEAN jjN2_CR(leftv res, leftv a);              // number2 ->cring
33BOOLEAN jjCM_CR(leftv res, leftv a);              // cmatrix ->cring
34BOOLEAN jjBIM2_CR(leftv res, leftv a);            // bigint ->cring
35BOOLEAN jjN2_N(leftv res, leftv a);               // number2 ->number
36BOOLEAN jjP2_R(leftv res, leftv a);              // poly2 ->ring
37// operations:
38BOOLEAN jjNUMBER2_OP1(leftv res, leftv a);
39BOOLEAN jjNUMBER2_OP2(leftv res, leftv a, leftv b);
40BOOLEAN jjNUMBER2_POW(leftv res, leftv a, leftv b);
41BOOLEAN jjPOLY2_OP1(leftv res, leftv a);
42BOOLEAN jjPOLY2_OP2(leftv res, leftv a, leftv b);
43BOOLEAN jjPOLY2_POW(leftv res, leftv a, leftv b);
44
45number2 n2Copy(const number2 d);
46void n2Delete(number2 &d);
47char *n2String(number2 d, BOOLEAN typed);
48void n2Print(number2 d);
49
50poly2 p2Copy(const poly2 d);
51void p2Delete(poly2 &d);
52char *p2String(poly2 d, BOOLEAN typed);
53void p2Print(poly2 d);
54
55BOOLEAN jjCMATRIX_3(leftv, leftv, leftv,leftv);
56#endif
57char *crString(coeffs c);
58
59void crPrint(coeffs cf);
60
61BOOLEAN jjR2_CR(leftv res, leftv a);              // ring ->cring
62
63BOOLEAN jjCRING_Zp(leftv res, leftv a, leftv b);
64BOOLEAN jjCRING_Zm(leftv res, leftv a, leftv b);
65
66BOOLEAN jjEQUAL_CR(leftv res, leftv a, leftv b); // compare cring
67
68#endif
Note: See TracBrowser for help on using the repository browser.