source: git/kernel/ideals.h @ bb5c28

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