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] / < f(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->extRing. |
---|
12 | * IMPORTANT ASSUMPTIONS: |
---|
13 | * 1.) So far we assume that cf->extRing 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->extRing->minideal is not NULL but an ideal with at |
---|
20 | * least one non-zero generator which may be accessed by |
---|
21 | * cf->extRing->minideal->m[0] and which represents the minimal |
---|
22 | * polynomial f(a) of the extension variable 'a' in K[a]. |
---|
23 | * 3.) As soon as an std method for polynomial rings becomes |
---|
24 | * availabe, all reduction steps modulo f(a) should be replaced |
---|
25 | * by a call to std. Moreover, in this situation one can finally |
---|
26 | * move from K[a] / < f(a) > to |
---|
27 | * K[a_1, ..., a_s] / I, with I some zero-dimensional ideal |
---|
28 | * in K[a_1, ..., a_s] given by a lex |
---|
29 | * Gröbner basis. |
---|
30 | * The code in algext.h and algext.cc is then capable of |
---|
31 | * computing in K[a_1, ..., a_s] / I. |
---|
32 | */ |
---|
33 | |
---|
34 | #include <coeffs/coeffs.h> |
---|
35 | |
---|
36 | // Forward declarations |
---|
37 | struct ip_sring; typedef struct ip_sring * ring; |
---|
38 | struct sip_sideal; typedef struct sip_sideal * ideal; |
---|
39 | |
---|
40 | /// struct for passing initialization parameters to naInitChar |
---|
41 | typedef struct { ring r; ideal i; } AlgExtInfo; |
---|
42 | |
---|
43 | /// Get a mapping function from src into the domain of this type (n_algExt) |
---|
44 | nMapFunc naSetMap(const coeffs src, const coeffs dst); |
---|
45 | |
---|
46 | /// Initialize the coeffs object |
---|
47 | BOOLEAN naInitChar(coeffs cf, void* infoStruct); |
---|
48 | |
---|
49 | /* Private hidden interface |
---|
50 | BOOLEAN naGreaterZero(number a, const coeffs cf); |
---|
51 | BOOLEAN naGreater(number a, number b, const coeffs cf); |
---|
52 | BOOLEAN naEqual(number a, number b, const coeffs cf); |
---|
53 | BOOLEAN naIsOne(number a, const coeffs cf); |
---|
54 | BOOLEAN naIsMOne(number a, const coeffs cf); |
---|
55 | BOOLEAN naIsZero(number a, const coeffs cf); |
---|
56 | number naInit(int i, const coeffs cf); |
---|
57 | int naInt(number &a, const coeffs cf); |
---|
58 | number naNeg(number a, const coeffs cf); |
---|
59 | number naInvers(number a, const coeffs cf); |
---|
60 | number naAdd(number a, number b, const coeffs cf); |
---|
61 | number naSub(number a, number b, const coeffs cf); |
---|
62 | number naMult(number a, number b, const coeffs cf); |
---|
63 | number naDiv(number a, number b, const coeffs cf); |
---|
64 | void naPower(number a, int exp, number *b, const coeffs cf); |
---|
65 | number naCopy(number a, const coeffs cf); |
---|
66 | void naWrite(number &a, const coeffs cf); |
---|
67 | number naRePart(number a, const coeffs cf); |
---|
68 | number naImPart(number a, const coeffs cf); |
---|
69 | number naGetDenom(number &a, const coeffs cf); |
---|
70 | number naGetNumerator(number &a, const coeffs cf); |
---|
71 | number naGcd(number a, number b, const coeffs cf); |
---|
72 | number naLcm(number a, number b, const coeffs cf); |
---|
73 | number naSize(number a, const coeffs cf); |
---|
74 | void naDelete(number * a, const coeffs cf); |
---|
75 | void naCoeffWrite(const coeffs cf); |
---|
76 | number naIntDiv(number a, number b, const coeffs cf); |
---|
77 | const char * naRead(const char *s, number *a, const coeffs cf); |
---|
78 | static BOOLEAN naCoeffIsEqual(const coeffs cf, n_coeffType n, void * param); |
---|
79 | */ |
---|
80 | |
---|
81 | /// return the specified parameter as a number in the given alg. field |
---|
82 | number naParam(short iParameter, const coeffs cf); |
---|
83 | |
---|
84 | |
---|
85 | /// if m == var(i)/1 => return i, |
---|
86 | int naIsParam(number, const coeffs); |
---|
87 | |
---|
88 | #endif |
---|
89 | /* ALGEXT_H */ |
---|