source: git/Singular/number2.h @ 4bada2

spielwiese
Last change on this file since 4bada2 was 3c0710, checked in by Hans Schoenemann <hannes@…>, 7 years ago
4-1-0: sources
  • 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 jjR2_CR(leftv res, leftv a);              // ring ->cring
36BOOLEAN jjN2_N(leftv res, leftv a);               // number2 ->number
37BOOLEAN jjP2_R(leftv res, leftv a);              // poly2 ->ring
38// operations:
39BOOLEAN jjNUMBER2_OP1(leftv res, leftv a);
40BOOLEAN jjNUMBER2_OP2(leftv res, leftv a, leftv b);
41BOOLEAN jjNUMBER2_POW(leftv res, leftv a, leftv b);
42BOOLEAN jjPOLY2_OP1(leftv res, leftv a);
43BOOLEAN jjPOLY2_OP2(leftv res, leftv a, leftv b);
44BOOLEAN jjPOLY2_POW(leftv res, leftv a, leftv b);
45
46number2 n2Copy(const number2 d);
47void n2Delete(number2 &d);
48char *n2String(number2 d, BOOLEAN typed);
49void n2Print(number2 d);
50
51poly2 p2Copy(const poly2 d);
52void p2Delete(poly2 &d);
53char *p2String(poly2 d, BOOLEAN typed);
54void p2Print(poly2 d);
55
56BOOLEAN jjCMATRIX_3(leftv, leftv, leftv,leftv);
57#endif
58char *crString(coeffs c);
59
60void crPrint(coeffs cf);
61
62BOOLEAN jjCRING_Zp(leftv res, leftv a, leftv b);
63BOOLEAN jjCRING_Zm(leftv res, leftv a, leftv b);
64
65BOOLEAN jjEQUAL_CR(leftv res, leftv a, leftv b); // compare cring
66
67#endif
Note: See TracBrowser for help on using the repository browser.