source: git/kernel/ideals.h @ 0b356b

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