source: git/kernel/ideals.h @ 8505243

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