1 | #ifndef SIMPLEIDEALS_H |
---|
2 | #define SIMPLEIDEALS_H |
---|
3 | /**************************************** |
---|
4 | * Computer Algebra System SINGULAR * |
---|
5 | ****************************************/ |
---|
6 | /* $Id$ */ |
---|
7 | /* |
---|
8 | * ABSTRACT - all basic methods to manipulate ideals |
---|
9 | */ |
---|
10 | #include <omalloc/omalloc.h> |
---|
11 | #include <polys/monomials/ring.h> |
---|
12 | #include <polys/matpol.h> |
---|
13 | |
---|
14 | struct sip_sideal |
---|
15 | { |
---|
16 | poly* m; |
---|
17 | long rank; |
---|
18 | int nrows; |
---|
19 | int ncols; |
---|
20 | #define IDELEMS(i) ((i)->ncols) |
---|
21 | #define MATCOLS(i) ((i)->ncols) |
---|
22 | #define MATROWS(i) ((i)->nrows) |
---|
23 | #define MATELEM(mat,i,j) ((mat)->m)[MATCOLS((mat)) * ((i)-1) + (j)-1] |
---|
24 | |
---|
25 | }; |
---|
26 | |
---|
27 | struct sip_smap |
---|
28 | { |
---|
29 | poly *m; |
---|
30 | char *preimage; |
---|
31 | int nrows; |
---|
32 | int ncols; |
---|
33 | }; |
---|
34 | |
---|
35 | struct sideal_list; |
---|
36 | typedef struct sideal_list * ideal_list; |
---|
37 | |
---|
38 | struct sideal_list |
---|
39 | { |
---|
40 | ideal_list next; |
---|
41 | ideal d; |
---|
42 | #ifndef NDEBUG |
---|
43 | int nr; |
---|
44 | #endif |
---|
45 | }; |
---|
46 | |
---|
47 | extern omBin sip_sideal_bin; |
---|
48 | |
---|
49 | /*- creates an ideal -*/ |
---|
50 | ideal idInit (int size, int rank=1); |
---|
51 | |
---|
52 | /*- deletes an ideal -*/ |
---|
53 | void id_Delete (ideal* h, ring r); |
---|
54 | void id_ShallowDelete (ideal* h, ring r); |
---|
55 | void idSkipZeroes (ideal ide); |
---|
56 | /*gives an ideal the minimal possible size*/ |
---|
57 | |
---|
58 | #ifdef PDEBUG |
---|
59 | void id_DBTest(ideal h1, int level, const char *f,const int l, const ring r); |
---|
60 | #define id_Test(A, r) id_DBTest(A, PDEBUG, __FILE__,__LINE__, r) |
---|
61 | // #define id_Print(id, r) id_Show(id, r) |
---|
62 | #else |
---|
63 | #define id_Test(A, r) (TRUE) |
---|
64 | // #define id_Print(A, r) ((void)0) |
---|
65 | #endif |
---|
66 | |
---|
67 | ideal id_Copy (ideal h1,const ring r); |
---|
68 | |
---|
69 | /*adds two ideals without simplifying the result*/ |
---|
70 | ideal id_SimpleAdd (ideal h1,ideal h2, const ring r); |
---|
71 | /*adds the quotient ideal*/ |
---|
72 | ideal id_Add (ideal h1,ideal h2,const ring r); |
---|
73 | /* h1 + h2 */ |
---|
74 | |
---|
75 | ideal id_Power(ideal given,int exp, const ring r); |
---|
76 | BOOLEAN idIs0 (ideal h); |
---|
77 | |
---|
78 | long id_RankFreeModule(ideal m, ring lmRing, ring tailRing); |
---|
79 | static inline long id_RankFreeModule(ideal m, ring r) |
---|
80 | {return id_RankFreeModule(m, r, r);} |
---|
81 | // returns TRUE, if idRankFreeModule(m) > 0 |
---|
82 | BOOLEAN id_IsModule(ideal m, ring r); |
---|
83 | ideal id_FreeModule (int i, const ring r); |
---|
84 | int idElem(const ideal F); |
---|
85 | int id_PosConstant(ideal id, const ring r); |
---|
86 | ideal id_Head(ideal h,const ring r); |
---|
87 | ideal id_MaxIdeal (const ring r); |
---|
88 | ideal id_MaxIdeal(int deg, const ring r); |
---|
89 | ideal id_CopyFirstK (const ideal ide, const int k,const ring r); |
---|
90 | void id_DelMultiples(ideal id, const ring r); |
---|
91 | void id_Norm(ideal id, const ring r); |
---|
92 | void id_DelEquals(ideal id, const ring r); |
---|
93 | void id_DelLmEquals(ideal id, const ring r); |
---|
94 | void id_DelDiv(ideal id, const ring r); |
---|
95 | BOOLEAN id_IsConstant(ideal id, const ring r); |
---|
96 | intvec *id_Sort(ideal id,BOOLEAN nolex, const ring r); |
---|
97 | ideal id_Transp(ideal a, const ring rRing); |
---|
98 | void id_Compactify(ideal id, const ring r); |
---|
99 | ideal id_Mult (ideal h1,ideal h2, const ring r); |
---|
100 | ideal id_Homogen(ideal h, int varnum,const ring r); |
---|
101 | BOOLEAN id_HomIdeal (ideal id, ideal Q, const ring r); |
---|
102 | BOOLEAN id_HomModule(ideal m, ideal Q, intvec **w, const ring R); |
---|
103 | BOOLEAN id_IsZeroDim(ideal I, const ring r); |
---|
104 | ideal id_Jet(ideal i,int d, const ring R); |
---|
105 | ideal id_JetW(ideal i,int d, intvec * iv, const ring R); |
---|
106 | ideal id_Subst(ideal id, int n, poly e, const ring r); |
---|
107 | matrix id_Module2Matrix(ideal mod, const ring R); |
---|
108 | matrix id_Module2formatedMatrix(ideal mod,int rows, int cols, const ring R); |
---|
109 | ideal id_Matrix2Module(matrix mat, const ring R); |
---|
110 | ideal id_Vec2Ideal(poly vec, const ring R); |
---|
111 | |
---|
112 | |
---|
113 | int binom (int n,int r); |
---|
114 | |
---|
115 | /*- verschiebt die Indizes der Modulerzeugenden um i -*/ |
---|
116 | void idInitChoise (int r,int beg,int end,BOOLEAN *endch,int * choise); |
---|
117 | void idGetNextChoise (int r,int end,BOOLEAN *endch,int * choise); |
---|
118 | int idGetNumberOfChoise(int t, int d, int begin, int end, int * choise); |
---|
119 | |
---|
120 | #endif |
---|