source: git/kernel/ideals.h @ e9c3b2

spielwiese
Last change on this file since e9c3b2 was e9c3b2, checked in by Oleksandr Motsak <motsak@…>, 13 years ago
ADD: intvec: new view() method ADD: some debug for NF strategy object ADD: idSize From: Oleksandr Motsak <motsak@mathematik.uni-kl.de> git-svn-id: file:///usr/local/Singular/svn/trunk@13978 2c84dea3-7e68-4137-9b89-c4e89433aadc
  • Property mode set to 100644
File size: 6.3 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#ifdef PDEBUG
49ideal idDBInit (int size, int rank, const char *f, int l);
50#define idInit(A,B) idDBInit(A,B,__FILE__,__LINE__)
51#else
52/*- creates an ideal -*/
53ideal idInit (int size, int rank=1);
54#endif
55ideal idCopyFirstK (const ideal ide, const int k);
56
57/// delete an ideal
58#define idDelete(h) id_Delete(h, currRing)
59void id_Delete (ideal* h, ring r);
60void id_ShallowDelete (ideal* h, ring r);
61/*- initialise an ideal -*/ // ?
62
63/// initialise the maximal ideal (at 0)
64ideal idMaxIdeal (int deg);
65
66/// gives an ideal the minimal possible size
67void idSkipZeroes (ideal ide);
68
69/// index of generator with leading term in ground ring (if any); otherwise -1
70int idPosConstant (ideal id);
71
72/// Count the effective size of an ideal
73/// (without the trailing allocated zero-elements)
74static inline int idSize(const ideal id)
75{
76  int j = IDELEMS(id) - 1;
77  poly* mm = id->m;
78  while ((j >= 0) && (mm[j] == NULL)) j--;
79  return (j + 1); 
80};
81
82void idNorm(ideal id);
83void idDelMultiples(ideal id);
84void idDelEquals(ideal id);
85void idDelLmEquals(ideal id);
86void idDelDiv(ideal id);
87BOOLEAN idIsConstant(ideal id);
88
89#ifdef PDEBUG
90void idDBTest(ideal h1, int level, const char *f,const int l);
91#define idTest(A) idDBTest(A, PDEBUG, __FILE__,__LINE__)
92#define idPrint(id) idShow(id)
93#else
94#define idTest(A)  (TRUE)
95#define idPrint(A) ((void)0)
96#endif
97
98ideal id_Copy (ideal h1,const ring r);
99#ifdef PDEBUG
100ideal idDBCopy(ideal h1,const char *f,int l);
101#define idCopy(A) idDBCopy(A,__FILE__,__LINE__)
102#else
103#define idCopy(A) id_Copy(A,currRing)
104#endif
105  /*adds two ideals without simplifying the result*/
106ideal idSimpleAdd (ideal h1,ideal h2);
107  /*adds the quotient ideal*/
108ideal idAdd (ideal h1,ideal h2);
109  /* h1 + h2 */
110BOOLEAN idInsertPoly (ideal h1,poly h2);
111  /* h1 + h2 */
112BOOLEAN idInsertPolyWithTests (ideal h1, const int validEntries,
113  const poly h2, const bool zeroOk, const bool duplicateOk);
114  /* h1 + h2 */
115ideal idMult (ideal h1,ideal h2);
116  /*hh := h1 * h2*/
117
118BOOLEAN idIs0 (ideal h);
119
120long idRankFreeModule(ideal m, ring lmRing, ring tailRing);
121inline long idRankFreeModule(ideal m, ring r = currRing)
122{return idRankFreeModule(m, r, r);}
123// returns TRUE, if idRankFreeModule(m) > 0
124BOOLEAN idIsModule(ideal m, ring r = currRing);
125BOOLEAN idHomIdeal (ideal id, ideal Q=NULL);
126BOOLEAN idHomModule(ideal m, ideal Q,intvec **w);
127BOOLEAN idTestHomModule(ideal m, ideal Q, intvec *w);
128
129ideal idMinBase (ideal h1);
130  /*returns a minimized set of generators of h1*/
131int pLowVar (poly p);
132  /*-the minimal index of used variables - 1-*/
133void pShift (poly * p,int i);
134  /*- verschiebt die Indizes der Modulerzeugenden um i -*/
135void    idInitChoise (int r,int beg,int end,BOOLEAN *endch,int * choise);
136void    idGetNextChoise (int r,int end,BOOLEAN *endch,int * choise);
137int     idGetNumberOfChoise(int t, int d, int begin, int end, int * choise);
138
139int     binom (int n,int r);
140
141ideal   idFreeModule (int i);
142
143ideal   idSect (ideal h1,ideal h2);
144ideal   idMultSect(resolvente arg, int length);
145
146//ideal   idSyzygies (ideal h1, tHomog h,intvec **w);
147ideal   idSyzygies (ideal h1, tHomog h,intvec **w, BOOLEAN setSyzComp=TRUE,
148                    BOOLEAN setRegularity=FALSE, int *deg = NULL);
149ideal   idLiftStd  (ideal h1, matrix *m, tHomog h=testHomog, ideal *syz=NULL);
150
151ideal   idLift (ideal mod, ideal sumod,ideal * rest=NULL,
152             BOOLEAN goodShape=FALSE, BOOLEAN isSB=TRUE,BOOLEAN divide=FALSE,
153             matrix *unit=NULL);
154
155void idLiftW(ideal P,ideal Q,int n,matrix &T, ideal &R, short *w= NULL );
156
157intvec * idMWLift(ideal mod,intvec * weights);
158
159ideal   idQuot (ideal h1,ideal h2,
160                BOOLEAN h1IsStb=FALSE, BOOLEAN resultIsIdeal=FALSE);
161
162ideal   idPower(ideal gid,int deg);
163
164//ideal   idElimination (ideal h1,poly delVar);
165ideal   idElimination (ideal h1,poly delVar, intvec *hilb=NULL);
166
167poly idMinor(matrix a, int ar, unsigned long which, ideal R=NULL);
168
169ideal   idMinors(matrix a, int ar, ideal R=NULL);
170
171void   idCompactify(ideal id);
172
173ideal idMinEmbedding(ideal arg,BOOLEAN inPlace=FALSE, intvec **w=NULL);
174
175ideal   idHead(ideal h);
176
177ideal   idHomogen(ideal h, int varnum);
178
179BOOLEAN idIsSubModule(ideal id1,ideal id2);
180
181ideal   idVec2Ideal(poly vec);
182
183ideal   idMatrix2Module(matrix mat);
184
185matrix  idModule2Matrix(ideal mod);
186
187matrix  idModule2formatedMatrix(ideal mod,int rows, int cols);
188
189ideal   idSubst(ideal i, int n, poly e);
190
191ideal   idJet(ideal i,int d);
192ideal   idJetW(ideal i,int d, intvec * iv);
193int idMinDegW(ideal M,intvec *w);
194ideal   idSeries(int n,ideal M,matrix U=NULL,intvec *w=NULL);
195
196BOOLEAN idIsZeroDim(ideal i);
197matrix  idDiff(matrix i, int k);
198matrix  idDiffOp(ideal I, ideal J,BOOLEAN multiply=TRUE);
199
200intvec *idSort(ideal id,BOOLEAN nolex=TRUE);
201ideal   idModulo (ideal h1,ideal h2, tHomog h=testHomog, intvec ** w=NULL);
202int     idElem(const ideal F);
203matrix  idCoeffOfKBase(ideal arg, ideal kbase, poly how);
204// transpose a module
205ideal   idTransp(ideal a);
206// version of "ideal idTransp(ideal)" which works within a given ring.
207ideal id_Transp(ideal a, const ring rRing = currRing);
208
209intvec *idQHomWeight(ideal id);
210
211void    idNormalize(ideal id);
212
213ideal idXXX (ideal  h1, int k);
214
215poly id_GCD(poly f, poly g, const ring r);
216
217ideal idChineseRemainder(ideal *x, number *q, int rl);
218//ideal idChineseRemainder(ideal *x, intvec *iv); /* currently unused */
219ideal idFarey(ideal x, number N);
220
221ideal id_TensorModuleMult(const int m, const ideal M, const ring rRing = currRing); // image of certain map for BGG
222
223#ifdef PDEBUG
224/* Shows an ideal -- only for debugging */
225void idShow(const ideal id, const ring lmRing = currRing, const ring tailRing = currRing, const int debugPrint = 0);
226#else
227#define idShow(id, lmRing, tailRing, debugPrint) ((void)0)
228#endif
229#endif
Note: See TracBrowser for help on using the repository browser.