1 | #ifndef ALGEXT_H |
---|
2 | #define ALGEXT_H |
---|
3 | /**************************************** |
---|
4 | * Computer Algebra System SINGULAR * |
---|
5 | ****************************************/ |
---|
6 | /* $Id$ */ |
---|
7 | /* |
---|
8 | * ABSTRACT: numbers in an algebraic extension field K(a) |
---|
9 | * Assuming that we have a coeffs object cf, then these numbers |
---|
10 | * are polynomials in the polynomial ring K[a] represented by |
---|
11 | * cf->algring. |
---|
12 | * IMPORTANT ASSUMPTIONS: |
---|
13 | * 1.) So far we assume that cf->algring is a valid polynomial |
---|
14 | * ring in exactly one variable, i.e., K[a], where K is allowed |
---|
15 | * to be any field (representable in SINGULAR and which may |
---|
16 | * itself be some extension field, thus allowing for extension |
---|
17 | * towers). |
---|
18 | * 2.) Moreover, this implementation assumes that |
---|
19 | * cf->algring->minideal is not NULL but an ideal with at |
---|
20 | * least one non-zero generator which may be accessed by |
---|
21 | * cf->algring->minideal->m[0] and which represents the minimal |
---|
22 | * polynomial of the extension variable 'a' in K[a]. |
---|
23 | */ |
---|
24 | #include <coeffs/coeffs.h> |
---|
25 | |
---|
26 | struct ip_sring; |
---|
27 | typedef struct ip_sring * ring; |
---|
28 | |
---|
29 | struct sip_sideal; |
---|
30 | typedef struct sip_sideal * ideal; |
---|
31 | |
---|
32 | /// struct for pass initialization parameters to naInitChar |
---|
33 | typedef struct |
---|
34 | { |
---|
35 | ring r; |
---|
36 | ideal i; |
---|
37 | } ExtInfo; |
---|
38 | |
---|
39 | /// Get a mapping function from src into the domain of this type (n_Ext) |
---|
40 | nMapFunc naSetMap(const coeffs src, const coeffs dst); |
---|
41 | |
---|
42 | /// Initialize the coeffs object |
---|
43 | BOOLEAN naInitChar(coeffs cf, void* infoStruct); |
---|
44 | |
---|
45 | /* Private hidden interface |
---|
46 | BOOLEAN naGreaterZero(number a, const coeffs cf); |
---|
47 | BOOLEAN naGreater(number a, number b, const coeffs cf); |
---|
48 | BOOLEAN naEqual(number a, number b, const coeffs cf); |
---|
49 | BOOLEAN naIsOne(number a, const coeffs cf); |
---|
50 | BOOLEAN naIsMOne(number a, const coeffs cf); |
---|
51 | BOOLEAN naIsZero(number a, const coeffs cf); |
---|
52 | number naInit(int i, const coeffs cf); |
---|
53 | int naInt(number &a, const coeffs cf); |
---|
54 | number naNeg(number a, const coeffs cf); |
---|
55 | number naInvers(number a, const coeffs cf); |
---|
56 | number naPar(int i, const coeffs cf); |
---|
57 | number naAdd(number a, number b, const coeffs cf); |
---|
58 | number naSub(number a, number b, const coeffs cf); |
---|
59 | number naMult(number a, number b, const coeffs cf); |
---|
60 | number naDiv(number a, number b, const coeffs cf); |
---|
61 | void naPower(number a, int exp, number *b, const coeffs cf); |
---|
62 | number naCopy(number a, const coeffs cf); |
---|
63 | void naWrite(number &a, const coeffs cf); |
---|
64 | number naRePart(number a, const coeffs cf); |
---|
65 | number naImPart(number a, const coeffs cf); |
---|
66 | number naGetDenom(number &a, const coeffs cf); |
---|
67 | number naGetNumerator(number &a, const coeffs cf); |
---|
68 | number naGcd(number a, number b, const coeffs cf); |
---|
69 | number naLcm(number a, number b, const coeffs cf); |
---|
70 | number naSize(number a, const coeffs cf); |
---|
71 | void naDelete(number *a, const coeffs cf); |
---|
72 | void naCoeffWrite(const coeffs cf); |
---|
73 | number naIntDiv(number a, number b, const coeffs cf); |
---|
74 | const char * naRead(const char *s, number *a, const coeffs cf); |
---|
75 | static BOOLEAN naCoeffIsEqual(const coeffs cf, n_coeffType n, void * param); |
---|
76 | */ |
---|
77 | |
---|
78 | #ifdef LDEBUG |
---|
79 | #define naTest(a) naDBTest(a,__FILE__,__LINE__,cf) |
---|
80 | BOOLEAN naDBTest(number a, const char *f, const int l, const coeffs r); |
---|
81 | #else |
---|
82 | #define naTest(a) |
---|
83 | #endif |
---|
84 | |
---|
85 | /* our own type */ |
---|
86 | #define naID n_Ext |
---|
87 | |
---|
88 | /* polynomial ring in which our numbers live */ |
---|
89 | #define naRing cf->algring |
---|
90 | |
---|
91 | /* coeffs object in which the coefficients of our numbers live; |
---|
92 | * methods attached to naCoeffs may be used to compute with the |
---|
93 | * coefficients of our numbers, e.g., use naCoeffs->nAdd to add |
---|
94 | * coefficients of our numbers */ |
---|
95 | #define naCoeffs cf->algring->cf |
---|
96 | |
---|
97 | /* minimal polynomial */ |
---|
98 | #define naMinpoly naRing->minideal->m[0] |
---|
99 | |
---|
100 | #endif |
---|
101 | /* ALGEXT_H */ |
---|