source: git/Singular/number2.h @ 584b82

spielwiese
Last change on this file since 584b82 was db143c, checked in by Hans Schoenemann <hannes@…>, 5 years ago
integrate xalloc into omalloc (./configure --disable-omalloc)
  • 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#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
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.