source: git/libpolys/polys/ideals.h @ cf3743

spielwiese
Last change on this file since cf3743 was cf3743, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
ADD: Starting to move in the non-commutative stuff
  • Property mode set to 100644
File size: 6.1 KB
Line 
1#ifndef IDEALS_H
2#define IDEALS_H
3/****************************************
4*  Computer Algebra System SINGULAR     *
5****************************************/
6/* $Id$ */
7/*
8* ABSTRACT - all basic methods to manipulate ideals
9*/
10#include <kernel/structs.h>
11#include <kernel/ring.h>
12
13struct sip_sideal
14{
15  poly*  m;
16  long rank;
17  int nrows;
18  int ncols;
19  #define IDELEMS(i) ((i)->ncols)
20};
21
22struct sip_smap
23{
24  poly *m;
25  char *preimage;
26  int nrows;
27  int ncols;
28};
29
30struct sideal_list;
31typedef struct sideal_list *      ideal_list;
32struct sideal_list
33{
34  ideal_list next;
35  ideal      d;
36#ifndef NDEBUG
37  int nr;
38#endif
39};
40
41//typedef struct sip_sideal *        ideal;
42//typedef struct sip_smap *          map;
43typedef ideal *            resolvente;
44
45
46extern omBin sip_sideal_bin;
47
48/*- creates an ideal -*/
49ideal idInit (int size, int rank=1);
50ideal idCopyFirstK (const ideal ide, const int k);
51
52/// delete an ideal
53#define idDelete(h) id_Delete(h, currRing)
54void id_Delete (ideal* h, ring r);
55void id_ShallowDelete (ideal* h, ring r);
56/*- initialise an ideal -*/ // ?
57
58/// initialise the maximal ideal (at 0)
59ideal idMaxIdeal (int deg);
60
61/// gives an ideal the minimal possible size
62void idSkipZeroes (ideal ide);
63
64/// index of generator with leading term in ground ring (if any); otherwise -1
65int idPosConstant (ideal id);
66
67/// Count the effective size of an ideal
68/// (without the trailing allocated zero-elements)
69static inline int idSize(const ideal id)
70{
71  int j = IDELEMS(id) - 1;
72  poly* mm = id->m;
73  while ((j >= 0) && (mm[j] == NULL)) j--;
74  return (j + 1); 
75}
76
77void idNorm(ideal id);
78void idDelMultiples(ideal id);
79void idDelEquals(ideal id);
80void idDelLmEquals(ideal id);
81void idDelDiv(ideal id);
82BOOLEAN idIsConstant(ideal id);
83
84#ifdef PDEBUG
85void idDBTest(ideal h1, int level, const char *f,const int l);
86#define idTest(A) idDBTest(A, PDEBUG, __FILE__,__LINE__)
87#define idPrint(id) idShow(id)
88#else
89#define idTest(A)  (TRUE)
90#define idPrint(A) ((void)0)
91#endif
92
93ideal id_Copy (ideal h1,const ring r);
94#define idCopy(A) id_Copy(A,currRing)
95  /*adds two ideals without simplifying the result*/
96ideal idSimpleAdd (ideal h1,ideal h2);
97  /*adds the quotient ideal*/
98ideal idAdd (ideal h1,ideal h2);
99  /* h1 + h2 */
100BOOLEAN idInsertPoly (ideal h1,poly h2);
101  /* h1 + h2 */
102BOOLEAN idInsertPolyWithTests (ideal h1, const int validEntries,
103  const poly h2, const bool zeroOk, const bool duplicateOk);
104  /* h1 + h2 */
105ideal idMult (ideal h1,ideal h2);
106  /*hh := h1 * h2*/
107
108BOOLEAN idIs0 (ideal h);
109
110long idRankFreeModule(ideal m, ring lmRing, ring tailRing);
111inline long idRankFreeModule(ideal m, ring r = currRing)
112{return idRankFreeModule(m, r, r);}
113// returns TRUE, if idRankFreeModule(m) > 0
114BOOLEAN idIsModule(ideal m, ring r = currRing);
115BOOLEAN idHomIdeal (ideal id, ideal Q=NULL);
116BOOLEAN idHomModule(ideal m, ideal Q,intvec **w);
117BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w);
118
119ideal idMinBase (ideal h1);
120  /*returns a minimized set of generators of h1*/
121int pLowVar (poly p);
122  /*-the minimal index of used variables - 1-*/
123void pShift (poly * p,int i);
124  /*- verschiebt die Indizes der Modulerzeugenden um i -*/
125void    idInitChoise (int r,int beg,int end,BOOLEAN *endch,int * choise);
126void    idGetNextChoise (int r,int end,BOOLEAN *endch,int * choise);
127int     idGetNumberOfChoise(int t, int d, int begin, int end, int * choise);
128
129int     binom (int n,int r);
130
131ideal   idFreeModule (int i);
132
133ideal   idSect (ideal h1,ideal h2);
134ideal   idMultSect(resolvente arg, int length);
135
136//ideal   idSyzygies (ideal h1, tHomog h,intvec **w);
137ideal   idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp=TRUE,
138                    BOOLEAN setRegularity=FALSE, int *deg = NULL);
139ideal   idLiftStd  (ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL);
140
141ideal   idLift (ideal mod, ideal sumod,ideal * rest=NULL,
142             BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE,
143             matrix *unit=NULL);
144
145void idLiftW(ideal P,ideal Q,int n,matrix &T, ideal &R, short *w= NULL );
146
147intvec * idMWLift(ideal mod,intvec * weights);
148
149ideal   idQuot (ideal h1,ideal h2,
150                BOOLEAN h1IsStb=FALSE, BOOLEAN resultIsIdeal=FALSE);
151
152ideal   idPower(ideal gid,int deg);
153
154//ideal   idElimination (ideal h1,poly delVar);
155ideal   idElimination (ideal h1,poly delVar, intvec *hilb=NULL);
156
157poly idMinor(matrix a, int ar, unsigned long which, ideal R=NULL);
158
159ideal   idMinors(matrix a, int ar, ideal R=NULL);
160
161void   idCompactify(ideal id);
162
163ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL);
164
165ideal   idHead(ideal h);
166
167ideal   idHomogen(ideal h, int varnum);
168
169BOOLEAN idIsSubModule(ideal id1,ideal id2);
170
171ideal   idVec2Ideal(poly vec);
172
173ideal   idMatrix2Module(matrix mat);
174
175matrix  idModule2Matrix(ideal mod);
176
177matrix  idModule2formatedMatrix(ideal mod,int rows, int cols);
178
179ideal   idSubst(ideal i, int n, poly e);
180
181ideal   idJet(ideal i,int d);
182ideal   idJetW(ideal i,int d, intvec * iv);
183int idMinDegW(ideal M,intvec *w);
184ideal   idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL);
185
186BOOLEAN idIsZeroDim(ideal i);
187matrix  idDiff(matrix i, int k);
188matrix  idDiffOp(ideal I, ideal J,BOOLEAN multiply=TRUE);
189
190intvec *idSort(ideal id,BOOLEAN nolex=TRUE);
191ideal   idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL);
192int     idElem(const ideal F);
193matrix  idCoeffOfKBase(ideal arg, ideal kbase, poly how);
194// transpose a module
195ideal   idTransp(ideal a);
196// version of "ideal idTransp(ideal)" which works within a given ring.
197ideal id_Transp(ideal a, const ring rRing = currRing);
198
199intvec *idQHomWeight(ideal id);
200
201void    idNormalize(ideal id);
202
203ideal idXXX (ideal  h1, int k);
204
205poly id_GCD(poly f, poly g, const ring r);
206
207ideal idChineseRemainder(ideal *x, number *q, int rl);
208//ideal idChineseRemainder(ideal *x, intvec *iv); /* currently unused */
209ideal idFarey(ideal x, number N);
210
211ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing = currRing); // image of certain map for BGG
212
213#ifdef PDEBUG
214/* Shows an ideal -- only for debugging */
215void idShow(const ideal id, const ring lmRing = currRing, const ring tailRing = currRing, const int debugPrint = 0);
216#else
217#define idShow(id, lmRing, tailRing, debugPrint) ((void)0)
218#endif
219#endif
Note: See TracBrowser for help on using the repository browser.