source: git/Singular/number2.h @ c7ae4d

spielwiese
Last change on this file since c7ae4d was c7ae4d, checked in by Hans Schoenemann <hannes@…>, 8 years ago
Singular_4_1: parent(..)
  • 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#ifdef SINGULAR_4_1
7#include <omalloc/omalloc.h>
8#include <coeffs/coeffs.h>
9#include <kernel/structs.h>
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
30char *crString(coeffs c);
31
32void crPrint(coeffs cf);
33
34BOOLEAN jjCRING_Zp(leftv res, leftv a, leftv b);
35BOOLEAN jjCRING_Zm(leftv res, leftv a, leftv b);
36
37BOOLEAN jjEQUAL_CR(leftv res, leftv a, leftv b); // compare cring
38
39// type conversion:
40BOOLEAN jjNUMBER2CR(leftv res, leftv a, leftv b); // <any>,cring ->number2
41BOOLEAN jjN2_CR(leftv res, leftv a);              // number2 ->cring
42BOOLEAN jjCM_CR(leftv res, leftv a);              // cmatrix ->cring
43BOOLEAN jjBIM2_CR(leftv res, leftv a);            // bigint ->cring
44BOOLEAN jjR2_CR(leftv res, leftv a);              // ring ->cring
45BOOLEAN jjN2_N(leftv res, leftv a);               // number2 ->number
46BOOLEAN jjP2_R(leftv res, leftv a);              // poly2 ->ring
47// operations:
48BOOLEAN jjNUMBER2_OP1(leftv res, leftv a);
49BOOLEAN jjNUMBER2_OP2(leftv res, leftv a, leftv b);
50BOOLEAN jjNUMBER2_POW(leftv res, leftv a, leftv b);
51BOOLEAN jjPOLY2_OP1(leftv res, leftv a);
52BOOLEAN jjPOLY2_OP2(leftv res, leftv a, leftv b);
53BOOLEAN jjPOLY2_POW(leftv res, leftv a, leftv b);
54
55number2 n2Copy(const number2 d);
56void n2Delete(number2 &d);
57char *n2String(number2 d, BOOLEAN typed);
58void n2Print(number2 d);
59
60poly2 p2Copy(const poly2 d);
61void p2Delete(poly2 &d);
62char *p2String(poly2 d, BOOLEAN typed);
63void p2Print(poly2 d);
64
65BOOLEAN jjCMATRIX_3(leftv, leftv, leftv,leftv);
66#endif
67#endif
Note: See TracBrowser for help on using the repository browser.