source: git/kernel/ideals.h @ 06662e

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