source: git/kernel/ideals.h @ 715f30

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